In a communication system, packets are transmitted from a sender to a receiver. Each packet is received with no error with probability $p$ independently from other packets (with probability $1−p$ the packet is lost). The receiver can decode the message as soon as it receives $k$ packets with no error. Find the probability that the sender sends exactly $n$ packets until the receiver can decode the message successfully.
To solve this problem, I just used the binomial formula. I.e.
$\binom{n}{k}p^n(1-p)^{n-k}$
Is this a correct application of the binomial formula? I tried to solve it using other methods, but was unable to come up with anything that seemed to be appropriate.
No, not quite so. You want the distribution of the count for iid Bernoulli trials until the $k$ th errorfree packet. This count follows a negative binomial distribution.
Give an iid errorfree rate of $p$, the probability for an arrangement of exactly $k-1$ errorfree packets among $n-1$ packets and then the $k^{\rm th}$ error free placket exactly on the $n^{\rm th}$ arrival is: ___?