IBM Research

PUZZLE   IBM-157

Distance between bad bars

IBM Research · Ponder This · 2011-05

IBM Ponder This #157 · May 2011

A barcode is composed of a series of variable-width white and black bars.

One of the important features of the barcode is that no bar be too wide; otherwise, the reader might get out of synchronization. Suppose we use the following barcode system, where we take a completely random sequence of bits and use it to build the bars. For example, the 7-bit-long sequence 0111001 will generate four bars of varying lengths: white(1), black(3), white(2), black(1). Such a system will generate, every once in a while, bars that are too wide. Let's call any black bar whose width is 20 bits or more a "bad bar".

What is the expected number of bits in the bars that are between two adjacent bad bars?

Solution

Best opened after a real attempt

To be added.