Written and maintained by CASRAI Editorial Board
Published
On this page
The standard deviation of a probability distribution is the square root of its variance: the probability-weighted average of the squared distances between each possible value and the mean. For a discrete random variable X with mean μ, it is σ = √[Σ(x − μ)² · P(x)], and it is measured in the same units as X.
Definition: what the standard deviation of a probability distribution measures
A probability distribution lists every value a random variable can take and the probability of each. Its mean (also called the expected value) says where the distribution is centred. Its standard deviation says how far values typically fall from that centre, weighting each value by how likely it is. Grinstead and Snell define the variance as V(X) = E((X − μ)²), the expected squared deviation from the mean, and the standard deviation D(X) as the square root of V(X). OpenStax Introductory Statistics describes the same quantity as the standard deviation of a discrete random variable and writes it σ.
This is a property of the distribution itself, not of a sample of data. If you have measured values and want their spread, you are computing a sample statistic, and the guides on sample variance and population variance cover that case. The distribution version has no n − 1 correction, because there is no sampling: the probabilities are given.
Formula for the standard deviation of a discrete probability distribution
Two equivalent forms are in common use. Both assume a valid distribution: each probability lies between 0 and 1 inclusive, and the probabilities sum to 1 (OpenStax, section 4.1).
- Definition form: σ = √[ Σ (x − μ)² · P(x) ]
- Shortcut form: σ = √[ E(X²) − μ² ], where E(X²) = Σ x² · P(x)
Symbols: x is one possible value of the random variable X; P(x) is the probability that X equals x; μ = Σ x · P(x) is the mean; Σ means sum over every possible value; E(X²) is the expected value of the squared variable. The shortcut form follows from the definition and is stated by Grinstead and Snell as V(X) = E(X²) − μ². It is convenient when the mean is not a round number, but it subtracts two large, similar numbers, so keep full precision in intermediate steps.
Worked example: standard deviation of a discrete random variable
The example below is Example 4.3 in OpenStax Introductory Statistics 2e. Let X be the number of days a team plays per week, with x = 0, 1, 2 and P(x) = 0.2, 0.5, 0.3. The probabilities are each between 0 and 1 and sum to 1.0, so this is a valid distribution.
Step 1: the mean
μ = 0(0.2) + 1(0.5) + 2(0.3) = 0 + 0.5 + 0.6 = 1.1
Step 2: the probability-weighted squared deviations
- x = 0: (0 − 1.1)² · 0.2 = 1.21 · 0.2 = 0.242
- x = 1: (1 − 1.1)² · 0.5 = 0.01 · 0.5 = 0.005
- x = 2: (2 − 1.1)² · 0.3 = 0.81 · 0.3 = 0.243
Step 3: variance and standard deviation
σ² = 0.242 + 0.005 + 0.243 = 0.49, so σ = √0.49 = 0.7 days.
Step 4: cross-check with the shortcut form
E(X²) = 0²(0.2) + 1²(0.5) + 2²(0.3) = 0 + 0.5 + 1.2 = 1.7. Then σ² = 1.7 − 1.1² = 1.7 − 1.21 = 0.49, and σ = 0.7. Both routes agree, which is a useful arithmetic check whenever you compute by hand.
A second check: a fair six-sided die
For a fair die, each face 1 to 6 has probability 1/6. Grinstead and Snell give μ = 7/2, E(X²) = 91/6 and V(X) = 91/6 − 49/4 = 35/12 ≈ 2.917, so the standard deviation is √(35/12) ≈ 1.708. Here the shortcut form is easier, because the squared deviations (2.5², 1.5², 0.5² and their mirror images) are fractions.
How to interpret the result
A larger σ means probability is spread further from the mean; a smaller σ means it is concentrated near it. Because σ is the square root of a quantity measured in squared units, it comes back to the units of X, which is why 0.7 is read as 0.7 days rather than 0.49 squared days. The table summarises both worked distributions.
| Distribution | Mean μ | Variance σ² | Standard deviation σ | Reading |
|---|---|---|---|---|
| Days played per week (0, 1, 2 with 0.2, 0.5, 0.3) | 1.1 | 0.49 | 0.7 | Values sit about 0.7 days from 1.1 on a probability-weighted basis; the whole range is only 2 days |
| Fair six-sided die (1 to 6, each 1/6) | 3.5 | 2.917 | 1.708 | Values spread about 1.7 faces from 3.5; the range is 5 faces |
Two properties follow directly from the definition. The standard deviation is zero only when one value has probability 1, because then every squared deviation is zero. And it can never be negative, since it is a square root of a sum of non-negative terms. Interpret it relative to the scale of the variable and its range: a σ of 0.7 is large for a variable confined to 0 to 2 and small for one that runs from 0 to 1,000.
How it changes when you transform the variable
Grinstead and Snell give three rules for variance, and each carries over to the standard deviation through the square root. The data table below lists them.
- Adding a constant, X + c, leaves the variance unchanged, so the standard deviation is unchanged. Shifting values does not change their spread.
- Multiplying by a constant, cX, multiplies the variance by c², so the standard deviation is multiplied by |c|. Converting days to hours multiplies σ by 24.
- For independent X and Y, V(X + Y) = V(X) + V(Y). The variances add, not the standard deviations, so the standard deviation of the sum is √(σX² + σY²).
Standard deviation of a probability distribution vs a sample standard deviation
The formula above applies when you know the probabilities. A sample standard deviation is computed from observed values and estimates the spread of whatever process produced them. Use the distribution formula for a model (a die, a published probability table, a stated survey distribution), and the sample formulas for measured data. Spreadsheet users often hit this fork in Excel: see whether the population or sample function fits your data before copying a formula, and for a normal distribution with a given σ, the empirical rule shows how that σ translates into coverage. For a discrete distribution built from repeated yes/no trials, the binomial distribution page covers its mean.
Assumptions and common mistakes
- Probabilities that do not sum to 1. Check this first. A table summing to 0.95 or 1.05 gives wrong μ and σ.
- Forgetting to weight. Averaging the squared deviations without multiplying by P(x) treats every value as equally likely. Only a uniform distribution, such as the fair die, makes the two coincide.
- Stopping at the variance. 0.49 is σ², not σ. Take the square root.
- Squaring after weighting. The weight P(x) multiplies (x − μ)², not the squared product.
- Rounding the mean early. With the shortcut form, rounding μ before squaring it can change the answer noticeably.
- Adding standard deviations of independent variables. Add variances, then take the root.
How to report it (APA example)
For a distribution, report the parameters with Greek symbols and say what the variable is. APA style sets statistical symbols for sample statistics such as M and SD in italics; here the quantities are distribution parameters, so state them as μ and σ. A sentence such as the following works in a methods or results section:
The number of days played per week was modelled as a discrete distribution with P(0) = .20, P(1) = .50 and P(2) = .30 (μ = 1.1 days, σ = 0.7 days).
If you instead computed a spread from collected data, report it as M = 1.1, SD = 0.7 and give the sample size. Do not describe a sample SD as the standard deviation of the distribution.
How to calculate it in Excel, R or Python
Each snippet uses the example above (values 0, 1, 2; probabilities 0.2, 0.5, 0.3) and returns 0.7.
Excel
Put the values in A2:A4 and the probabilities in B2:B4. The mean is =SUMPRODUCT(A2:A4,B2:B4), and the standard deviation is:
=SQRT(SUMPRODUCT((A2:A4-SUMPRODUCT(A2:A4,B2:B4))^2,B2:B4))
Do not use STDEV.S or STDEV.P here: they treat the cells as raw observations, not as values weighted by probabilities.
R
x <- c(0, 1, 2); p <- c(0.2, 0.5, 0.3); mu <- sum(x * p); sqrt(sum((x - mu)^2 * p))
Python
x = [0, 1, 2]; p = [0.2, 0.5, 0.3]; mu = sum(a * b for a, b in zip(x, p)); sigma = sum((a - mu) ** 2 * b for a, b in zip(x, p)) ** 0.5
In floating point the result prints as 0.7 to within rounding error (for example 0.6999999999999998), so round for display.
Frequently asked questions
What is the standard deviation of a probability distribution?
It is the square root of the distribution’s variance, where the variance is the probability-weighted average of squared deviations from the mean. It describes how spread out the possible values are, in the units of the variable.
How do you find the standard deviation of a discrete random variable?
Compute the mean μ = Σ x·P(x), then σ = √[Σ (x − μ)²·P(x)]. The worked example above gives μ = 1.1 and σ = 0.7.
Is there a shortcut formula?
Yes: σ = √[E(X²) − μ²]. It gives the same answer, and using both is a good check.
Does it use n or n − 1?
Neither. Those apply to samples of observed data. A probability distribution supplies probabilities, so the weights are the probabilities themselves.
Can the standard deviation be larger than the mean?
Yes. The two are unrelated in size, because the mean describes location and the standard deviation describes spread. Compare σ with the range of the variable instead.
Sources
- OpenStax, Introductory Statistics 2e, section 4.2, Mean or Expected Value and Standard Deviation (Example 4.3): https://openstax.org/books/introductory-statistics-2e/pages/4-2-mean-or-expected-value-and-standard-deviation (read 2026-11-14)
- OpenStax, Introductory Statistics 2e, section 4.1, Probability Distribution Function for a Discrete Random Variable: https://openstax.org/books/introductory-statistics-2e/pages/4-1-probability-distribution-function-pdf-for-a-discrete-random-variable (read 2026-11-14)
- Grinstead and Snell, Introduction to Probability, section 6.2, Variance of Discrete Random Variables (LibreTexts): https://stats.libretexts.org/Bookshelves/Probability_Theory/Introductory_Probability_(Grinstead_and_Snell)/06%3A_Expected_Value_and_Variance/6.02%3A_Variance_of_Discrete_Random_Variables (read 2026-11-14)
Data: Effect of transformations on the variance and standard deviation of a discrete random variable
Compares how adding a constant, multiplying by a constant and summing independent variables change the variance and standard deviation of a discrete random variable, compiled from the variance rules in Grinstead and Snell with the standard deviation effect derived by taking the square root.
| Operation on X | Effect on variance | Effect on standard deviation | Condition |
|---|---|---|---|
| X + c (shift by constant c) | V(X + c) = V(X) | unchanged | none |
| cX (scale by constant c) | V(cX) = c² V(X) | multiplied by |c| | none |
| X + Y (sum) | V(X + Y) = V(X) + V(Y) | √(V(X) + V(Y)) | X and Y independent |
Sources
- Grinstead and Snell, Introduction to Probability, 6.2 Variance of Discrete Random Variables (accessed 2026-11-14)
Compiled by CASRAI from the sources above. Free to reuse under CC BY 4.0 with attribution.







