Simulating Normal Distribution in Mathematica: Histogram and PDF Plotting

Join the discussion
Registration is free. Ask a follow-up in this thread, or start your own.
1 reply · 6K views
Sam_Goldberg
Messages
46
Reaction score
1
Hi guys,

On my homework, I'm simulating a normal distribution on Mathematica by adding up a bunch of RandomReal[] , that is, uniform(0,1) random variables, and using the central limit theorem. I would like to plot both the histogram and the actual Gaussian probability density function on the same graph, but it does not seem that I'm able to use both the Histogram and Plot functions at the same time. How should I do this? Thanks.
 
Physics news on Phys.org
You use "Show" to show multiple graphics at a time:

Show[Histogram[RandomReal[NormalDistribution[0, 1], 200]], Plot[Sin[x], {x, -6 Pi , 6 Pi}]]