From Aaron Wilkowski comes a rather enigmatic election:
Riddler Nation’s neighbor to the west, Enigmerica, is holding an election between two candidates, A and B. Assume every person in Enigmerica votes randomly and independently, and that the number of voters is very, very large. Moreover, due to health precautions, 20 percent of the population decides to vote early by mail.
On election night, the results of the 80 percent who voted on Election Day are reported out. Over the next several days, the remaining 20 percent of the votes are then tallied.
What is the probability that the candidate who had fewer votes tallied on election night ultimately wins the race?
Given voting population $p$, Let $\dfrac{A_e}{p}$, $\dfrac{B_e}{p}$, $\dfrac{A_m}{p}$, and $\dfrac{B_m}{p}$ represent the percent of people who vote for candidates $A$ and $B$, either on election night or by mail.
We know the following:
Since the people vote randomly and independently, $\dfrac{A_e}{p}$ has a frequency distribution that is binomial.
$μ = 0.8 \cdot \frac{1}{2} = 0.4 \textrm{ or } 40\%$
$σ = \sqrt{0.8 \cdot \frac{1}{2} \cdot \frac{1}{2}} = \sqrt{0.2} \approx 4.47\%$
Here are three cases to examine.
$\dfrac{A_e}{p} - \dfrac{B_e}{p} > 20\%$
It follows that $\dfrac{A_e}{p} > 50\%$ and $\dfrac{B_e}{p} < 30\%$. This accounts for $1.267\%$ of the election results.
$\dfrac{B_e}{p} - \dfrac{A_e}{p} > 20\%$
It follows that $\dfrac{B_e}{p} > 50\%$ and $\dfrac{A_e}{p} < 30\%$. This accounts for $1.267\%$ of the election results.
$\left| \dfrac{A_e}{p} - \dfrac{B_e}{p} \right| \le 20\%$
$97.46\%$ of the election results fall in this case.
The follow chart summarizes the results. $\%$ is in terms of $\dfrac{A_e}{p} - \dfrac{B_e}{p}$ for Election Night Vote and $\dfrac{A_m}{p} - \dfrac{B_m}{p}$ for Early Vote by Mail.
Note that if Candidate A had fewer votes on Election Night (bottom row), they win $25\%$ of the time. Similary, if Candidate B had fewer votes on Election Night (top row), they win $25\%$ of the time.
$97.46\% * 25\% = 24.37\%$
Code can be found here.