Normal (Gaussian) Distribution
📊 Normal (Gaussian) Distribution in Python
The Normal Distribution (also called Gaussian distribution) is a bell-shaped curve where most of the data points cluster around the mean. It’s widely used in statistics, machine learning, and natural phenomena modeling.
1. Characteristics of Normal Distribution
Symmetric about the mean
Mean, median, and mode are equal
Defined by mean (μ) and standard deviation (σ)
Probability Density Function (PDF):
f(x)=1σ2πe−(x−μ)22σ2f(x) = \frac{1}{\sigma \sqrt{2\pi}} e^{-\frac{(x-\mu)^2}{2\sigma^2}}
2. Generate Normal Distribution Using NumPy
3. Visualize Normal Distribution
Histogram
Using Seaborn
kde=True→ plots the smooth density curve
4. Generate Normal Distribution with Different Mean & Std
5. Check Mean and Standard Deviation
6. Probability Density Function (PDF)
🧠 Summary
| Parameter | Meaning |
|---|---|
mu / loc | Mean (center of the distribution) |
sigma / scale | Standard deviation (spread) |
size | Number of random samples |
Use
numpy.random.normal()for generating dataUse
matplotliborseabornfor visualizationThe bell curve is symmetric and widely applicable in statistics
🎯 Practice Task
Generate 1000 numbers with
μ=100andσ=15Plot histogram with KDE
Verify mean and standard deviation of the generated data
Plot the corresponding PDF curve
