Does "modulo 97 base 10" check digits follow an "uniform distribution"?

395 Views Asked by At

I have a batch of random numbers, all with 2-digit check digits, the algorithm module 97, base 10 (ISO 7064: 2003).

So, the check digits are distributed in an interval of 97 possible results, from 02 to 98. There are no check digits 00, 01, nor 99.

I did some simulations in Excel and apparently the check digits are spreaded with good uniformity among the 97 possible results. The algorithm is based on the rest of the division by 97, so I got the impression that an uniform distribution is really expected. Is this assumption correct, for random data?

I googled this silly question, but I didn't find an answer (maybe I used the wrong words when doing the search?).

Also, my native language is not English, so, if I have committed some grammatical or spelling mistake, I thank you very much for correcting it.

1

There are 1 best solutions below

0
On BEST ANSWER

Yes: if the input numbers are chosen uniformly over a big range, their checksums will be very nearly uniformly distributed over the 97 possibilities. Why not exactly? Suppose the input numbers are chosen from the range from 1 to 97,000,000. Then the 97 remainders will be exactly equally likely. But if the input numbers are chosen from the range 1 to 97,000,050 then 50 of the check sums will be slightly more likely than the other 47.