#Homework 3
#You have a F2 population of a plant species (which is a diploid) resulted from a cross between
#a plant with red flowers and a plant with white flowers. You hypothesized that: the flower color
#is controlled by a single gene; each of the parents is homozygous for the gene; the red allele
#is dominant over the white allele. When you scored 20 F2 plants, what is the probability to have
#the number of plants with white flowers is 2 or fewer? Upload a file that includes all the activities
#in your R session, so I can see how you did it.
#F0= both parents heterozygous, all offspring are homozygous. F1= all heterozygous. F2= 1 homozygous red
#, 2 heterozygous red, 1 homozygous white. So, 75% will be red, 25% will be white
1-pbinom(2,20,0.25,lower.tail=F)
## [1] 0.09126043
#[1] 0.09126043
pbinom(2,20,0.25)
## [1] 0.09126043
#[1] 0.09126043