Sequencing The Digits

How many ways are there to write the numbers 0 through 9 in a row , such that each number other than the left-most is within one of some number to the left of it?

(Source - A Putnam Exam from the 1960's)


The answer is 512.

This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try refreshing the page, (b) enabling javascript if it is disabled on your browser and, finally, (c) loading the non-javascript version of this page . We're sorry about the hassle.

2 solutions

The enumeration of permissible sequences is relatively simple if we classify them according to the position of the digit 0 in the sequence:

(1) There is only one permissible sequence with 0 in the first position: (0,1,2,3,4,5,6,7,8,9).

(2) There is also only one permissible sequence with 0 in the second position: (1,0,2,3,4,5,6,7,8,9).

(3) There are two permissible sequences with 0 in the third position: (1,2,0,3,4,5,6,7,8,9) and (2,1,0,3,4,5,6,7,8,9).

(4) There are four permissible sequences with 0 in the fourth position: (1,2,3,0,4,5,6,7,8,9), (2,1,3,0,4,5,6,7,8,9), (2,3,1,0,4,5,6,7,8,9) and (3,2,1,0,4,5,6,7,8,9).

Now we can see a pattern emerging:

(5) When 0 is in the n-th position (n > 1), the digits to its left are in the set {1,2,...,n-1} and the digits to its right form the subsequence (n,n+1,...,9).

(6) If ( a 1 , a 2 , , a n 1 ) (a_1,a_2,\ldots,a_{n-1}) is a permissible subsequence to the left of 0 when it is in the n-th position, it gives origin to two permissible subsequences when 0 moves to the (n+1)-th position: ( a 1 , a 2 , , a n 1 , n ) (a_1,a_2,\ldots,a_{n-1},n) and ( a 1 + 1 , a 2 + 1 , , a n 1 + 1 , 1 ) (a_1+1,a_2+1,\ldots,a_{n-1}+1,1) . Moreover, it is not difficult to prove (but I will not do it here) that, when 0 is in the (n+1)-th position, its left neighbor must be 1 or n. Therefore, that process generates all permissible subsequences when 0 moves from the n-th to the (n+1)-th position.

It follows from the observations above that, if f ( n ) f(n) is the number of permissible sequences with 0 in the n-th position, then f ( 1 ) = f ( 2 ) = 1 f(1) = f(2) = 1 and f ( n + 1 ) = 2 f ( n ) f(n+1) = 2f(n) for n > 1 n>1 . Therefore, the total number of permissible sequences is f ( 1 ) + f ( 2 ) + + f ( 10 ) = 1 + 1 + 2 + 4 + + 2 8 = 512 f(1) + f(2) + \ldots + f(10) = 1 + 1 + 2 + 4 + \ldots + 2^{8} = \boxed{512}\, .

Bill Bell
Jul 25, 2015

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...