Skip to content
Rainbow docs menu

Reference · Foundations

rainbow.math.monte-carlo-estimation

Foundationssrc/rainbow/math/monte_carlo_estimation.clj3 definitions, 3 theorems

Direct Monte Carlo estimation of a failure probability. Given a finite list of sample outcomes (a boolean flag per sample, true = failure), the empirical failure frequency is the count of failures over the sample size, an exact rational. The count reduces a boolean indicator over the list; the estimate is a nonnegative rational.

estimation/nnrat-indicator

DefinitionSource, line 36

estimation/nnrat-indicator :
  (x₁ : data/Bool)
  → ℕ

ℕ = data/Nat

estimation/failure-count

DefinitionSource, line 46

estimation/failure-count :
  (x₁ : List data/Bool)
  → ℕ

List = data/Listℕ = data/Nat

estimation/monte-carlo-frequency

DefinitionSource, line 56

estimation/monte-carlo-frequency :
  (x₁ : List data/Bool) (x₂ : ℕ)
  → ℚ≥0

List = data/Listℕ = data/Natℚ≥0 = nnrat/NonnegativeRational

estimation/indicator-failure

TheoremWorked exampleNo axiomsSource, line 68

estimation/indicator-failure :
  → estimation/nnrat-indicator data/true = 1

= = equality/Eq

estimation/indicator-success

TheoremWorked exampleNo axiomsSource, line 74

estimation/indicator-success :
  → estimation/nnrat-indicator data/false = 0

= = equality/Eq

estimation/count-empty

TheoremWorked exampleNo axiomsSource, line 80

estimation/count-empty :
  → estimation/failure-count [] = 0

= = equality/Eq