we need to distinguish between 5 zeros, between two 1's, and also between two zeros.
to represent 0,1,2 two bits are enough
writing the sequence
0 - 00
1- 01
0 - 00
2 - 10
0 - 00
2 - 10
0 - 00
1 - 01
0 - 00
checkout which is repeating more number of times
there are 5 zeros and we need to distinguish them
first zero = 000-00
2nd zero= 001-00
3rd zero = 010-00
4th zero= 011-00
5th zero = 100-00
two 1's can also be distiguished by 3 bits
two 2's can also be distiguished by 3 bits
so, 5 flipflops are needed, we capture the output only at last 2 flipflops and first 3 flipflops distingush between states
hence 5 are necessary