Question from Gelman Regression & Other Stories Comparison of proportions: You want to gather data to determine which of two students is a better basketball shooter. One of them shoots with 30% accuracy and the other is a 40% shooter. Each student takes 20 shots and you then compare their shooting percentages. What is the probability that the better shooter makes more shots in this small experiment?
I'm struggling with the above question. I think the solution requires computing a z score and looking at the probability of getting a value below. I.e., my logic so far is
$$p_1 - p_2 = -.1$$
$$se(p_1-p_2) = .15$$
$$z = -.66$$
Want to know $Prob(p_1-p_2 <0)$
implies; $Prob(Z > z) \to Prob(Z > -.66) \to 1-Prob(Z < -.66) = 1 - .2454 = .7546$
My reasoning isn't totally clear to me. Specifically, I'm not sure why $Prob(p_1-p_2 <0)$ implies $Prob(Z > z)$ makes sense.
 A: Let's actually start with a simulation to see where we should be heading, and then do the math.  Using R...
nsim = 1e5
set.seed(0)
a = rbinom(nsim, 20, 0.3)
b = rbinom(nsim, 20, 0.4)
mean(b>a)
[1] 0.69248

So whatever the answer is mathematically, it should be around 0.69.
Let $A$ and $B$ be independent random variables for the number of shots made by both players respectively.  Note because we have a success/failure outcome, and we make a sequence of them, then $A$ and $B$ are binomial random variables with mean $np$ and variance $np(1-p)$.  Here, $p$ is the probability of success for an individual trial. The normal approximation to the binomial is then
$$ A \sim \mathcal{N}(6, 4.2) $$
$$ B \sim \mathcal{N}(8, 4.8) $$
Here, I have just used the mean and variance of the binomials.  The question asks about the better player making more shots, which is equivalent to asking $P(B-A>0)$.  Because we are using a normal approximation, $B-A$ is also a normal random variable.
$$ B-A \sim \mathcal{N}(2, 9)$$
With the normal approximation to the difference in hand, we can apply standard techniques to estimate the probability.  One of these techniques is a continuity correction.  When we apply the continuity correction, we get an answer very similar to our simulation result.
$$ z = \dfrac{(0+0.5) - 2}{\sqrt{9}} = \dfrac{-1.5}{3}$$
$$ 1- \mathbf{\Phi}(z) \approx 0.6914$$
Where $\mathbf{\Phi}$ is the cumulative distribution function for the standard normal.
