Puzzle Time - Sequencing the digits
-
I like my answer better
SOLUTION: It seems that the sequences we want start with an arbitrary digit, but thereafter each digit must be either the lowest digit above those already placed, or the highest digit below them. If you construct the sequence from left to right, you don't know in advance when your number of choices will drop from 2 to 1. If you did know, you'd be fine; for example, if you knew you would run out of options after the seventh digit (as in the example), you'd know that the total number of sequences is 10 x 2 x 2 x 2 x 2 x 2 x 2 x 1 x 1 x 1.
If you're a fan of binomial coefficients, you might have noticed that the number of allowed sequences beginning with the digit k is "9 choose k," because it's the number of ways of deciding which of the remaining 9 positions to devote to the digits k-1, k-2, ..., 1, and 0. Thus, the total number of admissible sequences is the sum from k=0 to 9 of 9 choose k, which is 29 (because this counts all the ways of choosing a subset of the remaining 9 positions).
Indeed, choosing the "downward" positions is equivalent to choosing an allowed sequence. But there's an easier way to see that the answer is 29, A.K.A. 512. Construct your sequence from right to left instead of left to right!
The rightmost digit must be 0 or 9; its left neighbor will be the highest or lowest remaining digit. This continues all the way until the (forced) leftmost digit, so the number of ways to construct the sequence is 2 x 2 x 2 x 2 x 2 x 2 x 2 x 2 x 2 = 512.
-
I'll post my answer under a spoiler. I doubt Klaus is playing on vacation and Ax hasn't chimed in yet.
***=NSFW content***
click to show@jon-nyc said in Puzzle Time - Sequencing the digits:
I doubt Klaus is playing on vacation
I'm back. I'm not good with puzzles, but I love programming, so here we go:
Press on "Execute" to confirm the 512