Solution (source code)

= Solution

Each diploid individual contributes two marker <alleles>. Count $A$ copies as twice the $AA$ count plus the $Aa$ count, and count $a$ copies analogously. The observed chromosome-level <contingency table>, followed by its null expected table, is
$$
\boxed{\begin{array}{c|rr}
O&\text{cases}&\text{controls}\\\hline
A&20&120\\a&180&80
\end{array}\qquad
\begin{array}{c|rr}
E&\text{cases}&\text{controls}\\\hline
A&70&70\\a&130&130
\end{array}.}
$$
There are 200 <chromosomes> in each group; pooled totals are 140 $A$ and 260 $a$. The usual allelic <Pearson chi-squared test of independence> gives
$$
X^2=2\left(\frac{50^2}{70}+\frac{50^2}{130}\right)=\frac{10000}{91}\simeq109.89.
$$
With the ordinary independent-chromosome null model, use one <degree of freedom>; its <p-value> is about $1.04\times10^{-25}$, providing very strong evidence of <genetic association>.

The two <alleles> from the same person are not automatically two independent observations. The usual one-degree-of-freedom calibration is justified, for example, for unrelated individuals with <Hardy-Weinberg equilibrium> under the null. If that assumption is not suitable, retain individuals as the sampling units and test their allele dosages using an appropriate variance or permutation of case-control labels, or use the genotype-level test from part (iii). No <Hardy-Weinberg equilibrium> assumption was needed for that genotype-level test.