correction of the exercise:

1)

a) the number of possible codes is a 4-lists of 10 numbers. so they are 10^4=10000

b)The number of different codes (0987 has four different numbers, 1223 has not) is composed

by 10numbers, then 9, then 8 then 7, every chosen number cant be taken again. So this number is 10*9*8*7=5040.

2)

a) If the number were all different, the number of different codes possible would be a permutation of 4 elements:

it would be 4!=4x3x2X1=24. (the first number can be one of the four numbers, then the second the 3 following numbers and the third the 2 following numbers...) But we have 1,9,9,5 and the number 9 is repeated. there is 2 possibility to permute 2 different numbers in a code so the numers of possibility is to divide by 2,

so the numbers of different possible codes with the numbers 1,9,9,5 is (4*3*2)/2=12

b)24hours is 24*60 minutes = 1440 minutes

if we do a chart to represent the numbers of attempt, the time to add between 2 attempts and the total waiting time, we have this:

attempt-waiting time-total time

1 0 0

2 2 2

3 4 6

4 8 14

5 16 30

6 32 62

7 64 126

8 128 254

9 256 510

10 512 1022

11 1024 2046

after 10 attempts 1022 minutes have passed, after 11, 2046. So the answer is 10.