Average number of times we need to resend a packet of information There is a very simple system sending information from A to B. It sends information in Packets. Each packet, when travelling through the channel between A and B, is subject to a noise and therefore has a probability $\pi$ of being affected. If a packet is affected, we consider it to be wrong when it arrives to B. If that is the case, A will resend it until it is correctly received.
Suppose we want to correctly send one packet of information from A to B. What is the average number of times we have to send a packet so that it is correctly received?
I've spoken with a friend and he told me that it should be $1/(1-\pi)$. However, my approach produced a different result:
I considered the following: The first try has a probability $1$ of happening. The second try has a probability $\pi$ of happening since it will only happen if the packet is affected. The third try has a probability $\pi²$ of happening since it will only happen if there are two mistakes. Hence the average would be:
$$\sum_{n=1}^{\infty} nP(n) = \sum_{n=1}^{\infty} n \pi^{n-1} = \frac{1}{(1-\pi)²}$$
Which is the correct approach?
 A: The experiment is geometrically distributed with parameter $1−\pi$, so your friend is right saying the expected time to wait is $1/(1−\pi)$ (see https://en.wikipedia.org/wiki/Geometric_distribution). 
The geometric distribution waits on success for $n$ Bernoulli experiments.
But your approach also has the right idea. However the first try has probability $1-\pi$ of accepting, the second has $(1-\pi)\pi$, the third $(1-\pi)\pi^2$ et cetera. So $$\sum_{n=1}^{\infty} n (1-\pi)\pi^{n-1} = 1/(1-\pi).$$
You are missing the $(1-\pi)$ for accepting the packets.
A: The accepted answer has already shown one way to correct your calculation. But your calculation actually contained a very good idea, and there's another way to correct it that preserves that idea.
The first packet is sent with probability $1$, the second packet is sent with probability $\pi$, and so on. The expected total number of packets sent is the expected number of first packets sent plus the expected number of second packets sent and so on. The expected number of $n$-th packets sent is just the probability that the $n$-th packet is sent. So the expected number of packets sent is the sum of the probabilities for each packet of being sent:
$$
\sum_{n=1}^\infty P(n)=\sum_{n=1}^\infty\pi^{n-1}=\sum_{n=0}^\infty\pi^n=\frac1{1-\pi}\;.
$$
Thus your approach wasn't far from being right, and you don't need to include the probability of acceptance; you just need to count every packet just for itself and not count $n$ packets when the $n$-th packet is sent.
