[Math] Finding the PMF and CDF of a random variable.

probability

An experiment consists of throwing a fair coin four times.

Find the PMF and CDF of the number of heads before the first tail.

Here's what I did.

Let $X$ represent the number of heads before the first tail. We are using the geometric distribution to model this random variable.

I have that $P(X=x) = (1-p)^{x-1}p$

where $p = 1/2$.

Is that my PMF? Did I do that correctly? Is $p$ the probability of "success" means what in my context? Getting a tail? Hence my confusion.

Furthermore, how do I find the CDF using the PMF? That is my other misunderstanding.

Help appreciated.

Thanks!

Best Answer

The Geometric distribution can be described in two ways:

  • The number of Bernoulli trials before the first success. The pmf is defined for $k=1,2,\cdots$
  • The number of failures in successive Bernoulli trials before the first success. The pmf is defined for $k=0,1,\cdots$

Since it is possible to get zero heads before the first tail, the support set is $k=0,1,\cdots$ in this case, and the pmf is $$P(X=k)=(1-p)^kp$$ with $p$ the probability of success (tails).

The cdf is $P(X\le k)$, which means the probability that the number of failures is less than or equal to $k$. The complementary event is $k+1$ times failure (heads). Hence the cdf is $$P(X\le k)=1-(1-p)^{k+1}$$