This calculator helps you compute the probabilities of a normal distribution given the mean and standard deviation. You can find the probability of a value being less than, greater than, or between certain values given the mean and standard deviation of the normal distribution . The distribution chart shows the probability density function (PDF) and cumulative density function (CDF) of the normal distribution.
Calculator
Parameters
Important:If you have variance (σ² = 25), enter standard deviation (σ = 5)
Tip:P(X≤x) = P(X<x) since the probability of any exact value is zero.
Distribution Chart
Learn More
Normal Distribution
Definition: The normal distribution, also known as the Gaussian distribution, is a continuous probability distribution that is symmetric about its mean and follows a characteristic "bell-shaped" curve.
Where:
- is the mean (location parameter)
- is the standard deviation (scale parameter)
- is the variance
Properties
- Symmetric about the mean
- Bell-shaped curve
- Mean, median, and mode are all equal
- 68-95-99.7 rule:
- 68% of data falls within 1 standard deviation of the mean
- 95% of data falls within 2 standard deviations
- 99.7% of data falls within 3 standard deviations
Z-Scores
Definition: A z-score represents how many standard deviations away from the mean a data point is.
Where:
- is the data point
- is the mean
- is the standard deviation
Explore the Normal Distribution
Adjust the mean and standard deviation to see how they affect the shape of the normal curve.
Observe how:
- The mean shifts the center of the curve left or right
- The standard deviation makes the curve wider or narrower
- The total area under the curve always remains the same
How to Calculate Normal Distribution in R
library(tidyverse)
# P(X < 1) - P(X < -1)
P_between <- pnorm(1) - pnorm(-1)
print(p_between) # 0.6826895
# X ~ N(-5, 4)
# P(-7 < X < -3)
p_between <- pnorm(-3, mean = -5, sd = 2) - pnorm(-7, mean = -5, sd = 2)
print(p_between) # 0.6826895
# plot the standard normal distribution
x <- seq(-3, 3, length.out = 1000)
pdf <- dnorm(x)
df <- tibble(x = x, pdf = pdf)
ggplot(df, aes(x = x, y = pdf)) +
geom_line(color = "blue") +
geom_area(data = subset(df, x >= -1 & x <= 1), aes(x = x, y = pdf), fill = "blue", alpha = 0.2) +
labs(title = "Standard Normal Distribution",
x = "x",
y = "Probability Density") +
annotate("text", x = 1, y = 0.3, label = str_glue("P(-1 < X < 1) = {round(P_between, 4)}"), hjust = 0) +
theme_minimal()
How to Calculate Normal Distribution in Python
import pandas as pd
import numpy as np
import scipy.stats as stats
import matplotlib.pyplot as plt
# P(X < 1) - P(X < -1)
p_between = stats.norm.cdf(1) - stats.norm.cdf(-1)
print(p_between)
# X ~ N(-5, 4)
# P(-7 < X < -3)
p_between = stats.norm.cdf(-3, loc=-5, scale=2) - stats.norm.cdf(-7, loc=-5, scale=2)
print(p_between)
# Plot the standard normal distribution
x = np.linspace(-3, 3, 1000)
pdf = stats.norm.pdf(x)
# Create a pandas DataFrame
df = pd.DataFrame({'x': x, 'pdf': pdf})
# Plotting
plt.plot(df['x'], df['pdf'], color="blue")
plt.fill_between(df['x'], df['pdf'], where=(df['x'] >= -1) & (df['x'] <= 1), color="blue", alpha=0.2)
plt.title("Standard Normal Distribution")
plt.xlabel("x")
plt.ylabel("Probability Density")
plt.annotate(f"P(-1 < X < 1) = {round(p_between, 4)}", xy=(1, 0.3), ha='left')
plt.grid(True)
plt.show()