Another way is by simulating a million match-offs between $X$ and $Y$ to approximate $P(X > Y) = 0.9907\pm 0.0002.$ [Simulation in R.]
set.seed(825)
d = replicate(10^6, sum(sample(1:6,100,rep=T))-rbinom(1,600,.5))
mean(d > 0)
[1] 0.990736
2*sd(d > 0)/1000
[1] 0.0001916057 # aprx 95% margin of simulation error
set.seed(825)
d = replicate(10^6, sum(sample(1:6,100,rep=T))-
rbinom(1,600,.5))
mean(d > 0)
[1] 0.990736
2*sd(d > 0)/1000
[1] 0.0001916057 # aprx 95% margin of simulation error
Notes per @AntoniParellada's Comment:
In R, the function sample(1:6, 100, rep=T)
simulates 100 rolls a fair die;
the sum of this simulates $X$. Also rbinom
is R code for simulating
a binomial random variable; here it's $Y.$ The difference is $D = X - Y.$
The procedure replicate
makes a vector of a million differences d
.
Then (d > 0)
is a logical vector of a million TRUE
s and FALSE
s, the mean
of which is its proportion of TRUE
s--our Answer. Finally, the last statement
gives the margin of error of a 95% confidence interval of the proportion
of TRUE
s (using 2 instead of 1.96), as a reality check on the accuracy
of the simulated Answer. [With a million iterations one ordinarily expects
2 or 3 decimal paces of accuracy for probabilities--sometimes more for
probabilities so far from 1/2.]