# Probability mass function of a discrete random variable

A fair coin is continually flipped until heads appears for the 10th time. Let $X$ denote the number of tails that occur. Compute the probability mass function of $X$.

I thought weather $X = Y - 10$, where $Y$ is the number of trials.

If it is true, so $P(X)=P(Y)$?

To use the binomial or Poisson random distribution, we should have a given number $n$ of trials. So how do I use the binomial distribution in this case?

You should learn when to use each of the basic distributions (binomial, geometric etc).

From wikipedia

In probability theory and statistics, the binomial distribution with parameters n and p is the discrete probability distribution of the number of successes in a sequence of n independent yes/no experiments, each of which yields success with probability p.

As you noticed to have $X=k$, you need to perform exactly $10 + k$ independent trials. So you need $k$ successes out of $9 + k$ trials ($n=9+k$). We cannot count the final trial since it is always heads. Since your coin is fair $p=1/2$.

Using the binomial distribution compute $$\mathbb{P}[X=k] = \binom{9 +k}{k} {\left(\frac12\right)}^k \Big(1-\frac12\Big)^{10+k-k} = \binom{9+k}{k}{\left(\frac12\right)}^{10+k}$$

There is also a nice combinatorial argument to find $\mathbb{P}[X=k]$.

Notice that $(1/2)^{10+k}$ corresponds to the probability of a specific sequence of $k$ tails and $10$ heads e.g. $\overbrace{H H H T T H H T H\ldots T}^{9+k} H$. The thing is that you don't mind about the order of the tails but only about their sum so you have to multiply this probability with all the possible ways to take $k$ success from $9+k$ trials. That is where $\binom{9+k}{k}$ comes from. This argument explains the probability mass function formula of the binomial distribution in general.

The same result can be obtained using the negative binomial distribution considering heads as failures.

• There is a way to use the negative binomial distribution instead? It is the first distribution I would think. – AnalyticHarmony Dec 10 '16 at 1:31
• It's exactly the use case of the negative binomial distribution assuming heads are failures. Actually the probability mass formula of negative binomial distribution reveals a mistake in my argument. The last coin toss is always heads so the actual number of $n$ is $9 + k$. I will add this to the answer. – vkonton Dec 10 '16 at 1:40