Let X be a Binomial random variable defined as the sum of 6 independent Bernoulli trials. The probability of a Bernoulli taking the value 1 is given by p. Suppose that prior to the 6 Bernoulli trials, p is chosen to take one of three possible values with the following probabilities:
p Probability
--- -----------
0.2 0.1
0.6 0.7
0.8 0.2
• Compute the joint probability distribution of X and p. Are X and p independent?
• Compute the unconditional mean and variance of X.
• Compute the conditional mean of X given each possible value of p. Based on your calculations, what sign do you expect the covariance between X and p to be?
I'm having trouble understanding the lead-up of the question. I'm interpreting it that the probability of X is dependent on p, which also has probabilities and this is confusing me. What would the sample space of X be and how could you find the probabilities of X being values other than 1? Also for the probability of X being 1, how do you know which p value to use (0.2, 0.6, 0.8 from the table)? Thanking you in advance!
$X$ is the count of successes among $6$ Bernoulli trials, with success parameter $p$, while $p$ is itself a random variable with a support of three discrete values. $$P(p=0.2)=0.1, P(p=0.6)=0.7, P(p=0.8)=0.1$$
Thus the conditional distribution of $X$ for a given $p$ is binomial.
$$X\mid p=y \;\sim\; \mathcal{Binomial}(6, y)\\ \mathsf P(X=x\mid p=y) = \binom{6}{x}y^x(1-y)^{6-x}$$
So then $X$ itself has probability mass function:
$$\begin{align} \mathsf P(X=x) = {} & \mathsf P(X=x\mid p=0.2)\mathsf P(p=0.2) \\ & {} +\mathsf P(X=x\mid p=0.6)\mathsf P(p=0.6) \\ & {} +\mathsf P(X=x\mid p=0.8)\mathsf P(p=0.8) \end{align}$$
Substitute and simplify this, and determine if $\mathsf P(X=x, p=y) = \mathsf P(X=x)\mathsf P(p=y)$ for all $y\in \{0.2, 0.6, 0.8\}$