Transcript Chapter V

Random Variable
Random variable
A random variable χ is a function (rule) that
assigns a number to each outcome of a chance
experiment.
A function χ acts on the elements of its domain (the
sample space) associating each element with a
unique real number. The set of all values
assigned by the random variable is the range of
this function. If that set is finite, then the random
variable is said to be finite discrete. If that set is
infinite but can be written as a sequence, then
the random variable is said to be infinite
discrete. If that set is an interval then the random
variable is said to be continuous.
Example (1)
A coin is tossed 3 times. Let the random variable χ denotes the number
of heads that occur in 3 tosses.
1. List the outcomes of the experiment (Find the domain of the function
χ)
Answer:
The outcomes of the experiments are those of the sample space
S = { HHH, HHT, HTH, THH, HTT, THT, TTH, TTT }
= the domain of the function (random variable) χ
2. Find the value assigned to each outcome by χ
See the table on the following slide.
Outcome
Value of Χ
HHH
3
HHT
2
HTH
2
THH
2
HTT
1
THT
1
TTH
1
TTT
0
3. Let E be the event containing the outcomes to which a
value of 2 has been assigned by χ. Find E!
Answer:
E = {HHT, HTH, THH }
4. Is χ finite discrete, infinite discrete or continuous?
Answer:
The set of the values assigned by χ is:
{ 0, 1, 2, 3}, which is a finite set, hence the random variable
is χ finite discrete
Example (2)
A coin is tossed repeatedly until a head occurs. Let the random variable
χ denotes the number coin tosses in the experiment
1. List the outcomes of the experiment (Find the domain of the function
χ)
Answer
The outcomes of the experiments are those of the sample space
S = { H, TH, TTH, TTTH, TTTTH, TTTTTH, TTTTTTH, …. }
= the domain of the function (random variable) χ
2. Find the value assigned to each outcome by χ
See the table on the following slide which shows some of these values.
Outcome
Value of Χ
H
1
TH
2
TTH
3
TTTH
4
TTTTH
5
TTTTTH
6
TTTTTTH
7
….Etc etc
…..
3. Is χ finite discrete, infinite discrete or continuous?
Answer:
The set of the values assigned by χ is:
{1, 2, 3, 4, 5, 6, 7, 8, 9, ……..}, which is a infinite set, that
can written as a sequence, hence the random variable is
χ is infinite discrete
Example (3)
A flashlight is turned on until the battery runs out.
Let the Radom variable χ denote the length
(time) of the life of the battery. What values may
χ assume ? Is χ finite discrete, infinite discrete or
continuous?
Answer:
The set of possible values is the interval [0,∞), and
hence the random variable χ is continuous.
Probability Distribution of Random variable
Probability Distribution of Random variable
A table showing the probability distribution
associated with the random variable (
which is associated with the experiment)
rather than with the outcomes (which are
related to the random variable)
Example (4)
A coin is tossed 3 times. Let the random variable χ denotes
the number of heads that occur in 3 tosses.
Show the probability distribution of the random variable
associated with the experiment.
Outcome
Value of Χ
HHH
3
HHT
2
HTH
2
THH
2
HTT
1
THT
1
TTH
1
TTT
0
probability distribution of the random
variable X
Value of Χ
P(X=x)
0
1/8
1
3/8
2
3/8
3
1/8
Example (5)
Two dice are rolled. Let the random variable χ denotes the
sum of the numbers on the faces that fall uppermost.
Show the probability distribution of the random variable X.
Answer:
The values assumed by the random variable X are 2, 3, 4,
5, 6,….,12, corresponding to the events E2, E3,
E4,….,E12. The probabilities associated with the random
variable X corresponding to 2, 3, 4, …,12 are the
probabilities p(E2), p(E3),, p(E4), …., p(E12)..
Sum of
uppermost numbers
Event Ek
2
3
{ (1 ,1) }
4
5
{ (1,3) , (2 , 2) , (3 ,1) }
6
7
{ (1 , 5 ) , (2 , 4) , (3 , 3) , (4 , 2) , (5 ,1) }
8
{ (2 , 6) , (3 , 5) , (4 , 4) , (5 ,1) , (6 , 2) }
9
10
11
12
{ (1,2) , (2 ,1) }
{ (1, 4) , (2 , 3) , (3 , 2) , (4 ,1) }
{(1, 6) , (2 , 5) , (3,4) , (4 , 3) , (5 , 2) , (6 ,1)}
{ (3 , 6) , (4 , 5) , (5 , 4) , (6 , 3) }
{ (4 , 6) , (5 , 5) , (6 , 4) }
{ (5 , 6) , (6 , 5) }
{(6,6)}
Probability Distribution of the Random Variable X
x
2
3
p(X=x)
1/36
2/36
4
5
6
3/36
4/36
5/36
7
8
9
10
6/36
5/36
4/36
3/36
11
12
2/36
1/36
Example (6)
The following table shows
the number of cars
observed waiting in line at
the beginning of 2
minutes interval from
10.00 am to 12.00 noon
at the drive-in ATM of
QNB branch in Ghrafa
and the corresponding
frequency of occurrence.
Show the probability
distribution table of the
random variable x
denoting the number of
cars observed waiting in
line.
Cars
0
1
2
3
4
5
6
7
8
Frequency of
Occurrence
2
9
16
12
8
6
4
2
1
Dividing the frequency by 60
(the sum of these
numbers- the ones indicating
frequency), we get the
respective probability
associated with random
variable X.
Thus:
P(X=0) = 2/60 =1/30 ≈0.03
P(X=1) = 9/60 = 3/20 =0.15
P(X=2) = 16/60 = 1/10 = 0.1
….etc
See the opposite table
Cars
Frequency of Occurrence
p(X = x)
x
0
2/60 ≈ 0.03
1
9/60 ≈ 0.15
2
16/60 ≈ 0.27
3
12/60 ≈ 0.20
4
8/60 ≈ 0.13
5
6/60 ≈ 0.10
6
4/60 ≈ 0.07
7
2/60 ≈ 0.03
8
1/60 ≈ 0.02
Bar Charts ( Histograms )
A bar chart or histogram is a graphical means of
exhibiting probability distribution of a random
variable.
For a given probability distribution, a histogram is
constructed as follows:
1. Locate the values of the random variable on the
number line (x-axis)
2. Above each number (value) erect a rectangle of
width 1 and height equal to the probability
asociated with that number (value).
Remarks
1. The area of rectangle associated with the value of the
random variable x
= The probability associated with the value x (notice tat the
width of the rectangle is 1)
2. The probability associated with more than one value of
the random variable x is given by the sum of the areas of
the rectangles associated with those values.
Example
Back to the example of three tosses of the
coin
Outcome
Value of Χ
HHH
3
HHT
2
HTH
2
THH
2
HTT
1
THT
1
TTH
1
TTT
0
Probability Distribution
x
p(X=x)
0
1/8
1
3/8
2
3/8
3
1/8
Outcome
HHH
HHT
HTH
THH
HTT
THT
TTH
TTT
Value of Χ
3
2
2
2
1
1
1
0
4
8
3
8
2
8
1
8
0
1
2
3
x
The event F of obtaining at least two heads
F = {HHH, HHT, HTH, THH}
P(F) = 4/8 = ½
The same result can be obtained from the following
reasoning:
F is the event: “(X=2) or (X=3)”
The probability of this event is equal to:
p(X=2) + p(X=3)
= the sum of the areas of the rectangles associated with
the values 2 and 3 of the random variable
= 1(3/8) + 1(1/8)
= 4/8 = ½
on the following slide, these areas are identified (the
shaded areas)
4
8
3
8
2
8
1
8
0
1
2
3
x
Expected Value of a Random Variable
Mean (Average)
The average (mean) of the numbers a1, a2,
a3,……. an is denoted by ā and equal to:
(a1+a2+a3+…….+an ) / n
Example:
Find the average of the following numbers:
5, 7, 9, 11, 13
Answer: The average of the given numbers
ie equal to ( 5+7+9+11+13) / 5 = 45 / 5 = 9
Expected Value of a Random Variable
( the average or the mean of the random variable)
Let x be a random variable that assumes the
values x1, x2, x3,……. xn with associated
probabilities p1, p2, p3,……. pn
respectively. Then the expected value of x
denoted by E(x) is equal to
x1 p1 + x2 p2 + x3 p3 +……+ xn pn
The the expected value of x ( the average or the mean of
X) is a measure of central tendency of the probability
distribution associated with X.
As the number of the trails of an experiment gets larger and
larger the values of x gets closer and closer to the
expected value of x.
Geometric Interpretation:
Consider the histogram of the probability distribution
associated with the random variable X. If a laminate (thin
board or sheet) is made of this histogram, then the
expected value of X corresponds to the point on the
base of the laminate at which the laminate will balance
perfectly when the point is directly over the a fulcrum
(balancing object).
6
36
5
36
4
36
3
36
2
36
1
36
2
3
4
5
6
7
8
9 10
11
12
x
Example (7)
Let X be the random variable giving the
sum of the dots on the faces that fall
uppermost in the two dice rolling
experiment. Find the expected value E(X)
of X.
Recall the probability distribution of the this random
variable
x
2
3
P(X=x)
1/36
2/36
4
5
6
3/36
4/36
5/36
7
8
9
10
6/36
5/36
4/36
3/36
11
12
2/36
1/36
Solution
E(X)
= 2(1/36) + 3(2/36) + 4(3/36) + 5(4/36) + 6(5/36) + 7(6/36)
+ 8(5/36) + 9(4/36) + 10(3/36) + 11(2/36) + 12(1/36)
=(2+6+12+20+30+42+40+36+30+22+12) / 36 = 252 / 36
=7
Inspecting the histogram on the next slide, we notice that
the symmetry of the histogram with respect to the
vertical line x = 7, which is the expected value of the
random variable X.
6
36
5
36
4
36
3
36
2
36
1
36
2
3
4
5
6
7
8
9 10
11
12
x
Example (8)
The occupancy rates with corresponding probability of
hotels A (Which has 52 rooms) & B (which has 60
rooms) during the tourist season are given by the tables
on the next slide. The average profit per day for each
occupied room is QR 200 and QR 180 for hotels A & B
respectively. Find:
1. The average number of rooms occupied per day in each
hotel.
2. Which hotel generates the higher daily profit.
Hotel B
Hotel A
Occupancy Rate
Occupancy Rate
0.80
0.85
0.90
0.95
1.00
Probability
Probability
0.19
0.22
0.31
0.23
0.05
0.75
0.35
0.80
0.21
0.85
0.18
0.90
0.15
0.95
0.09
1.00
0.02
Steps
I. For each hotel:
1. Find the expected value of the random variable
defined to be the occupancy rate in the hotel.
2. Multiply that by the number of rooms of the hotel
to find the average number of rooms occupied
per day.
3. Multiply that by the profit made on each room
per day to find the hotel daily profit.
II. Compare the result of step 3., for hotels A & B.
Solution
1. Let the occupancy rate in Hotels A & B be the random
numbers X & Y respectively. Then the average daily
occupancy rate is given by the expected values E(X) and
E(Y) of X and Y respectively. Thus:
E(X) = (0.80)(0.19) + (0.85)(0.22) + (0.90)(0.31) +
(0.95)(0.23) + (1.00)(0.05) ≈ 0.8865
The average number of rooms occupied per day in Hotel A
= 0.8865 (52) ≈ 46.1 rooms
E(Y) = (0.75)(0.35) + (0.80)().21) + (0.85)(0.18) +
(0.90)(0.15) + (0.95)(0.09) + (1.00)(0.02) ≈ 0.8240
The average number of rooms occupied per day in Hotel A
= 0.8240 (60) ≈ 49.4 rooms
2. The expected daily profit at hotel A
= (46.1 )(200) ≈ 9220
The expected daily profit at hotel B
= (49.4 )(180) ≈ 8890
→ hotel A generates a higher profit