You will write the three calculations of the Hardy-Weinberg principle as functions. They use exact fractions, so an answer is never rounded.
The idea. Count the gene copies to find . Square and multiply to find the genotype frequencies. Compare them with the observed genotypes to see whether a sample is in equilibrium.
Your tasks.
allele_frequencies. It gives as fractions from the counts of , and .genotype_frequencies. It gives the frequencies of , and for a given .in_equilibrium. It says whether the counts of a sample have the Hardy-Weinberg proportions.Have you tried it?
Do the tasks in the editor first, and run the checker after each one. Its hints help when a check fails. When you are ready, compare your code with this solution.
Log in to join the discussion.
Loading…