<s>[INST] Two coins, one experiment: what is the probability that the coin lands on heads on exactly $7$ of the $10$ flips? When coin $1$ is flipped, it lands on heads with probability $0.4$; when coin $2$ is flipped, it lands on heads with probability $0.7$. One of these coins is randomly chosen and flipped $10$ times.
(a) What is the probability that the coin lands on heads on
exactly $7$ of the $10$ flips?
(b) Given that the first of these $10$ flips lands heads, what is the conditional probability that exactly $7$ of the $10$ flips land on heads?
MY ATTEMPT
(a) Let us denote by $X$ the random variable which counts the numbers of heads in 10 flips. Thus $X\sim\text{Binomial}(10,p)$, where the parameter $p$ depends on the coin that is chosen: $C = 1$ stands for the event "the first coin is chosen" and $C = 2$ stands for the event "the second coin is chosen". Based on these considerations, we have the answer to the first question, which is
\begin{align*}
\textbf{P}(X = 7) = \textbf{P}(X = 7\mid C = 1)\textbf{P}(C = 1) + \textbf{P}(X = 7\mid C = 2)\textbf{P}(C = 2)
\end{align*}
where
\begin{cases}
\textbf{P}(X = 7\mid C = 1) = \displaystyle{10\choose 7}(0.4)^{7}(0,6)^{3}\\\\
\textbf{P}(X = 7\mid C = 2) = \displaystyle{10\choose 7}(0.7)^{7}(0,3)^{3}\\\\
\textbf{P}(C = 1) = \textbf{P}(C = 2) = 0.5
\end{cases}
(b) Since $X = \displaystyle\sum_{k=1}^{10} X_{k}$, where each $X_{k}\sim\text{Bernoulli}(p)$, we are interested in the event $\textbf{P}(X = 7\mid X_{1} = 1)$, which is equivalent to
\begin{align*}
\textbf{P}(X = 7\mid X_{1} = 1) & = \frac{\textbf{P}(X = 7, X_{1} = 1)}{\textbf{P}(X_{1} = 1)} = \frac{\textbf{P}\left(\displaystyle\sum_{k=2}^{10}X_{k} = 6\right)}{\textbf{P}(X_{1} = 1)}
\end{align*}
Since $\textbf{P}(X_{1} = 1) = \textbf{P}(X_{1} = 1 | C = 1)\textbf{P}(C = 1) + \textbf{P}(X_{1} = 1 | C = 2)\textbf{P}(C = 2)$, it suffices to calculate $\textbf{P}(Y = 6)$, where $Y := \displaystyle\sum_{k=2}^{10}X_{k}$ and, consequentely, $Y\sim\text{Binomial}(9,p)$:
\begin{align*}
\textbf{P}(Y = 6) = \textbf{P}(Y = 6\mid C = 1)\textbf{P}(C = 1) + \textbf{P}(Y = 6\mid C = 2)\textbf{P}(C = 2)
\end{align*}
where
\begin{cases}
\textbf{P}(Y = 6\mid C = 1) = \displaystyle{9\choose 6}(0.4)^{6}(0,6)^{3}\\\\
\textbf{P}(Y = 6\mid C = 2) = \displaystyle{9\choose 6}(0.7)^{6}(0,3)^{3}\\\\
\textbf{P}(C = 1) = \textbf{P}(C = 2) = 0.5
\end{cases}
My question is: am I working it right or is there any conceptual misapplication?
Any contribution is appreciated. Thanks in advance!
 [/INST] For part $a)$, 
Let $K_1$ denotes when coin $1$ is chosen and $K_2$ denotes when coin $2$ is chosen.
The probability that the coin lands on heads on exactly $7$ of the $10$ flips is $P(H)$
$$P(H)=P(H|K_1)P(K_1)+P(H|K_2)P(K_2)$$
$$P(H)=\dbinom{10}{7}(0.4)^7(0.6)^3(0.5)+\dbinom{10}{7}(0.7)^7(0.3)^3()0.5$$
For part $b)$,
When the first flip is head, then the probability is computed from choosing $6$ head flips out of $9$ flips in both coins case. So, we get $\dbinom{9}{6}(0.4)^6(0.6)^3(0.5)+\dbinom96(0.7)^6(0.3)^3(0.5)$
Let $T$ denotes the event that the first flip is head.
$$P(H|T)=\dfrac{P(H\cap T)}{P(T)}$$
$P(T)=P(T|K_1)P(K_1)+P(T|K_2)P(K_2)=(0.4)(0.5)+(0.7)(0.5)=0.55$
$P(H\cap T)=P(H\cap T|K_1)P(K_1)+P(H\cap T|K_2)P(K_2)$
$$=\dbinom96(0.4)^6(0.6)^3(0.5)+\dbinom96(0.7)^6(0.3)^3(0.5)$$
</s>