Normal Distribution in Data Science
Last Updated :
06 Jun, 2025
Normal Distribution also known as the Gaussian Distribution or Bell-shaped Distribution is one of the widely used probability distributions in statistics. It plays an important role in probability theory and statistics basically in the Central Limit Theorem (CLT). It is characterized by its bell-shaped curve which is symmetric around the mean (μ). This symmetry shows that values equally distant from the mean. The probability of an event decreases as we move further away from the mean with most events clustering around the center. In this article, we will see the normal distribution and its core concepts.
It can be observed in the above image that the distribution is symmetric about its center which is the mean (0 in this case). This makes the probability of events at equal deviations from the mean equally probable. The density is highly centered around the mean which translates to lower probabilities for values away from the mean.
Probability Density Function (PDF)
The probability density function of the normal distribution defines the likelihood of a random variable taking a particular value. The formula for the PDF is given by:
f_X(x) = \frac{1}{\sigma \sqrt{2\pi}} e^{\frac{-1}{2}\big( \frac{x-\mu}{\sigma} \big)^2}\\
where:
- \mu (mu) is the mean of the distribution. It represents the central value of the distribution.
- \sigma (sigma) is the standard deviation which measures the spread or dispersion of the distribution.
- x is the specific value for which we're calculating the probability.
While the formula might seem complex at first time lets break it down to simplify it. The z-score is a measure shows how many standard deviations a data point is from the mean. Mathematically, it’s defined as:
\text{z-score} = \frac{X-\mu}{\sigma}
The exponent in the formula involves the square of the z-score multiplied by \frac{-1}{2} which aligns with the observation that values farther from the mean are less likely. Larger z-scores (representing values farther from the mean) result in smaller probabilities due to the negative exponent. On the other hand, values closer to the mean result in smaller z-scores and higher probabilities.
This behavior is reflected in the 68-95-99.7 rule which states that:
- 68% of values lie within 1 standard deviation from the mean,
- 95% lie within 2 standard deviations and
- 99.7% lie within 3 standard deviations.
The figure given below shows this rule:
68-95-99.7 rule Expectation (E[X]), Variance and Standard Deviation
The expectation or expected value E[X] of a random variable gives us a measure of the "center" of the distribution. For a normally distributed random variable 𝑋 with parameters \mu(mean) and \sigma^{2} (variance), the expectation is calculated by integrating the product of the random variable and its probability density function (PDF) over all possible values.
Mathematically, the expected value E[X] is:
E[X] = \int_{-\infty}^{\infty} x f_X(x) \, dx
For the normal distribution, the formula becomes:
E[X] = \frac{1}{\sigma \sqrt{2\pi}} \int_{-\infty}^{\infty} x e^{-\frac{1}{2} \left( \frac{x - \mu}{\sigma} \right)^2} \, dx
We can simplify this by breaking it into two parts:
- The first part involves integrating (x−μ) which is symmetric about the mean and its result is zero because the distribution is symmetric.
- The second part involves multiplying the mean\mu by the total probability which equals 1 (since the area under the normal curve is always 1).
Thus we find: E[X]=μ
This tells us that the expected value of a normal distribution is simply the mean \mu.
Variance and Standard Deviation
The variance of a normal distribution is the square of the standard deviation denoted as \sigma^ 2. It measures how spread out the values of the distribution are from the mean.
The standard deviation \sigma is simply the square root of the variance:
Variance= \sigma^ 2
Standard Deviation= \sigma
Standard Normal Distribution
In the General Normal Distribution, if the Mean is set to 0 and the Standard Deviation is set to 1 then resulting distribution is called the Standard Normal Distribution. The formula for the Probability Density Function (PDF) of the standard normal distribution is:
f_X(x) = \frac{1}{\sqrt{2\pi}} e^{-\frac{x^2}{2}}
where:
The Standard Normal Distribution is symmetric around the mean and its PDF defines the shape of the bell curve.
Cumulative Distribution Function (CDF)
1. The Cumulative Distribution Function (CDF) of the normal distribution does not have a closed-form expression. As a result, precomputed values from standard normal tables are used to find cumulative probabilities. These tables specifically provide cumulative probabilities for the standard normal distribution.
2. For a general normal distribution, the first step is to standardize the distribution by converting it into a z-score. Once standardized, the cumulative probability is calculated using the standard normal distribution tables.
3. This process has two key benefits:
- Only one table is needed to calculate probabilities for all normal distributions regardless of the specific mean and standard deviation.
- The table size is manageable containing 40 to 50 rows and 10 columns.
This is due 68-95-99.7 rule which says that values within 3 standard deviations of the mean account for 99.7% probability. So beyond X=3 (\mu +3\sigma = 0 + 3*1 = 3 ) will have very small probabilities which are approximately 0.
Example: Finding Probabilities
Problem: Suppose that the current measurements in a strip of wire are assumed to follow a normal distribution with a mean of 10 milliamperes and a variance of four milliamperes^ 2 . What is the probability that a measurement exceeds 13 milliamperes?
Solution:
1. Let X denote the current in milliamperes. We are tasked with finding P (X > 13).
2. Standardize X by converting it to a z-score:
Z = \frac{X - \mu}{\sigma} = \frac{13 - 10}{\sqrt{4}} = \frac{3}{2} = 1.5
3. Now P(X > 13) becomes equivalent to P(Z > 1.5) in the standard normal distribution.
4. From the standard normal table, find the value of P(Z \leq 1.5) = 0.93319
5. So P(Z \geq 1.5) = 1 - P(Z \leq 1.5) = 1 - 0.93319 = 0.06681
Thus the probability that the current exceeds 13 milliamperes is approximately 0.06681, or 6.7%.
Implementation of Normal Distribution in Python
Here we will be using Numpy, Matplotlib and Seaborn libraries for the implementation.
Python
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
mean = 10
std_dev = 2
size = 1000
data = np.random.normal(loc=mean, scale=std_dev, size=size)
sns.histplot(data, kde=True, stat="density", bins=30, color="skyblue", linewidth=0.8)
plt.title(f'Normal Distribution (μ={mean}, σ={std_dev})')
plt.xlabel('Value')
plt.ylabel('Density')
plt.show()
Output:
ResultApplications of Normal Distribution
The normal distribution is incredibly versatile and is used across a variety of fields:
- Scientific Research: Measurement errors are normally distributed helps in making this distribution important in experimental design and hypothesis testing.
- Finance: In stock market analysis, returns of stock prices follow a normal distribution. This helps in risk assessment and portfolio optimization.
- Engineering: Manufacturing processes such as the dimensions of parts produced can be modeled using normal distribution.
- Psychometrics: Test scores and IQ scores are assumed to follow a normal distribution helps in aiding in standardized testing and education.
- Healthcare: Certain biological measurements (e.g blood pressure) tend to follow normal distributions which helps in identifying outliers or abnormal conditions.
Mastering the Standard Normal Distribution helps in the deeper understanding of probability which enables more accurate data interpretation and decision-making.
Similar Reads
Engineering Mathematics Tutorials Engineering mathematics is a vital component of the engineering discipline, offering the analytical tools and techniques necessary for solving complex problems across various fields. Whether you're designing a bridge, optimizing a manufacturing process, or developing algorithms for computer systems,
3 min read
Matrix and Determinants
MatricesMatrices are key concepts in mathematics, widely used in solving equations and problems in fields like physics and computer science. A matrix is simply a grid of numbers, and a determinant is a value calculated from a square matrix.Example: \begin{bmatrix} 6 & 9 \\ 5 & -4 \\ \end{bmatrix}_{2
3 min read
Different Operations on MatricesFor an introduction to matrices, you can refer to the following article: Matrix Introduction In this article, we will discuss the following operations on matrices and their properties: Matrices AdditionMatrices SubtractionMatrices MultiplicationMatrices Addition: The addition of two matrices A m*n a
11 min read
Representation of Relation in Graphs and MatricesUnderstanding how to represent relations in graphs and matrices is fundamental in engineering mathematics. These representations are not only crucial for theoretical understanding but also have significant practical applications in various fields of engineering, computer science, and data analysis.
8 min read
Determinant of Matrix with Solved ExamplesThe determinant of a matrix is a scalar value that can be calculated for a square matrix (a matrix with the same number of rows and columns). It serves as a scaling factor that is used for the transformation of a matrix.It is a single numerical value that plays a key role in various matrix operation
15+ min read
Properties of DeterminantsProperties of Determinants are the properties that are required to solve various problems in Matrices. There are various properties of the determinant that are based on the elements, rows, and columns of the determinant. These properties help us to easily find the value of the determinant. Suppose w
10 min read
Row Echelon FormRow Echelon Form (REF) of a matrix simplifies solving systems of linear equations, understanding linear transformations, and working with matrix equations. A matrix is in Row Echelon form if it has the following properties:Zero Rows at the Bottom: If there are any rows that are completely filled wit
4 min read
Eigenvalues and EigenvectorsEigenvalues and eigenvectors are fundamental concepts in linear algebra, used in various applications such as matrix diagonalization, stability analysis and data analysis (e.g., PCA). They are associated with a square matrix and provide insights into its properties.Eigen value and Eigen vectorTable
10 min read
System of Linear EquationsA system of linear equations is a set of two or more linear equations involving the same variables. Each equation represents a straight line or a plane and the solution to the system is the set of values for the variables that satisfy all equations simultaneously.Here is simple example of system of
5 min read
Matrix DiagonalizationMatrix diagonalization is the process of reducing a square matrix into its diagonal form using a similarity transformation. This process is useful because diagonal matrices are easier to work with, especially when raising them to integer powers.Not all matrices are diagonalizable. A matrix is diagon
8 min read
LU DecompositionLU decomposition or factorization of a matrix is the factorization of a given square matrix into two triangular matrices, one upper triangular matrix and one lower triangular matrix, such that the product of these two matrices gives the original matrix. It is a fundamental technique in linear algebr
6 min read
Finding Inverse of a Square Matrix using Cayley Hamilton Theorem in MATLABMatrix is the set of numbers arranged in rows & columns in order to form a Rectangular array. Here, those numbers are called the entries or elements of that matrix. A Rectangular array of (m*n) numbers in the form of 'm' horizontal lines (rows) & 'n' vertical lines (called columns), is calle
4 min read
Sequence and Series
Binomial TheoremBinomial theorem is a fundamental principle in algebra that describes the algebraic expansion of powers of a binomial. According to this theorem, the expression (a + b)n where a and b are any numbers and n is a non-negative integer. It can be expanded into the sum of terms involving powers of a and
15+ min read
Sequences and SeriesA sequence is an ordered list of numbers following a specific rule. Each number in a sequence is called a "term." The order in which terms are arranged is crucial, as each term has a specific position, often denoted as anâ, where n indicates the position in the sequence.For example:2, 5, 8, 11, 14,
10 min read
Finding nth term of any Polynomial SequenceGiven a few terms of a sequence, we are often asked to find the expression for the nth term of this sequence. While there is a multitude of ways to do this, In this article, we discuss an algorithmic approach which will give the correct answer for any polynomial expression. Note that this method fai
4 min read
Mathematics | Sequence, Series and SummationsSequences, series, and summations are fundamental concepts of mathematical analysis and it has practical applications in science, engineering, and finance.Table of ContentWhat is Sequence?Theorems on SequencesProperties of SequencesWhat is Series?Properties of SeriesTheorems on SeriesSummation Defin
8 min read
Calculus
Limits in CalculusIn mathematics, a limit is a fundamental concept that describes the behaviour of a function or sequence as its input approaches a particular value. Limits are used in calculus to define derivatives, continuity, and integrals, and they are defined as the approaching value of the function with the inp
12 min read
Indeterminate FormsAssume a function F(x)=\frac{f(x)}{g(x)} which is undefined at x=a but it may approach a limit as x approaches a. The process of determining such a limit is known as evaluation of indeterminate forms. The L' Hospital Rule helps in the evaluation of indeterminate forms. According to this rule- \lim_{
3 min read
Limits, Continuity and DifferentiabilityLimits, Continuity, and Differentiation are fundamental concepts in calculus. They are essential for analyzing and understanding function behavior and are crucial for solving real-world problems in physics, engineering, and economics.Table of ContentLimitsKey Characteristics of LimitsExample of Limi
10 min read
Cauchy's Mean Value TheoremCauchy's Mean Value theorem provides a relation between the change of two functions over a fixed interval with their derivative. It is a special case of Lagrange Mean Value Theorem. Cauchy's Mean Value theorem is also called the Extended Mean Value Theorem or the Second Mean Value Theorem.According
7 min read
Lagrange's Mean Value TheoremLagrange's Mean Value Theorem (LMVT) is a fundamental result in differential calculus, providing a formalized way to understand the behavior of differentiable functions. This theorem generalizes Rolle's Theorem and has significant applications in various fields of engineering, physics, and applied m
9 min read
Rolle's Mean Value TheoremRolle's theorem one of the core theorem of calculus states that, for a differentiable function that attains equal values at two distinct points then it must have at least one fixed point somewhere between them where the first derivative of the function is zero.Rolle's Theorem and the Mean Value Theo
8 min read
Taylor SeriesA Taylor series represents a function as an infinite sum of terms, calculated from the values of its derivatives at a single point.Taylor series is a powerful mathematical tool used to approximate complex functions with an infinite sum of terms derived from the function's derivatives at a single poi
8 min read
Maclaurin seriesPrerequisite - Taylor theorem and Taylor series We know that formula for expansion of Taylor series is written as: f(x)=f(a)+\sum_{n=1}^{\infty}\frac{f^n(a)}{n!}(x-a)^n Now if we put a=0 in this formula we will get the formula for expansion of Maclaurin series. T hus Maclaurin series expansion can b
2 min read
Euler's FormulaEuler's formula holds a prominent place in the field of mathematics. It aids in establishing the essential link between trigonometric functions and complex exponential functions. It is a crucial formula used for solving complicated exponential functions. It is also known as Euler's identity. It has
5 min read
Chain Rule: Theorem, Formula and Solved ExamplesThe Chain Rule is a way to find the derivative of composite functions. It is one of the basic rules used in mathematics for solving differential equations. It helps us to find the derivative of composite functions such as (3x2 + 1)4, (sin 4x), e3x, (ln x)2, and others. Only the derivatives of compos
8 min read
Inverse functions and composition of functionsInverse Functions - In mathematics a function, a, is said to be an inverse of another, b, if given the output of b a returns the input value given to b. Additionally, this must hold true for every element in the domain co-domain(range) of b. In other words, assuming x and y are constants, if b(x) =
3 min read
Definite Integral | Definition, Formula & How to CalculateA definite integral is an integral that calculates a fixed value for the area under a curve between two specified limits. The resulting value represents the sum of all infinitesimal quantities within these boundaries. i.e. if we integrate any function within a fixed interval it is called a Definite
8 min read
Mathematics | Indefinite IntegralsAntiderivative - Definition :A function ∅(x) is called the antiderivative (or an integral) of a function f(x) of ∅(x)' = f(x). Example : x4/4 is an antiderivative of x3 because (x4/4)' = x3. In general, if ∅(x) is antiderivative of a function f(x) and C is a constant.Then, {∅
4 min read
Application of Derivative - Maxima and MinimaDerivatives have many applications, like finding rate of change, approximation, maxima/minima and tangent. In this section, we focus on their use in finding maxima and minima.Note: If f(x) is a continuous function, then for every continuous function on a closed interval has a maximum and a minimum v
6 min read
Summation FormulasIn mathematics, the summation is the basic addition of a sequence of numbers, called addends or summands; the result is their sum or total. The summation of an explicit sequence is denoted as a succession of additions. For example, the summation of (1, 3, 4, 7) can be written as 1 + 3 + 4 + 7, and t
6 min read
Statistics and Numerical Methods
Mean, Variance and Standard DeviationMean, Variance and Standard Deviation are fundamental concepts in statistics and engineering mathematics, essential for analyzing and interpreting data. These measures provide insights into data's central tendency, dispersion, and spread, which are crucial for making informed decisions in various en
10 min read
Mathematics - Law of Total ProbabilityProbability theory is the branch of mathematics concerned with the analysis of random events. It provides a framework for quantifying uncertainty, predicting outcomes, and understanding random phenomena. In probability theory, an event is any outcome or set of outcomes from a random experiment, and
12 min read
Probability Distribution - Function, Formula, TableA probability distribution is a mathematical function or rule that describes how the probabilities of different outcomes are assigned to the possible values of a random variable. It provides a way of modeling the likelihood of each outcome in a random experiment.While a frequency distribution shows
15+ min read
Bayes' TheoremBayes' Theorem is a mathematical formula used to determine the conditional probability of an event based on prior knowledge and new evidence. It adjusts probabilities when new information comes in and helps make better decisions in uncertain situations.Bayes' Theorem helps us update probabilities ba
13 min read
Conditional ProbabilityConditional probability defines the probability of an event occurring based on a given condition or prior knowledge of another event. Conditional probability is the likelihood of an event occurring, given that another event has already occurred. In probability, this is denoted as A given B, expresse
12 min read
Probability Distribution
Engineering Math Practice Problems