










Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!











Table I: Corresponding notions between statistics and probability. Examining probabilities models and random variables will lead to strategies for the collection of data and inference from these data.
From the universe of possible information, we ask a question. To address this question, we might col- lect quantitative data and organize it, for example, using the empirical cumulative distribution func- tion. With this information, we are able to com- pute sample means, standard deviations, medians and so on. Similarly, even a fairly simple probability model can have an enormous number of outcomes. For example, flip a coin 332 times. Then the num- ber of outcomes is more than a google ( 10 100 ) – a number at least 100 quintillion times the num- ber of elementary particles in the known universe. We may not be interested in an analysis that con- siders separately every possible outcome but rather some simpler concept like the number of heads or the longest run of tails. To focus our attention on the issues of interest, we take a given outcome and compute a number. This function is called a ran- dom variable.
Definition 7.1. A random variable is a real val- ued function from the probability space. X : ⌦! R.
Generally speaking, we shall use capital letters near the end of the alphabet, e.g., X, Y, Z for random variables. The range S of a random variable is sometimes called the state space.
Exercise 7.2. Roll a die twice and consider the sample space ⌦ = {(i, j); i, j = 1, 2 , 3 , 4 , 5 , 6 } and give some random variables on ⌦.
Exercise 7.3. Flip a coin 10 times and consider the sample space ⌦, the set of 10-tuples of heads and tails, and give some random variables on ⌦.
We often create new random variables via composition of functions:
! 7! X(!) 7! f (X(!))
Thus, if X is a random variable, then so are
X 2 , exp ↵X,
p X 2 + 1, tan 2 X, bXc
and so on. The last of these, rounding down X to the nearest integer, is called the floor function.
Exercise 7.4. How would we use the floor function to round down a number x to n decimal places.
7.2 Distribution Functions
Having defined a random variable of interest, X, the question typically becomes, “What are the chances that X lands in some subset of values B?” For example,
B = {odd numbers}, B = {greater than 1}, or B = {between 2 and 7}.
We write {! 2 ⌦; X(!) 2 B} (7.1)
to indicate those outcomes! which have X(!), the value of the random variable, in the subset A. We shall often abbreviate (7.1) to the shorter statement {X 2 B}. Thus, for the example above, we may write the events
{X is an odd number}, {X is greater than 1} = {X > 1 }, {X is between 2 and 7} = { 2 < X < 7 }
to correspond to the three choices above for the subset B. Many of the properties of random variables are not concerned with the specific random variable X given above, but rather depends on the way X distributes its values. This leads to a definition in the context of random variables that we saw previously with quantitive data..
Definition 7.5. A (cumulative) distribution function of a random variable X is defined by
F (^) X (x) = P {! 2 ⌦; X(!) x}.
Recall that with quantitative observations, we called the analogous notion the empirical cumulative distribution function. Using the abbreviated notation above, we shall typically write the less explicit expression
F (^) X (x) = P {X x}
for the distribution function.
Exercise 7.6. Establish the following identities that relate a random variable the complement of an event and the union and intersection of events
i
{X 2 B (^) i } = {X 2
i
B} and
i
{X 2 B (^) i } = {X 2
i
If we look at the graph of this cumulative distribution function, we see that it is constant in between the possible values for X and that the jump size at x is equal to P {X = x}. In this example, P {X = 5} = 4/ 36 , the size of the jump at x = 5. In addition,
F (^) X (5) F (^) X (2) = P { 2 < X 5 } = P {X = 3} + P {X = 4} + P {X = 5} =
2 <x 5
P {X = x}
We shall call a random variable discrete if it has a finite or countably infinite state space. Thus, we have in general that:
P {a < X b} =
a<xb
P {X = x}.
Exercise 7.9. Let X be the number of heads on three independent flips of a biased coin that turns ups heads with probability p. Give the cumulative distribution function F (^) X for X.
Exercise 7.10. Let X be the number of spades in a collection of three cards. Give the cumulative distribution function for X. Use R to plot this function.
Exercise 7.11. Find the cumulative distribution function of Y = X 3 in terms of F (^) X , the distribution function for X.
7.3 Properties of the Distribution Function
A distribution function F (^) X has the property that it starts at 0, ends at 1 and does not decrease with increasing values of x.. This is the content of the next exercise.
Exercise 7.12. 1. lim (^) x! 1 F (^) X (x) = 0.
! 1 !0.8 !0.6 !0.4 !0.2 0 0.2 0.4 0.6 0.8 1
! 1
!0.
!0.
!0.
!0.
0
1
x
0.0 0.5 1.
0.^ 0.^ 0.^ 0.^
x
probability
0.0 0.5 1.
0.^ 0.^ 0.^ 0.^
0.0 0.5 1.
0.^ 0.^ 0.^ 0.^
0.0 0.5 1.
0.^ 0.^ 0.^ 0.^
0.0 0.5 1.
0.^ 0.^ 0.^ 0.^
Figure 7.2: (top) Dartboard. (bottom) Cumula- tive distribution function for the dartboard ran- dom variable.
The cumulative distribution function F (^) X of a discrete random variable X is constant except for jumps. At the jump, F (^) X is right continuous,
lim x!x 0 + F (^) X (x) = F (^) X (x 0 ).
The next exercise ask that this be shown more generally.
Exercise 7.13. Prove the statement concerning the right continuity of the distribution function from the continuity property of a probability.
Definition 7.14. A continuous random variable has a cumulative distribu- tion function F (^) X that is differentiable.
So, distribution functions for continuous random variables increase smoothly. To show how this can occur, we will develop an example of a continuous random variable.
Example 7.15. Consider a dartboard having unit radius. Assume that the dart lands randomly uniformly on the dartboard. Let X be the distance from the center. For x 2 [0, 1],
F (^) X (x) = P {X x} =
area inside circle of radius x area of circle
⇡x 2 ⇡ 1 2
= x 2.
Thus, we have the distribution function
F (^) X (x) =
0 if x 0 , x 2 if 0 < x 1 , 1 if x > 1.
The first line states that X cannot be negative. The third states that X is at most 1, and the middle lines describes how X distributes is values between 0 and 1. For example,
indicates that with probability 1/4, the dart will land within 1/2 unit of the center of the dartboard.
Exercise 7.16. Find the probability that the dart lands between 1/3 unit and 2/3 unit from the center.
Exercise 7.17. Let the reward Y for through the dart be the inverse 1 /X of the distance from the center. Find the cumulative distribution function for Y.
Exercise 7.18. An exponential random variable X has cumulative distribution function
F (^) X (x) = P {X x} =
0 if x 0 , 1 exp( x) if x > 0.
for some > 0. Show that F (^) X has the properties of a distribution function.
Its value at x can be computed in R using the command pexp(x,0.1) for = 1/ 10 and drawn using
curve(pexp(x,0.1),0,80)
0 20 40 60 80
x
pexp(x, 0.1)
Figure 7.3: Cumulative distribution function for an exponential random variable with = 1/ 10.
Exercise 7.19. The time until the next bus arrives is an exponential random variable with = 1/ 10 minutes. A person waits for a bus at the bus stop until the bus arrives, giving up when the wait reaches 20 minutes. Give the cumulative distribution function for T , the time that the person remains at the bus station and sketch a graph.
Even though the cumulative distribution function is defined for every random variable, we will often use other characterizations, namely, the mass function for discrete random variable and the density function for continuous random variables. Indeed, we typically will introduce a random variable via one of these two functions. In the next two sections we introduce these two concepts and develop some of their properties.
The mass function and the cumulative distribution function for the geometric random variable with parameter p = 1/ 3 can be found in R by writing
x<-c(0:10) f<-dgeom(x,1/3) F<-pgeom(x,1/3)
The initial d indicates density and p indicates the probability from the distribution function.
data.frame(x,f,F) x f F 1 0 0.333333333 0. 2 1 0.222222222 0. 3 2 0.148148148 0. 4 3 0.098765432 0. 5 4 0.065843621 0. 6 5 0.043895748 0. 7 6 0.029263832 0. 8 7 0.019509221 0. 9 8 0.013006147 0. 10 9 0.008670765 0. 11 10 0.005780510 0.
Note that the difference in values in the distribution function F (^) X (x) F (^) X (x 1), giving the height of the jump in F (^) X at x, is equal to the value of the mass function. For example,
F (^) X (3) F (^) X (2) = 0. 7037037 0 .5555556 = 0.148148148 = f (^) X (2).
Exercise 7.24. Check that the jumps in the cumulative distribution function for the geometric random variable above is equal to the values of the mass function.
Exercise 7.25. For the geometric random variable above, find P {X 3 }, P { 2 < X 5 }. P {X > 4 }.
We can simulate 100 geometric random variables with parameter p = 1/ 3 using the R command rgeom(100,1/3). (See Figure 7.4.) Histogram of x
x
Frequency
0 2 4 6 8 10 12
0
10
20
30
40
50
Histogram of x
x
Frequency
0 5 10 15 20
0
1000
2000
3000
4000
5000
Figure 7.4: Histogram of 100 and 10,000 simulated geometric random variables with p = 1/ 3. Note that the histogram looks much more like a geometric series for 10,000 simulations. We shall see later how this relates to the law of large numbers.
7.5 Density Functions
Definition 7.26. For X a random variable whose distribution function F (^) X has a derivative. The function f (^) X satisfying
F (^) X (x) =
Z (^) x