By using "1" for left (lastKey = 0) and "0" for right (lastKey = 1), I get 12%.
A de Bruijn sequence DB(2, k) is spelled by an Eulerian path in the corresponding de Bruijn graph, whose vertices are {0, 1}^k and where any arc (x, y) has the following property: x[2..k] == y[1..k-1].
Obviously, there are as many Eulerian paths as there are de Bruijn sequences.
I didn't review the patch, but that is the expected result. That sequence will cause it to think that whatever previous 5 pattern it saw, your next is equally likely to be 1 or 0. So it will guess randomly, and half the time it is right.
However with $1 vs $1.05 returns, you'll steadily make money.
The idea is that if 2 lines are identical, the number of "count++" emitted will be exactly the same.
I took your gawk code, but I am starting the for loop at 2 instead of 1, and I removed the -F'\t' option.
Edit: added backslashes to split lines.