Documentation

CslibFrontier.Algorithms.Lean.LempelZiv.LZ78Count

The number of LZ78 phrases #

The LZ78 parse (Cslib.Algorithms.Lean.LempelZiv.LZ78.parse) is a distinct parsing except possibly for its last phrase, which may repeat an earlier one. The distinct-parsing bound (CslibFrontier.Algorithms.Lean.LempelZiv.DistinctParsing) still applies: the number c of phrases of an input of length n over an alphabet of size k ≥ 2 satisfies m * c ≤ n + 2 * k ^ m for every m, hence c * ⌊log_k c⌋ ≤ n + 2 c and c ≤ n / ((1 - ε_n) log_k n) with ε_n → 0 ([CT06], §13.5, there for binary inputs).

Main results #

References #

The distinct-parsing inequality for LZ78: m * c ≤ n + 2 * k ^ m for every m, where c is the number of phrases, n the input length and k ≥ 2 the alphabet size.

The number c of LZ78 phrases of an input of length n over an alphabet of size k satisfies c * ⌊log_k c⌋ ≤ n + 2 * c.

The number c of LZ78 phrases of an input of length n over an alphabet of size k ≥ 2 satisfies c * (log_k n - log_k log_k n - 4) ≤ n ([CT06], §13.5).

The number of LZ78 phrases ([CT06], §13.5, there for binary inputs; here for an alphabet of size k ≥ 2): c(n) ≤ n / ((1 - ε_n) log_k n), where ε_n → 0 (DistinctParsing.tendsto_epsilon).