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 2 0 3 5 is almost increasing.
The number 1 2 = 0 1 2 is a 2 digit number, not a 3 digit number.
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.
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 ( 4 9 ) = 1 2 6 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 ⋅ ( 3 9 ) = 2 5 2 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 ⋅ ( 2 9 ) = 1 0 8 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 1 2 6 + 2 5 2 + 1 0 8 + 9 = 4 9 5 .
I like this explanation the best, and from a Pokefan, too! LOL
ooooh....
Since all digits cannot be 0 , we can have at most 3 digits equal to 0 in any such 4 -digit number and for convenience we can assume that we have 3 different zeros. Thus we would have 9 + 3 = 1 2 digits in total. Since 0 can succeed any integer from 1 to 9 or even 0 itself, we can assume that these 3 zeros are greater than 9 . Thus the problem reduces to choosing 4 digits out of 1 2 . So there are 1 2 C 4 ways to do that. Also we note that any chosen set of 4 digits can be arranged in only single way in ascending order so the answer is 1 2 C 4 = 4 9 5 .
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.
Log in to reply
You are right. So in some sense, though the ordering of numbers from 1 to 9 is fixed, the position of first two zeros is not decided a priori. Thus after choosing 4 elements out of 1 2 , we can decide the ordering of these 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 1 0 2 0 is actually 1 0 1 2 0 2 and 1 2 0 0 is 1 2 0 1 0 2 and then everything is fine!
I dont find it satisfactory, supose we choose 4 numbers 1200, then it can be arranged in 2 ways 2100, 2010
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 . 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 . Now when you choose 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 1 2 C 4 = 4 9 5 ways.
Log in to reply
Ya ur logic seems justified,bt i still cant visualise the concept
Both 1 , 0 1 , 0 2 , 2 and 1 , 0 3 , 0 2 , 2 will give the same arrangement, 1 2 0 0
Log in to reply
@Siddhartha Srivastava – Nope.. since 0 3 > 0 2 , the arrangement 1 , 0 3 , 0 2 , 2 is illegal and will not be counted.
Log in to reply
@Snehal Shekatkar – No, I meant if we choose 1 , 0 1 , 0 2 , 2 It'll be rearranged as 1 , 2 , 0 1 , 0 2 which is 1 , 2 , 0 , 0
And if we choose 1 , 0 3 , 0 2 , 2 It'll be arranged as 1 , 2 , 0 2 , 0 3 which is 1 , 2 , 0 , 0 So the 2 different choices give the same rearrangement
You happened to hit upon ( 4 1 2 ) , though for the wrong reason (if i'm reading your above comment correctly).
Can you find a bijection which clearly establishes that there are ( 4 1 2 ) ways? This will also help you with the n − digit generalization.
Log in to reply
If zero(s) are chosen, put 0 1 in the first position, 0 2 in the second position, 0 3 ) in the third position, and the other chosen numbers in the remaining spaces in ascending order.
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.
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
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
There are 4 places to fill the digits from 0 to 9 . The first place can not contain 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 ways. The one place left can be filled in 9 C 1 ways by selecting the remaining nine digits. This gives us 3 C 3 × 9 C 1 ways of selecting the digits for a number . However, this also turns out to be the number of almost-increasing numbers with 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 ways. The two places left can be filled in 9 C 2 ways by selecting the remaining nine digits. This gives us 3 C 2 × 9 C 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 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 numbers and with no zeroes, we get 3 C 0 × 9 C 4 numbers.
Summing these up gives 4 9 5 .
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.
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
( r n + r − 1 ) .
Obviously there are 7 ways of arranging the almost-increasing numbers; 1 . a 0 0 0 . Here there are 1 ⋅ 9 ways.
2 . a b c 0 , a b 0 c , a 0 b c . Here there are 3 ⋅ T 8 ways.
3 . a b c 0 , a b 0 c , a 0 b c . Here there are 3 ⋅ Tet 7 = 3 ⋅ ( 3 7 + 2 ) ways.
4 . a b c d . Here is where the r-simplex comes in useful, as there are 1 ⋅ ( 4 6 + 3 ) ways (the number of spheres in a 4 − dimensional tetrahedron with its 'base' being a tetrahedron with Tet 6 spheres).
The answer is, after routine calculations, 4 9 5 .
Let the first digit be n , where 0 ≤ n ≤ 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 digits to consider in the remaining spaces because they are strictly higher than 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 ( 1 9 − n ) ways to choose the last digit.
For one 0, there are still three ways to order the 0s, and ( 2 9 − n ) 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 ( 3 9 − n ) possible ways using similar reasoning as above.
Thus, the sum is 9 + 3 ( ( 1 8 ) + ( 1 7 ) + ( 1 6 ) + ⋯ + ( 1 1 ) ) + 3 ( ( 2 8 ) + ( 2 7 ) + ( 2 6 ) + ⋯ + ( 2 2 ) ) + ( ( 3 8 ) + ( 3 7 ) + ( 3 6 ) + ⋯ ( 3 3 ) ) (Note that ( b a ) with a<b is equal to zero and omitted. By the Hockey-Stick Theorem, we get 9 + 3 ( 2 9 ) + 3 ( 3 9 ) + ( 4 9 ) = 4 9 5 .
No zeroes
a b c d
Number of 4 digit numbers= ( 3 8 ) + ( 3 7 ) + ( 3 6 ) + ( 3 5 ) + ( 3 4 ) + ( 3 3 ) = 5 6 + 3 5 + 2 0 + 1 0 + 4 + 1 = 1 2 6
One zero
a 0 b c / a b 0 c / a b c 0
Number of 4 digit numbers= 3 ( ( 2 8 ) + ( 2 7 ) + ( 2 6 ) + ( 2 5 ) + ( 2 4 ) + ( 2 3 ) + ( 2 2 ) ) = 3 ( 2 8 + 2 1 + 1 5 + 1 0 + 6 + 3 + 1 ) = 2 5 2
Two zeroes
a 0 0 b / a 0 b 0 / a b 0 0
Number of 4 digit numbers= 3 ( 8 + 7 + 6 + 5 + 4 + 3 + 2 + 1 ) = 1 0 8
Three zeroes
a 0 0 0
a can be 1 to 9,so the number of 4 digit numbers = 9
Ans= 1 2 6 + 2 5 2 + 1 0 8 + 9 = 4 9 5
Problem Loading...
Note Loading...
Set Loading...
We will look at four cases.
Numbers which have three 0 digits
Numbers which have two 0 digits
Numbers which have one 0 digit
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 ) ) = 3 × C ( 9 , 2 ) = 1 0 8 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 ) ) = 3 × C ( 9 , 3 ) = 2 5 2 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 ( 9 , 4 ) = 1 2 6 almost increasing numbers.
So, there are 9 + 1 0 8 + 2 5 2 + 1 2 6 = 4 9 5 almost increasing numbers