Calculate probabilities and z-scores for Gaussian distributions
Less than X [P(x < X)]
Greater than X [P(x > X)]
Between X1 and X2
Calculation Results
Understanding the Normal Model
The Normal Model (often called the Bell Curve or Gaussian Distribution) is a fundamental statistical concept used to describe how data points are distributed. It is defined by two primary parameters: the Mean (μ), which represents the center of the distribution, and the Standard Deviation (σ), which measures the spread or variability.
What is a Z-Score?
A Z-score indicates how many standard deviations a value is from the mean. It standardizes different data sets so they can be compared. The formula is:
z = (x – μ) / σ
The Empirical Rule (68-95-99.7)
In a perfect normal distribution:
68% of data falls within 1 standard deviation of the mean.
95% of data falls within 2 standard deviations of the mean.
99.7% of data falls within 3 standard deviations of the mean.
Realistic Example: IQ Scores
IQ tests are designed with a mean of 100 and a standard deviation of 15. If you want to find the probability of someone having an IQ higher than 130:
Input Mean: 100
Input SD: 15
Select "Greater than X" and enter 130.
The Z-score is 2.0. The probability is approximately 0.0228 (or 2.28%).
function toggleInputs() {
var type = document.getElementById("calcType").value;
var single = document.getElementById("singleInput");
var double = document.getElementById("doubleInput");
if (type === "between") {
single.style.display = "none";
double.style.display = "grid";
} else {
single.style.display = "block";
double.style.display = "none";
}
}
function normalCDF(x, mean, sd) {
var z = (x – mean) / sd;
var t = 1 / (1 + 0.2316419 * Math.abs(z));
var d = 0.3989423 * Math.exp(-z * z / 2);
var p = d * t * (0.3193815 + t * (-0.3565638 + t * (1.781478 + t * (-1.821256 + t * 1.330274))));
if (z > 0) {
return 1 – p;
} else {
return p;
}
}
function calculateNormalModel() {
var mean = parseFloat(document.getElementById("meanVal").value);
var sd = parseFloat(document.getElementById("sdVal").value);
var type = document.getElementById("calcType").value;
var resultArea = document.getElementById("resultsArea");
var zScoreDiv = document.getElementById("zScoreOutput");
var probDiv = document.getElementById("probOutput");
var percentDiv = document.getElementById("percentOutput");
if (isNaN(mean) || isNaN(sd) || sd <= 0) {
alert("Please enter valid numbers. Standard deviation must be greater than zero.");
return;
}
var prob = 0;
var zText = "";
if (type === "less") {
var x = parseFloat(document.getElementById("valX").value);
if (isNaN(x)) { alert("Please enter a value for X"); return; }
prob = normalCDF(x, mean, sd);
var z = (x – mean) / sd;
zText = "Z-Score: " + z.toFixed(4);
probDiv.innerHTML = "P(x " + x + ") = " + prob.toFixed(6);
} else if (type === "between") {
var x1 = parseFloat(document.getElementById("valX1").value);
var x2 = parseFloat(document.getElementById("valX2").value);
if (isNaN(x1) || isNaN(x2)) { alert("Please enter both values"); return; }
var lower = Math.min(x1, x2);
var upper = Math.max(x1, x2);
var probLower = normalCDF(lower, mean, sd);
var probUpper = normalCDF(upper, mean, sd);
prob = probUpper – probLower;
var z1 = (lower – mean) / sd;
var z2 = (upper – mean) / sd;
zText = "Z1: " + z1.toFixed(4) + " | Z2: " + z2.toFixed(4);
probDiv.innerHTML = "P(" + lower + " < x < " + upper + ") = " + prob.toFixed(6);
}
zScoreDiv.innerHTML = zText;
percentDiv.innerHTML = "Percentage: " + (prob * 100).toFixed(4) + "%";
resultArea.style.display = "block";
}