arXiv:2610.40845cs.ITOct 2026

Manuscript Offprint

arXiv:2610.40845

Learning Finite-Memory Binary Sources

Maciej Skorski

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Abstract

Estimating biased finite-memory sources from a single trajectory is a fundamental problem with practical impact, for example in estimating entropy for cryptography. We study order-dd binary sources whose conditional probabilities have bias at most ϵ\epsilon, and establish sharp sample complexity bounds: relative accuracy γ\gamma with confidence 1−δ1-\delta needs γ−2(12−ϵ)−d(log⁡d+log⁡1δ)\gamma^{-2}(\frac{1}{2}-\epsilon)^{-d}(\log d + \log \frac{1}{\delta}) samples up to constants depending on ϵ\epsilon, with matching upper and lower bounds and no dependence on mixing time or spectral gap. The proof rests on a sharp bound on expected hitting times of the sliding-window (de Bruijn) chain, which stay of order 1/π(w)1/\pi(w) uniformly in dd exactly when ϵ<310\epsilon < \frac{3}{10}, and on majorization of the window masses by those of independent biased coins. Applied to published entropy-source validations, the bounds show that their trace lengths may be underpowered: 10610^6 bits cannot resolve all transitions of an 8-bit model to better than about 4.5% relative error.

Keywords: Markov chains, sample complexity, finite-memory sources, de Bruijn graph, hitting times, minimax bounds, min-entropy estimation

1. Introduction

Learning binary sources with finite memory is of fundamental importance for applications such as cryptographic randomness assessment, lossless compression and sequential prediction (Turan et al., 2018; Willems et al., 1995; Han et al., 2023).

Unlike in the equally classical and well-understood memoryless model of independent coins, here the next-bit probabilities depend on a longer context, and the contexts are visited with exponentially different frequencies, resulting in very diverse reliability for each transition. How many samples are needed to estimate reliably and accurately all of them?

In this work we settle this problem for sources of bounded bias, pointing out that classical techniques, such as those based on mixing times or spectral gaps, do not yield optimal bounds Section 2. Our bounds, optimal in the minimax sense, show that the sample size is inversely proportional to the mass of the rarest window, inversely quadratic in the desired accuracy, logarithmic in the confidence, and, most importantly, only double-logarithmic in the parameters to learn (e.g., in the number of transitions). More precisely, under next-bit bias at most ϵ\epsilon, relative accuracy γ\gamma and confidence 1−δ1-\delta, the sample size splits into three interpretable factors:

n⋆≍ϵ(12−ϵ)−d⏟waiting for the rarest window⋅γ−2⏟accuracy (Fisher information)⋅(log⁡d+log⁡1δ)⏟confidence for multiple windows,n^{\star} \asymp_{\epsilon} \underbrace{\left(\frac{1}{2}-\epsilon\right)^{-d}}_{\text{waiting for the rarest window}} \cdot \underbrace{\gamma^{-2}}_{\text{accuracy (Fisher information)}} \cdot \underbrace{\left(\log d + \log \frac{1}{\delta}\right)}_{\text{confidence for multiple windows}},

under the mild restriction ϵ<0.3\epsilon < 0.3.

© M. Skórski.