# Return value from normal distribution using Bernoulli trial generator

Given a random Bernoulli trial generator, how do you return a value sampled from a normal distribution?

Came across this question in my interview prep. I thought it can be done by tuning the probability of success in the generator but I am not sure.

• Somewhat related: stats.stackexchange.com/questions/117689. Given that Bernoulli trials return only zeros and ones, it's hard to see what tuning it might do. Consider instead using it to generate binary sequences, because from there it's easy to obtain a uniform value in $[0,1)$ and you're off and running (search "Box Muller").
– whuber
Nov 12, 2020 at 22:47
• If you generate $n=100$ observations from $\mathsf{Binom}(100, 1/2)$ you will have 100 observations that are nearly $\mathsf{Norm}(\mu=25,\sigma=5),$ (except rounded to integers). In R, x = rbinom(100, 100, .5); mean(x); sd(x); shapiro.test(x)$p.val returns$\bar X \approx 50, S \approx 5,\$ and P-value > 5% for the normality test. Nov 12, 2020 at 22:48
• For some historically clever solutions, see jstor.org/stable/2245712?seq=1. I believe this may be the article in which Stigler describes Galton's dice, which had special (floating) values written on them which when summed emulated a standard Normal variate remarkably well.
– whuber
Nov 12, 2020 at 22:51