1) The document discusses the mean or expected value of random variables.
2) It provides examples of calculating the mean of discrete and continuous random variables, as well as the mean of functions of random variables.
3) One example calculates the expected commission a salesperson would earn based on the probabilities of making deals at two appointments.
2. Text Book:
Probability & Statistics for Engineers & Scientists, 9/E:
Ronald E. Walpole: Raymond H. Myers
Course Outline
Slides Material is from Textbook and Internet
Courtesy: Dr.-Ing. Erwin Sitompul
https://zitompul.wordpress.com/2-core-lectures/3-basic-probability-and-statistics/
https://www.probabilitycourse.com/
2
3. 3
Mean of a Random Variable
If two coins are tossed 16 times and X is the number of heads
that occur per toss, then the values of X can be 0, 1, and 2.
4 7 5
0 1 2 1.06
16 16 16
Sample
Space
x (Number
of Heads)
HH 2
HT 1
TH 1
TT 0
Suppose that the experiment yields
{0, 1 ,1 ,0 ,2 ,2 ,2 ,0 , 0,1 , 1 , 1 ,2 , 1, 1, 2}
The mean
0 1 1 0 2 2 2 0 0 1
1.
1 1 2 1 1 2
06
16
Probability Distribution function
x 0 1 2
P(X=x) 4/16 7/16 5/16
The mean is also known as average or expected value
In this experiment we can see that No Head = 4, One Head = 7
and Two Heads = 5
f(0)= P(X=0)=4/16, f(1)=P(X=1)=7/16 and f(2) = P(X=2)=5/16
Alternate way to get The average
number of heads per toss of the two
coins is to multiply each possible
outcome with its respective
probability
4. 4
Mean of a Random Variable
Let X be a random variable with probability distribution f(x). The
mean or expected value of X is
Chapter 4.1
( ) ( )
x
E X xf x
if X is discrete, and
if X is continuous.
( ) ( )
E X xf x dx
0 0 1 1 2 2
4 7 5
0 1 2 1.06
16 16 16
E X
f f f
Probability Distribution function
x 0 1 2
P(X=x) 4/16 7/16 5/16
5. 5
Mean of a Random Variable
Chapter 4.1 Mean of a Random Variable
A lot containing 7 components is sampled by a quality inspector, the
lot contains 4 good components and 3 defective components. A
sample of 3 is taken by the inspector. Find the expected value of
the number of good components in this sample
Let X represent the number of good components in the sample. Let
the probability distribution of X is
1 12 18 4
(0) , (1) , (2) , (3)
35 35 35 35
1 12 18 4 12
( ) ( ) (0) (1) (2) (3) 1.714
35 35 35 35 7
x
f f f f
E X xf x
Thus, if 3 components are selected at random over and over again
from a lot of 4 good components and 3 defective components, one
will pick on average 1.7 good components and, accordingly, 1.3 bad
components.
Exp:4-1
6. 6
Mean of a Random Variable
In a gambling game, a man is paid $5 if he gets all heads or all tails
when three coins are tossed, and he will pay out $3 if either one or
two heads show. What is his expected gain?
The sample space for the possible outcomes of this game is
{ , , , , , , , }
S HHH HHT HTH THH HTT THT TTH TTT
In this game the gambler will, on average, loss $1 per toss of the
three coins.
Each of these events is equally likely and occurs with probability of
each equal to 1/8.
Let Y be the amount of money the gambler can win, E1 is the event
of winning 5$ and E2 is event of losing $3,
1
2
{ , }
{ , , , , , }
2 6
( ) ( ) (5) ( 3) 1
8 8
y
E HHH TTT
E HHT HTH THH HTT THT TTH
E Y yf y
y
( ) [ ]
f y P Y y
5 3
2 / 8 6 / 8
7. 7
Chapter 4.1 Mean of a Random Variable
A salesperson has two appointments on a given day. He believes that he has 70%
chance to make the deal at the first appointment, from which he can earn $1000
commission if successful. On the other hand, he thinks he only has a 40% chance to
make the deal at the second appointment, which will give him $1500 if successful.
What is his expected commission based on his own probability belief? Assume that
the appointment results are independent of each other.
First, we know that the salesperson, for the two appointments, can have 4 possible commission
totals: $0 (No Deal), $1000 (Deal at First appointment), $1500 (Deal at First appointment), and
$2500 (Deal at both appointments). We then need to calculate their associated probabilities.
Let
A = Success in First Appointment P(A) = 0.7
B = Success in First Appointment P(A) = 0.4
Due to independence, the probabilities can be calculated as
($0) (1 0.7)(1 0.4) 0.18,
($1500) (1 0.7)(0.4) 0.12
($2500)
($0)(0.18) ($1
(0.7)(0.4) 0.
($1000) (0.7)(1 0.4) 0.
000)(0.42) ($1500)(
42
( )
2
(
,
0
)
8
x
f P A B P A P B
f
f P A B P A
f P A B P A
E
P A B P A
P B
P B
X x
P
xf
B
.12) ($2500)(0.28)
$1300
Exp:4-2
8. 8
Mean of a Random Variable
Chapter 4.1 Mean of a Random Variable
Let X be the random variable that denotes the life in hours of a
certain electronic device. The probability density function is
Find the expected life of this type of device.
3
20,000
, 100
( )
0, elsewhere
x
f x x
3 3
100
100 100
20,000 20,000 20,000
( ) ( ) 200
E X xf x dx x dx x dx
x x x
Therefore, we can expect this type of device to function well for, on
average, 200 hours.
9. 9
Mean of a Random Variable
Let X be a random variable with probability distribution f(x). The
mean or expected value of the function of random variable
g(X) is
Chapter 4.1 Mean of a Random Variable
( ) ( ) ( ) ( )
g X E g X g x f x
if X is discrete, and
if X is continuous.
( ) ( ) ( ) ( )
g X E g X g x f x dx
Probability Distribution function
x 0 1 2
g(X)=2X+5 2x0+5=5 2x1+5=7 2x2+5=9
f(x)=P(X=x) 1/4 2/4 1/4
Do not confuse g(X) (function of random variable with marginal distribution).
Some example of function of random variable
Let X is a random variable g(X) = 2X+5
10. 10
Mean of a Random Variable
Chapter 4.1
Suppose that the number of cars X that pass through a car
wash between 4:00 P.M. and 5:00 P.M. on any sunny Friday
has the following probability distribution:
9
4
( ) 2 1 (2 1) ( )
1 1 1 1
(7) (9) (11) (13)
12 12 4 4
1 1
(15) (17)
6 6
12.67
x
E g X E X x f x
Let g(X)=2X–1 represent the amount of money in dollars, paid to
the attendant by the manager. Find the attendant’s expected
earnings for this particular time period.
Exp:4-1
11. 11
Mean of a Random Variable
Chapter 4.1 Mean of a Random Variable
Let X be a random variable with density function
2 2
1
2
4 3
1
( ) ( ) ( )
(4 3)
3
8
3
E g X g x f x dx
x
x dx
x x
Find the expected value of g(X)=4X+3.
2
, 1 2
( ) 3
0, elsewhere
x
x
f x
Exp:4-1
12. 12
1
0
[ ] [ ] 1
X x x
E g X E e e dx
f x dx e e
Mean of a Random Variable
Let X be a random variable with density function
Find the expected value of
1 0 1
0
x
f x
otherwise
X
g X e
13. 13
Mean of a Random Variable
Let X and Y be random variables with joint probability distribution
f(x,y). The mean or expected value of the random variable g(X,Y)
is
( , ) ( , ) ( , ) ( , )
g X Y
x y
E g X Y g x y f x y
if X and Y are discrete, and
if X and Y are continuous.
( , ) ( , ) ( , ) ( , )
g X Y E g X Y g x y f x y dxdy
2 2
( , )
2 2
: ( , )
( , ) ( , ) ( , )
( , )
g X Y
x y
x y
Example Let g X Y X Y
E g X Y g x y f x y
x y f x y
14. 14
Mean of a Random Variable
Chapter 4.1 Mean of a Random Variable
Let X and Y be a random variables with joint probability density
function as in the “ballpoint pens” example. Find the expected value
of g(X,Y)=XY
2 2
0 0
( , )
3 3 1 9 3
(0)(0) (0)(1) (0)(2) (1)(0) (1)(1)
28 14 28 28 14
3 3
(1)(2)(0) (2)(0) (2)(1)(0) (2)(2)(0)
28 14
x y
E XY xyf x y
f(x,y)
x
0 1 2
y
0 3/28 9/28 3/28
1 6/28 6/28 0
2 1/28 0 0
Exp:4-1
15. 15
Mean of a Random Variable
Find E(Y/X) for the density function
2
(1 3 )
, 0 2,0 1
( , ) 4
0,
x y
x y
f x y
elsewhere
1 2
0 0
1 2 2
0 0
1 2 1
3 3
2
0
0 0 0
1 1
3 3
0 0
1
2 4
0
( , )
(1 3 )
4
3 3
4 4
3 3
2
4 2
3 5
8 16 8
Y y
E f x y dxdy
X x
y x y
dxdy
x
y y y y
dxdy x dy
y y y y
dy dy
y y
Exp:4-1
16. 16
How to do Double Integration
1 2
2
0.5 1
2
1 2 1 1
3
2
0.5 1 0.5 0.5
1
1
1 2
0.5 0.5
7
3 3
7 7 7 0.25 1 7 0.75
3 3 2 3 2 3 2
y x
y x y y
y
x y dxdy
x
x dx ydy ydy ydy
y
ydy
17. 17
1 2 3 4 5 6 7 8 9 10 10 10 10
1. From a regular deck of 52 playing cards we pick one at random. Let the
random variable X equal the number on the card if it is a numbered one
(ace counts as 1) and 10 if it is a face card (J, Q, and K). Find E(X).
4 16
1 10
52 52
E X
18. 18
Practice Problems
Probability and Statistics
From Book Solve the following Problems:
4.1,4.2,4.4,4.10,4.11,4.12,4.13,4.16,4.17,
4.18,4.20,4.22,4.23,4.24,4.26