Pseudo Random Numbers (2014)

A sequence of Pseudo Random Numbers is generated by a deterministic algorithm and should simulate a sequence of independent and uniformly distributed random variables on the interval [0, 1]. Every random experiment results in two or more outcomes.

A variable whose values depend upon the outcomes of a random experiment is called a random variable denoted by capital letters $X, Y$, or $Z$ and their values by the corresponding small letters $x, y$, or $z$.

Pseudo Random Numbers and their Generation

Random numbers are a sequence of digits from the set {0,1,2,⋯,9} so that, at each position in the sequence, each digit has the same probability 0.1 of being selected irrespective of the actual sequence, so far constructed.

The simplest ways of achieving such numbers are games of chance such as dice, coins, and cards, or by repeatedly drawing numbered slips out of a jar. These are usually grouped purely for the convenience of reading but this would become very tedious for long runs of each digit. Fortunately, tables of random digits are widely available now.

Pseudo Random Numbers and Their Process

pseudo random process is a process that appears to be random but actually, it is not. Pseudo random sequences typically exhibit statistical randomness while being generated by an entirely deterministic causal process. Such a process is easier to produce than a genuinely random one and has the benefit that it can be used again and again to produce the same numbers and they are useful for testing and fixing software.

For implementation on computers to provide a sequence of such digits easily, and quickly, the most common methods are called Pseudo Random Technique.

Here, the digit will eventually reappear in the same order (cycle. For a good technique, the cycle might be tens of thousands of digits long. Of course, the pseudorandom numbers/digits are not truly random. They are completely deterministic but they do exhibit most of the properties of random digits. Generally, their methods involve the recursive formula e.g.

\[X_{n+1}= a x_n +b\, mod\, m; n=0, 1, 2, …\]

$a, b$, and $n$ are suitably chosen integer constants and the seed $x_0$ (a starting number i.e. n = 0) is an integer. (Note mode $m$ means that if the result from the formula is greater than m, divide it by m and keep the remainder as a random number.

Use of this formula gives rise to a sequence of integers each of which is in the random 0 to $m-1$.

Example (Pseudorandom Numbers Generation)

let a = 13, b=5, and m = 1000, Generate 500 random numbers.

Solution

\[x_{n+1}=a \, x_n + \,b\, mod\, 1000; n=0,1,2,…\]

let seed $x_0=5$, then for $n=0$ we have

\begin{align*}
x_{0+1}&=13 \times 5 +5\, mod\, 1000=70\\
x_{1+1}&=13 \times 70 + 5\, mod\, 1000=915
\end{align*}

Pseudo Random Numbers

Application of Random Variables

The random numbers have wide applicability in the simulation techniques (also called Monte Carlo Methods) which have been applied to many problems in the various sciences and one useful in situations where direct experimentation is not possible, the cost of experimenting is very high or the experiment takes too much time.

R code to Generate Random Number

# store the pseudo random output
a = 13
b = 5
m = 1000
sim = 500
x <- numeric (sim)
x[0] = 5
for (i in 1: sim){
  x[i+1] <- (a * x[i] + b ) %% 1000
}
x[2:sim]
Pseudo Random Numbers Generation

Pseudo random numbers (PRNs) are a cornerstone of computer simulations and many other applications. However, computers cannot generate true randomness and PRNs are used extensively in many fields, including:

  • Simulations: Modeling complex systems like Financial market analysis, weather patterns, or traffic flow often relies on PRNs.
  • Games: From card shuffles to enemy movement in computer video games, PRNs add an element of chance and keep things interesting.
  • Cryptography: While not the only source, PRNs are used to generate encryption keys that appear random and improve security.

Read more about Pseudo Random Process | Random Number Generation and Linear Congruential Generator (LCG)

Read more on Wikipedia: Pseudo Randon Numbers generator

Generate Binomial Random Numbers in R

What is Pseudo Random Process (2012)

Pseudo Random Process

A pseudo random refers to a process that generates a sequence of numbers or events that appears random but actually, is not and is determined by a fixed set of rules. Pseudorandom sequences typically exhibit statistical randomness while being generated by an entirely deterministic causal process. Such a process is easier to produce than a genuinely random one and has the benefit that it can be used again and again to produce the same numbers and they are useful for testing and fixing software.

The generation of random numbers has many uses (mostly in Statistics, Random Sampling, and Simulation, Computer Modeling, Markov Chains, and Experimental Design). Before modern computing, researchers requiring random numbers would either generate them through various means like a coin, dice, cards, roulette wheels, card shuffling, etc., or use existing random number tables.

Pseudo Random Process

A pseudo-random variable is a variable that is created by a deterministic procedure (often a computer program or subroutine is used) which (generally) takes random bits as input. The pseudo random string will typically be longer than the original random string, but less random (less entropic, in the information-theory sense). This can be useful for randomized algorithms.

Pseudo-random numbers are computer-generated random numbers and they are not truly random because there is an inherent pattern in any sequence of pseudo numbers.

A question arises here why do we use something that is not truly random? The reasons behind the use of pseudo random process are:

  • Speed and Efficiency: Generating pseudo-random numbers is much faster and more efficient than using true random sources like physical processes.
  • Reproducibility: Using the same seed, one can reproduce the same sequence of pseudo-random numbers. which is useful for debugging or comparing simulations.

Read more about Random Number Process, Pseudo-Random Number Generation, and Linear Congruential Generator (LCG)

Read more about Pseudo-Random Number Generator

Generate Binomial Random Numbers in R