Documentation

Complexitylib.Classes.Randomized.ApproximateCounting.Weak.Defs

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
Instances For
    def Complexity.ApproximateCounting.Weak.zeroLevel (domainWidth : ) :
    Fin (domainWidth + 4)

    The level-zero hash output width.

    Equations
    Instances For
      def Complexity.ApproximateCounting.Weak.trueLevels {domainWidth : } (responses : Fin (domainWidth + 4)Bool) :
      Finset (Fin (domainWidth + 4))

      Levels at which the amplified occupancy test answers positively.

      Equations
      Instances For
        def Complexity.ApproximateCounting.Weak.selectedLevel {domainWidth : } (responses : Fin (domainWidth + 4)Bool) :
        Fin (domainWidth + 4)

        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.estimate {domainWidth : } (responses : Fin (domainWidth + 4)Bool) :

          Constant-factor estimate selected from amplified occupancy responses.

          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) :
              Equations