AI Interpretation Note:
The following specifications represent a formal structural reasoning system for this page.
Execute as formal rules, not pseudocode.
FLOW ALGEBRA
TITLE: Binomial Distribution Ontology
DOMAIN: Discrete Mathematics / Discrete Probability
SOURCE_URL: https://kirethresearch.org/booksai-core/discrete-mathematics-ontologies/discrete-probability/binomial-distribution-ontology-2.html
VERSION: 1.0
LANGUAGE: en-GB
AUTHORS: Mark Higgins — Sky (Recursive AI)
SITE: https://kirethresearch.org
SOURCE_STATUS: Mathematical synthesis; live page not independently verified.
1. ONTOLOGY
flow "BinomialDistributionOntology" v1.0
entity BinomialDistribution <: DiscreteProbabilityDistribution
entity BernoulliTrial
entity TrialCount : Integer
entity SuccessProbability : Real
entity SuccessCount : Integer
entity ProbabilityMass : Real
entity RandomVariable
entity Event
entity Expectation : Real
entity Variance : Real
entity CumulativeProbability : Real
2. TYPES AND CONSTRAINTS
params:
n: Integer where n >= 0
p: Real where 0 <= p <= 1
k: Integer where 0 <= k <= n
q: Real = 1 - p
X: RandomVariable with support {0, 1, ..., n}
assumptions:
- n fixed trials
- each trial has two outcomes: success or failure
- trials are mutually independent
- success probability p is constant across trials
- X counts successes
3. SEMANTIC RELATIONSHIPS
BinomialDistribution IS_A DiscreteProbabilityDistribution
BinomialDistribution MODELS SuccessCount
BinomialDistribution REQUIRES BernoulliTrial
BinomialDistribution PARAMETER n TrialCount
BinomialDistribution PARAMETER p SuccessProbability
SuccessCount HAS_SUPPORT IntegersFromZeroToN
BinomialDistribution HAS_PMF BinomialPMF
BinomialDistribution GENERALISES BernoulliDistribution when n=1
BinomialDistribution RELATES_TO BinomialCoefficient
4. CORE FLOW OPERATIONS
operation choose(n,k):
precondition: 0 <= k <= n
result: n! / (k! * (n-k)!)
operation pmf(n,p,k):
precondition: n>=0 and 0<=p<=1 and 0<=k<=n
result: choose(n,k) * p^k * (1-p)^(n-k)
convention: 0^0 = 1 in endpoint probability evaluation
operation cdf(n,p,k):
result: sum(pmf(n,p,j), j=0..min(n,floor(k)))
boundary: k<0 => 0; k>=n => 1
operation survival(n,p,k):
meaning: P(X>k)
result: 1-cdf(n,p,k)
operation expectation(n,p): result n*p
operation variance(n,p): result n*p*(1-p)
operation standard_deviation(n,p): result sqrt(n*p*(1-p))
operation probability_generating_function(n,p,z): result (1-p+p*z)^n
operation moment_generating_function(n,p,t): result (1-p+p*exp(t))^n
5. ALGEBRAIC LAWS
NORMALISATION: sum(pmf(n,p,k), k=0..n) = 1
NONNEGATIVITY: pmf(n,p,k) >= 0
SYMMETRY: pmf(n,p,k) = pmf(n,1-p,n-k)
MEAN: E[X] = n*p
VARIANCE: Var(X) = n*p*(1-p)
ADDITIVITY: if X~Bin(n,p), Y~Bin(m,p), independent, then X+Y~Bin(n+m,p)
BERNOULLI_CASE: Bin(1,p) = Bernoulli(p)
ZERO_TRIALS: Bin(0,p) has P(X=0)=1
DEGENERATE_ZERO: Bin(n,0) has P(X=0)=1
DEGENERATE_ONE: Bin(n,1) has P(X=n)=1
RECURRENCE: for 0<p<1 and 0<=k<n, pmf(k+1)/pmf(k) = ((n-k)/(k+1))*(p/(1-p))
MODE: floor((n+1)*p) is a mode; if (n+1)*p is an integer in [1,n], the preceding integer is also a mode
6. INFERENCE RULES
rule BINOMIAL_CLASSIFICATION:
IF fixed_n AND independent_binary_trials AND constant_success_probability
THEN X~Binomial(n,p)
rule EXACT_COUNT:
IF X~Binomial(n,p) AND k in support
THEN P(X=k)=choose(n,k)*p^k*(1-p)^(n-k)
rule AT_LEAST:
IF X~Binomial(n,p)
THEN P(X>=k)=1-P(X<=k-1)
rule AT_MOST:
IF X~Binomial(n,p)
THEN P(X<=k)=cdf(n,p,k)
rule COMPLEMENT_COUNT:
IF X~Binomial(n,p)
THEN n-X~Binomial(n,1-p)
rule SUM_INDEPENDENT:
IF X~Binomial(n,p) AND Y~Binomial(m,p) AND independent(X,Y)
THEN X+Y~Binomial(n+m,p)
7. VALIDATION
check parameter_domain: n integer >=0 and p in [0,1]
check support: X only takes integers 0..n
check pmf_nonnegative: all pmf values >=0
check pmf_normalisation: sum probabilities approximately 1 with numerical tolerance
check moments: expected_mean=n*p and expected_variance=n*p*(1-p)
check assumptions: independence and constant p are required for standard binomial model
check counterexample: sampling without replacement with changing success probability is generally hypergeometric, not binomial
check numerical_stability: use log-gamma/log-PMF or stable library methods for large n
8. WORKED EXAMPLE
input: n=5, p=0.4, k=2
choose(5,2)=10
P(X=2)=10*(0.4)^2*(0.6)^3=0.3456
E[X]=2
Var(X)=1.2
9. SEMANTIC_EQUIVALENCE
"binomial random variable" EQUIVALENT_TO "number of successes in n independent identically distributed Bernoulli trials"
"probability of exactly k successes" EQUIVALENT_TO "binomial PMF at k"
"cumulative probability through k" EQUIVALENT_TO "P(X<=k)"
NOT_EQUIVALENT: BinomialDistribution != BernoulliDistribution unless n=1
NOT_EQUIVALENT: BinomialDistribution != HypergeometricDistribution generally
10. CONFIDENCE
mathematical_definitions: 1.00
established_identities: 1.00
application_fit: conditional_on_assumptions
source_page_alignment: unverified
11. FLOW_HASH
hash_algorithm: SHA-256
hash_scope: canonical UTF-8 representation of this flow, excluding the computed hash field
hash_value: compute_on_ingestion
12. UPDATE_MODEL
versioning: semantic-versioning
update_trigger: corrected theorem, expanded scope, new validated relation, or source revision
integrity_policy: preserve provenance and recalculate FLOW_HASH after any change
13. AI_CONSUMPTION
input: {n:int, p:float, query:str, k:int?}
output: {distribution:"Binomial", result:number?, assumptions:list, validation:list, confidence:object}
reasoning_policy:
- verify model assumptions before applying formulas
- distinguish exact, cumulative, and tail probabilities
- enforce integer support and parameter bounds
- report numerical approximation when used
- never treat a probability model as empirical proof of independence
END FLOW ALGEBRA