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

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.
