Browse · MathNet
PrintXXII OBM
Brazil counting and probability
Problem
Let be the set of all sequences such that for and for . Given in , we define the distance between and as the number of values for , , for which . Find the number of distance-preserving functions , i.e., such that for all and in .
Solution
Let , and , say , and . It's easy to conclude that there exists a unique such that and differ at position , i.e., . This also gives . Another easy argument shows that if , then and also if , then . A similar argument shows the following: let where is the position of 1 and 2, and . Therefore if ( is the position that changes from to ), if and if . Now, it's clear that is a permutation of . On the other hand, if and , where is the position of 1, there is a unique such that . Denoting this by , if , one can show in a similar way that if and if . Finally, in order to count the number of different functions , it suffices to choose , which is a permutation of , , which is a permutation of , and for and for . This gives that the total number of functions is .
Final answer
1000!^2 * 12^{1000}
Techniques
Enumeration with symmetryPermutations / basic group theory