# In how many ways can you form a three-digit number using these digits?

In how many ways can you form a three-digit number using the digits of the number 21,150?

My solution (it's wrong, but I'm trying to find out why):

Use 3 cases:

Case 1: First number is a 2. There are 4 choices for the second number, and 3 for the third.

Case 2: First number is a 1. There are 4 choices for the second, and 3 for the third.

Case 3: First number is a 5. There are 4 choices for the second, and 3 for the third.

Thus, multiplying (4 * 3) = 12, and adding all 3 of the cases, we get 36.

My book says the answer is 26.

Why am I wrong, and what is the correct solution?

Thank you.

• In cases 1 and 3, I don't think there are 4 choices for the second number. – user84413 Sep 18 '15 at 0:37
• I see, I corrected that mistake. Now I have 3 choices for the second, and 2 for the third. 3 * 2 = 6. 6 + 6 + 12 = 24. Not 26 yet... – user164403 Sep 18 '15 at 0:42
• I would probably construe the question as meaning it is permissible to use more than one $1$. ${}\qquad{}$ – Michael Hardy Sep 18 '15 at 1:08

a) If the first digit is 1, then there are 4 choices for the 2nd digit and 3 choices for the 3rd digit,

$\;\;\;$giving $1\cdot4\cdot3=12$ possibilities.

b) If the first digit is 2 or 5 and the second digit is 1, then there are 3 choices for the last digit,

$\;\;\;$giving $2\cdot1\cdot3=6$ possibilities.

c) If the first digit is 2 or 5 and the second digit is not 1, then there are 2 choices for the 2nd digit

$\;\;\;$ and 2 choices for the 3rd digit, giving $2\cdot2\cdot2=8$ possibilities.

Therefore there are $\color{blue}{26}$ possibilities in total.

• I see that you used the case where the second digit is or is not 1. How would I do this for more complicated scenarios? Ex., in my work package I have a question, "How many 7-digit even numbers less than 3000000 can be formed using the digits 1,2,2,3,5,5,6?". I understand the even, and less than 3000000 restrictions, but how would I apply your thinking with duplicate numbers here? – user164403 Sep 18 '15 at 1:14
• It's basically counting enumerations in a multiset with $x$ elements from $n$. – user271754 Sep 18 '15 at 1:18
• You know that the first digit is 1 or 2, and the last digit is 2 or 6; so one way to do this would be to break it up into 4 cases. – user84413 Sep 18 '15 at 1:19
• I managed to see what you meant by breaking it into 4 cases. Thanks. – user164403 Sep 18 '15 at 1:20
• For the case where the first digit is 2 and the last digit is 6, say, we have 5 choices for placing the 1, 4 choices for placing the 3, and 3 choices for placing the other 2 (and then the 5's go in the remaining spots); so this gives 5x4x3=60 choices. – user84413 Sep 18 '15 at 1:23

There are two 1 in the number.   So let your case work depend on whether you use both or not.

Case A: $(x,y,z)$   No more than one 1 is used.   Count the ways to select three digits from $\{0, 1, 2, 5\}$ and arrange. Remember to exclude those beginning with 0.

There are $\binom{4}{3}$ ways to select three of four digits, and then $3!$ ways to arrange them.   However there are $\binom{3}{2}$ ways to select zero and two of three digits, and $2!$ arrangements of these begin with 0.   Multiplying and subtracting where appropriate, we count $18$ valid three digit numbers in case A.

Case B: $(1,1,x)$   Both 1 are used.   Count the ways to select both of these and one digit from $\{0, 2, 5\}$ then arrange. Of course, exclude those beginning with 0.

There's $3$ ways to select one of three digits, and then $3$ ways to select a position for it, but we need to subtract the $1$ way that places zero at the start.   Thus we count $8$ ways for case B.

That is a total of $26$ ways to select and arrange three digits that are a valid three digit number.

It's all combinations and permutations.

• I've never learned combinations, can you elaborate more on the permutations method? Or the case-work method. – user164403 Sep 18 '15 at 0:52
• @user164403 Spoilers may spoil things, but over your mouse over them to reveal if you wish. – Graham Kemp Sep 18 '15 at 1:06

For the hundredth-digit there're $3$ choices, namely $\{1,2,5\}$.

For the tenth-digit, if the hundredth-digit is $2$ or $5$ then there're $3$ choices ($\{1,5,0\}$ if the hundredth-digit is $2$, otherwise $\{1,2,0\}$), which leaves $2$ choices for the integer-digit. However, if the tenth-digit is a $1$ then it leaves $3$ choices for the integer. Thus $2\times(2\times2+3)=14$.

If instead the tenth-digit is $1$, then there're $4$ choices left to choose the tenth-digit $\{1,2,5,0\}$ and then $3$ choices for the integer. Thus $4\times3=12$

Therefore, the answer is $14+12=\boxed{26}.$

• +1, but you meant "e.g.", not "i.e.". "i.e." means "that is", whereas "e.g." means "for example". – 6005 Sep 18 '15 at 0:46
• my apologies .. – user271754 Sep 18 '15 at 0:47
• How are there 3 choices {1, 2, or 5,0}? – user164403 Sep 18 '15 at 0:57
• Note that when you're choosing the hundredth-digit you have used $2$ or $5$. So only one of them remain. – user271754 Sep 18 '15 at 1:05