# random experiment

*Entry of the [Dictionary of Applied Machine Learning](https://dictionaryofml.org) (course edition), by Alexander Jung, Aalto University. CC BY 4.0. Updated 2026-11-08. [HTML](https://dictionaryofml.org/terms/randomexperiment.html) · [typeset PDF](https://dictionaryofml.org/terms/randomexperiment.pdf) · [LaTeX](https://dictionaryofml.org/terms/randomexperiment.tex) · [Python demo](https://dictionaryofml.org/terms/randomexperiment.py) · [notebook](https://dictionaryofml.org/terms/randomexperiment.ipynb)*

Math is LaTeX with the book's macros expanded, so no notation package is needed to read it.

## Abstract

A random experiment is a physical or computational process that produces an outcome $\omega$ from a known set of possibilities, the sample space of the experiment. Probability theory represents the process by a probability space $(\Omega,\, \Sigma,\, \mathbb{P})$, where the σ-algebra $\Sigma$ collects the measurable events and the probability measure $\mathbb{P}\left(\cdot\right)$ assigns each event a probability. This representation is a probabilistic model of the process, not a property of it. A measurement of the outcome is represented by a random variable, a measurable function $x : \Omega \to \mathcal{X}$, and the measured value $x(\omega)$ is a realization. Repeating the experiment $m$ times is itself a random experiment on the product sample space, and the measurements of the runs are modeled as independent and identically distributed RVs. In machine learning, the collection of a training set, the draw of a subset of it by stochastic gradient descent, and the noise added for differential privacy are random experiments.

## Definition

The weather of a day at Krems an der Donau is a random experiment: the day's maximum temperature is not known in advance, but its range is. A random experiment is a physical or computational process that produces an outcome $\omega$ from a set $\Omega$ of possibilities, the sample space of the experiment (Bertsekas and Tsitsiklis, 2008, Sect. 1.2; Billingsley, 1986). The outcome is uncertain, and the experiment can be repeated under identical conditions. Fig. 1 shows the minimum and the maximum temperature of every day of January 2023 at the weather station Krems an der Donau: the weather of a day is a random experiment, and the two temperatures are measurements of its outcome.

![Figure 1 of the entry randomexperiment](https://dictionaryofml.org/terms/fig/randomexperiment-fig1.svg)

*Figure 1: The maximum (solid stems, filled circles) and the minimum temperature (dotted stems, open circles) of every day of January 2023 at the weather station Krems an der Donau. The weather of a day is a random experiment, one experiment per day, and the two temperatures are measurements of its outcome. Read the other way, the whole month is one random experiment whose outcome is all $31$ days together. Data generated by pythondemos/randomexperiment.py*

Rolling a die, reading the maximum temperature of a day at Krems, or drawing a handful of data points from a training set for one iteration of stochastic gradient descent: each of these is a random experiment.

Probability theory represents a random experiment by a probability space $(\Omega,\, \Sigma,\, \mathbb{P})$ (Bertsekas and Tsitsiklis, 2008, Sect. 1.2; Billingsley, 1986). The sample space $\Omega$ collects the possible outcomes. The σ-algebra $\Sigma$ collects the events, those subsets $\mathcal{A} \subseteq \Omega$ to which a probability is assigned. The probability measure $\mathbb{P}\left(\cdot\right)$ assigns to each event $\mathcal{A} \in
\Sigma$ a number $\mathbb{P}\left(\mathcal{A}\right) \in [0,1]$ such that $\mathbb{P}\left(\Omega\right) = 1$ and the probability of a countable union of pairwise disjoint events is the sum of their probabilities. Choosing $\Omega$, $\Sigma$ and $\mathbb{P}\left(\cdot\right)$ is a modeling step: the probability measure is a property of the probabilistic model, not of the process. For a die, the sample space is $\{1, \ldots, 6\}$ and the uniform probability measure is the model of a fair die; whether a given die is fair is a question about the process, answered by the relative frequencies of its outcomes in many rolls.

What is observed of an outcome is a measurement, a function $x : \Omega \to \mathcal{X}$ of the outcome. Such a measurable function is a random variable, and the value $x(\omega)$ it takes for the actual outcome $\omega$ is a realization of it (Billingsley, 1986; Gray, 2009). The temperature read at 13:00 is a random variable on the weather of a day, and the number read on one day is a realization. The probability measure on $\Omega$ induces the probability distribution of the random variable, $\mathbb{P}^{(x)}(\mathcal{B}) = \mathbb{P}\left(x \in
\mathcal{B}\right)$ for every measurable set $\mathcal{B} \subseteq
\mathcal{X}$ (Billingsley, 1986, Sect. 20). Machine learning methods work with the RVs and their probability distributions; the sample space behind them rarely needs to be written down. Fig. 2 depicts the two layers, the process and its mathematical representation.

![Figure 2 of the entry randomexperiment](https://dictionaryofml.org/terms/fig/randomexperiment-fig2.svg)

*Figure 2: A random experiment and its mathematical representation. The process produces an outcome $\omega$, of which a measurement $x(\omega)$ is observed. Probability theory represents the process by a probability space $(\Omega,\, \Sigma,\, \mathbb{P})$ and the measurement by a random variable $x$, a measurable function on $\Omega$ whose probability distribution $\mathbb{P}^{(x)}$ is induced by $\mathbb{P}\left(\cdot\right)$*

Repeating a random experiment $m$ times defines a new random experiment whose outcomes are sequences $(\omega^{(1)}, \ldots, \omega^{(m)})$ of outcomes of the original one (Fig. 3). Its sample space is the product $\Omega \times \cdots \times \Omega$, and repetition under identical conditions, with no run influencing another, is represented by the product probability measure: the measurements $x^{(1)}, \ldots, x^{(m)}$ of the runs are then independent and identically distributed RVs (Bertsekas and Tsitsiklis, 2008, Sect. 1.5). While the outcome of a single run is uncertain, the long-run behavior of repeated runs becomes predictable: the law of large numbers and the central limit theorem make this precise (Bertsekas and Tsitsiklis, 2008, Sects. 5.2 and 5.4).

![Figure 3 of the entry randomexperiment](https://dictionaryofml.org/terms/fig/randomexperiment-fig3.svg)

*Figure 3: Repeating a random experiment $m$ times yields another random experiment whose outcomes are sequences $(\omega^{(1)}, \,\omega^{(2)}, \,\dots, \,\omega^{(m)}) \in \Omega\times\ldots\times \Omega$. One random experiment arising in many machine learning applications is the gathering of a training set ${\mathbf z}^{(1)},\,\ldots,\,{\mathbf z}^{(m)}$, whose data points are RVs on the repeated runs*

Random experiments arise in machine learning in three places:

- Data collection: the data points of a training set are modeled as RVs, i.e., as functions of the outcome $\omega \in \Omega$ of a random experiment, and the independent and identically distributed assumption models their collection as the repetition of one experiment. This is what makes the risk of a hypothesis, an expectation under $\mathbb{P}^{({\mathbf z})}$, a meaningful target for empirical risk minimization.
- Stochastic algorithms: stochastic gradient descent runs a random experiment at each iteration, the draw of a subset of the training set; the bootstrap draws resamples of the training set.
- Privacy protection methods run a random experiment to perturb the outputs of a machine learning method, which is what differential privacy requires.

**See also:** outcome, sample space, event, [random variable](https://dictionaryofml.org/terms/rv.html), realization, probability, probability space, probability measure, [probability distribution](https://dictionaryofml.org/terms/probdist.html), probabilistic model, [independent and identically distributed](https://dictionaryofml.org/terms/iid.html), law of large numbers, central limit theorem.

## References

- Bertsekas and Tsitsiklis (2008). Introduction to Probability. *Athena Scientific*.
- Billingsley (1986). Probability and Measure. *Wiley*.
- Gray (2009). Probability, Random Processes, and Ergodic Properties. *Springer Science+Business Media*. <https://doi.org/10.1007/978-1-4419-1090-5>

## Cite this entry

```bibtex
@misc{dictml_randomexperiment,
  author = {Jung, Alexander},
  editor = {Olioumtsevits, Konstantina and Schnoor, Ekkehard},
  title = {random experiment},
  howpublished = {Dictionary of Applied Machine Learning (course edition)},
  year = {2026},
  doi = {10.5281/zenodo.21569296},
  note = {ISBN 978-952-64-3013-3, CC BY 4.0, retrieved 2026-11-11},
  url = {https://dictionaryofml.org/terms/randomexperiment.html}
}
```
