# How many ways are there to form a $4$-digit from $2$ unique digits? - A question

The solution to the problem:
1. Choose the first digit in $9$ ways and place it at the first place.
2. Choose the second digit in $9$ ways
3. Now, fill in the last three gaps: $2^3 -1$ because we don't want numbers composed of only one digit, so the answer is $9\cdot9\cdot(2^3-1)$

Now, here comes my question: the subtraction in the parentheses prevents numbers like $1111, 2222, 3333 ... 9999$. Thus, in fact, it removes 9 numbers from our set. Thus, my question is: What would $9\cdot9\cdot2^3-9$ mean? What numbers would we be counting more than once?

• There aren't ten digits? – law-of-fives May 8 '17 at 21:06

Say the first digit you choose is $1$ and the second digit you choose is $2$. This is one of the $9 \cdot 9$ choices for the two digits. You put $1$ in the first digit, giving $1\_\ \_\ \_$. Now you have two choices for each of the three blanks, so it would seem that you should have $2^3$ choices from here, but if you choose $1$ for all of them you would get $1111$ and have not used two digits, so you subtract $1$ from the $2^3$. If you list the choices by hand you have $112, 121, 122, 211,212,221,222$, which is seven choices. The total number of choices is then $9 \cdot 9 \cdot (2^3-1)=567$
• There should only be $72$ choices for the two digits (not including zero)? – John May 8 '17 at 21:42