A fair coin is flipped independently until the first Heads is observed. Let the random variable K be the number of tosses until the first Heads is observed plus 1. For example, if we see TTTHTH, then K=5 . For k=1,2,…,K , let Xk be a continuous random variable that is uniform over the interval [0,5] . The Xk are independent of one another and of the coin flips. Let X=∑Kk=1Xk . Find the mean and variance of X . You may use the fact that the mean and variance of a geometric random variable with parameter p are 1/p and (1−p)/p2 , respectively.

What is :

E[X] = ?

Var [X] = ?

To find the mean and variance of X, we need to analyze the random variable X in terms of the random variable K.

First, let's consider the random variable K. Since each coin flip is independent and has a probability of 1/2 of landing heads, K follows a geometric distribution with parameter p = 1/2. The possible values of K are 1, 2, 3, and so on.

1. Mean of K:
The mean of a geometric random variable with parameter p is given by 1/p. In this case, p = 1/2, so the mean of K is E[K] = 1/(1/2) = 2.

Now, let's consider the random variable X in terms of K.

2. X in terms of K:
For each value of K, we have a continuous random variable Xk that is uniformly distributed on the interval [0, 5]. And we have K such Xk variables since K represents the number of tosses until the first Heads is observed plus 1.

So, to find X, we need to sum up the K Xk variables. Mathematically, X can be represented as X = X1 + X2 + X3 + ... + XK.

3. Mean of X:
To find the mean of X, we'll use the linearity of expectations. Since the Xk variables are independent, we can calculate the mean of X by summing up the means of the Xk variables.

Since each Xk variable is uniformly distributed on [0, 5], the mean of each Xk is (0 + 5) / 2 = 2.5.

Therefore, the mean of X is E[X] = E[X1 + X2 + X3 + ... + XK] = E[X1] + E[X2] + E[X3] + ... + E[XK] = 2.5 + 2.5 + 2.5 + ... + 2.5 (sum of K terms) = 2.5K.

But we know that E[K] = 2, so substituting that in, we get E[X] = 2.5 * 2 = 5.

Therefore, E[X] = 5.

4. Variance of X:
To find the variance of X, we'll use the fact that the variance of a sum of independent random variables is the sum of their variances.

Since each Xk variable is uniformly distributed on [0, 5], the variance of each Xk is ((5 - 0)^2) / 12 = 25 / 12.

Therefore, the variance of X is Var[X] = Var[X1 + X2 + X3 + ... + XK] = Var[X1] + Var[X2] + Var[X3] + ... + Var[XK] = (25 / 12) + (25 / 12) + (25 / 12) + ... + (25 / 12) (sum of K terms) = (25 / 12)K.

Using E[K] = 2, we can substitute K as 2 to get Var[X] = (25 / 12) * 2 = 25 / 6.

Therefore, Var[X] = 25 / 6.

In summary:

E[X] = 5
Var[X] = 25 / 6