The Geometric distribution is used when we want to find the probability of performing a sequence of

trials with X “failures” before the first “success”, where a “success” occurs with some probability p.
We can denote such a random variable as X ∼ Geo(p). The pmf is given by
f(x) = p(1 − p)^x, x = 0,1,2, . . .
where 0 < p < 1.
(a) Is X a discrete or continuous random variable?
(b) Show that f(x) is a valid pmf.
(c) In a series of coin flips, what is the probability of getting the first heads on the 5th flip (so that
there are 4 tails before the first heads)?

I know it is discrete, and I know for part (b) that it has to be non negative and the integral equal to 1. However, when I work out the integral I get an awkward log function. And part (c), the only way I can think of is doing (1/2)^5, since each flip is independent but I feel like I am missing something.

(a) X is a discrete random variable because it takes on discrete values (0, 1, 2, ...) representing the number of failures before the first success.

(b) To show that f(x) is a valid probability mass function (pmf), we need to demonstrate two properties: non-negativity and the sum of all probabilities equal to 1.

1. Non-negativity:
For any value of x, we have p(1 - p)^x, where 0 < p < 1. Since both p and (1 - p) are between 0 and 1, the term (1 - p)^x always evaluates to a non-negative value. Moreover, p is also non-negative. Therefore, f(x) = p(1 - p)^x is non-negative for all x >= 0.

2. Sum of probabilities:
To calculate the sum of probabilities, we sum up f(x) for all possible values of x:
Summation of f(x) from x = 0 to infinity = p(1 - p)^0 + p(1 - p)^1 + p(1 - p)^2 + ...
= p(1 + (1 - p) + (1 - p)^2 + ...)
= p * 1/(1 - (1 - p)), by using the formula for the sum of an infinite geometric series
= p/(1 - 1 + p)
= p/p
= 1.

Since the sum of probabilities is equal to 1, f(x) satisfies the second property required for a valid pmf.

(c) In a series of coin flips, the geometric distribution can be used to find the probability of getting the first heads on a specific flip.

In this case, we want to know the probability of getting the first heads on the 5th flip, with 4 tails before the first heads. The probability of getting tails on each flip is (1/2) since a fair coin has an equal chance of landing on heads or tails.

Using the pmf formula for the geometric distribution, we can substitute x = 4 (the number of tails before the first heads) and p = 1/2 (the probability of getting tails on each flip):

f(4) = (1/2)(1 - 1/2)^4
= (1/2)(1/2)^4
= (1/2)(1/16)
= 1/32.

Therefore, the probability of getting the first heads on the 5th flip (with 4 tails before it) is 1/32.