The Uniform Distributn
The Uniform Distributn
A continuous random variable X which has probability density function given by:
F (x) = 1 for a x b (1)
b - a
and f(x) = 0 if x is not between a and b) follows a uniform distribution with
parameters a and b. We write X ~ U (a , b)
Remember that the area under the graph of the random variable must be
equal to 1 (see continuous random variables).
Expectation and Variance
If X ~ U (a , b), then:
E (X) = (a + b)
Var (X) = (1/12)(b - a)
2
Proof of Expectation
2 2 2
1
2 2( ) 2
b
a
x x b a b a
dx
b a b a b a
1 +
1
]
Cumulative Distribution Function
The cumulative distribution function can be found by integrating the p.d.f between 0 and t:
1
( )
t
a
t a
F t dx
b a b a
With this result, we now have an instance of the inverse transform method
to generate
random numbers with pdf
1/ 2 x
: generate a uniform random number r
and square it.
The general form of the inverse transform method is obtained by
computing the pdf of
x = g(r) for some function g, and then trying to _nd a function g such that
the desired
pdf is obtained.
Let us assume that g(r) is invertible with inverse
1
( ) g x
)
and r + dr =
1
g
thus
1
( ) ( ) '( ). p x g x
, gives us
1
( ) ( ), F x g x
or
1
( ) ( ), g x F x
. We
then generate a uniform random number 0 < r < 1 and compute x =
1
( ) F r
' ;
The advantage of this method is that the calculations are simple and fast, and the
rejection rate is reasonable. Quick acceptance and quick rejection areas can be
applied. For discrete distributions, f(x) is replaced by f( x ) .
The following values are used for the hat parameters for the poisson, binomial and
hypergeometric distributions
1
,
2
a and +
2
1, 1
2 1 3 3
( )
2 2
s s s
e e
+ +
where
(6)
then by the central limit theorem the distribution of
[ ]
[ ]
1
1
n
i
i
n
i
i
X E X
V X
' ;
,
%
( ) , : [ ]
x na
n n x
b a
%
largest integer less than
x na
b a