dimanche 8 janvier 2017

What is the importance of prime numbers in random number generating algorithms?

http://ift.tt/2i9eaPJ

random i = 7 * i mod 11

Since the answer is always a remainder when dividing by 11, it’ll be somewhere between 0 and 10. But it should be pretty easy to convince ourselves that if the number we give as input is between 1 and 10, then 0 isn’t a possible answer: if it were, then we’d have found two numbers, both less than 11, that multiply together to give us a multiple of 11. That’s impossible because…. 11 is prime.

Here 7 is also prime and 11 is also prime.

I could not understand the explanation given above. Why 7 and 11 are prime? What would have happened had they not been prime?




Aucun commentaire:

Enregistrer un commentaire