Skip to content
Rainbow docs menu

Reference · The Applied Higher-Order Functions catalogue

rainbow.algorithms.proofs.ahof.monte-carlo

The Applied Higher-Order Functions cataloguesrc/rainbow/algorithms/proofs/ahof/monte_carlo.clj2 definitions, 3 theorems

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

DefinitionSource, line 55

ahof-v26/samples :
  → List data/Bool

List = data/List

ahof-v26/estimate

DefinitionSource, line 63

ahof-v26/estimate :
  → ℚ≥0

ℚ≥0 = nnrat/NonnegativeRational

ahof-v26/count-is-one

TheoremWorked exampleNo axiomsSource, line 73

ahof-v26/count-is-one :
  → estimation/failure-count ahof-v26/samples = 1

= = equality/Eq

ahof-v26/estimate-is-quarter

TheoremWorked exampleNo axiomsSource, line 80

ahof-v26/estimate-is-quarter :
  → ahof-v26/estimate = 1/4

= = nnrat/equivalent: equality of rational values

ahof-v26/monte-carlo

TheoremWorked exampleNo axiomsSource, line 89

ahof-v26/monte-carlo :
  → proposition/conjunction (estimation/failure-count ahof-v26/samples = 1) (ahof-v26/estimate = 1/4)

= = nnrat/equivalent: equality of rational values