Problem 24 · 2010 Math Kangaroo
Stretch
Counting & Probability
careful-countingcasework
A barcode as pictured is made up of alternate black and white stripes. The code always starts and ends with a black stripe. Each stripe (black or white) has the width 1 or 2 and the total width of the barcode is 12. How many different barcodes of this kind are there if one reads from left to right?

Show answer
Answer: E — 116
Show hints
Hint 1 of 2
The colours alternate and the ends are black, so the number of stripes is odd.
Still stuck? Show hint 2 →
Hint 2 of 2
Each stripe is width 1 or 2 summing to 12; count by how many stripes there are.
Show solution
Approach: count compositions of 12 into 1s and 2s with an odd number of parts
- With k stripes there are 12 − k stripes of width 2, so C(k, 12−k) patterns.
- An odd number of stripes is needed (black at both ends): k = 7, 9, 11.
- That gives C(7,5) + C(9,3) + C(11,1) = 21 + 84 + 11 = 116.
Mark:
· log in to save