Hardy-Weinberg Equation (HW) states that following certain biological tenets or requirements, the total frequency of all homozygous dominant alleles (p) and the total frequency of all homozygous recessive alleles (q) for a gene, account for the total # of alleles for that gene in that HW population, which is 100% or 1.00 as a decimel. So in short: p + q = 1, and additionally (p+q)^2 = 1^2, or 1
So (p+q)(p+q) algebraically works out to p^2 + 2pq + q^2 = 1, where p^2 = genotype frequency of homozygous dominant individuals, 2pq = genotype frequency of heterozygous individuals, and q^2 = genotype frequency of homozygous recessive individuals.
The problem states that Ptotal = 150 individuals, H frequency (p) = 0.2, and h frequency (q) = 0.8.
So homozygous dominant individuals (HH) = p^2 = (0.2)^2 = 0.04 or 4% of 150 --> 6 people
Heterozygous individuals (Hh) = 2pq = 2(0.2)(0.8) = 0.32 or 32% of 150
--> 48 people
And homozygous recessive individuals (hh) = q^2 = (0.8)^2 = 0.64 = 64% of 150 --> 96 people
Hope that helps you to understand how to solve these types of population genetics problems!