What is the probability that there will be more black balls randomly selected from one urn? 0.52 of the balls in urn A are black and 0.47 of the balls in urn B are black. 100 balls are randomly chosen from each urn. What is the probability that the proportion of black balls chosen from urn B will be greater than the proportion of black balls chosen from urn A?
I don't know how to treat this mathematically but I get a value between 0.21 and 0.22 if I run the following R code.
mean(replicate(1000,sum(rbinom(100,100,0.47)-rbinom(100,100,0.52) > 0)/100))

The answer, I was told, is 0.24. Is this correct?
 A: As I understand, you draw $200$ balls, $100$ from each urn. 
Let $N_A$ be the number of black balls from the collection of $100$ balls drawn from urn A.
Let $N_B$ be the number of black balls from the collection of $100$ balls drawn from urn B.
You just want to calculate probability of the event $\{ N_A < N_B \}$. 
Assuming independence of $N_A$ and $N_B$, we have: 
$P_{N_A, N_B}(n_a, n_b) = 
P(N_A = n_a) * P(N_B = n_b) = \begin{cases}
\binom{100}{n_a} 0.52^{n_a}0.48^{100 - n_a}\binom{100}{n_b} 0.47^{n_b}0.53^{100 - n_b} & (n_a, n_b) \in \{0, 1, ..., 100 \} \times \{0, 1, ..., 100 \}\\
0 & \text{otherwise } 
\end{cases}$
Then, \begin{align*}
P(N_A < N_B) = \sum_{n_a = 0}^{100} \sum_{n_b = n_a + 1}^{100} \binom{100}{n_a} 0.52^{n_a}0.48^{100 - n_a}\binom{100}{n_b} 0.47^{n_b}0.53^{100 - n_b} 
\end{align*}
This is really tedious. Instead, consider the normal approximation: $N_A \sim \mathcal{N}(52, 24.96)$ and $N_B \sim \mathcal{N}(47, 24.91)$ so that $N_A - N_B \sim \mathcal{N}(5, 49.87)$
\begin{align}
P(N_A - N_B < 0) \approx 1 - \Phi\left (\frac{5}{\sqrt{49.87}} \right ) = 0.2395
\end{align}
A: Here is some python to calculate it if you don't want to use a normal approximation
def factorial(x):
if x == 0:
    return 1
else:
    return factorial(x -1) * x

def C(n,r):
    return factorial(n) / factorial(r) / factorial(n - r)

prob = 0
     for x in range(51, 101):
        p = 0.47**x * .53**(100 -x) * C(100, x)
        print("x = {} p = {}".format(x,p))
        prob = prob + p

print("Prob of 51 or more black balls= {}".format(prob))

my output 
Prob of 51 or more black balls= 0.24134395430136982

I've assumed large number of balls in urn/balance of ratio will remain similar during drawings due to proportional depletion of balls - grossly unequal depletion is very small probabilities
