Question:medium

There are 6 boxes numbered 1,2,... 6. Each box is to be filled up either with a red or a green ball in such a way that at least 1 box contains a green ball and the boxes containing green balls are consecutively numbered. The total number of ways in which this can be done is

Show Hint

Each valid colouring is decided by where the run of green boxes starts and where it stops. Count the possible runs.
Updated On: Nov 7, 2026
  • 5
  • 21
  • 33
  • 60
Show Solution

The Correct Option is B

Solution and Explanation

Step 1: Understanding the Question:
We need to count colourings of 6 boxes where the green boxes form one unbroken run that is not empty. A colouring like green, red, green is not allowed because the greens are not consecutive.

Step 2: Key Formula or Approach:
Think of the 6 boxes as lying between 7 dividing lines, numbered 0 to 6 (line 0 is before box 1, line 6 is after box 6). A run of green boxes starts at one line and ends at a different, later line.

Step 3: Choose the two lines.
Pick any 2 different lines out of the 7. The smaller one marks where the green run begins and the larger one marks where it ends. Different pairs give different runs, and every run comes from exactly one pair. The number of pairs is \[ \binom{7}{2} = \frac{7 \times 6}{2} = 21 \]

Step 4: Cross-check with a small case.
With 3 boxes the same rule gives $\binom{4}{2} = 6$ runs: G R R, R G R, R R G, G G R, R G G, G G G. That is 6, which matches $3 + 2 + 1$. So the method works.

Step 5: Why the other options are wrong.
The number 5 is the count of runs of length 2 only. The values 33 and 60 are more than the 21 runs that exist. The count of all non-empty subsets would be $2^6 - 1 = 63$, but that includes broken patterns such as G R G, which the question forbids.

Final Answer:
The total number of valid colourings is 21, option 2. \[ \boxed{21} \]
Was this answer helpful?
0