Chapter 3 Random Variables and Probability Distributions 3.1 Random Variables §3.1 * Different experiments yield different outcomes and we are interested in some numerical aspects of the random outcome. •No. of people voting for a candidate; •# of times that the ball in a roulette lands in even 0* This is the section number in the textbook 54
22
Embed
New Chapter 3 Random Variables and Probability Distributionsjqfan/fan/classes/245/chap3.pdf · 2017. 9. 21. · Chapter 3 Random Variables and Probability Distributions 3.1 Random
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Chapter 3
Random Variables and Probability Distributions
3.1 Random Variables §3.1∗
Different experiments yield different outcomes and we are interested in
some numerical aspects of the random outcome.
•No. of people voting for a candidate;
•# of times that the ball in a roulette lands in even0∗ This is the section number in the textbook
54
ORF 245: Random Variables – J.Fan 55
numbered pockets.
Random variable: X is a function on Ω. Formally,
it should be written as X(ω), but the outcome ω is often suppressed.
Example 3.1 Random dialing
Consider a random number dialer which picks a telephone number at
random in a certain area. Let Y be 1 if the call is picked up and 0
otherwise. Then the sample space is all allowable phone numbers and
Y is a binary random variable, called a Bernoulli r.v.
> sample(9999999,10) #draw a random sample of size 10 from 1:9999999
For a rare disease, a commonly used method is to sample until getting
a certain # of cases. Let X be the number of samples required to ob-
tain the first case. Then, the sample space is Ω = S, FS, FFS, · · ·
ORF 245: Random Variables – J.Fan 57
and X(ω) is simply the number of letters in ω.
Example 3.4 Spatial data
Let X be the current temperature at a random location (defined by
latitude and longitude). Then, the sample space is [0, 180] × [0, 360]
and X(ω) = current temperature at that location.
Range of a random variable is all of its possible values. When the
range is countable, the random variable is discrete. When the range
is an interval on the number line, it is a continuous.
Examples: In Ex 3.1 – 3.3, the random variables are discrete; while
in Ex 3.4, the random variable is continuous.
ORF 245: Random Variables – J.Fan 58
3.2 Probability Distributions §3.2
Prob dist says how the total probability of 1 is distributed among
possible values of a r.v. X . For a discrete X, it is given by
p(x) = P (X = x) = Pω : X(ω) = x, for all x in the range ,
also called probability mass function (pmf).
Example 3.2 (continued). The range of X is 0, 1, 2, 3.
p(0) = P (X = 0) =1
8, p(1) =
3
8, p(2) =
3
8, p(3) =
1
8.
It can easily be visualized by the line diagram (graph), called a bi-
nomial dist with no. of trials n = 3 and prob. of success p = 0.5.
ORF 245: Random Variables – J.Fan 59
Figure 3.1: The line diagrams for the pmf in Examples 3.2 and 3.3. It is equivalent to the histogram in this case. A probabilityhistogram represents probability by area.
Example 3.3 (continued). The range of X is 1, 2, · · · . Let p be
the prevalence probability of the disease and q = 1− p. Then,
p(1) = P (X = 1) = p, p(2) = qp, p(3) = q2p,
p(x) = P (X = x) = qx−1p, · · · .x︷ ︸︸ ︷
FFFFFFS
It is referred to as a geometric distribution with parameter p.
ORF 245: Random Variables – J.Fan 60
Example 3.5 Sampling inspection
In 100 products, 3 of them are defective. Suppose that we pick 4
products at random. Let X be the number of defective products.
Find the distribution of X .
First of all, the range of X is 0, 1, 2, 3. Now,
p(0) = P (X = 0) =
(974
)(1004
) =97×96×95×94
4×3×2×1100×99×98×97
4×3×2×1
=96× 95× 94
100× 99× 98= 88.36%.
Similarly,
p(1) = P (X = 1) =
(973
)(31
)(1004
) = = = 11.28%,
p(2) = P (X = 2) =
(972
)(32
)(1004
) = = = 0.36%
ORF 245: Random Variables – J.Fan 61
and
p(3) = P (X = 3) =
(971
)(33
)(1004
) = = ≈ 0%.
called a hypergeometric distribution.
Cumulative distribution function (cdf) is defined as
F (x) = P (X ≤ x) =∑y:y≤x
p(y),
the probability that the observed value of X is at most x.
Example 3.2 (continued). The cdf of X is
F (0) =1
8, F (1) =
1
8+
3
8=
1
2, F (2) = F (1) + p(2) =
7
8, F (3) = 1.
Example 3.3 (continued). For any given integer x,
F (x) =
x∑y=1
pqy−1 = p1− qx
1− q= 1− qx.
ORF 245: Random Variables – J.Fan 62
For noninteger x, replace x above by its integer part [x].x=seq(0,40, 0.02) #create x values for calculating CDF of Ex 3.3