Dictionary of Applied Machine Learning: 151 machine-learning terms, each with a definition, a figure, citations and a Python demo · All terms · Demos · Start here

random experiment

Updated on 2026-11-23

Readiness 100/100

▶ Run the Python demo Open in Colab Typeset PDF LaTeX source Markdown Cite this entry

See also random variable probability distribution independent and identically distributed

A random experiment is a physical or computational data-generating 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 $\sigma$-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 (RV), 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 (i.i.d.) RVs. In machine learning (ML), the construction of a training set, the draw of a subset of it by stochastic gradient descent (SGD), and the noise added for differential privacy (DP) are random experiments.

Figure produced by the Python demo of the entry random experiment
Figure written by the entry's Python demo randomexperiment.py, which recomputes what the entry states: the script block by block · open in Colab

Definition

B-januaryThe weather station Krems an der Donau (Austria) records the air temperature at $06{:}00$ and at $15{:}00$ (UTC) of every day (Fig. 1). On any given day neither temperature is known in advance, but the range they can take is. A process of that kind is a random experiment: it 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. Here one day is one run: the outcome $\omega$ is the weather of that day, and the two recorded temperatures are measurements of it.

Figure 1 of the entry randomexperiment
Figure 1: The air temperature at $15{:}00$ (solid stems, filled circles) and at $06{:}00$ (UTC) (dotted stems, open circles) of every day of January 2023 at the weather station Krems an der Donau (Austria). Each day is one run of the same random experiment: the outcome is the weather of that day, and the two temperatures are measurements of it. The month as a whole can instead be read as a single random experiment, whose outcome is the ordered list of the $31$ daily outcomes. Data generated by pythondemos/randomexperiment.py
Probability theory represents a random experiment by a probability space $(\Omega,\, \Sigma,\, \mathbb{P})$ (Bertsekas and Tsitsiklis, 2008, Sect. 1.2; Billingsley, 1986, Sect. 2). The sample space $\Omega$ collects the possible outcomes $\omega \in \Omega$. The $\sigma$-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. The triple $(\Omega,\, \Sigma,\, \mathbb{P})$ is a probabilistic model of the process, not a property of it. There are principled methods for choosing a useful probabilistic model $(\Omega,\, \Sigma,\, \mathbb{P})$ based on the observed data.

Rolling a die is a random experiment small enough to write the triple out. Its sample space is $\Omega = \{1, \ldots, 6\}$. Its $\sigma$-algebra $\Sigma$ is the collection of all subsets of $\Omega$: that the roll is even is the event $\mathcal{A} = \{2,4,6\}$. The uniform probability measure, $\mathbb{P}\left(\mathcal{A}\right) = |\mathcal{A}| / 6$, is the model of a fair die, under which $\mathbb{P}\left(\{2,4,6\}\right) = 1/2$. Whether a given die is fair is a question about the process rather than about the model, answered by the relative frequencies of its outcomes in many rolls.

The observed data are measurements of the outcome of the experiment. In particular, each measurement is a measurable function $x : \Omega \to \mathcal{X}$ of the outcome. Such a measurable function is a random variable (RV), and the value $x(\omega)$ it takes for the actual outcome $\omega$ is a realization of it (Billingsley, 1986; Gray, 2009). The temperature at 13:00 is an RV on the weather of a day, and the number read on one day is a realization.

B-repeatThe probability measure on $\Omega$ induces the probability distribution of the RV, $\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). Fig. 2 shows the process beside its mathematical representation: the experiment, its outcome and the measured value above, the probability space and the RV that represent them below.

Figure 2 of the entry randomexperiment
Figure 2: A random experiment and its mathematical representation. The upper row is the process, the lower row the model, as the labels at the left mark. Boxed items are objects, the experiment, the probability space and the RV; unboxed items are the values they produce. Solid arrows stay within one row; the dashed arrows cross from the process to its model. The process produces an outcome $\outcome$; a measurement of that outcome is a measurable function $\feature$ on $\samplespace$, an RV, and the value $\feature(\outcome)$ it takes is a realization. The probability distribution $\distof{\feature}$ of $\feature$ is induced by $\prob{\cdot}$
Repeating a random experiment $(\Omega,\, \Sigma,\, \mathbb{P})$ a fixed number $m$ of times, under identical conditions, defines a new random experiment $(\Omega,\, \Sigma,\, \mathbb{P})^{(m)}$ whose outcomes are sequences $(\omega^{(1)}, \ldots, \omega^{(m)})$ of outcomes of the original one (Fig. 3). Its sample space is the product $\Omega^{(m)} = \Omega \times \cdots \times \Omega$, and its probability measure is the product $\mathbb{P}^{(m)} = \mathbb{P} \times \cdots \times \mathbb{P}$. The measurements $x^{(1)}, \ldots, x^{(m)}$ of the runs are then independent and identically distributed (i.i.d.) RVs (Billingsley, 1986, Sect. 20). In machine learning (ML) these measurements are the data points ${\mathbf z}^{(1)}, \ldots, {\mathbf z}^{(m)}$ of a training set. While the outcome of a single experiment is uncertain, the long-run behavior of repeated experiments becomes predictable: the law of large numbers and the central limit theorem (CLT) make this precise (Bertsekas and Tsitsiklis, 2008, Sects. 5.2 and 5.4).
Figure 3 of the entry randomexperiment
Figure 3: Repeating a random experiment $\probspace$ a fixed number $\samplesize$ of times yields another random experiment $\probspacerep{\samplesize}$ whose outcomes are sequences $(\outcome^{(1)}, \,\outcome^{(2)}, \,\dots, \,\outcome^{(\samplesize)}) \in \samplespace\times\ldots\times \samplespace$. One random experiment arising in many ML applications is the gathering of a training set $\datapoint^{(1)},\,\ldots,\,\datapoint^{(\samplesize)}$, whose data points are RVs on the repeated runs. Boxes and arrows follow Fig. 2
The notion of a repeated experiment is an idealization that might result in a poor probabilistic model for a physical or computational data-generating process. Successive rolls of a die can typically be considered a repeated experiment. In contrast, the daily weather observations shown in Fig. 1 are not well represented as the result of a repeated experiment: a warm day tends to follow a warm day, so the daily readings are related rather than independent. The autocorrelation of such a record measures that relation (Brockwell and Davis, 1991, Sect. 1.5; Hyndman and Athanasopoulos, 2021).

B-mlRandom experiments arise in ML in three places:

See also: outcome, sample space, event, random variable, realization, probability, probability space, probability measure, probability distribution, probabilistic model, independent and identically distributed, law of large numbers, central limit theorem, autocorrelation.

References

  1. Bertsekas and Tsitsiklis (2008). Introduction to Probability. Athena Scientific.
  2. Billingsley (1986). Probability and Measure. Wiley.
  3. Gray (2009). Probability, Random Processes, and Ergodic Properties. Springer Science+Business Media. doi.org/10.1007/978-1-4419-1090-5
  4. Brockwell and Davis (1991). Time Series: Theory and Methods. Springer-Verlag.
  5. Hyndman and Athanasopoulos (2021). Forecasting: Principles and Practice. OTexts. otexts.com/fpp3/

Cite this entry

@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-26},
  url = {https://dictionaryofml.org/terms/randomexperiment.html}
}