Random Numbers and Monte-Carlo Methods
Random Numbers and Monte-Carlo Methods
PRNG - CHARACTERISTICS
• Deterministic: Given the same initial conditions, the sequence of numbers will always be the
same.
• Periodicity: After a certain number of iterations (period), the sequence will start repeating itself.
Cycle length should be long.
• Uniform Distribution: Ideally, the numbers should be uniformly distributed over a range. Eg: [0,1)
• Unpredictability: Despite being deterministic, PRNs should be difficult to predict without knowing
the algorithm or seed.
• a, c < m
• Modulus (m): Determines the range of possible random numbers.
Typically, a power of 2 or a large prime number is used.
• Multiplier (a): Should be carefully chosen for the best randomness.
• Increment (c): Introduces a constant shift. If c=0, the generator is called
a multiplicative LCG.
• Sequence begins with seed X0.
• m > 0;
• a, c < m; & X0 < m
• Shuffling
• If the observed no.s are significantly different from expected no.s then
we conclude that the PRNG is a poor one.
• Compare with the Critical Value: Compare the calculated chi-square
statistic 𝜒𝑐2 with a standard Chi-Squared distribution with ‘k-1’ degrees
of freedom (𝜒𝑘−1
2
) at a chosen significance level α
• If 𝝌𝟐 ≤ 𝝌𝟐𝒄 Numbers are uniformly distributed. (Null-hypothesis is
valid). That is no correlation between the RNs.
• Else, Number are not uniformly distributed. (Null-hypothesis is invalid)
Mean is calculated
Set the lag k = 1: Each number is compared with immediate next number
Calculate
The serial correlation coefficient r1= − 0.158 suggests that there is a slight
Interpret the result negative correlation between successive random numbers, but this value is
close to 0, which typically indicates no strong evidence of correlation.