Answer:
a: 16807
b: 0.0000595
Step-by-step explanation:
(a): We have 7 possibilities of numbers, and we need to choose 5 numbers that can repeat. So, for each of the 5 numbers, we have 7 possibilities. To determine how many codes are possible, we just need to multiply the number of possibilities of each of the 5 numbers, so we have 7x7x7x7x7, or 7^5, which is 16807 possibilities.
(b): to put the correct code in the first try, we need to find the exact combination (just one combination) among these 16807 possibilities, so the probability is 1/16807, which is 0.0000595, or 0.00595%.