Weak approximate counting -- definitions #
The weak Stockmeyer estimator probes hash-cell occupancy at every relevant output width. It returns the power of two indexed by the largest positive answer, with four extra levels supplying the constant-factor slack.
@[reducible, inline]
Hash output widths probed by the weak estimator.
Equations
- Complexity.ApproximateCounting.Weak.Level domainWidth = Fin (domainWidth + 4)
Instances For
The level-zero hash output width.
Equations
- Complexity.ApproximateCounting.Weak.zeroLevel domainWidth = ⟨0, ⋯⟩
Instances For
def
Complexity.ApproximateCounting.Weak.trueLevels
{domainWidth : ℕ}
(responses : Fin (domainWidth + 4) → Bool)
:
Levels at which the amplified occupancy test answers positively.
Equations
Instances For
def
Complexity.ApproximateCounting.Weak.selectedLevel
{domainWidth : ℕ}
(responses : Fin (domainWidth + 4) → Bool)
:
Largest level at which the occupancy test answers positively, or level zero if there is no positive answer.
Equations
- One or more equations did not get rendered due to their size.
Instances For
def
Complexity.ApproximateCounting.Weak.ResponsesAccurate
{domainWidth cardinality : ℕ}
(responses : Fin (domainWidth + 4) → Bool)
:
The response contract needed by the weak estimator. Levels whose expected
cell size is at least 8 answer positively, levels whose expected cell size is
at most 1/8 answer negatively, and level zero detects an empty set exactly.
Equations
- One or more equations did not get rendered due to their size.
Instances For
@[instance_reducible]
instance
Complexity.ApproximateCounting.Weak.instDecidableResponsesAccurate
{domainWidth cardinality : ℕ}
(responses : Fin (domainWidth + 4) → Bool)
:
Decidable (ResponsesAccurate responses)