Simulating Normal Distribution in Mathematica: Histogram and PDF Plotting

Click For Summary
SUMMARY

This discussion focuses on simulating a normal distribution in Mathematica using the Central Limit Theorem by summing multiple uniform random variables generated with RandomReal[]. The user seeks to plot both a histogram of the simulated data and the Gaussian probability density function (PDF) on the same graph. The solution involves using the Show function to combine multiple graphics, as demonstrated with the syntax: Show[Histogram[RandomReal[NormalDistribution[0, 1], 200]], Plot[Sin[x], {x, -6 Pi, 6 Pi}]].

PREREQUISITES
  • Familiarity with Mathematica programming language
  • Understanding of the Central Limit Theorem
  • Knowledge of histogram and probability density function (PDF) concepts
  • Experience with graphical functions in Mathematica, specifically Show, Histogram, and Plot
NEXT STEPS
  • Learn how to use the Show function in Mathematica for combining multiple plots
  • Explore the RandomReal[] function and its applications in generating random variables
  • Study the properties of the Gaussian distribution and its significance in statistics
  • Investigate advanced plotting techniques in Mathematica for enhanced data visualization
USEFUL FOR

Students and researchers in statistics, data analysts, and anyone interested in visualizing statistical distributions using Mathematica.

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}]]
 

Similar threads

  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 6 ·
Replies
6
Views
2K
  • · Replies 1 ·
Replies
1
Views
1K
  • · Replies 3 ·
Replies
3
Views
5K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 13 ·
Replies
13
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 5 ·
Replies
5
Views
3K
  • · Replies 1 ·
Replies
1
Views
2K