# How many possible iPhone passwords?

A standard iPhone has $10$ digits (ranging from $0$ to $9$) Consider a user who has oily fingers (which is normal for an average user) and he unlocks the iPhone by pressing the numbers on the number pad, creating the password. If he touches the number key, it will be marked (with oil).

If his lock key contains 4 different numbers, there will be 4 marks on the number pad. In this case, we know that there are $^4P_4=24$ possible passwords. Similarly, if the lock key contains only 1 number, there is only 1 possible password, which contains the same number.

It is said that there are more choices if there are 3 marks on the number pad. Could anybody show that? How many possible passwords are there with specifically 3 numbers? Note that an iPhone password has exactly 4 digits.

-
Not a mathematical comment, but worth noting that iOS includes an option for a long passcode, which can be alphanumeric and or arbitrary length. Most people won’t ever use this, but it would make the problem harder. (Especially if, like me, the user’s passcode goes around all ten digits. :P) –  alexwlchan Jun 15 '13 at 11:40

Let the marked keys be: a, b, c
We can choose any of these to be the one which is used more than 1 times. But because length of password is 4, we can only choose one of them to be repeated two times.
So ${3\choose 1}\times \frac{4!}{2!1!1!}$ would be the answer which is 36
Note: If we have $k_1$ objects of type 1, $k_2$ objects of type 2,...,$k_n$ objects of type $n$, the possible ways of arranging them in a row would be $$\frac{(k_1 + k_2 + ...+k_n)!}{k_1!k_2!...k_n!}$$

-
+1. You can write 3C1 as ${{3}\choose{1}}$ using \${{3}\choose{1}}\$ in $\LaTeX$ –  dreamer Jun 14 '13 at 20:39
@rbm Thanks for mentioning that –  Zeta.Investigator Jun 15 '13 at 11:26
@rbm: You can drop a couple of braces to make it easier to read; ${3 \choose 1}$ works similarly well. –  alexwlchan Jun 15 '13 at 11:38

Interchanging the same number wroughts the same password. So there are 2 $abca$ and $acba$. 6 that have aa together by counting them as 1 number. And 4 with a#a, bringing the total to 12, half of the amount possible with four smudges. Multiply this by 3 for the amount of numbers that could be a and you have 36.

-