Hey wicksteed.

For number 2, this question is a little too vague to give a precise answer.

For number 1, you need to consider the possibility that 0, 1, 2, 3, and 4 unique digits exist. We can treat this as a binomial and if every digit has the same likelihood then probability of getting that particular digit is 1/10 and not getting it is 9/10 providing that every digit is independent and has the same distribution.

For the one digit scenario we have a Binomial distribution with n = 4 and p = 1/10 (probability of getting that 1 digit in one slot).

If you can only get one correct digit in any slot, the probability is 4*(1/10)*(9/10)^3. If you can that unique digit twice the probability is 6*(1/10)^2*(9/10)^2, three times its 4*(1/10)^3*(9/10) and if the unique digit is in every digit of the number the probability is (1/10)^4.

If you want to add these all up, the probability is 1 - (9/10)^4.