Applications
Contents
4.5. Applications#
To be continued…
4.5.1. Pseudo-Random Numbers#
Randomly generating numbers is a crucial subroutine of many algorithms in computer science. Because computers execute deterministic code, it is not possible (without external influence) to generate truly random numbers. Hence, computers actually generate psuedo-random numbers.
The linear congruential method is a simple method for generating pseudo-random numbers.
Let
The initial condition of the recurrence realtion is called a seed of the random number generator.
If we let
Notice that this sequence repeats after the first six elements. Linear congruence methods are always periodic. They repeat after a certain number of repetitions. However, with
For a linear congruence generator to have a maximum period, it needs several conditions. These conditions are given by the Hull–Dobell theorem.
Theorem (Hull–Dobell Theorem)
A libnear congruence generator produces a period equal to
and are relatively prime, is a divisible by all the prime factors of , and is divisible by 4 if is divisible by 4.
We will not prove this theorem, but its interesting nonetheless.
4.5.2. Cryptogrophy#
A general overview is available here.