9 fair coins are independently tossed in a row. Let X be the random variable denoting the number of instances in which a Head is immediately followed by a Tail during these 9 tosses. The variance of X has the form a/b, where a and b are coprime integers. What is the value of a+b?

Details and assumptions Note: If we have 5 coins which are tossed as (HT)T(HT), there are 2 instances in which a Head is immediately followed by a Tail; they have been grouped.

To find the variance of X, we need to calculate the mean and the probability function of X.

First, let's find the probability of having a Head immediately followed by a Tail in a single coin toss. There are two possibilities: either HT or TH. Since the coins are fair, the probability of each outcome is 1/2.

Now, let's define a Bernoulli random variable Y that takes the value 1 when a Head is immediately followed by a Tail, and 0 otherwise. The probability distribution of Y is given by:

P(Y = 1) = P(HT) + P(TH) = 1/2 + 1/2 = 1

P(Y = 0) = P(HH) + P(TT) = 1/2 + 1/2 = 1

Since Y can only take two possible values, it follows a Bernoulli distribution.

To find the mean of X, we observe that X is the sum of independent Bernoulli random variables, one for each coin toss. Since the coins are independent, the mean of the sum is equal to the sum of the means. Therefore, the mean of X is the expected number of instances in which a Head is immediately followed by a Tail in a single coin toss, which is equal to the mean of Y:

E[X] = E[Y] = 1

To find the variance of X, we use the fact that the variance of a sum of independent random variables is equal to the sum of the variances. Since each coin toss is independent, the variance of X is equal to the sum of the variances of the individual Bernoulli random variables. The variance of a Bernoulli distribution is given by p(1-p), where p is the probability of success.

Var(Y) = p(1-p) = (1/2)(1-1/2) = 1/4

Therefore, the variance of X is:

Var(X) = 9 * Var(Y) = 9 * (1/4) = 9/4

The variance of X has the form a/b, where a = 9 and b = 4. The sum of a and b is:

a + b = 9 + 4 = 13

Therefore, the value of a+b is 13.