Suppose you have n sequences of bits stacked in rows. The sequences can repeat along their row indefinitely. The goal is to select n sequences such that the following are both true:
- All $2^n$ possible columns will eventually happen at least once.
- The longest sequence is $O(P(n))$ in length; where P is some polynomial.
For example, if n=4, the sequences you could pick are:
01
0011
00001111
0000000011111111 //Length 2^4 or 2^n in general
Repeating them along their rows gives:
0101010101010101
0011001100110011
0000111100001111
0000000011111111
If you take each column as its own bit string, you can see that every possible column appears. In fact, it mimics the classic binary counting system. However, this system is problematic since the longest sequence has length 2^4 or 2^n in general; instead of being polynomial in n.
An alternative would be the following sequences where the length of the next sequence is just 2 greater than the previous, instead of 2 times the previous:
01
0011
000111
00001111 //Length 2*4 or 2*n in general
Repeating them along their rows gives:
010101010101010101010101
001100110011001100110011
000111000111000111000111
000011110000111100001111
In this case, every possible column still appears at least once (even though there are duplicates). Furthermore, the longest sequence has length $2*4$ or $2*n$ in general. This is polynomial in $n$ and seems to solve the problem. However, this only works until $n=7$. In that case, there are some columns which never appear no matter how much you repeat the sequences.
So my question is, is there some way to pick the sequences so that the two rules are fulfilled for any n? Thanks