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

Problem 25

Problem 25 · 2017 Math Kangaroo Stretch
Counting & Probability Number Theory caseworkcareful-counting

My friend Heinz wants to use a special password that is made up of seven digits. Each digit used in the password appears as many times in the password as is the value of the digit. Additionally, equal digits are always next to each other. Therefore he can for example use 4444333 or 1666666 as passwords. How many possible passwords can he choose from?

Show answer
Answer: E — 13
Show hints
Hint 1 of 2
Each chosen digit takes up as many of the 7 slots as its value, so the values must add to 7.
Still stuck? Show hint 2 →
Hint 2 of 2
Equal digits stay together as one block, so count orderings of the blocks.
Show solution
Approach: partition 7 into distinct digit-values, then order the blocks
  1. Since a digit d fills d slots and equal digits are adjacent, choose distinct digit-values that sum to 7: {7}, {1,6}, {2,5}, {3,4}, {1,2,4}.
  2. Each choice of k blocks can be arranged in k! orders: 1 + 2 + 2 + 2 + 6 = 13.
  3. So there are 13 possible passwords, choice E.
Mark: · log in to save