A coin of any bias from fair bits, by comparing with its binary digits #
This module formalizes only the unbounded coin-reading tree (Cslib.Probability.DDGTree) and
weighted-series steps after [AB07], Lemma 7.14 (2007 draft numbering, §7.4, printed
p. 124 / PDF p. 140). It does not construct a probabilistic Turing machine or bound
Turing.MultiTapePTM.expectedTime; the machine-level expected-O(1) running-time statement of
Lemma 7.14 remains open under #9192 (and #4711).
Let d : ℕ → Bool be a binary expansion of ρ = ∑ᵢ dᵢ 2^{-(i+1)}. Every ρ ∈ [0, 1] has one;
ρ = 1 uses the expansion 0.111⋯. The tree coinOfDigits d reads fair bits
b₀ b₁ ⋯ and compares them with d₀ d₁ ⋯. At the first index i with bᵢ ≠ dᵢ it outputs dᵢ,
that is, whether the uniform number 0.b₀b₁⋯ lies below ρ. It outputs true with probability
exactly ρ (coinOfDigits_generates). It is still running after n flips exactly when the first
n bits match, with probability 2⁻ⁿ. Hence it reads exactly 2 fair bits in expectation
(expectedFlips_coinOfDigits), independently of ρ.
For any caller-supplied weight function w : ℕ → ℝ≥0∞ charged at flip n + 1, the expected
weighted sum along coinOfDigits d is ∑ₙ w n 2⁻ⁿ (expectedCostWith_coinOfDigits), which is
finite for every polynomially bounded w : ℕ → ℕ (expectedCostWith_coinOfDigits_lt_top). These
are purely analytic series bounds for an arbitrary weight w, not Turing-machine running-time
bounds.
Main definitions #
Cslib.Probability.DDGTree.coinOfDigits: the digit-comparison tree.
Main results #
Cslib.Probability.DDGTree.coinOfDigits_generates: DDG-tree output-law step (exact coin of biasρ).Cslib.Probability.DDGTree.expectedFlips_coinOfDigits: DDG-tree flip-count step (exactly2expected fair bits).Cslib.Probability.DDGTree.expectedCostWith_coinOfDigits,Cslib.Probability.DDGTree.expectedCostWith_coinOfDigits_lt_top: analytic geometrically weighted series identity and finiteness for polynomially bounded weightsw.
References #
- S. Arora, B. Barak, Computational Complexity: A Modern Approach, §7.4, Lemma 7.14 (2007 draft, printed p. 124 / PDF p. 140).
The masses after n fair bits: still comparing with probability 2⁻ⁿ, and having output x
with the probability of the first disagreement among the first n digits being at a digit x.
Intermediate DDG-tree output-law step (after [AB07], Lemma 7.14; not the full
probabilistic Turing-machine theorem, tracked in #9192): if d is a binary expansion of ρ, the
digit-comparison tree generates the coin of bias ρ from fair bits.
Analytic weighted-series identity for coinOfDigits (not a Turing-machine running-time bound):
for any digit sequence d and any caller-supplied weight w : ℕ → ℝ≥0∞ charged at flip n + 1,
the expected weight is ∑ₙ w n 2⁻ⁿ.
Intermediate DDG-tree flip-count step (after [AB07], Lemma 7.14; counts fair coin
flips only, not Turing-machine steps, tracked in #9192): the digit-comparison tree reads exactly
two fair bits in expectation, for every digit sequence d.
Analytic weighted-series finiteness step (not a Turing-machine running-time bound; the PTM
theorem for [AB07], Lemma 7.14 is tracked in #9192): for any digit sequence d and any
polynomially bounded weight w : ℕ → ℕ, the geometrically weighted series ∑ₙ w n 2⁻ⁿ is
finite.