How to calculate probability of “digit pairs”?
If the four-digit string contains two consecutive digit pairs, then it has the pattern aabb for some digits a and b, both drawn from the set 0-9. That is, 2277 contains two consecutive digit pairs, and so does 5555 (where in this case a=b). The probability that a random string contains two consecutive digit pairs is 0.01. There are two ways to work this out: Method 1) The only requirement is that the second digit match the first (probability 0.1) and that the fourth digit match the third (also probability 0.1); as these are independent, the probability of both matches is 0.1 * 0.1 = 0.01 Method 2) There are 10,000 possible four-digit strings. There are 100 possible 2-digit strings, and there is a 1-to-1 mapping between four-digit strings consisting of two consecutive digit pairs and the possible 2-digit strings (mapping each of the four-digit strings to one consisting of its second and third digits). The probability is therefore 100/10,000 = 1/100 = 0.