# Math Help - Question from Cambridge STEP Paper.

1. ## Question from Cambridge STEP Paper.

Hi everyone, I was looking through STEP Papers because I'm considering doing Mathematics at University. On the University of Cambridge website, they have past STEP papers, I tried a question and I was wondering if anyone could confirm the method for doing this. The question was:

How many integers between 10 000 and 100 000 (inclusive) contain exactly 2 different digits? (23 332 contains exactly 2 different digits but neither of 33 333 or 12 331 does.)

My calculation gave me an answer of 1 217.

Can someone try this question and let me know what they got and how they got it?

I'll explain my method too after there has been confirmation of whether my answer is right or wrong.

2. Originally Posted by AAKhan07
Hi everyone, I was looking through STEP Papers because I'm considering doing Mathematics at University. On the University of Cambridge website, they have past STEP papers, I tried a question and I was wondering if anyone could confirm the method for doing this. The question was:

How many integers between 10 000 and 100 000 (inclusive) contain exactly 2 different digits? (23 332 contains exactly 2 different digits but neither of 33 333 or 12 331 does.)

My calculation gave me an answer of 1 217.

Can someone try this question and let me know what they got and how they got it?

I'll explain my method too after there has been confirmation of whether my answer is right or wrong.
Here's my naive counting method for doing this. Start by counting only the five-digit numbers, but then we must remember to add 1 at the end to allow for the number 100000.

If both digits are nonzero then one of them, say x, occurs once or twice, and the other one, y, occurs 3 or 4 times. If x occurs once, there are 5 positions where it can occur. If it occurs twice, there are $\textstyle{5\choose2}=10$ possible positions. In each case, there are 9 ways to choose x and 8 ways to choose y. This gives a total of (5+10)×9×8 = 1080 possible numbers.

To those we must add the numbers containing one or more zeros. But a zero cannot occur as the first digit. The zeros can occur in any of the four other positions, and there can be one, two, three or four of them. There are 4×9 numbers with one zero, 6×9 with two zeros, 4×9 with three zeros, and 9 with four zeros. Total: 15×9 = 135.

My final answer is thus 1080 + 135 + 1 = 1216 (the "1" is for the number 100000 that we had to remember to account for).

So, where did number 1217 come from?

The papers are brilliant they cover come really good topics, Cambrdige do set high offers based on the papers though, I have my test in two months

Let me know if you want more resources.

Bobak

4. I agree with the 1216. Here is my approach.
$\binom{9}{2}\sum\limits_{k = 1}^4 \binom{5}{k}+ 9\sum\limits_{k = 1}^4 \binom{4}{k} +1$

5. Originally Posted by bobak
The papers are brilliant they cover come really good topics, Cambrdige do set high offers based on the papers though, I have my test in two months
You are probably going to do well.

6. ## My mistake, it was 1,216

Yes, sorry, you were all right, I meant to say 1,216. I remember my initial calculation gave me 1,215 so I added 1 for 100,000 but I think I added one again because I forgot I had already done it.

My method was 9(4C1+4C2+4C3+4C4)+36(5C1+5C2+5C3+5C4), same as Plato's I think although I could not express it as elegantly as Plato.

Thanks to bobak for the link, I'll be happy to hear about any more Cambridge STEP resources you have, and good luck for your test. Are you hoping to get into Cambridge? Which college? Are you doing AS Mathematics now?

7. ## my crap approach :)

This is my approach to the problem:

(I found the total possible values of "x" and "y", excluding 0 for now, by finding the sum of one to 8 which is 36)

Then calculating the number of posible possitions of "x" and "y" by doing 2^5 -2 = 30 (the -2 is because the digits can not all be the same)

So the number of combinations of the digits excluding 0 is therefore 36 * 30 = 1080

The total posible values of "x" and "y", when "x" = 0 is 9, and as the first digit can't be 0, you half the number of posible possitions making it 15, 15 * 9 = 135

so 1080 + 135 + 1 = 1216 ....