How many different permutations are there if you used 4 different digits?

Clean your screen of fingerprints and punch in your security code. View the screen at a shallow angle and you'll see smudges on the digits.
Now you know which digits were used. The number of permutations are now much less than 10^4.
How many different permutations are there if you used 4 different digits?
How many different permutations are there if you repeat a digit?
Remember, you must enter 4 digits to unlock the iPhone.

Starting with a clean screen:
No repeats: 10 * 9 * 8 * 7
With 1 repeat: 10 * 10 * 9 * 8

Starting with a dirty screen:
No repeats: 4 * 3 * 2 * 1
With 1 repeat: 3 * 3 * 2 * 1

CASE 1:
You can see the 4 digits clearly (let's say 4,6,7,9).

There are 4! Ways to rearrange those digits to form an unlock code:
4 x 3 x 2 x 1 = 24 ways

Specifically:
4679, 4697, 4769, 4796, 4967, 4976,
6479, 6497, 6749, 6794, 6947, 6974,
7469, 7496, 7649, 7694, 7946, 7964,
9467, 9476, 9647, 9674, 9746, 9764

CASE 2:
You can see only 3 digits, so one must be repeated (let's say 2,3,7)

There are 3 choices for the repeated digit (2, 3 or 7) --> 3 ways
There are 4C2 = 6 ways you could pick where the repeated digits go. --> 6 ways
The other two digits can fill in either of the remaining positions --> 2 ways

3 x 6 x 2 = 36 ways

Specifically:
2237, 2273, 2327, 2337, 2372, 2373,
2377, 2723, 2732, 2733, 2737, 2773,
3227, 3237, 3272, 3273, 3277, 3327,
3372, 3722, 3723, 3727, 3732, 3772,
7223, 7232, 7233, 7237, 7273, 7322,
7323, 7327, 7332, 7372, 7723, 7732