Chapter 5 Discrete Distributions
Chapter 5 Discrete Distributions
Chapter 5 Discrete Distributions
Create successful ePaper yourself
Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.
110 CHAPTER 5. DISCRETE DISTRIBUTIONS<br />
> F = cumsum(f)<br />
> F<br />
[1] 0.125 0.500 0.875 1.000<br />
As easy as this is, it is even easier to do with the distrEx package [74]. We define a<br />
random variable X as an object, then compute things from the object such as mean, variance,<br />
and standard deviation with the functions E, var, andsd:<br />
> library(distrEx)<br />
> X E(X); var(X); sd(X)<br />
[1] 1.5<br />
[1] 0.75<br />
[1] 0.8660254<br />
5.2 The <strong>Discrete</strong> Uniform Distribution<br />
We have seen the basic building blocks of discrete distributions and we now study particular<br />
models that statisticians often encounter in the field. Perhaps the most fundamental of all is the<br />
discrete uniform distribution.<br />
ArandomvariableX with the discrete uniform distribution on the integers 1, 2,...,m has<br />
PMF<br />
f X (x) = 1 , x = 1, 2,...,m. (5.2.1)<br />
m<br />
We write X ∼ disunif(m). A random experiment where this distribution occurs is the choice<br />
of an integer at random between 1 and 100, inclusive. Let X be the number chosen. Then<br />
X ∼ disunif(m = 100) and<br />
IP(X = x) = 1<br />
100 , x = 1,...,100.<br />
We find a direct formula for the mean of X ∼ disunif(m):<br />
m∑<br />
m∑<br />
µ = xf X (x) = x · 1<br />
m = 1 m + 1<br />
(1 + 2 + ···+ m) =<br />
m 2 , (5.2.2)<br />
x=1<br />
x=1<br />
where we have used the famous identity 1 + 2 + ···+ m = m(m + 1)/2. That is, if we repeatedly<br />
choose integers at random from 1 to m then, on the average, we expect to get (m + 1)/2. To get<br />
the variance we first calculate<br />
and finally,<br />
IE X 2 = 1 m<br />
m∑<br />
x=1<br />
σ 2 = IE X 2 − (IE X) 2 =<br />
x 2 = 1 m(m + 1)(2m + 3)<br />
=<br />
m 6<br />
(m + 1)(2m + 1)<br />
6<br />
( m + 1<br />
−<br />
2<br />
(m + 1)(2m + 1)<br />
,<br />
6<br />
) 2<br />
= ···= m2 − 1<br />
12 . (5.2.3)<br />
Example 5.4. Roll a die and let X be the upward face showing. Then m = 6, µ = 7/2 = 3.5,<br />
and σ 2 = (6 2 − 1)/12 = 35/12.