A ruler of logarithmic length #
Amplification runs logarithmically many rounds, and the bounded-iteration rule counts rounds by the length of a string. So an algorithm needs to write a string whose length is the logarithm of its input's — the one shrinking step the rest of the development never needed.
The construction folds over the input carrying two counters: a ruler, and a threshold that doubles. Every time the number of bits read reaches the threshold, the ruler gains a mark and the threshold doubles, so the ruler counts the doublings.
Main definitions #
Complexity.logStep— one step of that foldComplexity.logRuler— the ruler itself
Main results #
Complexity.logRuler_mem_FP— it is anFPfunction
How long the ruler is after reading n bits: it gains a mark exactly when
the count reaches the next power of two.
Equations
- Complexity.rulerLen 0 = 0
- Complexity.rulerLen n.succ = if n + 1 < 2 ^ Complexity.rulerLen n then Complexity.rulerLen n else Complexity.rulerLen n + 1
Instances For
The fold itself, on pair W z.
Equations
Instances For
A ruler of logarithmic length.
Equations
Instances For
The ruler is as long as the fold says.