Given that each number can be repeated, we use the following formula to find the number of possible codes.
[tex]n^m[/tex]Where n = 8 (the total number of digits) and m = 3 (the number of digits needed for a code).
[tex]8^3=512[/tex]In order to find the probability of randomly selecting the correct access code is 1/512 because there's just one correct code among 512 total.
[tex]P_{\text{correct}}=\frac{1}{512}\approx0.002[/tex]At last, to find the probability of not selecting the correct code, we just have to find the complement probability, which consists in subtracting from 1.
[tex]P_{\text{not correct}}=1-\frac{1}{512}\approx0.998[/tex]