codes, if a single bit is altered, none of the data that comes after it will be correctly read. With Fibonacci coding, on the other hand, a changed bit may cause one token to be read as two, or cause two tokens to be read incorrectly as one, but reading a "0" from the stream will stop the errors from propagating further. Since the only stream that has no "0" in it is a stream of "11" tokens, the total edit distance between a stream damaged by a single bit error and the original stream is at most three. This approach—encoding using sequence of symbols, in which some patterns (like "11") are forbidden, can be freely generalized. Example The following table shows that the number 65 is represented in Fibonacci coding as 0100100011, since . The first two Fibonacci numbers (0 and 1) are not used, and an additional 1 is always appended. Generalizations The Fibonacci encodings for the positive integers are binary strings that end with "11" and contain no other instances of "11". This can be generalized to binary strings that end with N consecutive 1's and contain no other instances of N consecutive 1's. For instance, for N = 3 the positive integers are encoded as 111, 0111, 00111, 10111, 000111, 100111, 010111, 110111, 0000111, 1000111, 0100111, …. In this case, the number of encodings as a function of string length is given by the sequence of Tribonacci numbers. For general constraints defining which symbols are allowed after a given symbol, the maximal information rate can be obtained by first finding the optimal transition probabilities using maximal entropy random walk, then use entropy coder (with switched encoder with decoder) to encode a message as a sequence of symbols fulfilling the found optimal transition probabilities. See also Golden ratio base NegaFibonacci coding Ostrowski numeration Universal code Varicode, a practical application Zeckendorf's theorem Maximal entropy random walk References Further reading Non-standard positional numeral systems Lossless compression algorithms Fibonacci numbers