Solution (source code)

= Solution

If $\sum_n\mathbb P(A_n)=\infty$, part (b) gives
$$
0\leq\mathbb E[2^{-N}]\leq e^{-\infty}=0.
$$
Thus $2^{-N}=0$ almost surely. By the convention in the question, this occurs exactly when $N=\infty$. Therefore
$$
\boxed{\mathbb P(N=\infty)=1}.
$$
This is the second <Borel-Cantelli lemmas>[Borel-Cantelli lemma] for independent events.