There are two kinds of probabilities:
Multiplication rules: A process takes several steps. The subsequent steps can only be performed after the previous steps are completed. The probability of completing the process is the product of the probability of the previous steps. Imagine that if the probability of a process in the middle is 0, the final step cannot be completed, and the probability must be 0. This is of course a multiplication relationship, the addition operation will not get the result of 0.
Addition Rules: One of multiple methods can be used to complete a process (any method can be used). The probability of completing this process is the sum of the probabilities of these methods.
For example:
To retrieve 3D numbers from 0-9, first retrieve the hundred digits, then retrieve the ten digits, and finally retrieve the single digit. This means that the 3D number is complete. You can score three steps and cannot complete any step if it is missing, then the probability of 3D completion is the sum of the probability of completing, 10, and 3 steps: P (3D) = P () * P (10) * P (count)
If the number is obtained for a hundred bits, you can get 0, 1, and 9. So the probability of getting a hundred bits is summed up. For example, the probability of getting a hundred bits to {14568} is P (1) + P (2) + P (5) + P (6) + P (8) = (1/10) * 5 = 5/10.
Now we can combine the multiplication rules to obtain the probability that all 10 million codes are within {14568} (5/10) * (5/10) * (5/10) = 125/1000 = 1/8.