5. Toss an unfair coin 5 times, if the probability of getting exactly 1 head is equal to the probability of getting exactly 2 heads and is not zero, then the probability of getting exactly 3 heads is $\qquad$ .


Let the probability of getting heads when tossing the biased coin once be $p$, then $C_{5}^{1} p(1-p)^{4}=C_{5}^{2} p^{2}(1-p)^{3}$ $\Rightarrow 1-p=2 p \Rightarrow p=\frac{1}{3}$, so the probability of getting exactly 3 heads when tossing the biased coin 5 times $P=C_{5}^{3} p^{3}(1-p)^{2}=10 \cdot \frac{1}{27} \cdot \frac{4}{9}=\frac{40}{243}$