Probability
The passcode consists of 7 (different) numbers.
Each digit of the number comes from the 10 digits available 0 to 9.
If the 7 digits are known, but not their order, we can calculate the number of possible combinations as follows.
Assume the passcode is ABCDEFG and we have the letters in any order, only one of which is correct.
Once one position is known, the other 6 positions can be sorted in a number given by the combinatorial
7*6*5*4*3*2*1 = 5,040
Only one of those combinations is correct, thus the probability of the spy to unlock the phone on his first try is:
P = 1 / 5,040
Expressed as a decimal:
P = 0.000198
To the nearest millionth