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
  • Lebesgue measure and null sets
  • Measuring the size of sets
  • Probability spaces, σ-algebras and random variables

© 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.

Lebesgue measure

Controls

Cover
0.100
0.0010.5
12
1200

Point n gets an interval of length ε / 2ⁿ, so all of them together stay under ε.

Darts
2,000
100100000
Hiding a set inside intervals
011/21/32/31/43/41/52/53/54/51/6cover01/41/23/41dartsLength of the cover as ε shrinks0.0625 at ε = 0.1ε = 00.500.5The other tabsAn interval [0.2, 0.5]0.3Any finite set0The rationals — dense0The Cantor set — uncountable0A fat Cantor set — no interval inside0.5
total length Σ |Iₙ|
0.0999 ≤ ε
λ(cover ∩ [0, 1])
0.0625
darts in the cover
115 / 2,000 = 5.8%
darts exactly on a listed point
0

About this tool

Lebesgue measure gives a subset of the interval from 0 to 1 a length, even when the set is far from an interval. The idea is to cover the set with countably many intervals and take the smallest total length you can reach. Sets that can be hidden inside intervals of arbitrarily small total length are null sets. Here you can cover the rationals, the Cantor set and a fat Cantor set, and see how much length each one really needs. A uniform random point misses a null set almost surely.

Frequently asked questions

What is the Lebesgue measure of a set?

It is the smallest total length of countably many intervals that together cover the set. For an interval it is the usual length, and for a countable union of disjoint intervals it is the sum of the lengths. The definition also works for sets with no intervals at all, which is why it can serve as the probability P of a uniformly drawn number. A set whose cover can be made as short as you like has measure zero.

How can the rationals be dense yet have length zero?

Dense means every interval contains a rational, so the rationals cannot hide in a few small intervals one by one. But they are countable: list them as q₁, q₂, q₃ and so on, and cover qₙ by an interval of length ε/2ⁿ. The total length is at most ε, and ε was arbitrary. So the rationals have length 0 even though they are everywhere. A uniform random number is irrational almost surely.

What should I try on the page?

Give yourself a length budget ε and try to cover each set. The rationals fit under any budget. The Cantor set is uncountable and still fits, because only (2/3)ⁿ of the interval is left after n steps. A fat Cantor set removes less each time, contains no interval and still has length 1/2, so no budget below 1/2 works. Compare the three to see that size, density and length are different ideas.

Does measure zero mean the set is small or empty?

No. Null sets can be dense, like the rationals, or uncountable, like the Cantor set. Zero measure only says that a uniform draw lands in the set with probability 0. Events of probability 0 can still happen in an uncountable space, since something must be drawn. That is why probability statements are made almost surely: they hold except on a null set, and a null set can be ignored for integrals and probabilities.

Learn the theory

  • Lebesgue measure and null sets — Building length for every Borel set: countable covers and outer measure, sets of length zero, the Cantor sets, almost everywhere, and why length is unique.
  • Measuring the size of sets — What counting, length, area and mass have in common: the rules of a measure, why additivity must be countable, and the first examples of measures.
  • Probability spaces, σ-algebras and random variables — Sample space, σ-algebra, probability measure, measurable maps and the σ-algebra generated by a variable.