0% found this document useful (0 votes)
20 views7 pages

Random Numbers

Uploaded by

om.work466
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
20 views7 pages

Random Numbers

Uploaded by

om.work466
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 7

RANDOM NUMBERS

 Random numbers are a necessary basic ingredient in the simulation of almost all
discrete systems.
 Most computer languages have a subroutine, object, or function that will generate a
random number.
 Similarly, simulation languages generate random numbers that are used to generate
event times and other random variables.
 The generation of random numbers and their subsequent testing for randomness
shows how random numbers are used to generate a random variable with any desired
probability distribution
PROPERTIES OF RANDOM NUMBERS
A sequence of random numbers, 𝑅1 , R2 , ••• , must have two important statistical
properties: uniformity and independence. Each random number Ri ; must be an
independent sample drawn from a continuous uniform distribution between zero and 1
• That is, the pdf is given by

This density function is shown in Figure pdf for random numbers.

The expected value of each is given by

and the variance is given.by


Usually, random numbers are generated by a digital Computer, as part of the simulation. There are
numerous methods that can be used to generate the values. Before we describe some of these methods, or
routines, ***  there are a number of important considerations that we should mention:

 The routine should be fast. Individual computations are inexpensive, but simulation could
require many millions of random numbers. The total cost can be managed by selecting a
computationally efficient method ( Analytic Model) of random number generation.
 The routine should be portable to different compute and ideally, to different programming
languages. This is desirable so that the simulation program will produce the same results
wherever it is executed.
 The routine should have a sufficiently long cycle. The cycle length, or period, represents the
length of the random number sequence before previous numbers begin to repeat themselves
in an earlier order. Thus, if 10,000 events are to be generated, the period should be many
limes that long. A special case of cycling is degenerating. A routine degenerates when the
same random numbers appear repeatedly. Such an occurrence is certainly unacceptable. This
can happen rapidly with some methods.
 The random numbers should be replicable. Given the starting point (or conditions) it should
be possible to generate the same set of random numbers. completely independent of the
system that is being simulated. This is helpful for debugging purposes and is a means of
facilitating comparisons between systems
TECHNIQUES FOR GENERATING RANDOM NUMBERS

The linear congruential method, initially proposed by Lehmer [1951], produces a


sequence of integers, 𝑋 1 , 𝑋 2 , …, 𝑋 𝑚 between zero and m - 1 by following a recursive
relationship:

X i 1 ( aX i  c )mod( m ) i 0,1,2,
The initial value 𝑋 0 is called the seed, a is called the multiplier, c is the increment, and m is the
modulus.
If c not equal to 0 in Equation, then the form is called the mixed congruential method. When c = 0, the
form is known as the multiplicative congruential method. The selection of the values for a, c, m, and X 0
drastically
𝑛
1.If the interval [0, l] is divided into classes, or subintervals of equal length, the expected number of
observations in each interval is 𝑁 , where N is the total number of observations.
𝑛
2. The probability of observing a value in a particular interval is independent of the previous values drawn.
.

GENERATION OF PSEUDO RANDOM NUMBERS

Notice that the title has the word "pseudo" in it. "Pseudo" means false, so false random numbers are being
generated! In this instance, "pseudo" is used to imply that the very act of generating random numbers by a
known method removes the potential for true randomness. If the method is known, the set of random numbers
can be replicated. Then an argument can be made that the numbers are not truly random. The goal of any
generation scheme, however, is to produce a sequence of numbers between 0 and l that simulates, or imitates,
the ideal properties of uniform distribution and independence as closely as possible.
To be sure, in the generation of pseudo-random numbers, certain problems or errors
can occur

1. The generated numbers might not be uniformly distributed.


2. The generated numbers might be discrete-valued instead of continuous-valued.
3. The mean of the generated numbers might be too high or too low.
4. The variance of the generated numbers might be too high or too low.
5. There might be dependence.
The following are examples:
(a) autocorrelation between numbers;
(b) numbers successively higher or lower than adjacent numbers;
(c) several numbers above the mean followed by several numbers below the mean.
Example
• Use the linear congruential method to generate a sequence of random numbers
with X 0 = 27, a= 17, c=43, and m = 100. Here, the integer values generated will
all be between zero and 99 because of the value of . Also, notice that random
integers are being generated rather than random numbers. These random
integers should appear to be uniformly distributed on the integers zero to 99.
Random numbers between zero and 1 can be generated by
Xi
Ri  i 1,2,
m
The sequence of 𝑋 𝑖 ; and subsequent 𝑅𝑖; values is computed as follows:

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy