🦘 Math Kangaroo Grade All Felix 1-2 Ecolier 3-4 Benjamin 5-6 Kadett 7-8 Junior 9-10 Student 11-12 ⇄ switch contest
2010 Math Kangaroo

Problem 24

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?

Figure for Math Kangaroo 2010 Problem 24
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
  1. With k stripes there are 12 − k stripes of width 2, so C(k, 12−k) patterns.
  2. An odd number of stripes is needed (black at both ends): k = 7, 9, 11.
  3. That gives C(7,5) + C(9,3) + C(11,1) = 21 + 84 + 11 = 116.
Mark: · log in to save