Probability distribution calculator: mean, variance, skewness and kurtosis

For a discrete distribution, the mean is E[X] = Σ x·p, the variance is Σ (x − μ)²·p, the skewness is μ₃/σ³ and the kurtosis is μ₄/σ⁴ (excess kurtosis subtracts 3). For x = 0 to 4 with p = 0.35, 0.25, 0.15, 0.15, 0.10 they are 1.4, 1.84, 0.5721 and 2.0449 (excess -0.9551). Type your own table for every step, compare scipy, pandas and Excel skewness on raw data, find normal probabilities exactly and by the z-table, and check your answers. Free, runs in your browser.

NIST e-Handbook 1.3.5.11 and 1.3.6.7.1 · SciPy 1.18, pandas 3.1.2 and Excel docs · von Hippel (2005) · checked against an independent solution (26,211 checks at build) · Updated 1 Dec 2026

What are the mean, variance, standard deviation, skewness and kurtosis of this distribution, with every product shown?

Mean E[X]1.4median 1, mode 0
Variance σ²1.84σ = 1.356466
Skewness μ₃/σ³0.572139μ₃ = 1.428
Kurtosis μ₄/σ⁴2.044896excess -0.955104
  • Both variance routes agree: E[(X − μ)²] = 1.84 and E[X²] − μ² = 3.8 − 1.96 = 1.84.
  • Pearson mode skewness (μ − mode)/σ = 1.0321 and median skewness 3(μ − median)/σ = 0.8847: different measures from the moment skewness 0.5721.
  • Kurtosis 2.0449 ≥ skewness² + 1 = 1.3273 (Pearson's inequality). Below 3, so lighter tails than a normal curve.
00.20.401234x = 0, p = 0.35x = 1, p = 0.25x = 2, p = 0.15x = 3, p = 0.15x = 4, p = 0.1mean 1.4median 1+1σ−1σxP(X = x)

Tap or hover a bar to see what it adds to each moment. The x = 4 bar has only 10 % of the probability but gives 123 % of the skewness sum: the left side's negative cubes cancel part of it.

xpx·p(x − μ)²p(x − μ)³p(x − μ)⁴p
00.3500.686-0.96041.34456
10.250.250.04-0.0160.0064
20.150.30.0540.03240.01944
30.150.450.3840.61440.98304
40.10.40.6761.75764.56976
Σ11.41.841.4286.9232

How do you find the mean, variance, skewness and kurtosis of a discrete distribution?

Weight every term by its probability. The mean is the probability-weighted average of the values. The other three are averages of powers of the distance from the mean, the second, third and fourth central moments, with the last two divided by a power of σ so that they have no unit:

Variance measures spread in squared units. Skewness is positive when the right tail carries more of the cubed distance than the left. Kurtosis grows with the weight of the tails: the fourth power makes far values count heavily. NIST's handbook computes both with N, not N − 1, in the denominator, and notes that "the kurtosis for a standard normal distribution is three". Tab 1 shows each column of products, so a hand-worked table can be checked line by line.

Worked example: the four business moments of x = 0 to 4

The Week 2 challenge gives x = 0, 1, 2, 3, 4 with P(x) = 0.35, 0.25, 0.15, 0.15, 0.10 and asks for "all 4 business moments using pen and paper". The probabilities add up to 1, so no normalising is needed.

So the distribution is right-skewed (the long tail is toward x = 4) and has lighter tails than a normal curve (kurtosis 2.0449 < 3, excess -0.9551). The median is 1, because the cumulative probability passes 0.5 at x = 1 (0.35, then 0.60). The mode is 0.

Why np.mean(x) and scipy.stats.skew(x) give the wrong answers here. Called on the five x values, they treat 0, 1, 2, 3, 4 as five equally likely observations: np.mean gives 2, np.var 2, scipy.stats.skew 0 and scipy.stats.kurtosis -1.3. The probabilities never enter. Use weighted sums (tab 5) or scipy.stats.rv_discrete(values=(x, p)).stats(moments="mvsk").

Pearson's two coefficients are different measures of skew, not other ways to get γ₁:

Here they give 1.0321 and 0.8847, both positive like γ₁ = 0.5721, but they can disagree in sign. Load the Poisson(0.75) preset in tab 1: γ₁ = 1.1547 (right skew) yet the mean 0.75 is below the median 1, so Pearson's median skewness is -0.8660. Binomial(10, 0.09) does the same: mean 0.9, median 1, γ₁ = 0.9061.

Why use expected value when the simple mean already exists?

Expected value is the mean of a probability distribution: each value counts in proportion to how likely it is. The simple mean, the sum of observations divided by their number, is the special case where every value counts once. When all outcomes are equally likely the two agree. A fair die has E[X] = (1 + 2 + … + 6)/6 = 3.5, the same as the simple mean of 1 to 6.

When outcomes are not equally likely, only the weighted version is right. For the challenge table, the simple mean of the five values is 2, but the expected value is 1.4: x = 0 happens 35 % of the time and x = 4 only 10 %. Expected value is also how you average over outcomes you have not observed yet, such as expected claims per policy, before any data exist.

Does positive skew mean the mean is bigger than the median? Is skewness bad?

Positive skew means a longer or heavier right tail. The textbook rule that follows, "the mean lies toward the direction of skew (the longer tail) relative to the median", usually holds: for a right-skewed curve, mean > median > mode. It is a rule of thumb, not a law. Von Hippel's 2005 paper in the Journal of Statistics Education, "Mean, Median, and Skew: Correcting a Textbook Rule", says it "fails with surprising frequency", most commonly "in discrete distributions where the areas to the left and right of the median are not equal". His Poisson example with mean 0.75 is the preset above. The reverse statement, that positive skew puts the median and mode above the mean, is wrong.

Skewness is not bad in itself. It is a description. It matters in three practical ways. The mean is pulled toward the long tail, so for skewed money variables such as insurance premiums the median is the better typical value; the IQR outlier calculator shows how quartile fences flag the far tail without being dragged by it. Methods that assume symmetric errors, such as least-squares regression tests, can mislead, and a log transform often makes a right-skewed positive variable close to symmetric. And a single extreme value can change skewness a lot, so check it before reading the sign.

Is kurtosis 3 or 0 for a normal distribution?

Kurtosis μ₄/σ⁴ is 3 for every normal distribution. Excess kurtosis subtracts 3 so the normal scores 0. NIST: "Which definition of kurtosis is used is a matter of convention", and "many sources use the term kurtosis when they are actually computing excess kurtosis". scipy.stats.kurtosis returns excess by default (fisher=True: "normal ==> 0.0"), as do pandas .kurt() and Excel KURT. When you write a kurtosis, say which one.

Kurtosis has a floor. For any distribution

so it can never be below 1. The bound is met only by two-point distributions: the (0.8, 0.2) preset has γ₁ = 1.5000 and β₂ = 3.2500 = γ₁² + 1. Wikipedia's kurtosis article states the bound and that "the lower bound is realized by the Bernoulli distribution". The symmetric preset has γ₁ = 0 exactly, the fair die 0 with β₂ = 1.7314, and binomial(10, 0.3) γ₁ = 0.2760, which matches the textbook (1 − 2p)/√(np(1 − p)). The Poisson(2) preset stops at x = 10: the tail beyond holds 8.31e-6 of the probability, and the rest is rescaled to add up to 1, so its mean is 1.9999236 rather than exactly 2.

Why does scipy skew differ from pandas skew and Excel SKEW?

They use different estimators for a sample. SciPy's documentation defines the biased sample moments and the two skewness forms; pandas returns the "unbiased" (adjusted) versions:

Call3, 4, 5, 2, 3, 4, 5, 6, 4, 7Formula
scipy.stats.skew(x)0.303193339g₁ (biased, the default bias=True)
scipy.stats.skew(x, bias=False)0.359543071G₁ (adjusted Fisher-Pearson)
pandas Series.skew()0.359543071G₁
Excel =SKEW(range)0.359543071G₁
Excel =SKEW.P(range)0.303193339g₁
scipy.stats.kurtosis(x)-0.631321007g₂, excess (fisher=True, bias=True)
scipy.stats.kurtosis(x, fisher=False)2.36867899m₄/m₂², normal = 3
scipy.stats.kurtosis(x, bias=False)-0.151799637G₂, excess
pandas Series.kurt()-0.151799637G₂, excess
Excel =KURT(range)-0.151799637G₂, excess

scipy.stats.skew defaults to bias=True; with bias=False it returns "the adjusted Fisher-Pearson standardized moment coefficient", G₁, the same as pandas and Excel SKEW. The gap shrinks as n grows: the factor √(n(n − 1))/(n − 2) is 1.186 at n = 10 and 1.015 at n = 100. For a probability distribution (tab 1) none of this applies: there is no sample, so the moment formulas are used as they are. A constant column has no spread, and scipy, pandas and this calculator all return no value (NaN) for its skewness.

How do I find P(X < x) for a normal distribution?

Standardise, then read the area to the left of z:

A printed z-table gives Φ for z to two decimals, so z = 1.9355 becomes 1.94 and P(X > 740) = 1 − 0.9738 = 0.0262, against the exact 0.0265. Cutting z to 1.93 instead gives 0.0268. Both routes are fine for a pen-and-paper answer; the difference sits in the third or fourth decimal. The between case by table is 1.29 and -2.58: 0.8966. The NIST table lists the area from 0 to z (for example 0.34134 at z = 1.00), so add 0.5 for Φ. Part d of the question, P(X = 720), is 0 for a continuous variable.

What 130 public reports did with this challenge (as of 1 Dec 2026)

We read the 130 public Skill-Lync reports titled "Basics of ML & AL Week 2 Challenge", n = 130. None is image-only by our rule (fewer than 15 lines and 100 words of text), but many answer some questions in screenshots we could not read, so each count has its own denominator: the reports whose text shows that answer. The links are examples.

What stands out: the moment formulas are mostly right once a report writes them out, and the misses are about rounding and reading tables. The most common kurtosis answer is −0.98 (16 reports), from rounding σ to 1.36 before raising it to the fourth power; the exact excess is -0.9551. For P(X > 740) the most common answer is 0.0268 (30 reports, z cut to 1.93), and only 2 give the exact 0.0265. Every one of these is matched by tab 4. These are first-party counts, a starting point rather than a measure of ability.

Common slips and how to fix them

The first rows are the slips counted in the public reports (the number with its denominator). Most are about reading the normal table, not the moment formulas. Rows with a dash are textbook slips the checker also names; each turned up in a handful of reports at most, or was not counted.

Answer seenReportsWhat the checker says
P(X > 740) = 0.973814 / 94Wrong: this is the other tail (1 − the answer). Check which side of the value the question asks for.
P(X > 740) = 0.02569 / 94Wrong: this is the z-table entry one column away (for z = 1.94, the 1.95 entry 0.9744). Read the column for the second decimal of z.
P(X > 740) = 0.02878 / 94Wrong: this is the z-table answer with z rounded to 1 decimal (for example 1.935 read as 1.9). Keep 2 decimals of z.
P(600 < X < 720) = 0.89858 / 96Wrong: this is the z-table answer with z rounded to 1 decimal (for example 1.935 read as 1.9). Keep 2 decimals of z.
Excess kurtosis −0.98 (σ rounded to 1.36 first)16Close: the method is right, but a rounded intermediate value (often σ to 2 decimals) moved the answer.
P(X > 740) = 0.0268 (z cut to 1.93)30Right by the z-table route with z cut (not rounded) to 2 decimals.
"Positive skew: median and mode greater than mean"16 / 130Reversed. With a long right tail the mean is usually the largest of the three.
Mean 2 (the average of 0, 1, 2, 3, 4)–Wrong: this is the value for the x column alone, ignoring the probabilities (what np.mean(x), np.var(x) or scipy.stats.skew(x) return). Weight every term by p.
Variance 2.4 (E[X²] − μ instead of − μ²)–Wrong: you subtracted μ instead of μ²: variance = E[X²] − μ².
Skewness 0.8847 (3(mean − median)/σ)–Wrong: this is Pearson's median skewness 3(mean − median)/σ, a different measure. The moment skewness is E[(X − μ)³]/σ³.
Skewness 0 (scipy.stats.skew on the five x values)–Wrong: this is the value for the x column alone, ignoring the probabilities (what np.mean(x), np.var(x) or scipy.stats.skew(x) return). Weight every term by p.
P(X < 711) = 0.1587–Wrong: this is the other tail (1 − the answer). Check which side of the value the question asks for.
P(X = 720) = 0.0056–Wrong: this is the height of the density curve f(x), not a probability. For a continuous variable P(X = x) = 0; probabilities are areas.
Kurtosis Σ z⁴·(p − 3)–Wrong: this is Σ z⁴·(p − 3): the 3 was subtracted inside the sum. Kurtosis = Σ z⁴·p; excess = that minus 3, once.

How we checked the calculator

An independent Python script, scripts/verify/moments.py, recomputes every number with its own code. Distribution moments use exact fractions, so the challenge gives exactly 7/5, 46/25, 357/250 and 4327/625 for μ, σ², μ₃ and μ₄. It covers 220 random distributions with 1 to 50 values (integers, decimals, negatives, values near 10⁹, frequencies and probabilities), raw data with n from 1 to 2,000, normal probabilities from Python's statistics.NormalDist and math.erfc, the whole 4-decimal z-table and 4,626 verdicts from the check tab. It also confirms Pearson's inequality for every case. This page refuses to build if the browser code differs from it in any of 26,211 numbers, medians, modes, table entries or verdicts (5,413 cases; 14,672 more assertions run inside the script). Run with SciPy 1.18.1, pandas 3.1.2 and NumPy 2.5.5, it compared 1,862 values with scipy.stats.skew and kurtosis (bias and fisher both ways), pandas skew and kurt, NumPy weighted sums and scipy.stats.norm: 0 mismatches. For 21 data sets with a huge offset (mean above 10⁴ standard deviations) the libraries were given the data minus its first value, because float arithmetic loses digits there and moments do not change with a shift. Two deliberate bugs, excess kurtosis without the − 3 and the variance shortcut E[X²] − μ, each make the build fail.

What this calculator does not cover

  • Continuous distributions other than the normal. Moments of a density need integrals; only the normal's probabilities are here.
  • Grouped data with class intervals. Enter class midpoints with frequencies in tab 1; the result is the usual midpoint approximation.
  • Tests of skewness or normality. No standard errors, D'Agostino or Shapiro-Wilk tests: the tool reports the estimates.
  • Very long data. Tab 2 handles a few thousand values; the table in tab 1 shows the first 60 distinct values.
Learn statistics for machine learning

Business moments and the normal distribution are Week 2 of Skill-Lync's Machine Learning Fundamentals course, part of the data analytics and data science program, before regression and classification on real datasets.

Frequently asked questions

How do you find the expected value of a discrete distribution?

Multiply each value by its probability and add the products: E[X] = Σ x·p(x). For x = 0 to 4 with p = 0.35, 0.25, 0.15, 0.15, 0.10 that is 0 + 0.25 + 0.30 + 0.45 + 0.40 = 1.4. Do not average the x values themselves: that gives 2 and ignores how likely each value is.

What are the four moments of a distribution?

The mean (centre), the variance (spread, the average squared distance from the mean), the skewness (lopsidedness, the third central moment over σ³) and the kurtosis (tail weight, the fourth central moment over σ⁴). Business analytics courses call them the first to fourth business moments. For the challenge table: 1.4, 1.84, 0.5721 and 2.0449.

What does a positive skew mean?

The distribution has a longer or heavier tail on the right, so the third central moment is positive. Usually the mean then sits right of the median, but not always: von Hippel (2005) shows the rule fails often in discrete distributions. Positive skew does not mean the median and mode exceed the mean; that is the reverse.

Is kurtosis 3 or 0 for a normal distribution?

Both, depending on the definition. Kurtosis μ₄/σ⁴ is 3 for any normal distribution; excess kurtosis subtracts 3, so the normal scores 0. scipy.stats.kurtosis, pandas .kurt() and Excel KURT all return excess kurtosis by default. NIST's handbook uses the original definition. Always say which one you report.

How do I find P(X < x) for a normal distribution?

Convert x to z = (x − μ)/σ and look up Φ(z), the area to the left. For μ = 680, σ = 31 and x = 711, z = 1 and P(X < 711) = 0.8413. For P(X > x) use 1 − Φ(z); between two values, subtract their Φ values. P(X = x) itself is zero.

Why does scipy skew differ from pandas skew?

They use different estimators. scipy.stats.skew defaults to bias=True, the plain moment ratio g₁. pandas .skew() and Excel SKEW return the adjusted G₁ = √(n(n − 1))/(n − 2) × g₁. For 3, 4, 5, 2, 3, 4, 5, 6, 4, 7 that is 0.303193 against 0.359543. scipy.stats.skew(x, bias=False) matches pandas.

Is skewness bad for analysis?

No. Skewness describes the data; it is not an error. It matters when a method assumes symmetry: the mean is pulled toward the long tail, so the median describes a skewed variable such as insurance premiums better, and linear models may fit better after a log transform. Report it, then choose methods that suit it.

Related on Skill-Lync

Sources

  • NIST/SEMATECH e-Handbook of Statistical Methods, 1.3.5.11 Measures of Skewness and Kurtosis (moment definitions with N, kurtosis 3 for the normal, excess kurtosis, adjusted Fisher-Pearson coefficient) and 1.3.6.7.1 Cumulative Distribution Function of the Standard Normal Distribution (area from 0 to z).
  • SciPy v1.18.0 manual, scipy.stats.skew, scipy.stats.kurtosis and scipy.stats.norm; pandas 3.1.2, Series.skew and Series.kurt; Microsoft support, SKEW, SKEW.P and KURT (worked examples); Python 3.15 statistics.NormalDist.
  • P. T. von Hippel (2005), "Mean, Median, and Skew: Correcting a Textbook Rule", Journal of Statistics Education 13(2).
  • Wikipedia, "Skewness" (Pearson's mode and median skewness, G₁ in Excel, Minitab, SAS, SPSS), "Kurtosis" (bound β₂ ≥ γ₁² + 1, Bernoulli), "Expected value" (weighted average, die 3.5) and "68–95–99.7 rule" (68.27, 95.45, 99.73 %).
  • Skill-Lync, the 130 public Basics of ML & AL Week 2 reports, read 1 Dec 2026.
Free counselling

From formulas to models you can defend.

Data science interviews ask what a library's default is and why the numbers differ. A Skill-Lync counsellor can map the statistics, machine learning or data science program that fits your background.

Talk to a course counsellor

Free. We call you back, usually the same day.

By submitting you agree to our Terms and Privacy Policy.

Talk to a career counsellor

Talk to a career counsellor

Free 20-minute call. We'll map the right course to where you want to work.

By submitting you agree to our Terms and Privacy Policy.