3
$\begingroup$

How many numbers smaller than one million have digits in a non-decreasing order?

I tried doing it by finding numbers with strictly decreasing order, and subtracting them from $1000000.$

$$1000000-\left( {10 \choose 6}+{10 \choose 5}+{10 \choose 4}+{10 \choose 3}+{10 \choose 2}\right)$$

I'm choosing 6 unique digits out of 10 and put it in decreasing order (we can put every 6 numbers in decreasing order) and so on.

So I subtract the number of decreasing ordered numbers from one million.

Is it a good way of thinking?

  • 0
    I'm not counting 1000000 in my set.2017-02-04
  • 0
    single digit numbers are not decreasing, so i'm not subtracting them?2017-02-04
  • 2
    "digits in non-decreasing order" might just mean, as you have viewed it, "digits not in decreasing order" But it may also mean only that each digit is greater or equal to the next one.2017-02-04
  • 0
    There is also the question of whether you consider $55443$ to be a number in decreasing order or not. If you do consider it to be decreasing, then you have not accounted for it in your subtraction. (*the difference between the phrase "strictly monotone" versus "monotone"*). Also, are you counting only positive numbers or zero as well?2017-02-04
  • 0
    no I think if I have 5 5 it's like a const so I'm taking it as not decreasing.2017-02-04
  • 0
    Special care needs to be taken to define "non-decreasing." [Here is a wiki page](https://en.wikipedia.org/wiki/Monotonic_function) describing the related terminology in the context of functions, and going by it one would think that a sequence in "non-decreasing" order $(a_1,a_2,\dots,a_n)$ implies $(i\leq j\implies a_i\leq a_j)$, so something like $223345$ is considered nondecreasing while $43234$ is not. "Not strictly decreasing" is not the same phrase as "Non-decreasing."2017-02-04
  • 0
    I would usually read "non-decreasing" as "never decreasing." So 112235 is non-decreasing, but 112231 is not, because it decreases between the last two digits, although it is not strictly decreasing either since that's the _only_ place it decreases.2017-02-04
  • 0
    So... thinking of it in this way, (*non-decreasing means never decreasing*), the question can be viewed as counting [NE lattice paths](https://en.wikipedia.org/wiki/Lattice_path) from $(1,0)$ to $(7,9)$2017-02-04

1 Answers 1

0

Count valid numbers from $000000\;$ to $\;999999$
by the number of ways $6$ balls can be placed in $10$ bins marked $0-9$, using stars and bars.

Note that each of the $\binom{6+10-1}{10-1}$ results thus obtained can yield only one non-decreasing sequence.

A result of $\;\;\fbox{X}\fbox{X}\fbox{2}\fbox{X}\fbox{1}\fbox{X}\fbox{1}\fbox{2}\fbox{X}\fbox{X}\;$, e.g. means obtaining the number $224677$