A biased coin that comes up heads with probability p, is tossed until the first head appears. Let random variable X be the number of tosses. For a fixed $n \in N$ find $P(X=n)$ and $P(X\leq n)$.
My attempt:
Completely stuck on finding $P(X=n)$ but i have a vague idea of $P(X\leq n)$:
So i know that the probability of not getting heads (getting tails) is $p-1$ thus
$$P(X\leq n)=(1-p)^{n+1}$$
so $E(x)=\sum_{n=1}^{\infty}P(X\leq n)=\sum_{n=1}^{\infty}(1-p)^{n+1}=\frac{1}{1-(1-p)}=\frac{1}{p}$
so the expected number of tosses until a head appears on a biased coin is $\frac{1}{p}$
Is this answer correct or have i gone wrong?
Many thanks
Best Answer
The probability that $X=n$ is the probability of $n-1$ tails followed by a head. This is $(1-p)^{n-1}p$.
The probability that $X\le n$ is $1$ minus the probability that $X\gt n$. The probability that $X\gt n$ is the probability of $n$ tails in a row, which is $(1-p)^n$.
Remark: The expectation of $X$ is indeed $\frac{1}{p}$. But that was not one of the questions asked. The calculation that led to the correct result was not right.