Passcode permutations In how many ways can a passcode of length $7$ be generated from the set $\{0, 1, ..., 9, a, b, ..., z, A, B, ..., Z\}$ with exactly $4$ entries being letters if:
(i) Repetition is allowed?
(ii) Repetition isn't allowed?
My attempt:
(i) There are $52^4$ ways to arrange $4$ letters together. Then, there are $62^4$ ways to arrange the entire passcode. So, there are $52^4 \cdot 62^4$ ways.
(ii) There are $52P4$ ways to arrange $4$ letters together and $62P4$ ways to arrange the whole passcode. So, we have $52P4 \cdot 62P4$ ways in total.
Is my solution correct? I often struggle with permutations so any assistance is appreciated.
 A: 
In how many ways can a passcode of length $7$ be generated from the set $\{0, 1, \ldots, 9, a, b, \ldots, z, A, B, \ldots Z\}$ with exactly $4$ entries being letters if repetition is allowed?

Choose which four of the seven positions will be filled with letters.  For each of these four positions, there are $52$ choices.  The remaining three positions must be filled with digits.  For each of these three positions, there are $10$ choices.

  There are $$\binom{7}{4}52^410^3$$ passcodes of length $7$ which can be formed if exactly four of the entries are letters and repetition is allowed.


In how many ways can a passcode of length $7$ be generated from the set $\{0, 1, \ldots, 9, a, b, \ldots, z, A, B, \ldots Z\}$ with exactly $4$ entries being letters if repetition is not allowed?

Choose which four of the seven positions will be filled with letters.  The first of these four positions can be filled with a letter in $52$ ways, the second in $51$ ways, the third in $50$ ways, and the fourth in $49$ ways. The remaining three positions must be filled with digits.  The first of these three positions can be filled with a digit in $10$ ways, the second in $9$ ways, and the third in eight ways.

  There are $$\binom{7}{4}P(52, 4)P(10, 3)$$ ways to form a passcode of length $7$ if exactly four of the entries must be letters and repetition is not permitted.

Why is your solution incorrect?
As discussed in the comments, you did not take into account the fact that exactly four of the entries are letters.  The strategy you discussed in the comments is designed for a block of four consecutive letters.  Suppose you wanted to count the number of passcodes of length $7$ with exactly four letters, all of which are consecutive, if repetition is permitted.  You would have four objects to arrange, the block of four letters and the three digits.  The objects could be arranged in $4!$ ways.  There would be $10$ choices for each digit and $52$ choices for each letter within the block, giving you $$4!10^326^4$ such passcodes.
