Intersection of Two Permutations If you are generating 2 digits codes $[X, X]$ where you have 5 choices for $X$. 
The number of choices for each code is:
Order matters so the total number of permutations is $n^r = 5^2 = 25$.
If for the first code the choices were [1,5], [4,8] (inclusive) and in the second code the choices were [3, 7], [2, 6].
How do you find the number of codes which are common to the first and the second?

Hint:  For the first digit to be common, you have choices that are both $[1,5]$ and $[3,7]$.  How many is that?  How many choices for the second digit?  Now multiply, just as you did in the example.
