← All visualizers

Code Distance & Logical Failure

Compare exact logical bit-flip probabilities for odd-length repetition codes with minimum-weight majority decoding.

Logical failure probability

Bar lengths use a logarithmic scale from 10⁻¹² to 1; values below 10⁻¹² are clipped visually. Numbers are computed directly from the binomial tail.

Pₗ(n,p) = Σₖ₌₍ₙ₊₁₎/₂ⁿ C(n,k) pᵏ (1−p)ⁿ⁻ᵏ

Model: independent identical bit flips and perfect measurements. These are exact repetition-code results, not simulated surface-code thresholds. For p < 0.5, increasing odd code length reduces majority-decoding failure; at p = 0.5 every displayed length has failure probability 0.5. General quantum noise requires protection against both bit and phase errors.