UPSC CSAT 2023 Q66: Flag Stripes, No Adjacent Same Colour — Solved
A flag has to be designed with 4 horizontal stripes using some or all of the colours red, green and yellow. What is the number of different ways in which this can be done so that no two adjacent stripes have the same colour?
- 12
- 18
- 24
- 36
Answer: (c) 24
Solution
- Read the conditions. The flag has 4 horizontal stripes, placed one below the other. Each stripe is red, green or yellow. "Some or all" means a flag does not have to use all three colours. The only rule is that two stripes next to each other must not have the same colour.
- Colour the stripes from the top down and count the choices at each stripe.
- Stripe 1 (top): it has no neighbour above it, so any of the 3 colours can be used. Choices = 3.
- Stripe 2: it must differ from stripe 1. That rules out 1 colour and leaves 2. Choices = 2.
- Stripe 3: it must differ from stripe 2 only. It may repeat the colour of stripe 1, because stripes 1 and 3 do not touch. Choices = 2.
- Stripe 4: it must differ from stripe 3 only. Choices = 2.
- The choices are independent, so multiply them: 3 × 2 × 2 × 2 = 3 × 8 = 24.
- Check that two-colour flags are counted. A flag like Red–Green–Red–Green uses only two colours. "Some or all" allows it, so it belongs in the count. The 24 includes all 6 such flags: 3 pairs of colours × 2 alternating orders = 6. The other 24 − 6 = 18 flags use all three colours.
- Quick check by listing. Fix the top stripe as Red. The flags are RGRG, RGRY, RGYR, RGYG, RYRY, RYRG, RYGR, RYGY, which is 8 flags. Green and Yellow on top give 8 each, so 3 × 8 = 24.
Answer: 24 different flags.
Option-wise explanation
- a: incorrect — 12 = 3 × 2 × 2 counts only 3 stripes. It drops one factor of 2. With 4 stripes there are three positions after the top, and each has 2 choices.
- b: incorrect — 18 is the number of flags that use all three colours. You get it by removing the 6 two-colour alternating flags (like RGRG) from 24. That is the trap. The question says "some or all" of the colours, so those 6 flags count.
- c: correct — The top stripe has 3 choices, and each of the next three stripes has 2, since it only has to differ from the stripe directly above it. 3 × 2 × 2 × 2 = 24.
- d: incorrect — 36 = 3 × 3 × 2 × 2 gives one stripe 3 choices when it can have only 2. The usual slip is to treat a stripe as free because it differs from a stripe further away, when only the stripe directly above it matters.
How to eliminate
There is nothing to eliminate here. Use the multiplication rule directly: 3 for the first stripe, then 2 for each later stripe, so 3 × 2³ = 24. As a sanity check, the answer must be 3 times a power of 2. That leaves 12, 24 or 48. 18 and 36 are not of that form, so they drop out at once. 12 belongs to 3 stripes, so 4 stripes give 24. Watch the phrase "some or all". It is there to stop you subtracting the two-colour flags, which is exactly what leads to 18. Time: 20–40 seconds. Attempt this first. It is a one-line count.
Know more
Colouring in a line with no two neighbours alike
You have n slots in a row (stripes, houses, beads on a string) and k colours, and no two adjacent slots may match. Count slot by slot:
- First slot: k choices.
- Every later slot: it only has to differ from the slot just before it, so it has (k − 1) choices.
Number of ways = k × (k − 1)^(n − 1)
This already includes patterns that leave out some colours. If the question says all k colours must appear, subtract the patterns that use fewer colours.
| Stripes (n), k = 3 | Ways |
|---|---|
| 2 | 3 × 2 = 6 |
| 3 | 3 × 2² = 12 |
| 4 | 3 × 2³ = 24 |
| 5 | 3 × 2⁴ = 48 |
Worked variant: 5 stripes, 4 colours, no two adjacent stripes alike. Ways = 4 × 3⁴ = 4 × 81 = 324.
Variant with "all colours must be used": 4 stripes, 3 colours, every colour must appear. Total = 24. Two-colour flags: choose the pair (3 ways) × pick which colour goes on top (2 ways) = 6. Required count = 24 − 6 = 18.
Watch for:
- "Adjacent" means neighbours only. Stripes 1 and 3 can share a colour.
- If the slots form a circle (seats at a round table, a ring), the last slot also touches the first, so the line formula does not apply.
- Read "some or all" as "repeats allowed and colours may be left out". Read "all" or "each colour at least once" as "subtract the patterns that leave a colour out".