28%
Chat with our AI personalities
First, separate the negative and positive integers (put them into two separate groups). If there is a zero, you can put it in its own group - or put it into the same group with the positive integers. Negative integers come first, then zero, then positive integers.For positive integers:An integer with less digits comes before an integer with more digits.For integers with the same number of digits, look at the first digit. The integer with the smaller digit in this position comes first.If the first digit is the same, look at the second digit. If those are equal, look at the third digit, etc.For negative integers, it is the other way round - for example, an integer with MORE digits comes first.
Positive integers are greater than negative integers. For positive integers: * The integer with more digits is larger. * If two integers have the same length, compare the first digit. If the first digit is the same, compare the second digit, then the third, etc., until you find a difference. In each case, the integer with the larger digit (at the first position where you find a difference) is the larger one.
952 of them.
An infinite amount
There is a clever but tricky way to solve this. If we have to find the number of 4-digit integers that contains at least one 5, we can also find the number of all the 4-digit integers and the number of integers that do not contain any 5's and subtract it from the first number. This is called complementary counting.So, first of all, we must find the number of 4-digit numbers there are. There are 9000 of them.Now, we find the number of 4-digit integers without 5's. By thinking a little bit, we see the first digit must be from 0~9 excluding 5. That is a total of 9 numbers. This is the same for the next three digits. Therefore, there are 94 = 6561 4-digit numbers without a 5.Finally, we can subtract. 9000 - 6561 = 2439