Reference · The Applied Higher-Order Functions catalogue
rainbow.algorithms.proofs.ahof.monte-carlo
AHoF V26 worked direct Monte Carlo failure-probability estimation. Four sample outcomes -- one failure and three successes -- give an empirical failure frequency of exactly 1/4. Scope (measured by the kernel): this module has 3 worked instances (statements about specific values). None of its theorems is a guarantee about the algorithm for all inputs; `lein verify rainbow.algorithms.proofs.ahof.monte-carlo` prints this classification.
ahof-v26/samples
ahof-v26/samples : → List data/Bool
List = data/List
ahof-v26/estimate
ahof-v26/estimate : → ℚ≥0
ℚ≥0 = nnrat/NonnegativeRational
ahof-v26/count-is-one
ahof-v26/count-is-one : → estimation/failure-count ahof-v26/samples = 1
= = equality/Eq
ahof-v26/estimate-is-quarter
ahof-v26/estimate-is-quarter : → ahof-v26/estimate = 1/4
= = nnrat/equivalent: equality of rational values
ahof-v26/monte-carlo
ahof-v26/monte-carlo : → proposition/conjunction (estimation/failure-count ahof-v26/samples = 1) (ahof-v26/estimate = 1/4)
= = nnrat/equivalent: equality of rational values