Chance & simulation

Central Limit Theorem Explorer

Draws up to 500 seeded samples of 1 to 30 values from a uniform, a fair die, an exponential or a custom parent of up to six whole values with whole weights, and shows the central limit theorem at work: the histogram of the sample means on exact lattice bins (die and custom) or grid bins, over the whole range or zoomed to the means, against the normal curve the theorem predicts; the spread of the means against sigma over the square root of n, and their skewness and kurtosis against the theory, at the chosen n and at n = 1, 2, 5, 10, 20 and 30 from the same draws; the share of means within one standard error; and the running mean of all draws (the law of large numbers). One seeded integer stream by jump-ahead, checked against the plain chain; five scored challenges are included. For learning sampling distributions.

Last updated

Calculator overview

Inputs and outputs

This summary comes from the calculator's published input and output contract.

Inputs

Custom weight 5 (required)
About this input

The weight of custom bar 5, a whole number from 0 to 100 (the bar height on the canvas; 0 hides the bar). The six weights must add to more than 0.

Default 2 Range 0 to 100
Custom weight 6 (required)
About this input

The weight of custom bar 6, a whole number from 0 to 100 (the bar height on the canvas; 0 hides the bar). The six weights must add to more than 0.

Default 1 Range 0 to 100
Custom weight 3 (required)
About this input

The weight of custom bar 3, a whole number from 0 to 100 (the bar height on the canvas; 0 hides the bar). The six weights must add to more than 0.

Default 4 Range 0 to 100
Custom weight 4 (required)
About this input

The weight of custom bar 4, a whole number from 0 to 100 (the bar height on the canvas; 0 hides the bar). The six weights must add to more than 0.

Default 3 Range 0 to 100
Histogram window (required)
About this input

The histogram window: Whole range (the parent's whole range), or Zoom to the means (the parent mean plus or minus 4 standard errors, snapped outward). It changes only the drawn window, never a statistic or a challenge result.

Default Whole range Allowed Whole range, Zoom to the means
Number of samples R (required)
About this input

R, the number of samples, a multiple of 10 from 10 to 500. Raising it adds samples and keeps the first ones unchanged.

Default 500 Range 10 to 500
Sample size n (required)
About this input

n, the draws in each sample, a whole number from 1 to 30. Raising it extends every sample: its first draws stay the same.

Default 5 Range 1 to 30
Parent distribution (required)
About this input

The parent the draws come from: Uniform (on 0 to 1), Fair die, Exponential (mean 1) or Custom (your six bars). Chosen on the canvas tabs.

Default Fair die Allowed Uniform, Fair die, Exponential, Custom
Random seed (required)
About this input

The seed of the random stream, a whole number from 1 to 2147483646; the same seed always gives the same draws.

Default 2026 Range 1 to 2147483646
Custom weight 2 (required)
About this input

The weight of custom bar 2, a whole number from 0 to 100 (the bar height on the canvas; 0 hides the bar). The six weights must add to more than 0.

Default 5 Range 0 to 100
Custom value 1 (required)
About this input

The value of custom bar 1, a whole number from -20 to 20 (dragged on the canvas). Used with Custom only, but always checked.

Default 0 Range -20 to 20
Custom value 2 (required)
About this input

The value of custom bar 2, a whole number from -20 to 20 (dragged on the canvas). Used with Custom only, but always checked.

Default 1 Range -20 to 20
Challenge (required)
About this input

Selects a challenge: 0 for none, 1 to 5 for a predefined challenge, which fixes the settings except the inputs it leaves to you.

Default 0 Range 0 to 5
Your predicted count (required)
About this input

Challenge 4: your predicted number of the 500 sample means that land within one standard error of the parent mean, a whole number from 0 to 500; 0 means not yet predicted, and the means stay hidden until you predict. Not used outside challenge 4.

Default 0 Range 0 to 500
Custom value 3 (required)
About this input

The value of custom bar 3, a whole number from -20 to 20 (dragged on the canvas). Used with Custom only, but always checked.

Default 2 Range -20 to 20
Custom value 6 (required)
About this input

The value of custom bar 6, a whole number from -20 to 20 (dragged on the canvas). Used with Custom only, but always checked.

Default 5 Range -20 to 20
Custom weight 1 (required)
About this input

The weight of custom bar 1, a whole number from 0 to 100 (the bar height on the canvas; 0 hides the bar). The six weights must add to more than 0.

Default 6 Range 0 to 100
Custom value 4 (required)
About this input

The value of custom bar 4, a whole number from -20 to 20 (dragged on the canvas). Used with Custom only, but always checked.

Default 3 Range -20 to 20
Custom value 5 (required)
About this input

The value of custom bar 5, a whole number from -20 to 20 (dragged on the canvas). Used with Custom only, but always checked.

Default 4 Range -20 to 20

Outputs

The parent distribution as data: its bars (integer parents) or its bins and their probabilities (continuous parents)
About this output

The parent as data: for the die and Custom one row per bar (its value, weight and probability; rows 7 to 30 blank); for Uniform and Exponential 30 bins with their edges and probabilities (the exponential up to 5).

No unit declared
Parent skewness
About this output

The parent skewness (0 for a symmetric parent). Blank when only one custom value has weight and when the inputs are not valid.

No unit declared
Samples used
About this output

The number of samples R used. Blank when the inputs are not valid.

No unit declared
Sample size used
About this output

The sample size n used. Blank when the inputs are not valid.

No unit declared
The running mean of all draws every 10 samples, with the band of two standard errors about the parent mean
About this output

The running mean of all draws after every 10 samples (rows 1 to 50; rows past R/10 blank): the draws so far, the running mean, and the band of two standard errors about the parent mean.

No unit declared
Parent standard deviation
About this output

The parent standard deviation sigma. Blank when the inputs are not valid.

No unit declared
Normal share outside the window
About this output

The share of the normal approximation that lies outside the histogram window (not drawn). Blank when only one custom value has weight and when the inputs are not valid.

No unit declared
Normal share within one standard error
About this output

The share a normal distribution puts within one standard deviation of its mean, about 0.6827, for comparison. Blank when the inputs are not valid.

No unit declared
Parent used
About this output

The parent used (a challenge sets its own). Blank when the inputs are not valid.

No unit declared
Parent mean
About this output

The parent mean mu. Blank when the inputs are not valid.

No unit declared
Parent excess kurtosis
About this output

The parent excess kurtosis (0 for a normal shape). Blank when only one custom value has weight and when the inputs are not valid.

No unit declared
Theory skewness of the mean
About this output

The theoretical skewness of the mean, the parent skewness divided by the square root of n. Blank when only one custom value has weight and when the inputs are not valid.

No unit declared
Theory excess kurtosis of the mean
About this output

The theoretical excess kurtosis of the mean, the parent excess kurtosis divided by n. Blank when only one custom value has weight and when the inputs are not valid.

No unit declared
Theory standard error
About this output

The theoretical standard error of the mean, sigma divided by the square root of n. Blank when the inputs are not valid.

No unit declared
Window low
About this output

The low edge of the histogram window (the low edge of bin 1). Blank when the inputs are not valid.

No unit declared
Window high
About this output

The high edge of the histogram window (the high edge of the last bin). Blank when the inputs are not valid.

No unit declared
Stream check mismatches
About this output

The stream self-check: the first 10 samples drawn one step at a time must equal the jump-ahead draws, and their sums the row sums; the number of disagreements (expected 0). Blank when the inputs are not valid.

No unit declared
SD of the sample means
About this output

The standard deviation of the R sample means (divisor R - 1). Blank when the inputs are not valid.

No unit declared
The first 10 samples draw by draw (draws past n blank)
About this output

The first 10 samples draw by draw (rows 1 to 10, columns Draw 1 to Draw 30): the value of each draw, blank past n.

No unit declared
Seed used
About this output

The seed used. Blank when the inputs are not valid.

No unit declared
Spread of the means at sample sizes 1, 2, 5, 10, 20 and 30 from the same draws, against the theory
About this output

The spread of the means at sample sizes 1, 2, 5, 10, 20 and 30 from the same draws (the first draws of each row): the mean of the means, their standard deviation and the theory sigma over the square root of n, and their measured and theoretical skewness. Blank while challenge 2 is active and not met.

No unit declared
Measured SD over the standard error
About this output

The measured standard deviation of the means divided by the theoretical standard error (near 1 by the central limit theorem). Blank when only one custom value has weight and when the inputs are not valid.

No unit declared
Grand mean of all draws
About this output

The mean of all n x R draws (equal to the mean of the sample means). Blank when the inputs are not valid.

No unit declared
Draws in all
About this output

The draws in all, n x R. Blank when the inputs are not valid.

No unit declared
Grand mean in standard errors
About this output

How far the grand mean lies from the parent mean, in standard errors of the grand mean (sigma over the square root of n x R). Blank when only one custom value has weight and when the inputs are not valid.

No unit declared
Means within one standard error
About this output

The number of sample means within one theoretical standard error of the parent mean. Blank when the inputs are not valid or while challenge 4 awaits a prediction.

No unit declared
Histogram window used
About this output

The histogram window used. Blank when the inputs are not valid.

No unit declared
Challenge result
About this output

No challenge selected, MET or NOT MET.

No unit declared
Challenge feedback
About this output

Feedback on the selected challenge: the prediction prompt, the met text or the not-met hint (blank with none).

No unit declared
Histogram bins
About this output

The number of histogram bins: up to 31 for the die and Custom (each bin holds whole lattice points of the possible means), 30 for Uniform and Exponential. Blank when the inputs are not valid.

No unit declared
Challenge goal
About this output

The goal of the selected challenge (blank with none).

No unit declared
Challenge score
About this output

The challenge score: 100 when met, else 0.

No unit declared
Challenge: the value scored
About this output

The value the selected challenge scores: the theoretical standard error (1), the theoretical ratio of the spread to the spread at n = 5 (2), the theoretical skewness of the mean (3), the in-band count (4) or the grand mean in standard errors (5); blank with none, when not valid or while challenge 4 awaits a prediction.

No unit declared
Model Status
About this output

NOT VALID with the reason when an input cannot be used; CHECK when only one custom value has any weight (no spread) or when the sample size is 1 (the histogram is the parent itself); otherwise OK.

No unit declared
Skewness of the sample means
About this output

The skewness of the R sample means (the bias-adjusted sample form). Blank when every mean is equal and when the inputs are not valid.

No unit declared
Model version
About this output

The model version.

No unit declared
Near ties
About this output

The number of Uniform or Exponential samples whose in-band test or bin edge lies within 1E-9 relative of its threshold (such a sample could fall the other way in another engine; expected 0). Blank when the inputs are not valid.

No unit declared
Formula module versions
About this output

The formula modules the model is built from, with their versions.

No unit declared
Excess kurtosis of the sample means
About this output

The excess kurtosis of the R sample means (the bias-adjusted sample form). Blank when every mean is equal and when the inputs are not valid.

No unit declared
The histogram of the sample means: bin edges, the count of means in each bin and the normal expected count (the central limit theorem approximation)
About this output

The histogram of the sample means, one row per bin (up to 31; unused rows blank): the bin's low and high edges, the count of means in it and the normal expected count, R times the normal chance of the bin (the central limit theorem's approximation, blank when only one custom value has weight). The counts are blank while challenge 4 awaits a prediction.

No unit declared
Share within one standard error
About this output

The share of the sample means within one theoretical standard error of the parent mean. Blank when the inputs are not valid or while challenge 4 awaits a prediction.

No unit declared
Mean of the sample means
About this output

The average of the R sample means. Blank when the inputs are not valid.

No unit declared
The sample means: each sample's mean and its histogram bin (0 below the window, binCount + 1 above it); blank past R
About this output

The R sample means (rows 1 to 500; rows past R blank): each sample's mean and its histogram bin, 0 below the window and binCount + 1 above it. Blank while challenge 4 awaits a prediction.

No unit declared
Means outside the window
About this output

The number of sample means below or above the histogram window (counted, not binned). Blank when the inputs are not valid or while challenge 4 awaits a prediction.

No unit declared
This page is provided by LogicCommons for informational purposes only. Results are analysis outputs computed from the inputs you supply and are not professional advice. Verify all inputs and results independently.

LogicCommons is in beta. If a result, label, or reference looks wrong, tell us here; we read every message.

Methodology

Purpose and model boundary

This lab shows the central limit theorem at work. It draws R seeded samples (10 to 500, a multiple of 10) of n values each (1 to 30) from one parent distribution: a uniform on 0 to 1, a fair die, an exponential with mean 1, or a custom parent of up to six whole values with whole weights. It takes the mean of every sample and returns the histogram of those means against the normal curve the theorem predicts, the spread of the means against the parent's standard deviation over the square root of n, their skewness and excess kurtosis against the theory, the same measures at n = 1, 2, 5, 10, 20 and 30 from the same draws, the share of means within one standard error, and the running mean of all draws (the law of large numbers). Five scored challenges use the same model.

It is a lab for learning how a sampling distribution forms: why the means bunch more tightly as n grows, why a skewed parent still gives lopsided means at small n, and why one seed's measured spread or skewness is not the true value. It is not a statistical analysis tool. It samples with replacement, every sample has the same size, there is no normal parent, and the normal curve it draws is the theorem's approximation, not the exact distribution of the mean.

The model is the calculation authority. The page sends the values you set to the model and draws only what it returns: the parent bars, the tray of the first ten samples, the falling blocks and the histogram of the means with its normal curve, the spread-by-n chart and the running mean with its band. The page computes no draw, mean, bin, count or statistic itself.

Inputs and units

Every input is a pure number or a choice; the lab has no physical units. Every input is required and is checked on its entered value, even when the chosen parent does not use it.

Input Meaning and unit
Parent distribution Uniform (on 0 to 1), Fair die, Exponential (mean 1) or Custom (your six bars). Default Fair die.
Histogram window Whole range (the parent's whole range) or Zoom to the means (the parent mean plus or minus 4 standard errors, snapped outward). Default Whole range. It changes only the drawn window, never a statistic or a challenge result.
Random seed The start of the random stream, a whole number from 1 to 2,147,483,646 (default 2026). The same seed always gives the same draws.
Number of samples R A multiple of 10 from 10 to 500 (default 500). Raising it adds samples and leaves the first ones unchanged.
Sample size n The draws in each sample, a whole number from 1 to 30 (default 5). Raising it extends every sample: its first draws stay the same.
Custom value 1 to 6 The value of each custom bar, a whole number from -20 to 20 (defaults 0, 1, 2, 3, 4 and 5). Used with Custom only.
Custom weight 1 to 6 The weight of each custom bar, a whole number from 0 to 100 (defaults 6, 5, 4, 3, 2 and 1), with the six adding to more than 0. A bar's probability is its weight over the total weight; weight 0 hides the bar.
Challenge 0 for free exploration, or 1 to 5 to load a challenge.
Your predicted count Challenge 4 only: how many of the 500 sample means you predict land within one standard error of the parent mean, a whole number from 0 to 500. 0 means not yet predicted.

Where each input is set:

  • On the canvas only: the parent distribution (its tabs), the histogram window (its chip), and the six custom values and weights (drag the top of a bar for its weight and its foot for its value).
  • In the input panel: the random seed, the number of samples, the sample size, the challenge number and the predicted count.

Governing relationships

The generator. The model implements Park and Miller's minimal standard generator (MINSTD) with the multiplier 48271. Starting from s₀ = the seed, each state is

sₖ = MOD(48271 · sₖ₋₁, 2³¹ − 1), and each uniform draw is uₖ = sₖ / (2³¹ − 1),

which lies strictly between 0 and 1. The first two states are discarded, so the first draw used is s₃. The draws form a fixed block of 500 rows of 30: draw j of sample r is s₂₊₃₀₍ᵣ₋₁₎₊ⱼ, and a sample uses the first n draws of its row. Rows are reached by jump-ahead: a state k steps later is MOD(Aₖ · s, 2³¹ − 1) with Aₖ = 48271ᵏ reduced modulo 2³¹ − 1, and every product is split into 16-bit halves so that each step stays an exact whole number. The model also steps the first 10 samples one draw at a time and counts any disagreement with the jump-ahead draws (the stream check, expected 0).

From a draw to a value. With d the state of a draw and m = 2³¹ − 1:

  • Uniform: the value is u = d / m.
  • Exponential: the value is −ln(1 − u), the inverse of the exponential distribution function with mean 1.
  • Fair die and Custom: with weights w₁ … w₆, cumulative weights C₁ … C₆ and total W = C₆, the value is vₖ for the smallest k with u · W < Cₖ. The fair die is the integer parent with values 1 to 6 and weight 1 each, so it shows INT(6u) + 1. The test is made exactly in whole numbers (d · W against Cₖ · m), and a bar of weight 0 is never chosen.

The parent. For an integer parent, μ = Σ wₖvₖ / W and σ² = (W · Σ wₖvₖ² − (Σ wₖvₖ)²) / W². Its skewness γ is the third central moment over σ³ and its excess kurtosis κ is the fourth central moment over σ⁴, minus 3. The continuous parents use their exact moments: uniform μ = 1/2, σ² = 1/12, γ = 0, κ = −6/5; exponential μ = 1, σ² = 1, γ = 2, κ = 6. The fair die has μ = 7/2, σ² = 35/12, γ = 0 and κ = −222/175.

The central limit theorem. The mean of n independent draws has mean μ and standard deviation

se = σ / √n (the theoretical standard error),

its skewness is γ / √n and its excess kurtosis is κ / n, and its distribution approaches the normal curve with that mean and standard deviation as n grows.

Measured spread and shape. Over the R sample means, the model reports their average, their standard deviation with divisor R − 1, and the bias-adjusted sample skewness and excess kurtosis:

skewness = R / ((R − 1)(R − 2)) · Σ ((xᵢ − x̄) / s)³, excess kurtosis = R(R + 1) / ((R − 1)(R − 2)(R − 3)) · Σ ((xᵢ − x̄) / s)⁴ − 3(R − 1)² / ((R − 2)(R − 3)),

with s the sample standard deviation. The ratio of the measured standard deviation to se is near 1 by the theorem.

Within one standard error. A sample mean is in the band when |mean − μ| ≤ σ / √n. For the die and Custom the test is made exactly in whole numbers; for Uniform and Exponential it is a floating-point comparison. The normal curve puts Φ(1) − Φ(−1) ≈ 0.6827 of its area within one standard deviation, shown for comparison.

The histogram. Uniform and Exponential use 30 equal bins on a grid of 120 units across the whole range (0 to 1 for Uniform, 0 to 5 for Exponential). The die and Custom use lattice bins: every possible sample sum is n·L + j·g₀ for a whole number j, where L is the lowest value with weight and g₀ the greatest common divisor of the gaps from L to the other weighted values. Each bin holds the same number of consecutive lattice points (at most 31 bins), and its edges sit half a lattice step either side, so a mean never sits on an edge. With a fair die this gives one bin per possible mean at n = 2 (11 bins) and 26 bins at n = 5. The zoomed window is the parent mean plus or minus 4 standard errors, widened outward to the next grid unit or lattice point and kept inside the whole range. The normal expected count of a bin is

R · (Φ((high − μ) / se) − Φ((low − μ) / se)),

with Φ the standard normal distribution function. The normal share outside the window is reported separately and not drawn; means outside the window are counted, not binned.

The running mean. After every 10 samples the model reports the mean of all N = n · (samples so far) draws and the band μ ± 2σ / √N. The grand mean of all n · R draws is also expressed in standard errors of the grand mean: z = (grand mean − μ) / (σ / √(n · R)).

The parent as data. For the die and Custom, one row per bar with its value, weight and probability. For Uniform, 30 bins of width 1/30, each with probability 1/30. For Exponential, 30 bins of width 1/6 up to 5, each with probability e^(−(b − 1)/6) − e^(−b/6); the share above 5, about 0.0067, is not drawn.

Calculation sequence

The model works through the relationships above in this order:

  1. It checks the entered values in the order of the status list under Errors and warnings.
  2. It fixes the values used: your inputs, or in a challenge the challenge's own parent, seed, number of samples and sample size, except the inputs the challenge leaves to you.
  3. It builds the parent: its values and weights, or its constants, and its mean, standard deviation, skewness and excess kurtosis.
  4. It generates the 500 rows of 30 draws by jump-ahead, turns each draw into a value, and sums each row's first n values, and its first 1, 2, 5, 10, 20 and 30.
  5. It computes each sample's mean, whether it lies within one standard error, and its histogram bin.
  6. It computes the measured and theoretical spread and shape, the histogram counts and normal expected counts, the spread-by-n table, the running mean and the grand mean.
  7. It steps the first 10 samples one draw at a time for the tray and the stream check.
  8. It sets the status and, in a challenge, scores the challenge.

Outputs and interpretation

  • SD of the sample means, theory standard error and mean of the sample means: the primary results. The measured standard deviation wanders around σ / √n from seed to seed; the mean of the means wanders around μ.
  • Parent mean, standard deviation, skewness and excess kurtosis: the moments of the parent used.
  • Measured SD over the standard error: the ratio of the two; near 1.
  • Skewness and excess kurtosis of the sample means, measured, beside the theory γ / √n and κ / n.
  • Means within one standard error and their share, beside the normal share of about 0.6827.
  • Grand mean of all draws, draws in all (n · R) and the grand mean in standard errors. At about 1 seed in 20 the grand mean lies more than 2 standard errors from μ; that is what such a band means.
  • Histogram bins, window low and high, means outside the window and the normal share outside the window.
  • Near ties: Uniform or Exponential samples whose in-band test or bin edge lies within 1×10⁻⁹ (relative) of its threshold, which could fall the other way in another computation; expected 0.
  • Stream check mismatches: the disagreements between the jump-ahead draws and the one-step chain; expected 0.
  • Settings used: the parent, seed, number of samples, sample size and window of the run, which in a challenge are the challenge's own; the model version and formula module versions.
  • Tables: the means table (each sample's mean and bin, 0 below the window and one more than the bin count above it), the tray (the first 10 samples draw by draw), the histogram (each bin's edges, count and normal expected count), the spread-by-n table (mean, standard deviation and skewness of the means at n = 1, 2, 5, 10, 20 and 30 against the theory), the running mean every 10 samples with its band, and the parent table.

Reading the canvas: the parent is drawn on its own axis from the parent table. The first ten samples appear draw by draw in the tray; every mean then drops as a block into its bin, ten at a time, and at the end the bars are the model's counts and the curve passes through the normal expected counts. The spread chart shows the measured standard deviation of the means against n on log scales, with the theory line falling at slope −1/2: four times the draws give half the spread. The running mean settles toward μ as its band narrows.

What to take from the lab: the spread of the means shrinks like 1 over the square root of n whatever the parent; the bell shape arrives quickly for a symmetric parent and slowly for a skewed one, because the skewness of the mean falls only like 1 over the square root of n; and every measured value is one seeded sample, so it differs from the theory by an amount that itself shrinks as R grows.

Challenges

Choosing a challenge number from 1 to 5 loads that challenge. The challenge fixes its own parent, seed, number of samples and sample size, except the inputs it leaves to you; the histogram window and the custom bars are never overridden. The result reads MET (score 100) or NOT MET (score 0), with the goal, the value the challenge is scored on and a short explanation or hint.

  1. Find where the spread settles. For the exponential parent, find the smallest sample size at which the standard deviation of the sample means falls below 0.25. Open: the sample size. Scored on the theoretical standard error: met when σ / √n is below 0.25 and σ / √(n − 1) is not.
  2. Halve the spread. Starting from samples of 5 uniform draws, choose the sample size that halves the spread of the sample means. Open: the sample size. Scored on the theoretical ratio √(5 / n), met when it is exactly one half. While this challenge is selected and not met, the spread-by-n table is blank, because it would show the answer.
  3. Skewed means. Build a custom parent whose means of 5 draws are still clearly skewed. Open: the six custom values and weights. Scored on the theoretical skewness of the mean, γ / √5, met at 0.5 or more with at least two weighted values.
  4. The 68% band. Predict how many of the 500 means of 10 dice land within one standard error of 3.5, then reveal them. Open: your predicted count. Met when your count is within 25 of the count of means in the band.
  5. A stubborn seed. Find a seed whose grand mean of all 15,000 dice (500 samples of 30) lands outside 3.5 plus or minus two standard errors. Open: the seed. Scored on the grand mean in standard errors, tested exactly in whole numbers.

Challenges 1 to 3 are scored on theory, not on the sampled results, so the seed does not decide them; challenges 4 and 5 are about the sampling itself.

Challenge 4 holds back the answer until you predict: while your predicted count is 0, the count and share of means within one standard error, the means outside the window, the value scored, the means table and the histogram counts are blank, the result reads NOT MET with the prompt, and the status reads OK. The parent, the tray, the theory, the normal curve and the spread table still show. Once you enter a count, every result appears and the challenge is scored.

Validation and status logic

The status reads the first match in the list under Errors and warnings. The NOT VALID checks apply to the entered values, inside a challenge too; the two CHECK items apply to the values used, so a challenge's own settings decide them. A CHECK does not stop the calculation: every result is still shown, except those that need a spread.

Assumptions and limitations

  • Four parents only: Uniform on 0 to 1, a fair die, Exponential with mean 1, and Custom with up to six whole values from -20 to 20 and whole weights from 0 to 100. There is no normal parent.
  • Samples are drawn with replacement, all of the same size; at most 500 samples of 30 draws (15,000 draws, all computed whatever R and n are). Raising n extends each sample and raising R adds samples, so the first draws never change.
  • The generator is deterministic and reproducible. It is a small linear congruential generator, fine for teaching and wrong for cryptography or serious simulation. Seed 2,147,483,646 mirrors seed 1 (every state becomes m minus the state), so its die means are exactly 7 minus those of seed 1.
  • The normal curve is the central limit theorem's approximation, not the exact distribution of the mean; at small n and for a skewed parent the bars and the curve disagree, and that is the lesson.
  • The measured spread, skewness, kurtosis and in-band count are one seeded sample and wander from seed to seed.
  • The exponential parent table stops at 5. The exponential value relies on a logarithm, which may differ in its last digit between computations; the near-tie count reports any sample this could move.
  • At most 31 bins for the die and Custom; a wide custom parent can leave empty bins, because the true distribution of the mean is lumpy.

Restrictions and non-computing states

Every input is required and is checked on its entered value even when the chosen parent does not use it. A challenge number that is not a whole number from 0 to 5 counts as no challenge selected.

Under NOT VALID every result and every table is blank, except the model and module versions, the challenge result (No challenge selected, or NOT MET with a challenge selected), a score of 0, and the goal and hint of a selected challenge.

When only one custom value has any weight, every draw and every mean is the same: the standard error is 0, one bin holds every mean, and the parent skewness and excess kurtosis, the theory skewness and kurtosis of the mean, the measured SD over the standard error, the grand mean in standard errors, the normal curve and the normal share outside the window are blank. The measured skewness and kurtosis of the means are blank whenever every mean is equal.

In challenge 4, until you predict, the results named under Challenges are held back.

Errors and warnings

The status messages, first match wins:

  • NOT VALID: choose a parent distribution and a histogram window from the lists: the parent or the window is not one of the listed choices.
  • NOT VALID: the seed must be a whole number from 1 to 2147483646: the seed is blank, not whole or out of range.
  • NOT VALID: the number of samples must be a multiple of 10 from 10 to 500
  • NOT VALID: the sample size must be a whole number from 1 to 30
  • NOT VALID: each custom value must be a whole number from -20 to 20 and each custom weight a whole number from 0 to 100, with the weights adding to more than 0: checked even when the parent is not Custom.
  • NOT VALID: the challenge number must be a whole number from 0 to 5, and the count prediction a whole number from 0 to 500
  • CHECK: only one custom value has any weight, so every draw and every mean is the same and there is no spread; give a second bar some weight: a Custom parent with a single weighted value.
  • CHECK: the sample size is 1, so each mean is a single draw and the histogram shows the parent itself, not a distribution of means; raise the sample size
  • OK: the run is computed with nothing to flag.

References

This laboratory is an educational model of the central limit theorem and the law of large numbers. Its random numbers come from the Park-Miller minimal standard (MINSTD) generator, a multiplicative linear congruential generator with modulus 2^31 - 1 and the multiplier 48271, so every run is exact and repeatable from its seed. Draws become uniform, exponential (by the inverse-transform method), die or weighted discrete values. The spread of the sample means is set beside the parent's standard deviation over the square root of n, their shape beside the parent's skewness and kurtosis scaled by n, and their histogram beside the normal approximation the theorem predicts.

Sources and further reading

  • The central limit theorem for sample means and the standard error: B. Illowsky and S. Dean, Introductory Statistics 2e, OpenStax, section 7.1, The Central Limit Theorem for Sample Means (Averages). OpenStax
  • The law of large numbers and when the theorem applies: B. Illowsky and S. Dean, Introductory Statistics 2e, OpenStax, section 7.3, Using the Central Limit Theorem. OpenStax
  • The adjusted sample skewness and the kurtosis and excess kurtosis: NIST/SEMATECH, e-Handbook of Statistical Methods, section 1.3.5.11, Measures of Skewness and Kurtosis. NIST
  • The moments of the uniform parent: NIST/SEMATECH, e-Handbook of Statistical Methods, section 1.3.6.6.2, Uniform Distribution. NIST
  • The moments and the inverse distribution function of the exponential parent: NIST/SEMATECH, e-Handbook of Statistical Methods, section 1.3.6.6.7, Exponential Distribution. NIST
  • The minimal standard generator: S. K. Park and K. W. Miller, "Random number generators: good ones are hard to find", Communications of the ACM 31(10), 1988, pages 1192-1201. doi:10.1145/63039.63042

No table or text from any of these publications is reproduced, and none of their authors or publishers has reviewed or endorses this laboratory.

This laboratory is for learning. Its results hold only within its stated ranges; one seeded run is one sample, and its measured spread and shape differ from the theory by chance.

Links were current at build time. If one moves, search the document's title rather than reporting a broken link as a defect.

Results are informational and not professional advice. See our Terms of Use. Powered by SpreadsheetWeb · About · Privacy · Terms