Almost, just almost

We say that a number is almost increasing if for each digit of that number, either that digit is 0 or all digits to the left of it are (strictly) smaller than it. How many 4 digit numbers are almost increasing?

Details and assumptions

As an explicit example, the number 2035 2035 is almost increasing.

The number 12 = 012 12=012 is a 2 digit number, not a 3 digit number.


The answer is 495.

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.

8 solutions

We will look at four cases.

  1. Numbers which have three 0 digits

  2. Numbers which have two 0 digits

  3. Numbers which have one 0 digit

  4. Numbers which don't have 0 digit at all

In the first case , there are 9 numbers: 1000, 2000, ..., 9000

In the second case , there are C(3,2) ways to place the two 0 digits. And if the first digit is 1, we have C(8,1) choices of the other digit. If the first digit is 2, we have C(7,1) choices of the other digit and so on. So, for this case, there are C ( 3 , 2 ) × ( C ( 8 , 1 ) + C ( 7 , 1 ) + C ( 6 , 1 ) + C ( 5 , 1 ) + C ( 4 , 1 ) + C ( 3 , 1 ) + C ( 2 , 1 ) + C ( 1 , 1 ) ) C(3,2) \times (C(8,1) + C(7,1) + C(6,1) + C(5,1) + C(4,1) + C(3,1) + C(2,1) + C(1,1)) = 3 × C ( 9 , 2 ) = 3 \times C(9,2) = 108 = 108 almost increasing numbers.

In the third case , there are C(3,1) ways to place the only 0 digit. And if the first digit is 1, we have C(8,2) choices of the other two digits. If the first digit is 2, we have C(7,2) choices of the other two digits and so on. So, there are C ( 3 , 1 ) × ( C ( 8 , 2 ) + C ( 7 , 2 ) + C ( 6 , 2 ) + C ( 5 , 2 ) + C ( 4 , 2 ) + C ( 3 , 2 ) + C ( 2 , 2 ) ) C(3,1) \times (C(8,2) + C(7,2) + C(6,2) + C(5,2) + C(4,2) + C(3,2) + C(2,2)) = 3 × C ( 9 , 3 ) = 3 \times C(9,3) = 252 = 252 almost increasing numbers.

In the fourth case , there are C ( 8 , 3 ) + C ( 7 , 3 ) + C ( 6 , 3 ) + C ( 5 , 3 ) + C ( 4 , 3 ) + C ( 3 , 3 ) C(8,3) + C(7,3) + C(6,3) + C(5,3) + C(4,3) + C(3,3) = C ( 9 , 4 ) = C(9,4) = 126 = 126 almost increasing numbers.

So, there are 9 + 108 + 252 + 126 = 495 9+108+252+126 = \boxed{495} almost increasing numbers

SuperSnivy S
Nov 2, 2013

We can split this into 4 cases:

Case 1 : No 0's

We can choose 4 out of the 9 nonzero digits, and there will only be 1 way to order them such that the 4-digit number is almost increasing . This means that there is ( 9 4 ) = 126 \binom{9}{4} = 126 ways for this case.

Case 2 : 1 Zero

There are 3 places to put the zero (i.e. not the first digit). We can choose 3 digits (out of 9), and again, there will only be 1 way to order them. This means that there is 3 ( 9 3 ) = 252 3 \cdot \binom{9}{3} = 252 ways for this case.

Case 3 : 2 0's

There are 3 ways to place the zeroes. We can choose 2 digits (out of 9), and once again, there will only be 1 way to order them. So, there is 3 ( 9 2 ) = 108 3 \cdot \binom{9}{2} = 108 ways.

Case 4 : 3 0's

There are only 9 possible 4-digit almost increasing numbers with 3 zeroes (i.e. 1000, 2000, ..., 9000), so there is 9 ways.

Summing up the cases, we get 126 + 252 + 108 + 9 = 495 126+252+108+9 = \boxed{495} .

I like this explanation the best, and from a Pokefan, too! LOL

Hunter Skelton - 7 years, 7 months ago

ooooh....

Hunter Skelton - 7 years, 7 months ago
Snehal Shekatkar
Oct 28, 2013

Since all digits cannot be 0 0 , we can have at most 3 3 digits equal to 0 0 in any such 4 4 -digit number and for convenience we can assume that we have 3 3 different zeros. Thus we would have 9 + 3 = 12 9+3=12 digits in total. Since 0 0 can succeed any integer from 1 1 to 9 9 or even 0 0 itself, we can assume that these 3 3 zeros are greater than 9 9 . Thus the problem reduces to choosing 4 4 digits out of 12 12 . So there are 12 C 4 ^{12}C_{4} ways to do that. Also we note that any chosen set of 4 4 digits can be arranged in only single way in ascending order so the answer is 12 C 4 = 495 ^{12}C_{4}=\boxed{495} .

How does this method count a case such as 1020? I see it does because of the 3 ways of choosing 2 zeros, but it does not seem like a very valid way to me. Though to be fair, it works.

Jonathan Wong - 7 years, 7 months ago

Log in to reply

You are right. So in some sense, though the ordering of numbers from 1 1 to 9 9 is fixed, the position of first two zeros is not decided a priori. Thus after choosing 4 4 elements out of 12 12 , we can decide the ordering of these 4 4 among themselves so that they will be in ascending order and then that order will be unique. In the example you gave, we can say that 1020 1020 is actually 1 0 1 2 0 2 10_{1}20_{2} and 1200 1200 is 12 0 1 0 2 120_{1}0_{2} and then everything is fine!

Snehal Shekatkar - 7 years, 7 months ago

I dont find it satisfactory, supose we choose 4 numbers 1200, then it can be arranged in 2 ways 2100, 2010

Surendra Ratha - 7 years, 7 months ago

Log in to reply

Yes but only one of all possible permutations would be in ascending order. To make things even more cleaner, let us say that three zeros satisfy 0 1 < 0 2 < 0 3 0_{1}<0_{2}<0_{3} . Then we have following list of symbols in ascending order: 1 < 2 < 3 < 4 < 5 < 6 < 7 < 8 < 9 < 0 1 < 0 2 < 0 3 1<2<3<4<5<6<7<8<9<0_{1}<0_{2}<0_{3} . Now when you choose 4 4 from these, you are not allowed to arrange them in different ways because that will change ascending order and then it will not be "almost increasing number". Hence there are exactly 12 C 4 = 495 ^{12}C_{4}=495 ways.

Snehal Shekatkar - 7 years, 7 months ago

Log in to reply

Ya ur logic seems justified,bt i still cant visualise the concept

Surendra Ratha - 7 years, 7 months ago

Both 1 , 0 1 , 0 2 , 2 1,0_1,0_2,2 and 1 , 0 3 , 0 2 , 2 1,0_3,0_2,2 will give the same arrangement, 1200 1200

Siddhartha Srivastava - 7 years, 7 months ago

Log in to reply

@Siddhartha Srivastava Nope.. since 0 3 > 0 2 0_{3}>0_{2} , the arrangement 1 , 0 3 , 0 2 , 2 1,0_{3},0_{2},2 is illegal and will not be counted.

Snehal Shekatkar - 7 years, 7 months ago

Log in to reply

@Snehal Shekatkar No, I meant if we choose 1 , 0 1 , 0 2 , 2 1,0_1,0_2,2 It'll be rearranged as 1 , 2 , 0 1 , 0 2 1,2,0_1,0_2 which is 1 , 2 , 0 , 0 1,2,0,0

And if we choose 1 , 0 3 , 0 2 , 2 1,0_3,0_2,2 It'll be arranged as 1 , 2 , 0 2 , 0 3 1,2,0_2,0_3 which is 1 , 2 , 0 , 0 1,2,0,0 So the 2 different choices give the same rearrangement

Siddhartha Srivastava - 7 years, 7 months ago

You happened to hit upon ( 12 4 ) 12 \choose 4 , though for the wrong reason (if i'm reading your above comment correctly).

Can you find a bijection which clearly establishes that there are ( 12 4 ) 12 \choose 4 ways? This will also help you with the n n- digit generalization.

Calvin Lin Staff - 7 years, 7 months ago

Log in to reply

If zero(s) are chosen, put 0 1 0_1 in the first position, 0 2 0_2 in the second position, 0 3 ) 0_3) in the third position, and the other chosen numbers in the remaining spaces in ascending order.

Jonathan Wong - 7 years, 7 months ago

think that it simplifies to 12C4 because we could just use the hockey stick identity to the sums in Zacky's solution.

However, I still can't find an intuitive reasoning

This would really help for the proof of the n-digit generalization.

Russell FEW - 7 years, 7 months ago

While I think this method just accidentally hit the correct answer but it does not work in another case as far as I am concerned

Junyi Qian - 7 years, 7 months ago
Vedant Cacklur
Mar 3, 2014

These numbers can be divided into 4 groups- 1)No 0 :We select 4 digits out of the 9 digits (ie. from 1 to 9)and arrange them in an ascending order.It can be done in 9c4 ways...... 2)One 0 :We select 3 digits out of nine and place '0' at any one of 3 positions(ie. 2nd, 3rd, or 4th). It can be done in (9c3)X3 ways......... 3)Two 0s :Select 2 digits out of nine and arrange the zeros in any one of following 3 ways(XOXO,XXOO,XOOX).It can be done in (9c2)X3 ways........ 4)Three 0s :Select a digit and write it in the form XOOO. Can be done in 9 ways........ Total is 126+252+108+9 = 495

Parth Thakkar
Nov 3, 2013

There are 4 4 places to fill the digits from 0 0 to 9 9 . The first place can not contain 0 0 . Let's start by filling up maximum number of zeroes and keep on decreasing their number.

We can fill three zeroes (we can't fill four), in 3 C 3 ^3C_3 ways. The one place left can be filled in 9 C 1 ^9C_1 ways by selecting the remaining nine digits. This gives us 3 C 3 × 9 C 1 ^3C_3 \times ^9C_1 ways of selecting the digits for a number . However, this also turns out to be the number of almost-increasing numbers with 3 3 zeroes . That's because, for every such selection, there is only one permutation which abides by the constraint of being 'almost-increasing'.

We can fill two zeroes, in 3 C 2 ^3C_2 ways. The two places left can be filled in 9 C 2 ^9C_2 ways by selecting the remaining nine digits. This gives us 3 C 2 × 9 C 2 ^3C_2 \times ^9C_2 ways of selecting the digits for a number . Again, the same argument: This also turns out to be the number of almost-increasing numbers with 3 3 zeroes . That's because, for every such selection, there is only one permutation which abides by the constraint of being 'almost-increasing'.

Similarly, with one zero, we get 3 C 1 × 9 C 3 ^3C_1 \times ^9C_3 numbers and with no zeroes, we get 3 C 0 × 9 C 4 ^3C_0 \times ^9C_4 numbers.

Summing these up gives 495 495 .

One confession: Before trying this problem mathematically, I wrote a program and got it correctly. But let me make it clear, I didn't see any solutions (cause I couldn't have seen any) before typing in this one.

A L
Nov 3, 2013

If the square numbers are in the second dimension and the tetrahedral numbers in the third dimension, then the general formula for the n-simplex numbers is

( n + r 1 r ) . \binom{n+r-1}{r}.

Obviously there are 7 7 ways of arranging the almost-increasing numbers; 1. 1. a 000 a000 . Here there are 1 9 1\cdot 9 ways.

2. 2. a b c 0 , a b 0 c , a 0 b c abc0,ab0c,a0bc . Here there are 3 T 8 3\cdot \text{T}_8 ways.

3. 3. a b c 0 , a b 0 c , a 0 b c abc0,ab0c,a0bc . Here there are 3 Tet 7 = 3 ( 7 + 2 3 ) 3\cdot \text{Tet}_7=3 \cdot \binom{7+2}{3} ways.

4. 4. a b c d abcd . Here is where the r-simplex comes in useful, as there are 1 ( 6 + 3 4 ) 1 \cdot \binom{6+3}{4} ways (the number of spheres in a 4 4- dimensional tetrahedron with its 'base' being a tetrahedron with Tet 6 \text{Tet}_6 spheres).

The answer is, after routine calculations, 495 495 .

Albert Yue
Oct 31, 2013

Let the first digit be n n , where 0 n 9 0 \le n \le 9 . Then there are 4 cases: no 0s, one 0, two 0s, and three 0s.These cases are definitely independent because any open spaces must contain digits higher than the first, which is higher than 0. Note that there are 9 n 9-n digits to consider in the remaining spaces because they are strictly higher than n n but at most 9.

For three 0s, no matter the starting digit, gets 1 possibility.

For two 0s, there are three ways to order the 0s and ( 9 n 1 ) \binom{9-n}{1} ways to choose the last digit.

For one 0, there are still three ways to order the 0s, and ( 9 n 2 ) \binom{9-n}{2} ways to choose the remaining open digits. This is because of the "strictly larger" phrase, meaning that for every order of two distinct numbers, there is one possible ordering.

Finally, for no 0s, there are ( 9 n 3 ) \binom{9-n}{3} possible ways using similar reasoning as above.

Thus, the sum is 9 + 3 ( ( 8 1 ) + ( 7 1 ) + ( 6 1 ) + + ( 1 1 ) ) + 3 ( ( 8 2 ) + ( 7 2 ) + ( 6 2 ) + + ( 2 2 ) ) + ( ( 8 3 ) + ( 7 3 ) + ( 6 3 ) + ( 3 3 ) ) 9+3(\binom{8}{1} + \binom{7}{1} + \binom{6}{1} + \cdots + \binom{1}{1}) + 3(\binom{8}{2} + \binom{7}{2} + \binom{6}{2} + \cdots + \binom{2}{2}) + (\binom{8}{3} + \binom{7}{3} + \binom{6}{3} + \cdots \binom{3}{3}) (Note that ( a b ) \binom{a}{b} with a<b is equal to zero and omitted. By the Hockey-Stick Theorem, we get 9 + 3 ( 9 2 ) + 3 ( 9 3 ) + ( 9 4 ) = 495 9+3\binom{9}{2} + 3\binom{9}{3} + \binom{9}{4} = 495 .

No zeroes

a b c d \overline{abcd}

Number of 4 digit numbers= ( 8 3 ) + ( 7 3 ) + ( 6 3 ) + ( 5 3 ) + ( 4 3 ) + ( 3 3 ) = 56 + 35 + 20 + 10 + 4 + 1 = 126 {8\choose3}+{7\choose3}+{6\choose3}+{5\choose3}+{4\choose3}+{3\choose3}=56+35+20+10+4+1=126

One zero

a 0 b c / a b 0 c / a b c 0 \overline{a0bc}/\overline{ab0c}/\overline{abc0}

Number of 4 digit numbers= 3 ( ( 8 2 ) + ( 7 2 ) + ( 6 2 ) + ( 5 2 ) + ( 4 2 ) + ( 3 2 ) + ( 2 2 ) ) = 3 ( 28 + 21 + 15 + 10 + 6 + 3 + 1 ) = 252 3({8\choose2}+{7\choose2}+{6\choose2}+{5\choose2}+{4\choose2}+{3\choose2}+{2\choose2})=3(28+21+15+10+6+3+1)=252

Two zeroes

a 00 b / a 0 b 0 / a b 00 \overline{a00b}/\overline{a0b0}/\overline{ab00}

Number of 4 digit numbers= 3 ( 8 + 7 + 6 + 5 + 4 + 3 + 2 + 1 ) = 108 3(8+7+6+5+4+3+2+1)=108

Three zeroes

a 000 \overline{a000}

a a can be 1 to 9,so the number of 4 digit numbers = 9 =9

Ans= 126 + 252 + 108 + 9 = 495 126+252+108+9=495

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...