Genetics is the study of heredity and how traits are passed from parents to offspring. Gregor Mendel was the first to successfully predict how traits are transferred through generations by experimenting with pea plants. He discovered that every organism has two alleles that control each trait, and that one allele may be dominant and expressed while the other is recessive and not expressed. The combination of alleles an organism has is its genotype, while its physical appearance and behavior is its phenotype. When gametes are produced, each receives one of the two alleles according to Mendel's law of segregation. An individual can be homozygous, meaning its alleles are the same, or heterozygous, meaning its alleles are different.