First, let's calculate the probability of winning the game.
We win the game if we get three heads or three tails, so the probability is:
![\begin{gathered} P(3\text{ heads})=(1)/(2)\cdot(1)/(2)\cdot(1)/(2)=(1)/(8)\\ \\ P(3\text{ tails})=(1)/(2)\cdot(1)/(2)\cdot(1)/(2)=(1)/(8)\\ \\ P(win)=(1)/(8)+(1)/(8)=(2)/(8)=(1)/(4) \end{gathered}](https://img.qammunity.org/2023/formulas/mathematics/high-school/iv0qe8ep5kh3oyfic8zx88mnet7k0o7lwb.png)
If the probability of winning is 1/4, the probability of losing is 3/4.
If the wager is $1, winning will return $4 plus the original bet, so a net earning of $4.
Losing will return nothing, so the net "earning" is -$1.
Calculating the expected value of one game, we have:
![\begin{gathered} E(x)=\sum x\cdot p(x)\\ \\ E(x)=(1)/(4)\cdot4+(3)/(4)\cdot(-1)\\ \\ E(x)=(4)/(4)-(3)/(4)\\ \\ E(x)=(1)/(4) \end{gathered}](https://img.qammunity.org/2023/formulas/mathematics/high-school/29spb046fmd3zcn2hoo5s9gqr7wualax8r.png)
Playing 20 times will result in an earning of 20 * 1/4, that is, a gain of $5.
Correct option: fourth one.