Download Discrete Random Variables and Their Probability Distributions

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts

History of statistics wikipedia , lookup

Statistics wikipedia , lookup

Probability wikipedia , lookup

Transcript
Discrete Random Variables and Their
Probability Distributions
Dr. Tai-kuang Ho, National Tsing Hua University
The slides draw from the textbooks of Wackerly, Mendenhall, and
Schea¤er (2008) & Devore and Berk (2012)
1
3.1
Basic De…nition
Numerical events
Let Y denote a variable to be measured in an experiment.
To each sample point in the sample space S we will assign a real number denoting
the value of the variable Y .
The sample space S can be partitioned into subsets so that points within a subset
are all assigned the same value of Y .
2
These subsets are mutually exclusive since no point is assigned two di¤erent
numerical values.
We convert an event to a number for simpli…cation and convenience.
Figure 2.14
Random variable
A random variable is a real-valued function de…ned over a sample space.
3
A random variable is a rule of association between experiment outcomes and
numerical values.
Figure 3.1 (B.S.)
A random variable Y is said to be discrete if it can assume only a …nite or
countably in…nite number of distinct values.
Examples?
Number of voters favoring a certain candidate
4
Number of defect TV sets
Number of bacteria per unit area
3.2
The Probability Distribution for a Discrete Random Variable
Y : denote a random variable
y : denote a particular value
Y is a random variable, but the speci…c observed value y is not random.
5
P (Y = y )
De…nition: probability function The probability that Y takes on the value y , P (Y = y ),
is de…ned as the sum of the probabilities of all sample points in S that are assigned the value y . We will sometimes denote P (Y = y ) by p (y ).
De…nition: probability distribution The probability distribution for a discrete variable Y can be represented by a formula, a table, or a graph that provides
p (y ) = P (Y = y ) for all y .
De…nition: probability distribution B.S. The probability mass function (pmf) of a
discrete random variable is de…ned for every number x by p (x) = P (X = x) =
P (all s 2 S : X (s) = x).
6
Example 3.1
Three methods to present a probability distribution: table, histogram, and formula.
p (y ) =
3
y
!
3
2
6
2
!
Table 3.1
7
y
!
;
y = 0; 1; 2
Figure 3.1
Discrete probability distribution must satis…ed the properties of probability.
Theorem: properties of discrete probability distribution For any discrete probability distribution, the following must be true:
1. 0
p (y )
1 for all y .
P
2. y p (y ) = 1, where the summation is over all values of y with nonzero probability.
More examples: Figure 3.2 (B.S.); Figure 3.3 (B.S.)
8
The Cumulative Distribution Function (cdf)
De…nition: cumulative distribution function The cumulative distribution function
F (x) of a discrete random variable X with pmf p (x) is de…ned for every number
x by
F (x) = P (X
x) =
y;
X
p (y )
y x
For any number x, F (x) is the probability that the observed value of X will be
at most x.
9
Example 3.11 (B.S.); Figure 3.5 (B.S.)
Properties of cdf.
Cumulative Distribution Function
Let X be a random variable. Then its cumulative distribution function (cdf) is
de…ned by:
FX (x) = PX ([ 1; x]) = P (X
10
x)
Let X be a random variable with cdf F (x). Then
1. For all a and b, if a < b then F (a)
F (b).
2. limx! 1 F (x) = 0
3. limx!1 F (x) = 1
4. limx#x0 F (x) = F (x0), F is right continuous
For any random variable,
11
P [X = x] = FX (x)
FX (x ) ;
for all x 2 R, where FX (x ) = limz"x FX (z ).
3.3
The Expected Value of a Random Variable or a Function
of a Random Variable
De…nition: expected value Let Y be a discrete random variable with the probability function p (y ). Then the expected value of Y , E (Y ), is de…ned to be
12
E (Y ) =
X
y p (y )
y
E (Y ) =
Table 3.2
Figure 3.2
1
1
1
+1
+2
=1
E (Y ) = 0
4
2
4
13
Theorem: expected value of a function Let Y be a discrete random variable with
probability function p (y ) and g (Y ) be a real-valued function of Y . Then the
expected value of g (Y ) is given by
E [g (Y )] =
X
g (y ) p (y )
allY
De…nition: variance of a random variable If Y is a random variable with mean
E (Y ) = , the variance of a random variable Y is de…ned to be the expected
value of (Y
)2. That is,
14
h
V (Y ) = E (Y
)
2
i
V (Y ) = 2
The standard deviation of Y is the positive square root of V (Y ).
Example 3.2
Table 3.3
15
Figure 3.3
Some additional tools
Theorem: expectation of a constant Let Y be a discrete random variable with
probability function p (y ) and c be a constant. Then E (c) = c.
Theorem Let Y be a discrete random variable with probability function p (y ), g (Y )
be a function of Y , and c be a constant. Then
E [c g (Y )] = c E [g (Y )]
16
Theorem Let Y be a discrete random variable with probability function p (y ) and
g1 (Y ), g2 (Y ), . . . , gk (Y ) be k functions of Y . Then
E [g1 (Y ) + g2 (Y ) +
+ gk (Y )] = E [g1 (Y )] + E [g2 (Y )] +
Theorem E (aY + b) = a E (Y ) + b
Theorem E (aY ) = a E (Y )
Theorem E (Y + b) = E (Y ) + b
17
+ E [gk (Y )]
Theorem: variance and second moment Let Y be a discrete variable with probability function p (y ) and mean E (Y ) = ; then
V (Y ) =
2
h
= E (Y
)
2
i
=E Y2
2
Proof
2
h
2
i
=E Y2
2 Y + 2
= E (Y
)
= E Y2
2 E (Y ) + 2 = E Y 2
18
2 2+ 2
Theorem V ar (aY + b) = a2 V ar (Y )
Theorem V ar (Y + b) = V ar (Y )
3.4
The Binomial Probability Distribution
A Bernoulli experiment is a random experiment, the outcome of which can be
classi…ed in but one of two mutually exclusive and exhaustive ways.
For example, success or failure, female or male, life of death, non-defective or
defective.
19
Let X be a random variable associated with a Bernoulli experiment.
X (success) = 1
X (f ailure) = 0
What is the parameter of a Bernoulli distribution? p
De…nition: parameter of a distribution Suppose p depends on a quantity that can
be assigned any one of a number of possible values, with each di¤erent value
determining a di¤erent probability distribution. Such a quantity is called a parameter of the distribution.
20
The probability mass function (pmf) of X can be written as:
p (x) = px (1
p)1 x ;
x = 0; 1
The expected value of X and the variance of X is:
= E (X ) = 0 (1
2
h
= E (X
)
2
i
= p2 (1
p) + 1 p = p
p) + (1
21
p)2 p = p (1
p)
A sequence of Bernoulli experiments occur when a Bernoulli experiment is performed several independent times so that the probability of success, say p, remains the same from experiment to experiment.
toss a coin n times
shot in a sequence of …rings at a target
De…nition: Binomial Experiment
A binomial experiment possesses the following properties:
22
1. The experiment consists of a …xed number n of identical trials.
2. Each trial results in one of two outcomes: success S or failure F .
3. The probability of success on a single trial is equal to some value p and remains
the same from trial to trial. The probability of a failure is equal to q = (1 p).
4. The trials are independent.
5. The random variable of interest is Y , the number of successes observed during
the n trials.
23
The random variable of interest in a Bernoulli experiment is success or failure.
Important: the random variable of interest in the binomial experiment is the
number of successes observed in the n experiments (trials).
A random sample of n = 10 voters will be selected, and Y , the number of
favoring some candidate is to be observed. This experiment approximates a
binomial experiment.
Binomial Probability Distribution
De…nition: pmf of a binomial distribution A random variable Y is said to have a
binomial distribution based on n trials with success probability p if and only if
24
p (y ) =
n
y
!
n
1
!
py q n y ;
y = 0; 1; 2; : : : ; n
Figure 3.4
(p + q )n =
|
n
0
!
{z
p(0)
qn +
}
|
p1 q n 1 +
{z
p(1)
}
25
n
2
!
p2 q n 2 +
+
|
n
n
!
{z
p(n)
pn
}
X
y
p (y ) =
n
X
y=0
n
y
!
py q n y = (p + q )n = 1
Draw a picture of binomial distribution using R.
vals=dbinom(1:10,size=10,prob=0.2)
barplot(vals,names=1:10,main="Binomial(n=10,p=0.2)")
What are the parameters of the distribution?
26
p; n
Mean and variance of binomial distribution
Theorem: mean and variance of binomial distribution Let Y be a binomial random variable based on n trials and success probability p. Then
= E (Y ) = np
2
= V (Y ) = npq
27
Please work out the proof at home.
Most texts use moment generating function to compute mean and variance of
binomial distribution.
28