# Linear Congruential Generator (LCG)

The building block of a simulation study is the ability to generate random numbers where a random number represents the value of a random variable uniformly distributed on (0,1).

The generator is defined by the recurrence relation:

Xi+1=(aXi + C) Modulo m

$a$ and $m$ are given positive integers, $X_n$ is either $0,1, \dots, m-1$ and quantity $\frac{X_n}{m}$ is pseudo random number.

Some conditions are:

1. m>0m is usually large
2. 0<a<m;  (a is the multiplier)
3. 0≤<c<m (c is the increment)
4. 0≤X0<m  (X0is seed or starting value)
5. c and m are relatively prime numbers (there is no common factor between c and m).
6. a−1 is a multiple of every prime factor m
7. a−1 is multiple of 4 if m is multiple of 4

If  c=0, the generator is often called a multiplicative congruential method, or Lehmer RNG. If $c\neq0$ the generator is called a mixed congruential generator.

# Statistical Simulation

Simulation is used before an existing system is altered or a new system built, to reduce the chances of failure to meet specifications, to eliminate unforeseen bottlenecks, to prevent under or over-utilization of resources and to optimize system performance. Models are simulated versions/results.
Simulation depends on unknown (or external/ impositions/ factors) parameters and statistical tools depends on estimates.

• Simulation follows finite sample properties (have to specify n)
• Reasoning of statistical simulation can’t be proofed mathematically)
• Simulation is used to illustrate the things.
• Simulation is used to check the validity of methods.
• Simulation is a technique of representing the real world via computer program.
• Simulation is act of initiating the behavior of some situation or some process by means of something suitably analogous. (especially for the purpose of study or some personal training)
• A simulation is representation of something (usually in smaller scale).
• Simulation is the art of giving false/artificial appearance.

Issues of simulations

• What distribution do the random variable have
• How do we generate these random variables for simulation
• How do we analyze the output of simulations
• How many simulation runs do we need
• How do we improve the efficiency of simulation?