Genetics (from Ancient Greek γενετικός genetikos, "genitive" and that from γένεσις genesis, "origin"), a discipline of biology, is the science of genes, heredity, and variation in living organisms.
Genetics deals with the molecular structure and function of genes, gene behavior in the context of a cell or organism (e.g. dominance and epigenetics), patterns of inheritance from parent to offspring, and gene distribution, variation and change in populations, such as through Genome-Wide Association Studies. Given that genes are universal to living organisms, genetics can be applied to the study of all living systems, from viruses and bacteria, through plants and domestic animals, to humans (as in medical genetics).
The fact that living things inherit traits from their parents has been used since prehistoric times to improve crop plants and animals through selective breeding. However, the modern science of genetics, which attempts to understand the process of inheritance, only began with the work of Gregor Mendel in the mid-19th century. Although he did not know the physical basis for heredity, Mendel observed that organisms inherit traits by way of discrete units of inheritance, which are now called genes.