Quant Sandbox
DerivativesPortfolio & RiskFixed IncomeCorporate FinanceProbability & MeasureStochastic ModelsMarket MicrostructureGuide
Probability & Measure
Probability Space
σ-Algebras
InformationFiltration
Lebesgue Measure
Random Variables
SpinnerDistribution function
Lebesgue Integral
Riemann vs LebesgueExpectation by sorting
Convergence
Escaping massModes of convergence
Conditional Expectation
Best guessChange of measure
Connected Guides
  • Random variables and their distributions
  • Measurable functions
  • Probability spaces, σ-algebras and random variables
  • The law of large numbers and the central limit theorem

© 2026 Quant Sandbox · A study aid for quantitative finance

Privacy & dataNo cookies

This site does not use cookies and asks for no personal data. It keeps a few small settings in your browser's local storage — your chosen theme and language, the sidebar layout, and your progress and answers in the Guides — so it remembers them on your next visit. This data never leaves your device; clearing your browser storage removes it. Inputs you change can also be captured in the page URL, so you can share or bookmark a specific setup. The site uses Vercel Web Analytics, a privacy-friendly, cookieless service that records only anonymous, aggregated usage (such as page views) without identifying you or tracking you across other sites.

Random variables

Controls

Question B = (a, b]
0.80
−11
1.00
−11

Or drag the band on the value axis.

Spins
5,000
100100,000
One spin, one number
53°127°θ = 100° → X = 0.985Ω: the spinner’s angle θ, uniform on 0°–360°X(θ) = sin θ, the height of the marked pointLaw of X — the arcsine lawbar length = share of spins0.204810.50−0.5−1
{X ∈ B} on the spinner
θ: 53.1°–126.9°
P(X ∈ B) = 73.7° / 360°
0.2048
spins with X in B
1,002 / 5,000

About this tool

A random variable is an ordinary function of the outcome. The only randomness is the outcome itself, here the angle where a spinner stops. The variable reads a number off it, such as the height of the point on the rim or the place where a beam from the pointer hits a wall. Asking whether X lies in a set B is asking whether the spinner stopped on the matching arcs, so P(X in B) is an arc length. The law of X is the spinner's uniform measure carried over to the value axis.

Frequently asked questions

What is a random variable, really?

It is a function X from the outcomes Ω to the real numbers, with one technical requirement: for every set B of values you care about, the set of outcomes where X lies in B must be an event. Nothing about X is random once the outcome is fixed. Randomness comes only from which outcome occurs. Two variables can be very different functions and still have the same distribution.

What is the law of X?

The law, or distribution, of X is the probability measure it creates on the real line: P(X in B) is the probability of the set of outcomes that X sends into B. It pushes the probability P forward through the function X. Once you know the law you can compute probabilities and expectations of X without going back to Ω. On the page, you pull a band of values back to arcs of the spinner and measure them.

What should I try on the pages?

Spin the pointer, read the height of the point on the rim and compare the histogram with the arcsine law: the density piles up near the top and bottom, because the rim is steep there. Switch to the beam hitting a wall and you get the Cauchy law, whose tails are so heavy that it has no mean. On the second page, read probabilities off the distribution function F(x) = P(X ≤ x), where jumps are atoms.

If two variables have the same law, are they equal?

No. The sine and the cosine of the spinner angle have exactly the same law, yet they take different values at almost every outcome. The law only records how likely each set of values is, not which outcomes produce them. Equality in law is much weaker than equality as functions, which is why the joint behaviour, not just the individual laws, matters for sums and products.

Learn the theory

  • Random variables and their distributions — Random variables as measurable functions and the distributions they carry: distribution functions, atoms and densities, common laws, quantiles, sampling.
  • Measurable functions — Functions whose level sets can be measured: preimages, the half-line test, closure under limits, simple functions, σ(f) and the image measure.
  • Probability spaces, σ-algebras and random variables — Sample space, σ-algebra, probability measure, measurable maps and the σ-algebra generated by a variable.
  • The law of large numbers and the central limit theorem — Why averages settle down, how fast, and why the normal distribution appears: the two theorems behind Monte Carlo and the Brownian limit.