[Math] How many possible iPhone passwords

combinatoricspermutations

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.

Best Answer

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!}$$