22.1_Operation_of_Random_Numbers_on_the_RECOMP_Digital_Computer_Feb62 22.1 Operation Of Random Numbers On The RECOMP Digital Computer Feb62

22.1_Operation_of_Random_Numbers_on_the_RECOMP_Digital_Computer_Feb62 22.1_Operation_of_Random_Numbers_on_the_RECOMP_Digital_Computer_Feb62

User Manual: 22.1_Operation_of_Random_Numbers_on_the_RECOMP_Digital_Computer_Feb62

Open the PDF directly: View PDF PDF.
Page Count: 25

AUT
0
NET
I C S
A
DIVISION
OF
NORTH
AMERICAN
AVIATION,
INC.
INDUSTRIAL
PRODUCTS
-3400
E.
10th
Street,
Long
Beach
5,
Calif.
RECOMP
TECHNICAL
BULLETIN
NO.
22.1
SUBJECT:
GENERATION
OF
RANDOM
NUMBERS
ON
THE
RECOMP
DIGITAL
COMPUTE~
PURPOSE:
This
bulletin
describes
techniques
for
generating
sequences
of
pseudo-random numbers
with
the
RECOMP
digital
computer
and
discusses
methods
for
obtaining
various
statistical
and
spectral
properties
in
such sequences.
EFFECTIVE
DATE:
13
Septembe~
1961
RE"FERENCES:
(a)
"Quarterly
of
Applied Mathematics" Vol
XVI,
1958.
(b)
"Symposium
on
Monte
Carlo Methods",
edited
by
H.
A.
Meyer, John Wiley and Sons, 1956;
in
par-
ticular,
pp
15-28,
Olga Taussky and John Todd,
"Generation and
Testing
of
Pseudo-Random Numbers".
(c)
Martin Greenberger "Notes on a
New
Pseudo-Random
Number
Generator"
J.
Assoc.
Compo
Mach.
Vol.
8,
No.2,
April
1961.
(d)
J.
N.
Franklin,
"Note
on
the
Equidistribution
ot
Pseudo-Random Numbers,
Quarterly
of
Applied Mathe-
matics,
Vol.
XVI
No.2,
July
1958.
INFORMATION
TO:
All
Concerned
WRITTEN
BY:
Robert
J.
Doyle
System
Integration
Advanced
Systems
Auto
netic
8
REVISED
DATE:
26
February
1962
Copyrifht 1961
Auto
netics
Industrial
Pro
ducts
A Div.
of
North American Aviati.on,
Inc.
r~ng
Beach,
Calif.
RECOMP
TECHNICAL
BULLF:Tn~
NO.
22
PAGE
ONE
-- -- - ---- - ----------------
In
system
analysis
work
there
arises
from
time
to
time
a
need
for
sequences
of
random numbers,
to
simulate,
e.g.,
the
effects
of
noise
and
errors
of
a random
nature
on
system
performance;
and,
of
course,
sue h
sequences
are
essential
to
the
use
of
Monte
Carlo
techniques.
This
memorandum
will
discuss
some
techniques
for
generating
sequences
of
numbers which
are
suitable
for
these
puproses,
and
will
descr:ibe
some experiment·s
that
have
been
conducted
to
studY
the
nature
of
such
sequences.
Although
the
following
discussion
will
be
limited
to
application
to
Autonetics'
REC0HP
digital
computer,
the
basic
ideas
are
certainly
applicable
to
digital
computation
in
general.
A
conventional
digital
computer
such
as
RECOJ'!P
is,
of
course,
incapable
of
performing
a
truly
random
process;
all
of
its
operations
are
deterministic.
However,
there
exists
a
rather
convenient
method
of
generating
a
sequence
of
numbers
which,
from
the
standpoint
of
the
user
are
(through
his
ignorance,
if
you
will)
unpredictabl
e and
in
this
sense
are
pseudo-random.
By
a
1?seudo~.
random
sequence
we
mean a
previously
determined
sequence
which
is
used
to
simulate
a random
sequence;
however,
in
the
discussion
that
follows
the
pre-
fix
IIpseudo"
will
be
omitted
l-lhen
we
refer
to
such
sequences.
The mathod
for
generating
this
sequence
is
as
follows:
Let
N be an
intefer
greater
than
one
and
let
Xo
be
a
fraction
o
~
xo~
1
Define
Then
the
sequence
=-
fractional
part
of
r
NXk-1
2
l_1
?
Xk)
is
uniformly
distributed
between
zero
and
one.
That
is,
the
probability
density
function
~l
p(x)
lo
otherwise
To
generate
this
random
sequence
on
RECOHP
'We
store
the
fraction
x
at
a
binary
scale
of
zero
and
the
integer
N
at
a
binary
scale
of
39. Then
if'
we
multiply
N
by
x
we
have
the
fractional
part
of
the
product,
which
is
the
new
x,
in
the
R
register.
The
sequence
of
commands
is
'.
CLA
x
MPY
N
XAR
(exchange
A & R
registers)
STO
x
RECOMP
TECHNICAL
BULLETIN
NO.
22
PAGE
TWO
~
----
~
- -
~
--
~
--- ----------- - --
~
--
~
The
simplicity
of
this
method
is
apparent.
In
practice
it
is
recommended
that
X
2-3~
and
that
an
odd power
ot
3
or
5
be
selected
tor
N.
Different
o -
----
choices
will
ot
course
provide
different
sequences.
It
is
best
to
select
the
largest
odd power
of
3
or
5
that
can
be
contained
in
39
bits.
For
further
discussion
on
this
point,
as
well
as
the
mathematical
nature
of
the
pseudo-
random
sequence,
see
references
(b) and
(c).
A
convenient
method
of
obtaining
different
sequences
is
to
employ two
generators
with
different
odd powers
oti-
say,
5
tor
N.
A member
of
the
first
sequence
is
selected,
with
an
element
of'
chance,
by
throwing
a
sense
switch,
to
be
used
as
the
starting
number
for
the
second
sequence which
provides
the
random numbers
for
the
problem.
A
brief
table
of
odd
pOWers
of
3 and 5
in
command
fonnat
is
given
in
AppendixB.
In
a
practical
application
we
are
concerned
with
two
characteristics
of
the
random
~quence.
One
of
these
is
the
distribution
of
the
random
numbers.
As
assertea
above
the
members
of
the
random
sequence
are
uniformly
distributed
between
zero
and
one,
and
a
proof
of
this
fact
may
be
found
in
reference
(d).
Figure
1 shows
the
actual
distribution
of
a sample
of
1024 numbers
generated
in
this
manner.
A
second
characteristic
of
interest
is
the
sequencing
of
the
numbers,
or
more
precisely,
if
the
sequence
is
thought
of
as
a random
time
series,
the
power
spectral
density
of
the
series.
In
this
regard
experimental
evidence
indicates
that
the
spectral
density
is
"whiten
or
uniform
over
all
frequencies.
(Of
course,
as
in
all
digital
computer work,
the
spectral
content
is
band
limited
in
a
real
time
sense,
by
the
sampling
frequency,
or
the
rate
at
which
the
numbers
are
generated.)
Another
way
of
considering
this
characteristic
which
does
not
depend on
any
concept
of
time
is
to
state
that
the
menbers
of
the
sequence
are
statistically
independent
of
one
another.
To
demonstrate
this
fact
an
lt
au
tocorre1ation"
function
was computed.
N
012
K • 1
Figure
2 shows
an
actual
example
of
this
computation
on a sample
of
1024
numbers.
(The numbers
were
shifted
first
by
subtracting
one-half
to
lie
between
plus
and
minus
one-halt.)
From
this
figure
it
is
apparent
that
for
one
or
more
shifts
the
numbers
are
uncorre1ated.
An
important
consequence
of
the
independence
of
the
members
of
the
sequence
is
that
it
permits
the
use
of
a
single
random number
generator
to
provide
numbers
for
several
applications
in
the
same
problem.
t-
--
,Yo
....
i\io..~
-----
.~-
~~
.......
'".
,
..
0·5
-0.4-
-0.3
-o.z.
F
igure
1.
Ie
Samp
Distribution
of
,-
,.~
-
~",14
.
-,;.:
,.
O.~
I
i
I
I
~JI4;~""'"
"
-0.
f 0 0
10
Random
Nll
IIlbers.
1=
1 a
I~
1 t-3
~
~
H
1
~.
I~
I~
11-3
H
1 Z
12:
o
I
I
I\)
II\)
ODe
0.06
.-
1
Figure
2.
~
-:=,0 I .....
31
)
;>
0
..
"'1
with
l
uniformly
distrjbuted
between
-~
and
+!
t , ,
'!
1
~
1 I t 1
..
, , t
..
'C
..
t J t i I , l
3b
l
5
10
;
.:>
La
z-S
L
Autocorrelation
Function
of
1024
Random
Numbers.
I\)
I\)
l:g
10
txJ
I~
'I
~
RECOMP
TECHNICAL
BULLETIN
NO.
22
PAC'-E
FIVE -----
Thus,
we
have
available
a
simple
method
of
generating
a random
sequence
whose
members
are
uniformly
distributed
between
·zero
and
one and
are
independent
of
one
another
or
"white".
Other
rectangular
distributions
may
be
easily
obtained
by
multiplying
by
a
scale
factor
and
adding
a
bias.
For
example,
suppose
it
.
is
desired
to
select
at
random
an
integer
bet't~een
1
ann
52.
We
simply
gener
ate
a random number,
multiply
by
52,
add
1,
and
take
the
integral
part
of
the
answer
as
the
desired
number.
However,
distributions
other
than
rectangular
are
often
required.
For
example,
failure
rate
is
often
characterized
by
an
exponential
distribution,
system
errors
are
frequently
considered
to
have
gaussian
distributions;
other
random
events
may
have
a
Poisson
distribution.
How
may
other
distributions
be
ob-
tained
from a
rectangular
distribution?
If
x
is
uniformly
distributed
between
zero
and one and
if
the
probability
,
density
functio
n p (
t)
has
the
proper
tie
s
/"
~
p
(t)
~
0 and I p
(t)
dt
= 1
,
./
_1,>tI&>
then
the
random
variable
z
defined
by
the
relation
x =
z
(
p(t)
dt
\
,,}
-~
has
the
probability
distribution
function
z
p
(zo)
=J
_ p
(t)
dt
and
hence
the
probability
density
function
p
(z).
=
Probability
{
=
Zo
S p
(t)
dt
_
<?O
For
Pro
babili
ty
Sz
<...
(1)
since
x
is
uniformly
distributed
between
zero
and
one
and
hence
Probability
tx!:
aJ
= a
For
example,
suppose
an
exponential
distribution
is
required,
i.e.,
r/
-az
p(z)
\ae
::
-'.
/0
o
<.
z
-
z
~
0
;
\
'RECOMP
TECHNICAL
BJLLETIN
NO~
22
PAGE
SIX
-------------------- - ------------- - ----
~
---
From
equation
(1)
it
is
theretore
req~ed
that
the
uniform
random
variable
For
z~O
or
x
f(
I 0
ae-
at
dt·.
\ o
z 1
log
(I-x)
=a-
o
~
z
z
.c:..
0
or
since
x and
(1
-
x)
have
the
same
distribution,
we
let
1
log
x
-a
and
the
random
variable
zwi11
have
the
probability
density
p
(z)
as
desired.
In
other
words,
we
generate
a random number, compute
its
natural
logarithm,
and
divide
bl
minus
a.
The
result
will
have
the
probability
densityfunction
p
(z).
As
a second example suppose
it
is
desired
to
select
a
point
at
random from
the
unit
circle
under
the
assumption
that
the
points
are
uniformly
distributed
over
the
c12-cle.
One
possible
solution
would
be
to
generate
two random numbers,
say
x and
y,
scaled
and
biased
to
lie
between
plus
and minus
one
rejecting
the
pair
if'the
sum
of
their
squares
exceeded
one.
The
pairs
(x,
y~
that
were
acoepted
'Would,
ot
oourse,
have a
unifom
distribution
over
the
unit
circle.·
c,
An
a1
temate
matho d
'Would
us e
polar
coordinates
rand
9.
From symmetry
it
1s
clear
that
arty
angle
is
equally
likely
so
1:J'e
pro
bahili
ty
density
ot
~
is
given
by
p e
(9)
1
2Tr
o
o
~
e
.(
2TT
otherwise
Therefore,
to
generate
the
random
variable
~we
simply
generate
a random
number and
multiply
it
by
2,.,...
RECOMP
TECHNICAL
mIlJETIN
NO.
22
PAGE
SEVEN
---------------------------------~---------
To
find
the
distribution
of
r
we
note
that
the
pro
babili
ty
of
a
point
lying
in
an
incremental
area
is
dxdy
iT
r
dr
de
-rT
==(~dr)de
211
I:
Pr(r)dr
p~~
(e)
de
Since
we
have
already
determin~d
P,9 (
e)
p
(r)
J
2r
r ( 0
it
follows
that
o
-<.~
r
..
.:.
1
otherwise
From
equation
(1)
we
require
that
the
uniformly
distributed
number
r
x •
2t
dt
=
r2
or
r
To
summarize
the
procedure
then
-we
generate
two random numbers.
One
of
these
is
multiplied
by 2
if
and
designated
G The
square
root
of
the
other
is
extracted
and
the
result
designated
r.
The
resulting
points
(r,
e)
are
uniformly
distributed
over
the
uni
t
circle.
The
size
of
the
circle
can
be
easily
scaled
by
multiplying
r
by
the
radius
of
the
de
sired
circle.
In
principle
any
desired
distribution
may
be
obtained
by
the
nethod
discussed
in
the
preceding
p,aragraphs.
However,
there
may
be
computational
difficulties
for
some
density
functions.
Unfortunately,
this
is
the
case
for
the
most
important
gaussian
distribution,
p(z)
==
1
V2~
e
According
to
equation
(1)
it
would
be
necessary
to
invert
the
equation
z
J e
-
~
Y21i
dt
RECOMP
TECHNICAL
lJJLLETIN
NO. 22
PAGE
EIGHT
--
~
-------
~
-----------
~
- - - - - - - - - - - -
~.,.~!-...(
...•
,.
-
It
the
function
on
the
right
is
designated
to
lind
z -
t~.
-1
(~
(x)
......
<P
(z)
we
see
that
it
is
required
..-
and
of
course
this
equation
may
be
solved
by
nunerical
methods;
but,
it
would
appear
that
considerable
computation
~uld
be
required,and
for
this
reason
it
has
not
been
attempted.
As an
alternate
approach
:we
again
resort
to
polar
coordinates.
If
u and v
are
independent random numbers
with
gaussian
distributions
then
the
random
variable
r =
has
the
so-called
Rayleigh
distribution
re-
r2
h
r.~
0
p
(r)
r
..(..
0
and
the
random
variable
e-
-1
tan
v
u
is
uniformly
distributed
bet'Ween zero
and
2
iT".
To
obtain
a random number
with
the
Rayleigh
distribution,
as
before,
'We
let
the
uniformly
distributed
nuniber
fa
2 .
x
te-
t
12
dt
~
-r
1 - e 2
or
r
[210
g
(~)
J'
.
or
since
. % and (1-%) have
the
same
distribution
we
simply
let
RECOMP
TECHNICAL
BULLETIN
NO.
22
----- - -
~
----- - -------- - - - - -----
~
r =
Similarly
we
let
e
III
2
Trx
1.
.?
PAGE
NINE
where
of
course
x
is
another
uniformly
distributed
number. Then
we
simply
make
the
inverse
transformation
u = r cos f?
v = r
sin
f:::)
and u and v
will
be independent random numbers
with
gaussian
distributions.
It
will
be noted
that
this
me
tho d
requires
the computation
of
a
logarithm
and
sine
and
cosine
for
which
subroutines
are
normally
available
.
The
above method
provides
a
pair
of
independent
gaussian
random numbers
at
the
expense
of
computing a
logarithm
and
sine-cosine.
Since
the
latter
computations
are
somewhat
time
consuming, and
usually
time
is
at
a premium
in
analyses
of
a
probabilistic
nature,
this
method has
limited
practical
apRlication.
The
following
approach
provides
a
technique
for
generating
numbers whose
distribution
is
approximate~
gaussian
with
relatively
little
computation
required.
From
the
central
limit
theorem
of
statistics
it
is
known
that
the
distribution
of
the
averase
of
N samples from any
distribution
approache s
the
gaussian
distribution
as
N becomes
large.
If
the
original
distribution
is
rectangular,
the convergence
is
remarkably
fast,
in
fact,
N = 3
or
4
gives
a
distribution
which
is
a
very
good approximation
to
the
gaussian.
Let
[
1
0",
Xi
ot!.l
Pl
(Xi ) = ( 2)
0
otherwise
for
i
1,
2,
••
, N
Then
the
random
variable
N
z =
Hl
Xi
RECOMP
TECHNICAL
IlJILETIN
NO.
22
PAGE
TEN
- -
*.-
- - - -
~
-
-"-
- - - - - - - - - - - - -
~
- - - - - - - - - -
~
- - - - -
has
the
probabUity
density
function
Pn
(z)
which may be
obtained
by
con-
volving
Pl
with
PN-l
or
r"-
.•
_""'
(z)
-J;
(z-x)
P
(x)·
<Ix
1
n-l
-eo
For
convenience
we
let
where
u·Z-~n
0-
n
~
/1
f
tpn(t)dt
-
l.,,:.:l
01:>
o-!"
f(t-
~n)2
Pn(t)dt
-00
so
that
t1n
has
a
zero
mean
and
unit
varlance.
'.
N -
2,
3,
For
N - 2
the
distribution
is
triangular
shaped
and
of
limited
interest.
For
N • 3
evaluation
of
the
convolution
integral
gives
J - u
2 o
~'ul
~
3
8
P3
(u)
-(3 -
lu
I
)2
1~"
lu
1-:
3
16
(3)
o 3
~
luI
where u
-2
(Xl
+ x2 +
x3
) - 3
with
xi'
1,
2,
3,
distributed
according
to
(2).
A plOt
of
P3
(u)
is
given
in
Figure
3.
For
comparison, a
plot
of
the
gaussian
distribution
·1
r(u)··Vi~
e
is
given
on
the
same
figure.
From
this
figure
it
is
seen
that
the
distribution
0·4
0.3
0.2..
0-1
Figure
3.
Comparison
of
Distribution
P3
(u)
'With
Gaussian.
LA.
.:=
Z
(X,.-f
'IZs
of
)(3) -3
OL.
~
{, I
OTt.lERWI>£"
I~
10
o
I~
:~
:l
Ii
IH
o
I~
I
I~
f:"'4
IS:;
11-3
I~
I
.~
o
I
I
I
.'
I :
I
I.
~
10
I
tzJ
.~
: ;
RECCMP
TECHNICAL
BULLETIN
NO.
22
PAGE
T~JELVE
---- ----------------
~
-------
~
~
-- - -----
of
u
is
a
very
good
approximation
to
the
gaussian.
In
fact,
it
would
be
difficult
to
distinguish
between samples from
the
two
distributions
unless
an
extremely
large
sample were
taken.
Figure
4 shows
the
actual
distri-
bution
of
,000
numbers
generated
according
to
equation
(4).
In
this
figure
the
area
of
the
rectangles
equals
the
fraction
of
the
sample
falling
in
the
corresponding
interval.
The
gaussian
is
also
plotted
on
this
figure
for
comparison.
This
technique
lends
itself
readily
to
digital
computation.
A
subroutine
for
generating
"approximate
gaussian"
random numbers
in
this
fashion
is
given
in
Appendix
A.
As
mentioned, above,
these
numbers have
the
distribution
given
by
(3)
with
zero
mean
and
unit
variance.
To
simulate
the
gaussian
random
variable
z
with
mean I J and
variance
I-""!'"
,
,let
~l
z
~
Z
z -
O'u.
z +
It
should
be
noted
that
members
of
the
resulting
gaussi.an random sequeooe
are
also
independent
of
one
another
or
"white".
An
even
better
approximation
may
be
obtained
by
combining
four
of
the
uni-
formly
distributed
numbers.
For
N
equal
4,
evaluation
of
the
convolution
integral
yields
r::1
where
u-13
("
4 13' -2
iK3'
u2
+lu/
3
i
li (2 )31 -I
u/
)3
54
o
~.l
xi
-~
.-:-\
2
,1
3
~
lu
I
with
Xi'
1
1,
2,
3,
4,
distributed
according
to
(2).
As
before
the
distr.l-
bution
has
been
scaled
to
have a
zero
mean
and
unit
variame.
Figure,
shows
a
plot
of
P4
(u)
with
the
gaussi.
an
for
comparison.
Appendix C
provides
a
tawlation
of
the
density
functions
P3
(u)
and
P4
(u)
together
with
their
respective
cumulative
distributions.
/
:ft.'
.....:/I.'~~~
..
f
-
..
\
\'-~'
\.
'
..
~\
-'
Figure h.
P3
(u) Sample
Distribution.
Sample
Size
-
,000
Sample Hean
-0.0276
Sample
Variance
0.9979
"",.-,.,.---
'.
.::0
t%J
1(')
9
I~
11-3
ItxJ
.~
H
Q
>
t"4
~
~
I~
H
I~
.Z
o
I
0.2
o.
f
1.0'
Figure
S.
Gonparison
of
Distribution
P4
(u)
with
Gaussian.
I
I'\)
'1\)
I~
I~
t:r:J
I
'"1j.
:~
1-:3
1t:t:J
I~
I
I
REcorU'
TECHNICAL
BULlE
TP'T
NO.
22
PAGE
F'IFTEf.N
Another
technique
that
j.s
useful
in
providing
a
distribution
that,
although
not
gaussian,
favors
small
numbers
over
large
and
thus
may
be adequate
for
some
purposes,
is
to
simply
multinly
two
of
the
uniformly
distributed
numbers.
If
xl'
x2
are
distributed
according
to
i =
1,
2
~
~
-1
__
xi
-_
1
I 0
otherwise
(,
then
the
random
variable
z = x x
1 2
has
the
distribution
-1
.
__
z
'._
1
p(z)
= o othen-Jise
Also
the
random
variable
y =
xl
I
xII
has
the
distribution
( 1
\
J..
4;y.
'~
p(y)
l 0
,
-1",-
Y
...
,.1
otherwise
\
...
,
Random
variables
such
as
these
have
the
advantafe
of
being
computed
rather
easily.
As
a
final
subject,
we
will
briefly'
consider
the
case
where a random sequence
is
required
with
a
spectral
density
other
than
white.
For example,
it
might
be
required
to
constrain
the
sequence so
that
it
does
not
change
value
too
rapidly
or
in
other
words,
suppress
the
high
frequency
components
in
the
sequence.
To
achieve
this
end
it
is
necessary
to
run
the
ttwhite" sequence
through
a
lo'W-
pass
filter.
If
the
input
X
(t)
to
a
filter
with
transfer
function
H (jw)
is
white,
i.e.,
has
power
spectral
density,
S
(jw)·
S
(0)
x x
then
the
power
spectral
density
of
the
output
y
(t)
is
S (jw) ·iH (jw) 2 S (0)
y i x
RECOMP
TECHNICAL
BULLF:TIN
NO.
22
PAGE
SIXTEEN
or
in
other
words,
the
output
spectral
content
is
determined
by
the
filter
characteristic.
If
the
input
to
a
line
ar
filter
has
a
gaussian
distribution
then
the
output
will
also
be
gaussian.
It
is
then
only
necessary
to
determine
the
mean
and
variance
of
the
output
in
order
to
completely
characterize
the
output
distribution.
Well
known
techniques
are
available
for
the
design
of
digit~l
filters
and
thus
it
is
possible
to
generate
gaussian
random numbers
with
a
desired
spectral
content.
To
demonstrate
this
technique
a
simple
first
order
lag
filter
was programmed
a..l1d
fed
with
a
white
gaussian
input.
The
distribution
and
autocorrelation
function
of
the
output
were
then
computed.
Suc,h
a
filter
has
t~e
character-
istic
H(jw) = a
a + jw
and
impulse
response
h(t)
=
where
a
is
the
so-called
corner
frequency.
The
output
spectral
density
is
therefore
S
(0)
x
The
autocorrelation
,function
of
the
output(the
inverse
transform
of
S
(jw)
y
has
the
form
(8)
where
<-::r
y
is
the
variance
0 f
the
output.
To
derive
the
difference
equation
defining
the
d;f!i-tal
filter,
we
use
the
fact
that
the
output
is
the
convolution
of
the
input
with
the
filter
i.1tIpulse
response,
yet)
= 5
'to
h(t
-tl>
x(tt)
dt'
= t
-a(
t-t'
)
ae
x(tt)
dt'
o
REOOMP
TECHNICAL
BULLETIN
NO.
22
PAC·E
SEVFNT2}!J\J
To
evaluate
this
integral
numerically
we
take
an
integration
step
A t = T
and assume x
(t)
is
constant
over
this
interval,
thus
xC
t)
a
Xn
(n-l)T
......
t
~'.
nT n =
1,
2,
•••
The xn
~ill
be
the
input
white
p:aussian random
sequence,
'With
zero
mean
and
unit
variance.
Now
or
Yn+l =
y(fu+l)T)
-a(n+l)T
= e
= e
-at
nT
-anT:/""
e
)"1
(n+l)T
(
j 0
~
-aT ( -aT)
uo+l
= e Y
n + 1 - e xn+l
at'
ae
xC
t I
)dt
I
Equation
(9)
is
the
difference
equation
that
defi~es
the
filter.
By
averaging
both
sides
of
(9)
we
see
that
the
output
mean
or
.
.,....2
=
t/
Y I
-aT
- e
1 +
e-
aT
2
,
..
'f" x
RECOMP
TECHNICAL
IDILETlN
NO.
22
PAG.E
l.i'!
G:-ITIi:EN
------------- --------------
~
-- --------
~
~
From
equations
(8)
and
(10)
the
autocorrelation
function
of
the
output
is
R
CC)
y
for
~
=
0,
1,
2,
=
-aT
1 - e
-aT
1 + e
As
an
example
of
this
computation
we
let
aT
=
0.4
This
gives
2
~.,'"
=
.191
y
-'CaT
e
Figure
6 shows
the
distribution
of
the
output
(normalized
to
have
unit
variance)
and
Figure
1 shows
the
output
autocorrelation
function.
One
could
apply
Fourier
techniques
to
determine
the
output
spectral
content.
However, from
the
exponen-
tial
nature
of
the
output
autocorrelation
f~~ction,
it
is
clear
that
the
output
has
the
desired
spectral
density.
';\,
...
/'
"
/ I
"
~3
..
0 -Z.'S
Figure
6. Output
Distribution,
Filtered
Gaussian
Random
Numberse
I~
18
I~
:~
I~
IH
~
::
1E=i
It'"
t'1j
1'-3
H
IZ
IZ
o
Ie
I
I\)
II\)
I
I-
.
1
.zo
~
..•..
"'",
~.'
..
.~
. .
(")
o
I~
11-3
It.z:j
o
.~
IH
(")
I~
.z
o
I\)
If\)
I .
I
"
...
.."
....
. I
~
·;·.· ..... ·
••
~(
..
-'W:'!.;·"q
•• t ••
~.
I
,
....
",
.............
, -
.......
,
..
··,.."~,..~·'"'·"··Ir.'···~,,,·f·.'·
..
··.,..-···~,,·
••...
~.'''
..
.:.''"'"''.".,.*
.........
,
...
".
b
~(
..
'.
\3
:
Figure
7. Output
Autocorrelation
Function,
Filtered
Gaussian
Random
Numbers.
RECO~1P
TECm~ICAL
BULLETIN
NO.
22
PAGE
Tl:AlENTY-ONE
------- ----- - ---
~
--- - --- - --------- - -- - - -
~
--
Appendix A "Approximate -Gaussian"
Random
Number
Generator
Subroutine
Enter
Subroutine
with
+
TRA
0006.0
Exit
to
next
location
with
gaussian
random number
in
A and R
registers
0006.0 +
SAX
7760.0 +
CTL
0010.0
+
CTV
0020.0 +
TRA
7760.0
0010.0 +
ADD
7773.0 +
srA
7773.1
+
CI.JA
77TI.O +
~1PY
7776.0
+
XA.~
0000.0 +
STO
7777.0
+
ARS
0001.0 +
AnD
7774.0
+
STO
7774.0
+.
eLA
7777.0
+
MPY
7776.0 +
XAR
0000.0
+
STO
7777.0 +
ARS
0001.0
+
A~D
777h.O +
STO
7174.0
0020.0
+
CIA
7777.0 +
MPY
7776.0
+
nLA
7775.0 +
XAR
0000.0
+
STO
()027.0 +
ARS
0001.0
+
FAD
7774.0 +
TR.A
0000.1
-3
at
Binary
scale
of
2
+2
at
Binary
scale
of
39
N
at
Binary
scale
of
39
Xo
=
+1
at
Binary
scale
of
39
Notes:
(1)
It
is
recommended
that
N be an odd power
of
3
or
5.
(2)
r'~in
memory
addresses
are
underlined.
RECOO
TECHNICAL
BULLETIN
NO.
22
PAGE·
TWENTY-TWO
------- - ----------------- - ---------
--
- - -
--
Appendix B
Odd
Powers
of
3 and 5
RECOMP
users
may
find
the
following
list
of
odd 'pawers
ot
3 and 5,
!!:!
Command
format,'
usetul
in
programming random number
generators
a
3
23
+
1275321
+
67204$1
3
21
+
011,731
+
424$311
3
19
+
0010,20
6,47551
3
17
+
0000751
2413411
3
1,
. +
0000061
+
27446Sl
$1, +
0343271
+
,223061
~3
+ 0011000 -
2347121
sll
+
0000270
+
103$,61
,9
+ 0000001 +
,632621
RE~Or1P
TEC:"lN
I
CAL
BUT
LH:TDT
NO.
22
---- - ----- --- - - - - --- - - --------- - ----- - - ---
Appendix C
Probability
Density
Function
and Cumulative
u
.0
.1
.2
.3
.4
.5
.6
.7
.8
.9
1.0
1.1
1.2
1.3
1.L
1.,
1.6
1.7
1.8
1.9
2.0
2.1
2.2
2.3
2.1+
2.5
2.6
2.7
2.8
2.9
3.0
3.1
3.2
3.3
3.h
3.5
3.6
+.37500 + 0
+.37375 + 0
+.37000 + 0
+.36375 + 0
+.35500 + 0
+.34375 + 0
+.330UO
+ 0
+.31375 + 0
+.29500 + 0
+.27375 + 0
+.25000 + 0
+.22563 + 0
+.20250 + 0
+.18063 + 0
+.16000 + 0
+.lu063 + 0
+.12250 + 0
+.10563 + 0
+.90000 - 1
+.75625 - 1
+.62500 - 1
+.,0625 - 1
+.40000 - 1
+.30625 - 1
+.22500 - 1
+.15625 - 1
+.10000 - 1
+.56250 - 2
+.25000 - 2
+.62500 - 3
+.84703 -21
+.00000 + 0
+.00000 + 0
+.00000 + 0
+.00000 + 0
+.00000 + 0
+.00000 + a
,tt...
j,.
P3(x)dX
~"J
+.00000 + 0
+.37458 -1
+.7}J.667
- 1
+.11137 + 0
+.14733 + 0
+.18229 + a
+.21~00
+ 0
+.24821 + 0
+.27867 + 0
+.30712 + 0
+.33333 + 0
+.35710 + 0
+.378,0 + 0
+.39765 + a
+.41467 + 0
+.42969 + 0
+.44283 + 0
+.45423 + 0
+.h6400 + 0
+.47227 + 0
+.47917 + 0
+.48h81 + 0
+.48933 + 0
+.49285 + a
+.49,,0
+ 0
+.49740 + 0
+.49867 + 0
+.h9944 + a
+.49983 + 0
+.49998 + a
+.50000 + 0
+.10000 + 1
+.10000 + 1
+.10000 + 1
+.10000 + 1
+.10000 + 1
+.10000 + 1
P4(U)
+.66667 + 0
+.66343 + 0
+.65L.IO
+ 0
+.63926 + 0
+.61949 + 0
+.59536 + 0
+.56745 + 0
+.5363h + 0
+.50260 + 0
+.46681 + a
+.42956 + 0
+.39141 + 0
+.35294 + 0
+.31L.74
+ 0
+.27737 + 0
+.2h143 + 0
+.20747 + 0
+.17609 + 0
+.It,781 + 0
+.12273 + 0
+.10067 + 0
+.81h15 - 1
+.64791 - 1
+.50599 -1
+.38647 - 1
+.28743 - 1
+.20695 - 1
+.14309 - 1
+.93944 -2
+.57576 - 2
+.32063 - 2
+.15482 -2
+.59085 - 3
+.14174 - 3
+.8h48h - 5
+.00000 + 0
+.00000 + 0
.1..
~)'
P4(x)dx
")
+.00000 + 0
+.38427 -1
+.76489 - 1
+.11385 + 0
+.15C>21
+ 0
+.113530
+ 0
+.21:988
+ 0
+.25076 + 0
+.28076 + 0
+.30C376
+
')
+.33464 + 0
+.35834 + 0
+.37983 + 0
+.39910 + 0
+.41619 + 0
+.43116 + 0
+.h4h10 + 0
+.45",16 + 0
+.46450 + 0
+.47229 + 0
+.h7873 + 0
+.48397 + 0
+.48818 + 0
+.49150 + 0
+.l.t9406
+ 0
+.49600 + 0
+.49742 + 0
+.49842 + 0
+.1.9910
+ 0
+.49953 + 0
+.l.t9979
+ 0
+.49992 + 0
+.49998 + 0
+.50000 + 0
+.
,0000 + 0
+.,0000
+ a
+.,0000 + 0
RECOMP
TECHNICAL
BULLETIN
NO.
22
PAGE
~1ENTY-FOUR
REFERENCES
a)
"Quarterly
of
Applied
Mathema~icsn
Vol XVI,
1958

Navigation menu