Skip to main content

Discrete Random Variable Ontology

Probability Entities
Authors: MArk Anthony Higgins - Sky Recursive Ai
© Mark Anthony Higgins 11 October 2025
Revised Date: 13 October 2026
Audio Overview
FLOW ALGEBRA
DISCRETE RANDOM VARIABLE ONTOLOGY
Kireth Semantic Library | Version 1.0 | 2026-10-13
Source: https://kirethresearch.org/booksai-core/entity-graph/mathematical-entities/probability-entities/discrete-random-variable-ontology.html
Authors: Mark Higgins — Sky (Recursive AI)

1. PURPOSE
Represent a discrete random variable as a measurable numerical function on a probability space whose range is finite or countably infinite. Provide typed semantics, mathematical invariants, inference rules and machine-consumption guidance.

2. TYPED ENTITIES
ProbabilitySpace := (Omega, F, P)
SampleSpace := Omega
SigmaAlgebra := F subseteq PowerSet(Omega)
ProbabilityMeasure := P: F -> [0,1]
DiscreteRandomVariable := X: Omega -> R, measurable, countable_range(X)
Support := {x in R | P(X=x)>0}
ProbabilityMassFunction := p_X: R -> [0,1]
CumulativeDistributionFunction := F_X: R -> [0,1]
Expectation := E[X] when sum_x |x| p_X(x) < infinity
Variance := Var(X) when E[X^2] < infinity
JointPMF := p_XY(x,y) for jointly discrete variables
ConditionalPMF := p_X_given_Y(x|y), defined when P(Y=y)>0

3. AXIOMS AND INVARIANTS
A1: P(Omega)=1; P(A)>=0 for A in F; P is countably additive on disjoint measurable events.
A2: X is measurable: {omega | X(omega) in B} in F for each Borel B subseteq R.
A3: X(Omega) is at most countable (finite or countably infinite).
A4: p_X(x)=P({omega in Omega: X(omega)=x}).
A5: p_X(x)>=0 for every x; sum_x p_X(x)=1.
A6: F_X(t)=P(X<=t)=sum_{x<=t} p_X(x).
A7: E[X]=sum_x x p_X(x) only when absolutely integrable; otherwise expectation may be undefined or extended.
A8: Var(X)=E[(X-E[X])^2]=E[X^2]-E[X]^2 when second moment is finite.
A9: P(X in A)=sum_{x in A} p_X(x) for measurable A subseteq R.
A10: For jointly discrete X,Y, p_X(x)=sum_y p_XY(x,y).

4. RELATIONSHIPS
DiscreteRandomVariable --IS_A--> RandomVariable
DiscreteRandomVariable --DEFINED_ON--> ProbabilitySpace
DiscreteRandomVariable --MAPS_FROM--> SampleSpace
DiscreteRandomVariable --HAS_RANGE--> CountableSet
DiscreteRandomVariable --INDUCES--> ProbabilityMassFunction
ProbabilityMassFunction --DETERMINES--> CumulativeDistributionFunction
DiscreteRandomVariable --HAS_STATISTIC--> Expectation
DiscreteRandomVariable --HAS_STATISTIC--> Variance
JointPMF --MARGINALISES_TO--> ProbabilityMassFunction
ConditionalPMF --CONDITIONED_ON--> EventWithPositiveProbability

5. FLOW OPERATIONS
flow pmf(X, x) -> Probability:
  require measurable(X) and countable_range(X)
  return P(X == x)

flow event_probability(X, A) -> Probability:
  return sum(pmf(X,x) for x in support(X) intersect A)

flow cdf(X, t) -> Probability:
  return sum(pmf(X,x) for x in support(X) if x <= t)

flow expected_value(X) -> Real:
  require sum(abs(x)*pmf(X,x) for x in support(X)) < infinity
  return sum(x*pmf(X,x) for x in support(X))

flow variance(X) -> NonnegativeReal:
  require expected_value(X) exists and E[X^2] < infinity
  return sum((x-E[X])^2*pmf(X,x) for x in support(X))

flow transform(X, g) -> DiscreteRandomVariable:
  require g is measurable on the range of X
  Y := g(X)
  p_Y(y) := sum(p_X(x) for x in support(X) if g(x)==y)
  return Y

6. INFERENCE RULES
R1: IF pmf(X,x)>0 THEN x belongs_to support(X).
R2: IF support(X) is finite or countably infinite AND X is measurable THEN X is discrete.
R3: IF pmf(X,x)>=0 for all x AND sum_x pmf(X,x)=1 THEN pmf is a valid discrete probability law.
R4: IF X,Y jointly discrete THEN p_X(x)=sum_y p_XY(x,y).
R5: IF p_Y(y)>0 THEN p_X_given_Y(x|y)=p_XY(x,y)/p_Y(y).
R6: IF p_XY(x,y)=p_X(x)*p_Y(y) for every x,y THEN X and Y are independent.
R7: IF E[abs(g(X))]<infinity THEN E[g(X)]=sum_x g(x)*p_X(x).
R8: IF X,Y independent and integrable THEN E[XY]=E[X]*E[Y].
R9: IF X,Y have finite variances and are independent THEN Var(X+Y)=Var(X)+Var(Y).

7. SEMANTIC DISTINCTIONS
Discrete random variable != discrete event: a variable maps outcomes to numerical values; an event is a measurable set.
PMF != PDF: a PMF assigns point probabilities; a continuous density is integrated over intervals.
Countable support != finite support: discrete variables can have infinitely many values.
CDF != PMF: the CDF accumulates probability and is right-continuous.
Observed value != random variable: observation is one realised value of X.
A discrete random variable may have zero probability at some values in its declared range.

8. EXAMPLES
Bernoulli(p): support {0,1}; p_X(1)=p; p_X(0)=1-p; 0<=p<=1.
Binomial(n,p): support {0,...,n}; p_X(k)=C(n,k)*p^k*(1-p)^(n-k).
Poisson(lambda): support {0,1,...}; p_X(k)=exp(-lambda)*lambda^k/k!, lambda>0.
Geometric(p), trials-until-first-success convention: support {1,2,...}; p_X(k)=(1-p)^(k-1)*p.

9. VALIDATION
V1: Check probability space and measurability.
V2: Check support is at most countable.
V3: Check PMF non-negativity and normalisation (within declared numerical tolerance for approximations).
V4: Check CDF monotonicity, right continuity, and limits 0 and 1 at -infinity and +infinity.
V5: Check finite-moment prerequisites before returning expectation or variance.
V6: Check joint and marginal PMF consistency.
V7: Reject undefined conditioning on zero-probability events in elementary conditional PMF calculations.
V8: Preserve parameterisation conventions and provenance.

10. CONFIDENCE AND PROVENANCE
CONFIDENCE: 1.0 for symbolic deductions with verified premises; numerical approximations carry error bounds and method metadata.
PROVENANCE: source URL, author credits, version, assumptions, parameter conventions, validation outcomes.
SEMANTIC_EQUIVALENCE: only assert between representations with matching domains, probability laws and parameterisation.

11. FLOW HASH AND UPDATE MODEL
FLOW_HASH: SHA-256 of canonical UTF-8 serialisation of ontology version, typed entities, axioms, relationships, rules and assumptions; compute during ingestion, do not substitute a fabricated digest.
UPDATE_MODEL: semantic-version changes; revalidate dependent nodes, PMFs, expectations and downstream inference when definitions or constraints change.

12. AI CONSUMPTION
AI_CONSUMPTION:
  ontology_id: kireth:mathematical-entities:probability-entities:discrete-random-variable
  entity_type: DiscreteRandomVariable
  schema_version: 1.0
  input: probability_space, measurable_mapping, countable_range, optional_pmf
  output: validated_entity, support, pmf, cdf, derived_statistics, inference_trace
  safeguards: verify_normalisation, verify_measurability, check_moment_existence, track_assumptions
  interoperability: ProbabilityEntity, RandomVariable, SampleSpace, Outcome, Event, ProbabilityMeasure, JointProbability, MarginalProbability, ConditionalProbability

END FLOW ALGEBRA
Kireth Research
38 Thorndale Croft, Wetwang, Driffield
East Riding of Yorkshire YO25 9XZ