ZeroProb.jl is a Julia library for handling zero-probability events in continuous probability spaces. It provides rigorous mathematical tools for reasoning about events with measure zero, including density-based relevance, Hausdorff measures, paradox demonstrations, tail risk modelling, and black swan event analysis.
In continuous probability distributions, events with measure zero can still occur. This library provides alternative relevance measures, classical paradox demonstrations, and application-oriented tools for extreme events.
In continuous probability theory, individual points have measure zero (P(X = x) = 0), yet one such point must occur when sampling. This creates a paradox:
-
Probability: P(X = 3.14159…) = 0
-
Reality: X can equal exactly 3.14159…
-
Problem: How do we reason about relevance when probability is always zero?
ZeroProb.jl provides three complementary approaches:
Compare probability densities instead of probabilities:
relevance = density_ratio(f, x, baseline)
# Higher density -> more "typical" for the distributionUse dimensional analysis for sets of measure zero:
measure = hausdorff_measure(event_set, dimension)
# Generalizes volume to fractional dimensionsusing ZeroProb, Distributions
# Define distribution
dist = Normal(0, 1)
# Compare relevance of two points
x1 = 0.0 # At mean
x2 = 3.0 # 3 standard deviations out
ratio = density_ratio(dist, x1, x2)
# ratio ~ 228.0 (x1 is 228x more "typical")using ZeroProb
# Cantor set has Hausdorff dimension log(2)/log(3) ~ 0.631
cantor_set = construct_cantor_set(iterations=10)
dimension = hausdorff_dimension(cantor_set)
measure = hausdorff_measure(cantor_set, dimension)
# Even though Lebesgue measure is 0, Hausdorff measure is non-zerousing ZeroProb, Distributions
dist = Exponential(1.0)
x = 2.0
# Compute probability in shrinking neighborhoods
eps_values = [0.1, 0.01, 0.001, 0.0001]
probs = [epsilon_neighborhood_prob(dist, x, e) for e in eps_values]
# Observe convergence rate
convergence_rate = estimate_convergence_rate(eps_values, probs)ZeroProbEvent-
Abstract base type for zero-probability events.
ContinuousZeroProbEvent-
Zero-probability event in a continuous space.
DiscreteZeroProbEvent-
Zero-probability event in a discrete approximation.
AlmostSureEvent-
Event that occurs with probability 1 (complement has measure zero).
SureEvent-
Event that occurs in every outcome (not just almost every).
TailRiskEvent-
Extreme tail event with severity and return period.
QuantumMeasurementEvent-
Quantum measurement outcome with Born rule probability.
InsuranceCatastropheEvent-
Catastrophe event for insurance/reinsurance modelling.
| Function | Description |
|---|---|
|
Probability of an event (zero for measure-zero events) |
|
Alternative relevance score |
|
Ratio of probability densities at two points |
|
Hausdorff measure of a set at given dimension |
|
Probability mass in epsilon-ball around x |
|
Composite relevance score |
| Function | Description |
|---|---|
|
Box-counting dimension estimate |
|
Rate of P(ball) → 0 as eps → 0 |
|
P(|X - x| < eps) for distribution |
|
Conditional density given event |
|
Radon-Nikodym derivative dmu/dnu at x |
|
Total variation between measures |
|
Kullback-Leibler divergence |
|
Fisher information at a point |
|
Pointwise entropy contribution |
|
Test if event holds almost surely |
|
Test if a set has Lebesgue measure zero |
| Function | Description |
|---|---|
|
P(X = x) = 0 yet outcomes exist |
|
Conditioning on measure-zero sets |
|
Countable dense set with measure zero |
|
Uncountable union of measure-zero sets |
|
Distinction between a.s. and sure events |
|
Build Cantor set to given depth |
|
Equidecomposition via non-measurable sets |
|
Non-measurable Vitali set construction |
|
Infinite surface area, finite volume |
|
Ambiguity of "random chord" in a circle |
|
Geometric probability via needle drops |
| Type / Function | Description |
|---|---|
|
Type for high-impact, low-probability events |
|
Type for financial market crash events |
|
Type for edge cases in probabilistic betting |
|
Severity measure for extreme events |
|
Expected impact accounting for severity |
|
Expected value of event outcome |
|
Test if a system handles black swan events |
|
Test if a system handles zero-prob events |
|
Singular alias for above |
| Function | Description |
|---|---|
|
Visualize the zero-probability paradox |
|
Visualize the continuum paradox |
|
Compare density and probability |
|
Visualize shrinking neighborhoods |
|
Visualize black swan impact distribution |
ZeroProb.jl is designed for use with ECHIDNA’s probabilistic reasoning:
-
Premise Selection: Rank premises by density ratio instead of raw probability
-
Proof Search: Use epsilon-neighborhood probability to guide search
-
Anomaly Detection: Flag events far from distribution support using Hausdorff measures
Current Version: 0.1.0
-
✓ Core types and density ratio
-
✓ Hausdorff measure and dimension
-
✓ Epsilon-neighborhood probability
-
✓ Extended types (tail risk, quantum, insurance)
-
✓ Extended measures (KL divergence, Fisher information, Radon-Nikodym)
-
✓ Classical paradoxes (Cantor, Banach-Tarski, Vitali, Bertrand, Buffon)
-
✓ Black swan and extreme event applications
-
✓ Visualization functions
-
✓ Comprehensive test suite (280 tests)
-
❏ Performance optimization
-
❏ Integration examples with ECHIDNA
See ROADMAP.adoc for future development plans.
-
Kolmogorov, A.N. Foundations of the Theory of Probability. Chelsea Publishing, 1933/1956. — Axiomatic probability theory.
-
Billingsley, P. Probability and Measure. 3rd ed., Wiley, 1995. — Measure-theoretic probability.
-
Halmos, P.R. Measure Theory. Graduate Texts in Mathematics 18, Springer, 1950/1974. — Classic measure theory reference.
-
Dudley, R.M. Real Analysis and Probability. Cambridge University Press, 2002. — Rigorous integration of real analysis and probability.
-
Feller, W. An Introduction to Probability Theory and Its Applications. Vol. II, 2nd ed., Wiley, 1971. — Continuous distributions, densities, and convergence.
-
Falconer, K.J. Fractal Geometry: Mathematical Foundations and Applications. 3rd ed., Wiley, 2014. — Hausdorff dimension, box-counting, iterated function systems.
-
Taleb, N.N. The Black Swan: The Impact of the Highly Improbable. 2nd ed., Random House, 2010. — Black swan events and fat-tailed distributions.
-
de Haan, L. & Ferreira, A. Extreme Value Theory: An Introduction. Springer, 2006. — GEV/GPD distributions, tail risk.
-
Embrechts, P., Kluppelberg, C., & Mikosch, T. Modelling Extremal Events for Insurance and Finance. Springer, 1997. — Extreme events in insurance and financial applications.
-
Nielsen, M.A. & Chuang, I.L. Quantum Computation and Quantum Information. 10th anniversary ed., Cambridge University Press, 2010. — Born rule and quantum measurement theory.
Palimpsest-MPL License v1.0 (MPL-2.0) — see LICENSE.
See CONTRIBUTING.md for contribution guidelines.
If you use ZeroProb.jl in research, please cite:
@software{zeroprob2026,
author = {Jewell, Jonathan D.A.},
title = {ZeroProb.jl: Zero-Probability Event Analysis},
year = {2026},
version = {0.1.0},
url = {https://github.com/hyperpolymath/ZeroProb.jl}
}-
Author: Jonathan D.A. Jewell <jonathan.jewell@open.ac.uk>