Distribution Explorer

The learner moves parameter sliders and drags interval ends, quantiles, observed statistics or thresholds on a pmf or pdf. They see probability as shaded area or highlighted bars, linked to the cdf, survival or hazard panels, with live moment readouts, tail-bound comparisons, p-values and rejection regions.

Used in: Introduction to Probability Theory, Introduction to Statistics

Props

PropTypeDefaultDescription
titlestring"<Family> distribution"Title bar text.
familystring"normal"Named family (canonical name; aliases such as 't', 'chi2', 'exp' are also accepted). Ignored when atoms, pdf, pieces or components are given.
paramsobjectfamily defaultsFamily parameters, e.g. {"n": 20, "p": 0.3}. Canonical names: normal mean/sd, uniform a/b, exponential rate, gamma shape/rate, beta alpha/beta, chi-squared df, student-t df, f df1/df2, lognormal mu/sigma (log scale), weibull shape/scale, pareto alpha/xm, bernoulli p, binomial n/p, geometric p (+start 0 or 1), negative-binomial r/p, poisson lambda, hypergeometric N/K/n, discrete-uniform a/b. Common aliases (mu, sigma, lambda, nu) are accepted.
components{family, params, weight}[]noneFinite mixture of named families with mixing weights (normalised).
atoms{x, p, label?}[]nonePoint masses. Alone they define a discrete law; with pdf or pieces they are the atoms of a mixed-type law. label replaces the tick text (non-numeric outcomes).
pdfstringnoneCustom density in x, e.g. "2*x" or "y = 0.006*exp(-0.01*x)" (+ - * / ^, exp, log, sqrt, abs, pi, e). Needs support.
pieces{expr, from, to}[]nonePiecewise custom density: expr in x on [from, to).
support[number, number]noneInterval on which a custom pdf lives (finite).
normalizationstring"auto"Custom atoms/pdf: 'auto' rescales silently to total 1; 'check' shows the raw values with a validity verdict (sum or integral = 1, all >= 0); 'solve' treats them as g and shows T and c = 1/T with a button to apply c.
editablebooleanfalseAtoms can be dragged up and down to change their weights (with a Normalize button).
slidersboolean | {name, min, max, step?}[]trueFamily parameter sliders. false hides them; a list shows only those parameters (canonical names) with the given ranges.
presets(string | {label?, family?, params?})[]noneButtons that set the family and/or parameters, e.g. [{"label": "α = β = 0.5", "params": {"alpha": 0.5, "beta": 0.5}}] or ["exponential", "uniform"].
sampleMeannumbernoneShow the exact law of the mean of n iid draws (normal, bernoulli, binomial, poisson, exponential, gamma, chi-squared) with an n slider; the initial n.
affine{a, b}noneShow Y = aX + b with sliders for a and b; the original law is dashed.
truncate[number | null, number | null]noneShow the law of X given a <= X <= b (draggable ends; null = open end).
censornumbernoneShow X = min(Y, c): right-censoring at a draggable c, which turns the upper tail into a point mass.
agenumbernoneResidual life: show the law of X - t given X > t, with an age slider and the original law dashed (memorylessness).
intervalboolean | [number | null, number | null]shown when no other question is setShaded interval with draggable ends; its probability is read out (null = infinite end, so [null, x] gives F(x)). true = a default interval, false = none.
symmetricbooleanfalseInterval kept symmetric about the mean, one handle sets the half-width.
intervalPresetsnumber[][]Buttons that set the interval to mean ± k sd for each k (empirical rule: [1, 2, 3]).
endpointTogglesbooleanfalseToggles to include or exclude each endpoint (matters only at point masses).
densityRatiobooleanfalseInterval [x0, x0 + h] with a width slider; reads out P, P/h and f(x0), so P -> 0 while P/h -> f(x0).
showComplementbooleanfalseAlso shade and read out the complement 1 - P.
quantilenumbernoneQuantile level in (0, 1) with a slider and a draggable x: the area to the left (or right, see quantileTail) is the level.
quantileTailstring"lower"'lower': x_p with P(X <= x_p) = p. 'upper': critical value x with P(X > x) = level.
observednumbernoneObserved test statistic t (draggable); the p-value region for the chosen alternative is shaded.
alphanumbernoneSignificance level (slider); shades the rejection region and reads out critical values (and the decision when observed is set).
alternativestring"greater"Initial alternative for observed / alpha: 'greater', 'less' or 'two-sided' (equal-tail doubling). The learner can switch it.
boundstringnoneTail bound to compare with the true tail: 'markov' P(X >= a) <= E[X]/a, 'markov-moment' P(|X| >= a) <= E|X|^r/a^r, 'chebyshev' P(|X - μ| >= kσ) <= 1/k², 'cantelli' P(X - μ >= kσ) <= 1/(1 + k²). Adds a panel of both against the threshold.
compareBoundstringnoneA second bound drawn dashed in the bound panel (same values as bound).
thresholdnumberper boundInitial threshold: a (markov forms, in x units) or k (chebyshev/cantelli, in standard deviations).
thresholdInstring"sd"Chebyshev/Cantelli threshold units: 'sd' (k) or 'x' (a distance ε in x units, so the bound is σ²/ε², useful with sampleMean).
boundOrdernumber2Moment order r for 'markov-moment' (slider 0.5 to 4).
showCdfbooleanfalseLinked cdf panel (jumps with closed and open dots at atoms) marking the interval, quantile or observed value.
showSurvivalbooleanfalseSurvival panel S(x) = P(X > x).
showHazardbooleanfalseHazard panel h = f/S (discrete: p(k)/P(X >= k)) and a trend readout.
showTailSumbooleanfalseShade the area under S(x) from 0 (or the bars P(X >= k)) and read it out next to E[X].
logAxesbooleanfalseSurvival panel on log-log axes (a Pareto tail becomes a line).
showMeanSdbooleanfalseMean line, mean ± sd bar, and E[X], Var(X), σ readouts ('does not exist' / ∞ when they do not).
showMedianbooleanfalseMedian line and readout.
showModebooleanfalseMode line and readout ('not unique' when flat).
showSkewnessbooleanfalseSkewness readout.
showKurtosisbooleanfalseExcess kurtosis readout.
showFulcrumbooleanfalseDraggable pivot under the distribution with a tilting beam; it balances exactly at the mean (net moment E[X - c] = 0).
showVariancebooleanfalseVariance readout; for small discrete laws a table of (x - μ)² p(x).
showSecondMomentbooleanfalseE[X²] and E[X²] - (E[X])² readouts (and an x² p(x) column).
showZAxisbooleanfalsez = (x - μ)/σ labels along the top and z readouts.
showComponentsbooleanfalseMixtures: draw each weighted component density dashed.
comparestring | {family, params}noneA second law drawn dashed (e.g. the standard normal against a t); quantiles, p-values and critical values are also read out under it.
xRange[number, number]autoFixed x window.
variablestring"X"TeX name of the random variable in labels, e.g. "T", "Z", "\\hat p".
controlsstring[]all controls shownIds of the hideable controls to show (see the controls registry); core ones always show. Absent = everything. Fitted per page by tooling, not by hand.