3. (4-decimal digit combination lock)
k = 10(base); n = 4(length)
Number of combinations: 104 = 10, 000 (kn)
Total sequence length: 4 ∗ 104 = 40, 000 (nkn)
4. De Bruijn sequence
A cyclic sequence in which every possible length-n string occurs
exactly once as a substring.
B(k, n) - De Bruijn sequence of order n on a size-k alphabet.
7. De Bruijn sequence
B(k, n) has length kn - the number of distinct substrings of
length n on given alphabet A ⇒ is optimally short.
B(k, n) is not unique. There are (k!)kn−1
kn distinct B(k, n)
sequences.
⇒ linear speedup! (O(kn) vs O(nkn))
9. Hamiltonian Path on De Bruijn graph
De Bruijn graph on a set of m symbols S := S1, ....Sm, is a
directed graph with mn vertices representing all possible length-n
sequences of given symbols:
V = Sn = (s1, ..., s1, s1), (s1, ...., s1, s2), ....., (sm, ...., sm, sm)
and edges representing set of all possible expressions of vertices as
another vertex by shifting all its symbols by one place to the left
and adding a new symbol at the end of this vertex:
E = ((v1, v2, ...., vn), (v2, ...., vn, si )) : i = 1, ..., m
10. Hamiltonian Path on De Bruijn graph
Each vertex in De Bruijn graph has exactly m incoming and m
outgoing edges.
Each n-dimensional De Bruijn graph is the line digraph of the
(n-1)-dimensional De Bruijn graph with the same set of
symbols.
Each De Bruijn graph is Eulerian and Hamiltonian.
11. Hamiltonian Path on De Bruijn graph
De Bruijn sequences can be constructed by taking a Hamiltonian
path of an n-dimensional De Bruijn graph over k symbols (or a
Eulerian cycle of a (n − 1)-dimensional De Bruijn graph).
12. Generation using shift registers
Generate one digit at the time, and repeatedly work with the
n most recently generated digits, passing from one tuple
(x0, ..., xn−1) to another one (x1, ..., xn−1, xn) by shifting an
appropriate new digit in at the right.
14. Generation using shift registers
If we want to generate a single order n sequence on the letters
(0, 1, . . . k − 1), where k is prime, we can pick an irreducible
polynomial
xn − bnxn−1 − · · · − b2x − b1 ∈ Zk[x]
and an initial string of n numbers s1 . . . sn which isn’t 00 . . . 0.
The next term in the sequence is defined by:
sn+1 = b1s1 + b2s2 + · · · + bnsn ∈ Zk[x]
17. Indexing 1s in a Computer Word
h(x) = (x ∗ deBruijn) >> (n − lgn)
We assume that n is an exact power of 2. Multiplication is
performed modulo 2n
deBruijn is a computer word whose bit pattern contains a
length-n de Bruijn sequence beginning with lgn zeros.
19. Fault Tolerant Systems
In the binary De Bruijn graph
there will exist 22n−1−n different Hamiltonian cycles
De Bruijn graph B(2, n) with a single node failure has a cycle
with at least 2n − n − 1 nodes