Date post: | 03-Apr-2018 |
Category: |
Documents |
Upload: | nurgazy-nazhimidinov |
View: | 223 times |
Download: | 0 times |
of 39
7/28/2019 5.Random Variables and Expectations
1/39
1
RANDOM VARIABLES
AND EXPECTATION
7/28/2019 5.Random Variables and Expectations
2/39
2
Random Variables
A random variable is a function or rule thatassigns a numerical value to each simpleevent in a sample space.
A random variable reflects the aspect of arandom experiment that is of interest for us.
There are two types of random variables:
Discrete random variable Continuous random variable.
7/28/2019 5.Random Variables and Expectations
3/39
3
Random Variables
IfXis a function that assigns a realnumbered value to every possible event ina sample space of interest,Xis called a
random variable. It is denoted by capital letters such asX, Y
andZ.
The specified value of the random variableis unknown until the experimental outcomeis observed.
7/28/2019 5.Random Variables and Expectations
4/39
4
EXAMPLES
The experiment of flipping a fair coin.Outcome of the flip is a random variable.
S={H,T}X(H)=1 andX(T)=0
Select a student at random from allregistered students at METU. We want toknow the weight of these students.
X= the weight of the selected student
S: {x: 45kg X 300kg}
7/28/2019 5.Random Variables and Expectations
5/39
5
A random variable is discrete if it can assumea countable number of values.
A random variable is continuous if it can
assume an uncountable number of values.
0 11/21/41/16
Continuous random variable
After the first value is defined
the second value, and any valuethereafter are known.
Therefore, the number of
values is countable
After the first value is defined,
any number can be the next one
Discrete random variable
Therefore, the number of
values is uncountable
0 1 2 3 ...
Discrete and Continuous RandomVariables
7/28/2019 5.Random Variables and Expectations
6/39
6
A table, formula, or graph that lists all possiblevalues a discrete random variable can assume,together with associated probabilities, is calleda discrete probability distribution.
To calculate the probability that the randomvariable X assumes the valuex,P(X = x), add the probabilities of all the simple events for which
X is equal tox, or Use probability calculation tools (tree diagram),
Apply probability definitions
Discrete Probability Distribution
7/28/2019 5.Random Variables and Expectations
7/39
7
If a random variable can assume valuesxi, then the following must be true:
1)x(p.2
xallfor1)p(x0.1
ixall
i
ii
Requirements for a DiscreteDistribution
7/28/2019 5.Random Variables and Expectations
8/39
8
EXAMPLE
Consider an experiment in which a fair coin istossed 3 times.
X= The number of heads
Lets assign 1 for head and 0 for tail. The samplespace is
S: {TTT,TTH,THT,HTT,THH,HTH,HHT,HHH}
Possible values ofXis 0, 1, 2, 3. Then, the
probability distribution ofXis
x 0 1 2 3 Total
p(x) 1/8 3/8 3/8 1/8 1
7/28/2019 5.Random Variables and Expectations
9/39
9
EXAMPLE
An automobile service facility specializing inengine tune-ups knows that 45% of all tune-ups are done on 4-cylinder automobiles,
40% of 6-cylinder automobiles and 15% on8-cylinder automobiles.
LetX= The number of cylinders on the next car
to be tuned.
7/28/2019 5.Random Variables and Expectations
10/39
10
Example (Contd.)
a) What is the pmf ofX?
b) Draw the line graph for the pmf.
c) What is the probability that the next car tuned has at least6-cylinder? More than 6-cylinder?
d) Draw a probability histogram.
7/28/2019 5.Random Variables and Expectations
11/39
11
Distribution and Relative Frequencies
In practice, often probability distributions areestimated from relative frequencies.
ExampleA survey reveals the following frequencies(1,000s) for the number of color TVs per household.
Number of TVs Number of Households x p(x)0 1,218 0 1218/Total = .0121 32,379 1 .3192 37,961 2 .374
3 19,387 3 .1914 7,714 4 .0765 2,842 5 .028Total 101,501 1.000
7/28/2019 5.Random Variables and Expectations
12/39
12
Determining Probability of Events
The probability distribution can be used tocalculate the probability of different events
Example continued
Calculate the probability of the followingevents:
P(The number of color TVs is 3) = P(X=3)
=.191
P(The number of color TVs is two or more) =P(X2)=P(X=2)+P(X=3)+P(X=4)+P(X=5)=
.374 +.191 +.076 +.028 = .669
7/28/2019 5.Random Variables and Expectations
13/39
13
EXAMPLE
Find a constant c so thatp(x) satisfies theconditions of being a pmf ofX.
2, 1,2,3,....
( ) 30 ,elsewhere
x
c xp x
Letp(x)=x/15, x=1,2,3,4,5 be a pmf ofX.
FindPr(X=1 or X=2).
FindPr(1X3).
7/28/2019 5.Random Variables and Expectations
14/39
14
The Cumulative DistributionFunction
IfXis a random variable, then thecumulative distribution function (cdf),denoted byF(x) is given by
for all real numbersx. It is a non-decreasingstep function ofx and it is right continuous.
:
( ) ( ) ( )
y y x
F x P X x p y
7/28/2019 5.Random Variables and Expectations
15/39
15
The Cumulative DistributionFunction
For any two numbers a and b, a b
P (a Xb) = F (b)F (a-)
where a- represents the largest possibleXvalue which is less than a.
Ifa and b are integers,
P (a Xb) = F (b)F(a-1)
Taking a=b,P( X=a ) = F (a)-F (a-1)
7/28/2019 5.Random Variables and Expectations
16/39
16
EXAMPLE
Let X is the number of days of sick leave takenby a randomly selected employee of a largecompany during a particular year. If the max.number of allowable sick days per year is 14,
possible values ofXare 0,1,2,,14. WithF(0)=0.58, F(1)=0.72,F(2)=0.76,F(3)=0.81,F(4)=0.88 and F(5)=0.94,find
P(2 X5) =
P(X = 3) =
P(X2) =
7/28/2019 5.Random Variables and Expectations
17/39
17
Describing the Population/
Probability Distribution The probability distribution represents a
population
Were interested in describing the population
by computing various parameters.
Specifically, we calculate the population
mean and population variance.
7/28/2019 5.Random Variables and Expectations
18/39
18
EXPECTED VALUES
LetXbe a rv with pdffX(x) andg(X) be afunction ofX. Then, the expected value (orthe mean or the mathematical expectation)
ofg(X)
X
x
X
g x f x , if X is discrete
E g X
g x f x dx, if X is continuous
providing the sum or the integral exists, i.e.,
7/28/2019 5.Random Variables and Expectations
19/39
19
EXPECTED VALUES
E[g(X)] is finite ifE[| g(X) |] is finite.
Xx
X
g x f x < , if X is discrete
E g X
g x f x dx< , if X is continuous
7/28/2019 5.Random Variables and Expectations
20/39
20
Population Mean (Expected Value)
Given a discrete random variable X withvaluesxi, that occur with probabilitiesp(xi),the population mean ofX is.
ixall
ii)x(px)X(E
7/28/2019 5.Random Variables and Expectations
21/39
21
Let X be a discrete random variable withpossible valuesxi that occur withprobabilitiesp(x
i
), and letE(xi
) = . Thevariance ofX is defined by
ixall
i
2
i
22 )x(p)x()X(E)X(V
Population Variance
2
isdev iationdardtansThe
7/28/2019 5.Random Variables and Expectations
22/39
22
EXAMPLE
The pmf for the number of defective itemsin a lot is as follows
0.35, 0
0.39, 1
( ) 0.19, 2
0.06, 3
0.01, 4
x
x
p x x
x
x
Find the expected number and the variance of
defective items.
7/28/2019 5.Random Variables and Expectations
23/39
23
EXAMPLE
What is the mathematical expectation if wewin $10 when a die comes up 1 or 6 andlose $5 when it comes up 2, 3, 4 and 5?
X= amount of profit
7/28/2019 5.Random Variables and Expectations
24/39
24
EXAMPLE
A grab-bay contains 6 packages worth $2each, 11 packages worth $3, and 8packages worth $4 each. Is it reasonable
to pay $3.5 for the option of selecting oneof these packages at random?
X= worth of packages
7/28/2019 5.Random Variables and Expectations
25/39
25
Laws of Expected Value
LetXbe a rv and a, b, and c be constants.Then, for any two functionsg1(x) andg2(x)whose expectations exist,
1 2 1 2)a E ag X bg X c aE g X bE g X c
1 10 , 0.b) If g x for all x then E g X
1 2 1 2) .c If g x g x for all x, then E g x E g x
1 1)d If a g x b for all x, then a E g X b
7/28/2019 5.Random Variables and Expectations
26/39
26
Laws of Expected
Value
E(c) = c
E(X + c) = E(X) + c
E(cX) = cE(X)
Laws of
Variance
V(c) = 0
V(X + c) = V(X)
V(cX) = c2V(X)
Laws of Expected Value and Variance
7/28/2019 5.Random Variables and Expectations
27/39
27
SOME MATHEMATICAL
EXPECTATIONS
Population Mean: = E(X)
Population Variance:
2 22 2
0Var X E X E X (measure of the deviation from the population mean)
Population Standard Deviation: 2 0
Moments:* k
k E X the k-th moment
k
k E X the k-th central moment
7/28/2019 5.Random Variables and Expectations
28/39
28
SKEWNESS
Measure of lack of symmetry in the pdf.
3
3
3 3/2
2
E XSkewness
If the distribution ofXis symmetric around itsmean ,
3=0 Skewness=0
7/28/2019 5.Random Variables and Expectations
29/39
29
KURTOSIS
Measure of the peakedness of the pdf. Describesthe shape of the r,v.
4
4
4 2
2
E X
Kurtosis
Kurtosis=3 Normal
Kurtosis >3 Leptokurtic
(peaked and fat tails)
Kurtosis
7/28/2019 5.Random Variables and Expectations
30/39
30
EXAMPLE
An appliance dealer sells 3 different modelsof upright freezers having 13.5, 15.9 and 19.1cubic feet of storage space, respectively.
X= the amount of storage space purchased bythe next customer.
The pmf ofX0.2, 13.5
( ) 0.5, 15.9
0.3, 19.1
x
p x x
x
7/28/2019 5.Random Variables and Expectations
31/39
31
EXAMPLE (contd.)
a) E(X)=?
b) If the price of a freezer having capacityXcubic feet is25X-8.5, what is the expected price paid by the next
customer to buy a freezer?
c) Var (X)=?
d) Suppose that although the rated capacity of a freezer isX,the actual capacity is h (X)=X-0.01X2. What is the expectedactual capacity of the freezer purchased by the nextcustomer?
7/28/2019 5.Random Variables and Expectations
32/39
32
A continuous random variable has anuncountably infinite number of values inthe interval (a,b).
Continuous Probability Distributions
The probability that a continuous variableX will assume any particular value is zero.Why?
0 11/21/3 2/3
1/2 + 1/2 = 11/3 + 1/3 + 1/3 = 1
1/4 + 1/4 + 1/4 + 1/4 = 1The probability of each value
7/28/2019 5.Random Variables and Expectations
33/39
33
0 11/21/3 2/3
1/2 + 1/2 = 11/3 + 1/3 + 1/3 = 1
1/4 + 1/4 + 1/4 + 1/4 = 1
As the number of values increases the probability of each
value decreases. This is so because the sum of all the
probabilities remains 1.
When the number of values approaches infinity (becauseX
is continuous) the probability of each value approaches 0.
The probability of each value
Continuous Probability
Distributions
7/28/2019 5.Random Variables and Expectations
34/39
34
To calculate probabilities we define aprobability density functionf(x).
The density function satisfies the following
conditionsf(x) is non-negative,
The total area under the curve representing f(x)equals 1.
x1 x2
Area = 1P(x1
7/28/2019 5.Random Variables and Expectations
35/39
35
CUMULATIVE DISTRIBUTIONFUNCTION
min
( ) ( ) ( )x
X
F x P X x f x dx
Example: LetXis the amount of time for which abook on two-hour reserve at a college library is
checked out by a randomly selected student.Suppose thatXhas density function
0.5 ,0 2( )
0 ,otherwise
x xf x
P(X1)=?
P(0.5 X1.5)=?P(X
7/28/2019 5.Random Variables and Expectations
36/39
36
EXPECTED VALUE
The expected value or mean value of acontinuous random variableXwith pdff(x) is
( ) ( )
all x
E X xf x dx
The variance of a continuous randomvariableXwith pdff(x) is
2 2 2
all x
2 2 2 2
all x
( ) ( ) ( ) ( )
( ) ( ) ( )
Var X E X x f x dx
E X x f x dx
7/28/2019 5.Random Variables and Expectations
37/39
37
EXAMPLE
LetXbe a random variable and it is a lifelength of light bulb. Its pdf is
f(x)=2(1-x), 0< x < 1
FindE(X) and Var(X).
7/28/2019 5.Random Variables and Expectations
38/39
38
EXPECTED VALUE OF SUMS OF
RANDOM VARIABLES
IfXand Yare random variables, then
E(X+Y) = E(X) + E(Y)
7/28/2019 5.Random Variables and Expectations
39/39
Example At computer store, the annual demand for a particular software
package is a discrete random variable X. The store owner ordersfour copies of the package at 10$ per copy and charges customers$35 per copy. At the end of the year, the package is obsolete andthe owner loses the investment on unsold copies. The pdf ofXisgiven by the following table:
FindE(X) and Var(X).
Express the owners net profit Yas a linear function ofX, and findE(Y) and Var(Y).
39
x 0 1 2 3 4
P(x) .1 .3 .3 .2 .1