I am interested in modeling the following experiment:
A binomial trial with $n$ Bernoulli experiments is run. For the k positive outcomes a second (independent) binomial trial with $k$ runs with a different success probability is run.
For example: I throw $n$ darts with probability $p_1$ of hitting the bull's eye. The number of hits is $k$. My friend is then allowed to throw $k$ times and has a different skill set than I do (probability $p_2$). I want to model the probability that he will hit the bull's eye $l$ times. Let us call the random variable $Y_{n}$ if n trials are run. The first binomial trial is $X^{1}_{n}$ and the second is $X^{2}_{k}$.
Question 1:
What is the distribution of this random variable?
I argue that an ugly form is:
$P \left(Y_{n}=l\right) = \sum_{i=l}^{n}P\left(X_{n}^{1}=i\right)\cdot P\left(X^{2}_i = l\right)$.
Is this correct and is there a nice way to determine confidence intervals for the success probability $p$ of $Y$? I am especially concerned with the quality of the confidence intervals for small $n$ so I am not feeling well with using a normal approximation which would I guess lead to a sum of product normal probabilities. Using Jeffrey's prior (which afaik leads to better results for smaller $n$) I would with a wild guess receive a sum of products of beta probabilities which seems to be numerically difficult (Product of beta distributions).
Question 2:
Finally I am interested for $Y^{i}\sim D \left(n_{i},p_{i}\right)$, with $D$ being the (for me) unknown distribution with overall success probability $p_{i}$ to calculate (approximately)
$P\left(p^{1}_{n_1}\gt p^2_{n_2}\right)$ given sample data. Is there a general way to attack this problem?
Interpretation: there are two teams of dart player pairs. I observe a series of outcomes and want to calculate the probability that one team has a higher sucess probability (success being hitting the bull's eye in the second step which requires at least one hit in the first step).
Question 3:
Is there a nice generalization if I have not only 2, but $k$ successive binomial experiments of this kind? Nice in the sense not simply extending my formula above and summing/integrating approximately.