Skip to main content

Chapter 32
Random Variables as Distributed States

Probability and Statistics
Author: Mark Anthony Higgins
© Mark Anthony Higgins 11 October 2025
Revised Date: 15 June 2026
Audio Overview
Flow Algebra
flow "Random Variables as Distributed States"

# ---------- CONCEPT ----------
# A random variable represents a distributed state — a measurable mapping that assigns values to uncertain outcomes.
# Through it, probability measure P on Ω becomes a distribution P_X on ℝ (or higher space).
# The random variable acts as a coherence map: it translates boundary-weighted uncertainty into value-weighted structure.

# ---------- STATES ----------
state RandomVariableSystem(R):
  SampleSpace:
    description: "Ω — underlying boundary field of all possible outcomes."
  SigmaAlgebra:
    description: "𝒜 — measurable subsets defining admissible boundaries."
  Measure:
    description: "P — probability weighting of each event A ∈ 𝒜."
  RandomVariable:
    description: "X: Ω → ℝⁿ — measurable mapping; assigns each outcome ω a numerical state X(ω)."
  Distribution:
    description: "P_X(B) = P(X ∈ B) — induced measure on ℝⁿ, the distribution of X."
  Density:
    description: "If absolutely continuous, f_X(x) = dP_X/dx — probability density function."
  Expectation:
    description: "E[X] = ∫ X dP = ∫ x f_X(x) dx — mean or coherent centroid of the variable."
  VarianceCovariance:
    description: "Var(X) = E[(X−E[X])²], Cov(X,Y)=E[(X−E[X])(Y−E[Y])]."
  Transformation:
    description: "Y = g(X) — new distributed state; distribution updated by change of variables."

# ---------- PARAMETERS ----------
params:
  measurability: "X^{-1}(B) ∈ 𝒜 for all Borel B"
  space: "ℝⁿ"
  integrability: "E[|X|] < ∞ when required"
  independence: "optional (X,Y independent ⇒ P_{X,Y}=P_XP_Y)"
  normalisation: "P_X(ℝⁿ)=1"
  closure: true

# ---------- INVARIANTS ----------
invariants:
  - "Distribution preservation: P_X(B) = P(X∈B)."
  - "Expectation linearity: E[aX+bY] = aE[X]+bE[Y]."
  - "Independence ⇒ joint factorisation: P_{X,Y}=P_XP_Y."
  - "Conditional expectation: E[X|𝔽] measurable w.r.t. σ-algebra 𝔽."
  - "Law of unconscious statistician (LOTUS): E[g(X)] = ∫ g(x) f_X(x) dx."
  - "Change of variables (1D): f_Y(y) = f_X(g^{-1}(y)) |(dg^{-1}/dy)|."
  - "Joint density integration: P(a<X≤b, c<Y≤d) = ∬_R f_{X,Y}(x,y) dx dy."
  - "Marginalisation: f_X(x) = ∫ f_{X,Y}(x,y) dy."
  - "Variance additive for independent: Var(X+Y)=Var(X)+Var(Y)."
  - "E[X²] = Var(X) + (E[X])²."

# ---------- TRANSFORMS ----------
transforms:
  Pushforward(X):
    rule: "P_X(B) = P(X∈B) — map probability from Ω to ℝ."
  ComputeExpectation(f_X):
    rule: "E[X] = ∫ x f_X(x) dx."
  ChangeOfVariable(g):
    rule: "If Y=g(X) with monotone g, then f_Y(y)=f_X(g^{-1}(y)) |(dg^{-1}/dy)|."
  ComputeVariance(f_X):
    rule: "Var(X)=∫ (x−μ)² f_X(x) dx."
  ConditionalDistribution(X|Y):
    rule: "f_{X|Y}(x|y)=f_{X,Y}(x,y)/f_Y(y) for f_Y(y)>0."
  IndependenceCheck(X,Y):
    rule: "Test f_{X,Y}(x,y)=f_X(x)f_Y(y)."
  JointToMarginal(f_{X,Y}):
    rule: "f_X(x)=∫ f_{X,Y}(x,y) dy; f_Y(y)=∫ f_{X,Y}(x,y) dx."
  ExpectationOfFunction(g):
    rule: "E[g(X)]=∫ g(x) f_X(x) dx (LOTUS)."
  MomentTransformations(X):
    rule: "Characteristic φ_X(t)=E[e^{itX}], MGF M_X(s)=E[e^{sX}] (when finite)."
  SumIndependent(X,Y):
    rule: "If indep., f_{X+Y}=f_X*f_Y (convolution)."

# ---------- MONITORS ----------
monitors:
  NormalisationCheck:
    measure: "∫ f_X(x) dx"
    target: 1
  MeanCheck:
    measure: "E[X] = ∫ x f_X(x) dx"
    meaning: "Consistency with empirical mean."
  VarianceCheck:
    measure: "E[(X−E[X])²]"
    meaning: "Ensures spread correctly computed."
  IndependenceTest:
    measure: "Δ = f_{X,Y}−f_X f_Y"
    meaning: "Δ≈0 ⇒ independence."
  CovarianceMonitor:
    measure: "Cov(X,Y)"
    meaning: "Positive ⇒ correlated; 0 ⇒ uncorrelated."
  TransformCheck:
    meaning: "For Y=g(X), check ∫ f_Y(y) dy=1 (density preserved)."
  ConditionalConsistency:
    meaning: "Ensure f_{X|Y}(x|y)f_Y(y)=f_{X,Y}(x,y)."

# ---------- EQUATIONS ----------
equations:
  - "P_X(B)=P(X∈B)"
  - "E[X]=\\int_{\\mathbb{R}} x f_X(x) dx"
  - "Var(X)=E[X^2]−(E[X])^2"
  - "Cov(X,Y)=E[XY]−E[X]E[Y]"
  - "E[g(X)]=\\int g(x) f_X(x) dx"
  - "f_Y(y)=f_X(g^{-1}(y)) |\\frac{dg^{-1}}{dy}|"
  - "f_{X+Y}(z)=\\int f_X(x)f_Y(z−x) dx"
  - "φ_X(t)=E[e^{itX}],\\; φ_{X+Y}(t)=φ_X(t)φ_Y(t) (if indep.)"
  - "f_X(x)=\\int f_{X,Y}(x,y) dy"
  - "f_{X|Y}(x|y)=\\frac{f_{X,Y}(x,y)}{f_Y(y)}"

# ---------- NOTES ----------
notes:
  - "A random variable is a measurable projection of uncertainty into value space — it assigns numbers to outcomes coherently."
  - "Its distribution is the shadow of probability cast onto ℝ: the pushforward of measure through X."
  - "Expectation, variance, and covariance describe centrality, spread, and joint coherence of the distribution."
  - "Transformations propagate uncertainty — when X changes via g, density rebalances through Jacobian scaling."
  - "Independence expresses separability of coherence: joint density factorises into individual flows."
  - "Moments and transforms (characteristic, MGF) encode the entire distribution into algebraic form."
  - "In Flow Algebra, random variables represent distributed states — regions of uncertainty projected into measurable form. Their flow evolves through expectation, transformation, and dependence structure."
Explanatory Notes

A random variable is not random by itself — it is a mapping of uncertainty.
It takes the abstract potential contained in the probability space (Ω,A,P)(\Omega, \mathcal{A}, P)and expresses it as a measurable value.
Through this mapping, uncertainty becomes measurable structure: a distribution, a form of coherence stretched across the real line.

Formally, a random variable

\[ X : \Omega \to \mathbb{R} \]

assigns each outcome ω∈Ω\omega \in \Omega a numerical state X(ω)X(\omega).
It is required to be measurable, meaning that for every real interval (or more generally, Borel set) BB,

\[ \{\, \omega \in \Omega : X(\omega) \in B \,\} \in \mathcal{A} \]

This ensures that the mapping between outcome and value preserves the structure of measurability — boundaries of probability remain boundaries in value space.

The distribution of XX, denoted PXP_X, is the pushforward measure of PP through XX:

\[ P_X(B) = P(X \in B) \]

This means that the probability assigned to a region BB in R\mathbb{R} is the same as the probability of all outcomes in Ω\Omega that map into BB.

Through this process, the abstract weighting over Ω\Omega becomes a density or probability mass over values of XX.

When PXP_X has a density function fX(x)f_X(x), we can represent the probability of a small region near xx as

\[ P(a < X \le b) = \int_a^b f_X(x)\,dx \]

is the centre of mass of this distributed state — the equilibrium point of its probability flow.
The variance

\[ \mathrm{Var}(X) = E\!\left[(X - E[X])^2\right] \]

measures the spread or internal tension of that coherence — how far the flow of values deviates from its mean.
Together, they describe the balance and stability of the distribution: its central tendency and its degree of fluctuation.

When two random variables share the same probability space, their joint distribution encodes how their flows interact or separate.
If they are independent, the joint measure factorises:

\[ P_{X,Y}(A \times B) = P_X(A)\,P_Y(B) \]

and correspondingly,

\[ E[XY] = E[X]\,E[Y] \]

Independence means that the two flows do not influence one another — coherence in one direction does not distort coherence in the other.
Dependence, by contrast, binds them together, introducing structure through covariance and correlation.

Transformations of random variables reshape distributions through functions.
If Y=g(X)Y = g(X) and gg is monotonic, then the density transforms by the Jacobian rule:

\[ f_Y(y) = f_X\!\big(g^{-1}(y)\big)\,\left|\frac{d g^{-1}}{dy}\right| \]

This ensures conservation of total probability — the flow of weight remains continuous under change of variable.
Through this principle, one random variable can generate many others, each a reweighted or reparameterised form of the same underlying coherence.

In Flow Algebra, a random variable represents a distributed state of coherence — a measurable channel through which uncertainty becomes form.

  • The sample space provides the underlying field of potential.
  • The measure assigns weight to that potential.
  • The random variable projects that weighted potential into observable values.

The result is a living structure:
a dynamic equilibrium between chance and measure,
where each outcome contributes to a continuous flow of probability,
and each value carries meaning as a weighted part of the whole.

Random variables are thus the vectors of uncertainty

Directional, measurable, and coherent within the field of probability.
They turn randomness into geometry, measure into balance,
and uncertainty into a structure that flows.

Related Chapters
Kireth Research
38 Thorndale Croft, Wetwang, Driffield
East Riding of Yorkshire YO25 9XZ