In a population of Drosophila grown in the laboratory, 4% of flies have black bodies while 96% of flies have brown bodies. Black bodies are encoded by the recessive allele b and brown bodies by the wild type allele B.
Hardy-Weinberg equilibrium
Assuming this population is in Hardy-Weinberg equilibrium, we take the wild type allele as p and recessive allele as q. Since, 4% of flies have recessive phenotype; it indicates that q2 is 4% or 0.04.
When q2 is 0.04, then q would be 0.2.
If q is 0.2 then p is 0.8 since p + q equals 1.
Hence, p2 or BB would have a frequency of (0.8)2 which is 0.64.
The frequency of Bb or 2pq would be 2 x 0.2 x 0.8 which is 0.32.