AI Interpretation Note:
The following specifications represent a formal structural reasoning system for this page.
Execute as formal rules, not pseudocode.
FLOW ALGEBRA
TITLE: Probability Mass Function Ontology
DOMAIN: Discrete Mathematics / Discrete Probability
SOURCE_URL: https://kirethresearch.org/booksai-core/discrete-mathematics-ontologies/discrete-probability/probability-mass-function-ontology.html
VERSION: 1.0
AUTHORS: Mark Higgins — Sky (Recursive AI)
SITE: https://kirethresearch.org
SOURCE_STATUS: Formal mathematical synthesis; live page not independently verified.
1. PURPOSE
Represent a probability mass function (PMF) as a typed mapping from the countable support of a discrete random variable to nonnegative real probabilities, with normalisation, event probability, transformations, validation and machine-consumption rules.
2. TYPED ENTITIES
ProbabilitySpace := (Omega: Set[Outcome], F: SigmaAlgebra[Omega], P: ProbabilityMeasure)
DiscreteRandomVariable[X] := measurable function X: Omega -> S, with S finite or countable
ValueSpace := S: CountableSet
PMF[X] := p_X: S -> RealNonnegative
Support[X] := {x in S | p_X(x) > 0}
Event := A subseteq S
CDF[X] := F_X(t) = sum_{x in S, x <= t} p_X(x), for ordered numeric S
Expectation[X] := sum_{x in S} x*p_X(x), if absolutely integrable
Variance[X] := E[(X-E[X])^2], when finite
JointPMF[X,Y] := p_XY(x,y)
ConditionalPMF[X|Y=y] := p_XY(x,y)/p_Y(y), when p_Y(y)>0
3. CORE SEMANTICS
PMF_DEFINITION: p_X(x) := P({omega in Omega : X(omega)=x}).
NONNEGATIVITY: forall x in S, p_X(x) >= 0.
NORMALISATION: sum_{x in S} p_X(x) = 1.
EVENT_PROBABILITY: P(X in A) = sum_{x in A} p_X(x).
SUPPORT: x in Support[X] iff p_X(x)>0.
ZERO_OUTSIDE_SUPPORT: x notin Support[X] implies p_X(x)=0.
COUNTABLE_ADDITIVITY: For pairwise disjoint A_i subseteq S, P(X in union_i A_i) = sum_i P(X in A_i).
4. FLOW OPERATIONS
flow PMF_FROM_RANDOM_VARIABLE(X, P) -> p_X:
require X discrete and P probability measure
for each x in S: p_X(x) := P(X=x)
ensure nonnegative(p_X) and sum(p_X)=1
flow EVENT_PROBABILITY(p_X, A) -> probability:
require A subseteq S
return sum_{x in A} p_X(x)
flow TRANSFORM_PMF(p_X, g: S -> T) -> p_Y:
for each y in T: p_Y(y) := sum_{x in S: g(x)=y} p_X(x)
ensure sum_y p_Y(y)=1
flow MARGINALISE(p_XY) -> (p_X,p_Y):
p_X(x) := sum_y p_XY(x,y)
p_Y(y) := sum_x p_XY(x,y)
flow CONDITION(p_XY, y) -> p_X_given_y:
require p_Y(y)>0
p_X_given_y(x) := p_XY(x,y)/p_Y(y)
flow EXPECTATION(p_X, h) -> result:
require sum_x |h(x)|*p_X(x) < infinity
return sum_x h(x)*p_X(x)
5. MATHEMATICAL IDENTITIES
COMPLEMENT: P(X notin A)=1-P(X in A).
UNION: P(X in A union B)=P(X in A)+P(X in B)-P(X in A intersect B).
CDF_FROM_PMF: F_X(t)=sum_{x<=t} p_X(x).
INDEPENDENCE: X independent Y iff p_XY(x,y)=p_X(x)*p_Y(y) for all x,y.
TOTAL_PROBABILITY: p_X(x)=sum_y p_X_given_y(x)*p_Y(y), using terms with p_Y(y)>0.
BAYES: p_Y_given_x(y)=p_X_given_y(x)*p_Y(y)/p_X(x), when p_X(x)>0.
6. EXAMPLE MODELS
BERNOULLI: S={0,1}; p(1)=q; p(0)=1-q; 0<=q<=1.
BINOMIAL: p(k)=C(n,k)*q^k*(1-q)^(n-k), k=0,...,n; n>=0; 0<=q<=1.
POISSON: p(k)=exp(-lambda)*lambda^k/k!, k=0,1,...; lambda>0.
FINITE_UNIFORM: p(x)=1/n for x in S, |S|=n>=1.
7. INFERENCE RULES
R1: ValidPMF(p_X) and A subseteq S => 0<=P(X in A)<=1.
R2: ValidPMF(p_X) and disjoint(A,B) => P(X in A union B)=P(X in A)+P(X in B).
R3: ValidPMF(p_X) and g deterministic => ValidPMF(TRANSFORM_PMF(p_X,g)).
R4: ValidJointPMF(p_XY) => ValidPMF(MARGINALISE(p_XY).p_X).
R5: ValidJointPMF(p_XY) and p_Y(y)>0 => ValidPMF(CONDITION(p_XY,y)).
R6: PMF equality pointwise on S => equality of induced discrete distributions.
8. SEMANTIC RELATIONSHIPS
ProbabilityMassFunction --IS_A--> DiscreteProbabilityDistributionRepresentation
ProbabilityMassFunction --DESCRIBES--> DiscreteRandomVariable
ProbabilityMassFunction --ASSIGNS_PROBABILITY_TO--> OutcomeValue
ProbabilityMassFunction --NORMALISED_OVER--> ValueSpace
ProbabilityMassFunction --DETERMINES--> CumulativeDistributionFunction
JointProbabilityMassFunction --MARGINALISES_TO--> ProbabilityMassFunction
ProbabilityMassFunction --SUPPORTS--> Expectation
ProbabilityMassFunction --SUPPORTS--> ConditionalProbability
9. VALIDATION
V1: Reject negative or non-finite mass values.
V2: Check normalisation: abs(sum_x p_X(x)-1)<=tolerance for finite numerical representations.
V3: For infinite support, require a mathematical convergence argument; finite truncation alone does not prove normalisation.
V4: Reject conditional PMF requests when conditioning probability equals zero.
V5: Validate type and support membership for each x.
V6: Distinguish probability mass from probability density; p_X(x) is a point probability for discrete X.
V7: Missing or approximate probability entries must be explicitly flagged.
10. SEMANTIC_EQUIVALENCE
PMF(X) == LAW(X) on a discrete value space, where LAW(X) denotes the induced probability measure represented by singleton masses.
P(X=x) == p_X(x).
Two PMFs are semantically equivalent iff they assign equal mass to every value after compatible support alignment.
Do not equate equal support with equal probability distribution.
11. CONFIDENCE
FORMAL_THEOREM: 1.00 when assumptions are satisfied and derivation verified.
NUMERICAL_RESULT: confidence depends on numerical precision, truncation bounds and source quality.
EMPIRICAL_ESTIMATE: report sample size, estimator, uncertainty and provenance; never label an estimate as an exact theorem.
12. FLOW_HASH
CANONICALISE: UTF-8; stable field ordering; canonical mathematical notation; preserve assumptions and domain restrictions.
FLOW_HASH := SHA256(canonical_serialisation(flow_version, definitions, rules, constraints, provenance)).
Note: FLOW_HASH is a specification; no precomputed digest is asserted here.
13. UPDATE_MODEL
ON_SOURCE_CHANGE: compare definitions, assumptions, examples and dependencies; increment version; regenerate hash; revalidate rules.
ON_NEW_DISTRIBUTION: verify support, normalisation and parameter restrictions before insertion.
ON_CORRECTION: retain provenance and prior version reference; invalidate affected downstream results.
14. AI_CONSUMPTION
INPUT: typed probability space, discrete random variable or candidate PMF, optional events/transformations.
PROCESS: parse -> type-check -> verify axioms -> execute symbolic/numeric operations -> validate -> annotate provenance/confidence.
OUTPUT: validated PMF, derived probabilities, explicit assumptions, errors, traceable inference steps and canonical hash when computed.
SAFETY: do not infer a PMF from unsupported observations or confuse estimated frequencies with guaranteed probabilities.
END FLOW ALGEBRA