Counting deficient-carry ternary words #
The automaton gives an exact enumeration theorem. Among all ternary words of
length m ≥ 2, precisely (m + 5) * 2 ^ (m - 2) create fewer than two carries
when doubled. The theorem below uses the subtraction-free parameterization
m = n + 2.
Fixed-length ternary words that remain outside .good when read from a
given automaton state.
Equations
- GKPCarry.BadCarryWordsFrom state length = { word : List.Vector (Fin 3) length // GKPCarry.badCarryStateAux (GKPCarry.ternaryWordDigits word) state ≠ GKPCarry.BadCarryState.good }
Instances For
Fixed-length ternary words whose doubling creates fewer than two carries.
Equations
Instances For
Peeling the least significant digit gives the recursive decomposition of deficient-carry words.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Recursive dynamic-programming count for words read from a given state.
Equations
- GKPCarry.badCarryWordCountFrom x✝ 0 = if x✝ = GKPCarry.BadCarryState.good then 0 else 1
- GKPCarry.badCarryWordCountFrom x✝ length.succ = ∑ digit : Fin 3, GKPCarry.badCarryWordCountFrom (GKPCarry.badCarryStateStep x✝ ↑digit) length
Instances For
The recursive count is the actual cardinality of the corresponding finite word type.
Exact dynamic-programming count of deficient-carry ternary words.
Headline enumeration theorem: among all ternary words of length n + 2,
exactly (n + 7) * 2 ^ n have fewer than two doubling carries.
The ambient set contains all 3 ^ (n + 2) ternary words.