#1: De Bruijn Sequences

Sequences of 0’s and 1’s

Suppose I want to write a sequence of 0’s and 1’s that contains every possible 2-letter subsequence. This means somewhere in my sequence I need 01, 10, 00, and 11.

Obviously, gluing them all together gives a valid sequence:


Continue reading