Probability Problem(unfair coin) Suppose we have an unfair coin with a probability of  0.6  of obtaining a heads on any given toss. As is typical for coin toss problems, assume each coin toss is independent.
What is the expected number of flips before we get a heads?
My thought is using the negative binomial distribution and get this:
$E(x) = 1 + (1-p)/p = 1 + ( 0.4)/ (0.60) = 1.67$ Filps
I tried 1.67 and 2 flips, but none of them is correct, can someone explain to me what's wrong here? Thanks
 A: Let the positive-integer-valued random variable $X$ be the number of tosses before a heads show up for the first time. For any $k \in \mathbb Z_{>0}$, the event $X=k$ is equivalent to the event that the first $k-1$ tosses land tails, and the $k$th toss lands heads. Thus $\mathbb P(X=k)=(1-p)^{k-1} p$. WLOG and to avoid trivialities, we will be assuming $0 < p < 1$; if $p=0$, then $X=\infty$ almost surely, and so $\mathbb E[X] = \infty$; if $p=1$, then $X=1$ almost-surely, and so $\mathbb E[X] = 1$. Otherwise,
one computes
$$
\mathbb E[X] = \sum_{k=1}^\infty k\mathbb P(X=k)=\sum_{k=1}^\infty k(1-p)^{k-1} p = pf'(p),
$$
where $f(p):= -\sum_{k=1}^\infty (1-p)^k=1-1/p$, and so $pf'(p) = p/p^2 = 1/p$.

Therefore, $\mathbb E[X] = 1/p$.

If you need the expected number of flips before the head, this is $\mathbb E[Y]$, where $Y=X-1$. Thus, $\mathbb E[Y] = \mathbb E[X] - 1 = 1/p-1=(1-p)/p$, by linearity of expectations.
A: There is an intuitive approach.  If something has a $\frac {1}{n}$ chance of occuring in $1$ flip, we can expect it to happen in $n$ flips.
$E[X] = \frac {1}{p} = \frac 53$
More rigorously, you might make a table.
$\begin {array}{} X & p(x)\\
1 & 0.6\\
2 & 0.4\cdot 0.6\\
3 & 0.4^2\cdot 0.6\\
\vdots \end {array}$
$p(x) = 0.6\cdot 0.4^{x-1}$
$E[X] = \sum xp(x) = 0.6 \sum_\limits{n=0}^\infty (n+1)0.4^n $
How to resolve that sum?
$S = \sum_\limits{n=0}^\infty (n+1)0.4^n\\
S - 0.4 S = \sum_\limits{n=0}^\infty 0.4^n$
Which is a geometric series
$s = \frac {1}{(1-0.4)^2}$
$E[X] = 0.6 S = \frac {0.6}{0.6^2} = \frac {1}{0.6}$
