|
|
|
|
|
by paulgb
6417 days ago
|
|
Technically speaking, yes. But, if you want to uniformly map a random number from set X to set Y where (IIRC) lcm(|X|, |Y|) != |X|, it seems you need an infinite worst-case running time. Here's an informal proof that you can't have a finite upper bound to the number of iterations. After n iterations, you have |X|^n possible outcomes. But, since lcm(|X|, |Y|) != |X|, |X|^n cannot be divided evenly by |Y| (since its factors are the same). So some outcomes in Y must be more likely than others. (This is not nearly complete, but hopefully it's enough to show how it might be right.) Of course, in practice it is highly unlikely that you will get past more than a couple iterations before determining an outcome. |
|
Can you go into more detail about this part?