Random Number Generation
Extracting Random Numbers from Nature
- State two natural sources of random numbers.
- State what devices are used to “extract” the random numbers from the two sources in the previous learning objective.
Pseudorandom Number Generators (PRNG)
- Explain how pseudorandom numbers differ from truly random numbers.
Linear Congruential Generators
- State the algorithm for generating pseudorandom numbers using a linear congruential generator (LCG).
- Given the modulus, multiplier, and increment for a LCG and a seed, generate variates from the LCG.
- Evaluate expressions \(a \operatorname{mod} m\) involving the modulo operation by-hand.
- Compute expressions \(a \operatorname{mod} m\) using R.
- State the possible values that a LCG with a given modulus could generate.
- Given iterates from a LCG with a relatively small period, identify the period of the LCG.
Desirable Properties of Variates from a PRNG
- State three desirable properties of iterates from a PRNG.
- Convert variates uniform on \(\{0, 1, 2, \ldots, m - 1\}\) to variates approximately uniform on \((0, 1)\).
- Compute the quantile function of a given distribution using R.
- Given the quantile function \(q_{F_{X}}\) of a distribution \(F_{X}\) and variates uniform on \((0, 1)\), generate non-uniform variates following \(F_{X}\).
R’s PRNGs
- Use R to generate pseudorandom numbers following a given distribution.
- Set the seed of the PRNG in R, and explain what setting the seed does.
- Explain why it may or may not be appropriate to set the seed in R.