Qm

How many color blocks in a shuffled row of balls?

Four red balls and four blue balls (8 total) are lined up in a random order. A "block" is a maximal run of the same color, so RRBRB has 4 blocks: RR, B, R, B.

On average, how many color blocks form in the row of 8?

Your answer

Solving needs a free account

Answers, streaks and solutions unlock when you are signed in. Reading the question and the hint stays free.

Discussion

Sign in to join the discussion · reading is open to everyone

💡 Discussion rules

  1. No full solutions here. Hints and approaches only.
  2. Complexity, edge cases and intuition are the point.
  3. Interview experiences are welcome. Respect your NDAs.

Loading discussion…

Learn the concepts

The theory behind this question.

Related questions

How many streaks in ten coin flips?How many streaks in twenty coin flips?How many streaks with a biased coin?How many blocks of equal values in six dice rolls?How many rising steps in a shuffled list?
All questions →