Simulation and Modeling · Unit 5 · 7 hrs
Random Numbers
Exam-focused notes for Random Numbers (Simulation and Modeling, CSC328): what the TU syllabus asks and how it has actually been tested, with 13 solved past questions from this unit.
What this unit covers
- Random Numbers and its properties
- Pseudo Random Numbers
- Methods of generation of Random Number
- Tests for Randomness - Uniformity and independence
- Random Variate Generation
Tests for Randomness - Uniformity and independence
What are the properties of random numbers?
The sequence of numbers 0.23, 0.45, 0.67, 0.12, 0.89, 0.34, 0.56, 0.78, 0.19, 0.41, 0.63, 0.08, 0.85, 0.29, 0.51, 0.73, 0.16, 0.94, 0.37, 0.59 has been generated. Test for the independence among numbers in the sequence starting with index $i = 2$ and lag $m = 3$ using auto-correlation test. ($\alpha = 0.05$, $Z_{\alpha/2} = 1.96$)[10]
Random numbers $Ri$ must satisfy two key properties: 1. Uniformity The numbers are uniformly distributed on $(0,1)$; every value is equally likely. The pdf is: $$f(x) = \begin{cases} 1 & 0 \le x \le 1 \\ 0 & \text{otherwise} \end{cases}$$ with $E(R) = \tfra...
Full solved answer →Explain the independence and uniformity property of random number. For the following sample of random numbers, perform test for independence using K-S test. ($D_{0.05,10} = 0.41$) 0.35, 0.77, 0.12, 0.33, 0.88, 0.45, 0.19, 0.25, 0.91, 0.54[10]
The random numbers $Ri$ are assumed to be drawn from a continuous uniform distribution over $[0,1]$: $$f(x) = \begin{cases} 1 & 0 \le x \le 1 \\ 0 & \text{otherwise} \end{cases}$$ - $E(R) = \dfrac{1}{2}$, $\text{Var}(R) = \dfrac{1}{12}$ - Every equal-length...
Full solved answer →What are the two main properties of random numbers? Test whether the 3rd, 7th, 11th, and so on numbers in the sequence in the following random number sample are auto-correlated. ($Z_{\alpha}=0.05$ and $Z_{0.025}=1.96$)
0.12, 0.01, 0.23, 0.28, 0.89, 0.31, 0.64, 0.28, 0.83, 0.93, 0.99, 0.15, 0.33, 0.35, 0.91, 0.41, 0.60, 0.27, 0.75, 0.88, 0.68, 0.49, 0.05, 0.43, 0.95, 0.58, 0.19, 0.36, 0.69, 0.87, [10]
1. Uniformity: The random numbers $Ri$ are uniformly distributed on $[0,1]$. Each value is an independent draw from a continuous uniform distribution with pdf $$f(x)=\begin{cases}1 & 0\le x\le 1\\ 0 & \text{otherwise}\end{cases}$$ giving $E(R)=\tfrac12$ and...
Full solved answer →Define and develop a Poker test for four-digit random numbers. A sequence of 1,000 random numbers, each of four digits has been generated. The analysis of the numbers reveals that in 525 numbers all four digits are different, 419 contain exactly one pair of like digits, 47 contain two pairs, 9 have three digits of a kind and 7 contain all like digits. Use Poker test to determine whether these numbers are independent. (Critical value of chi-square for a = 0.05 and N = 4 is 9.49).[10]
Category Observed $Oi$ ------ All four digits different 525 Exactly one pair 419 Two pairs 47 Three of a kind 9 All four alike 7 Total 1000 - $N = 1000$ numbers, each 4 digits - Critical value: $\chi^2{0.05,\,4} = 9.49$ (degrees of freedom = 4) --- The Poke...
Full solved answer →Define true random numbers and pseudo random numbers with its properties. The sequence of numbers 0.64, 0.50, 0.25, 0.58, 0.72, 0.90 has been generated. Use KS Test with Da=0.050 => 0512 to determine if the hypothesis that they are uniformly distributed on interval [0, 1] can be rejected.[10]
True random numbers are drawn from genuinely unpredictable physical processes (radioactive decay, thermal/electronic noise, atmospheric noise). Properties: - Non-deterministic and non-reproducible - Each value independent of all others - Require a physical ...
Full solved answer →Difference between chi-square test and KS test for uniformity. Use KS test to check for the uniformity for the input set of random numbers given below. 0.54, 0.73, 0.98, 0.11, 0.68, 0.45. Assume level of significance to be $D_{a=0.05} => 0.565$ [10]
Basis Chi-Square Test Kolmogorov-Smirnov (KS) Test --------- Data type Suited to discrete / grouped (binned) data Suited to continuous data, used on raw values Grouping Requires grouping into class intervals No grouping needed Sample size Needs a large samp...
Full solved answer →Random Variate Generation
Discuss the inverse transform technique and acceptance-rejection technique for random variate generation. [5]
--- The inverse transform method generates random variates by inverting the Cumulative Distribution Function (CDF) of the desired probability distribution. The technique can be utilized for any distribution when the CDF, F(x), is of a form that its inverse ...
Full solved answer →Explain generation of non uniform random number generation using inverse method. [5]
The Inverse Transform Method is a technique for generating random variates (non-uniform random numbers) from any desired probability distribution by using uniformly distributed random numbers R ~ U(0,1) as input. The core idea is based on the fact that if X...
Full solved answer →Methods of generation of Random Number
Write a short note on: a. Mid Square Method b. Digital Analog Simulation [2.5+2.5]
--- The Mid Square Method is one of the earliest and simplest techniques for generating pseudo-random numbers. It was proposed by John von Neumann. 1. Start with an n-digit seed number (initial value) $X0$. 2. Square the seed to obtain a $2n$-digit number (...
Full solved answer →Generate 10 random integers using Linear congruential method where $m=1000$, $a=19$, $c=6$ and $X_0=13$. [5]
Parameter Value ------------------ Modulus $m$ 1000 Multiplier $a$ 19 Increment $c$ 6 Seed $X0$ 13 Number of random integers required: 10 $$X{n+1} = (aXn + c) \bmod m = (19Xn + 6) \bmod 1000$$ Since $c \neq 0$, this is the mixed (linear) congruential method...
Full solved answer →Generate ten 3 digit random integers and corresponding random variables using Multiplicative Congruential method where a =7, and X0= 22. [5]
- Method: Multiplicative Congruential Generator (MCG), so $c = 0$ - Multiplier: $a = 7$ - Seed: $X0 = 22$ - Required: ten 3-digit random integers and corresponding random numbers - Modulus $m$: not given in the question Missing data note: The modulus $m$ is...
Full solved answer →Use Multiplicative congruential method to generate a sequence of random numbers with X=7, a=11 m=16. [5]
Parameter Value ------------------ $X0$ (seed) 7 $a$ (multiplier) 11 $m$ (modulus) 16 $c$ 0 (multiplicative case) Recurrence: $X{n+1} = (a \cdot Xn) \bmod m = (11 \cdot Xn) \bmod 16$ Iteration 1: $$X1 = (11 \times 7) \bmod 16 = 77 \bmod 16 = 13 \quad (77 = ...
Full solved answer →Use Mixed congruential method to generate a sequence of random numbers with $X_0 = 27$, $n = 17$, $m = 100$ and $c = 43$. [5]
Parameter Symbol Value -------------------------- Seed $X0$ 27 Multiplier $a$ (given as $n$) 17 Modulus $m$ 100 Increment $c$ 43 Mixed (Linear) Congruential Method, with $c \ne 0$: $$X{i+1} = (aXi + c) \bmod m = (17Xi + 43) \bmod 100$$ $$Ri = \frac{Xi}{m}$$...
Full solved answer →Make Unit 5 stick
Practice CSC328 with flashcards & quizzes