How many integers could be in such a way that any digits is not bigger than the left digits?

115 Views Asked by At

How many 4-digits integers could be in such a way that any digits is not bigger than it's left digits?

I Try it with simulation, i get 714. anyone could describe a formula for me?

My try:

enter image description here

1

There are 1 best solutions below

11
On BEST ANSWER

Assuming you mean the four digit number to have the digits weakly decreasing (each less than or equal to the digit to the left), I get $715$, so think you missed one. If I had to guess it is $0000$, but maybe you don't allow that. One way to think of it is to select four digits allowing repetition. Each selection generates a single solution-just sort the digits selected in descending order. One way to get this is stars and bars. Add 3 to the thousands digit, 2 to the hundreds, 1 to the tens, and 0 to the ones. Now we don't allow any ties. Choose 4 numbers from the range 0 through 12 without repetition, which you can do in ${13 \choose 4}=715$ ways. Sort them, subtract the numbers added, and you have a four digit number with the digits weakly decreasing.

Another approach is to enumerate the distributions of duplicate digits. No duplicates gives ${10 \choose 4}=210$ One pair gives $10{9 \choose 2}=360$ A triplet gives $90$. Four of a kind gives $10$. Two pair gives ${10 \choose 2}=45$ and $210+360+90+10+45=715$