0% found this document useful (0 votes)
34 views82 pages

Probability and Statistics: Random Variables

Uploaded by

tanveer1111110
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
34 views82 pages

Probability and Statistics: Random Variables

Uploaded by

tanveer1111110
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 82

Probability and Statistics

Random Variables

Dr. Zubair Ali

DBS&H, CEME-NUST

October 27, 2024

Dr. Zubair Ali Probability and Statistics 1 / 62


Random Variable
It represents a numerical outcome of a random
phenomenon, experiment, or process.

Random variables can take on different values according to the


outcome of a random event, and they are typically denoted by
letters such as X , Y , or Z .

Dr. Zubair Ali Probability and Statistics 2 / 62


Types of Sample spaces

Discrete Sample Spaces


If a sample space contains a finite number of possibilities or an unending
sequence with as many elements as there are whole numbers, it is called a
discrete sample space.

A random variable is called a dDiscrete random variable if its set of


possible outcomes is countable.
Continuous Sample Spaces
If a sample space contains an infinite number of possibilities equal to the
number of points on a line segment, it is called a continuous sample
space.

A random variable can take on values on a continuous scale, it is called a


continuous random variable.

Dr. Zubair Ali Probability and Statistics 3 / 62


Discrete and Continuous Sample Space

Number of Students in a Classroom: {0, 1, 2, 3, . . .}


# of Goals Scored in a Soccer Match: {0, 1, 2, 3, . . .}
# of Defective Items in a Batch of Products: {0, 1, 2, 3, . . .}
Temperature Measurement: All real numbers within a range
Distance Traveled by a Car: All non-negative real numbers
Depth of Water in a Reservoir: All non-negative real numbers

Dr. Zubair Ali Probability and Statistics 4 / 62


Variables with Negative Values

Change in Stock Price:

Sample Space: {. . . , −3, −2, −1, 0, 1, 2, 3, . . .}

Change in Temperature:

Sample Space: {. . . , −3◦ C, −2◦ C, −1◦ C, 0◦ C, 1◦ C, 2◦ C, 3◦ C, . . .}

Elevation Relative to Sea Level:

Sample Space: All real numbers (e.g., −∞ to +∞)

Change in Position of an Object:

Sample Space: All real numbers (e.g., −∞ to +∞)

Dr. Zubair Ali Probability and Statistics 5 / 62


1 The number of cats in a shelter at any given time.
2 The weight of newborn babies.
3 The weight of a book in the library.
4 The number of books in the library.
5 The number of days someone lives.
6 The length of time someone lives.

Dr. Zubair Ali Probability and Statistics 6 / 62


Two balls are drawn in succession without replacement from an urn
containing 4 red balls and 3 black balls. Let Y be the number of red balls.
The possible outcomes and the values y of the random variable Y are

Dr. Zubair Ali Probability and Statistics 7 / 62


Two balls are drawn in succession without replacement from an urn
containing 4 red balls and 3 black balls. Let Y be the number of red balls.
The possible outcomes and the values y of the random variable Y are

Sample Space y
RR 2
RB 1
BR 1
BB 0

Dr. Zubair Ali Probability and Statistics 7 / 62


Let X be the random variable defined by the waiting time, in hours,
between successive speeders spotted by a radar unit. The random variable
X takes on all values x for which x ≥ 0.

Suppose a sampling plan involves sampling items from a process until a


defective is observed. The evaluation of the process will depend on how
many consecutive items are observed. In that regard, let X be a random
variable defined by the number of items observed until a defective is
found.
With N a non-defective and D a defective, sample spaces are S = {D}
given X = 1, S = {ND} given X = 2,S = {NND} given X = 3, and so on.

Dr. Zubair Ali Probability and Statistics 8 / 62


The number of students using the Math Lab per day is found in the
distribution below.

X 6 8 10 12 14
P(X) 0.15 0.3 0.35 0.1 0.1

What is the probability that fewer than 8 or more than 12 use the lab in a
given day?
Random Variable
A random variable is a variable whose values are determined by
chance.
A variable was defined as a characteristic or attribute that can assume
different values. Various letters of the alphabet, such as X, Y, or Z, are
used to represent variables

Dr. Zubair Ali Probability and Statistics 9 / 62


For example, if a die is rolled, a letter such as X can be used to represent
the outcomes. Then the value that X can assume is 1, 2, 3, 4, 5, or 6,
corresponding to the outcomes of rolling a single die.
If two coins are tossed, a letter, say Y, can be used to represent the
number of heads, in this case 0, 1, or 2.

As another example, if the temperature at 8:00 A.M. is 43◦ and at noon it


is 53◦ , then the values T that the temperature assumes are said to be
random, since they are due to various atmospheric conditions at the time
the temperature was taken.

The quantity that we observe in an experiment will be denoted by


X and called a random variable (or stochastic variable) because the
value it will assume in the next trial depends on chance, on
randomness.

Dr. Zubair Ali Probability and Statistics 10 / 62


Types of Random Variables

1 Discrete variables have a finite number of possible values or an infinite


number of values that can be counted.
2 Variables that can assume all values in the interval between any two
given values are called continuous variables.
If we count (cars on a road, defective screws in a production, tosses until a
die shows the first Six), we have a discrete random variable. If we measure
(electric voltage, rainfall, hardness of steel), we have a continuous random
variable.

Dr. Zubair Ali Probability and Statistics 11 / 62


Examples of Random Variables(RV)

1 Three coins are tossed and if X is the random variable for the number
of heads, then X assumes the value 0, 1, 2, or 3.
2 Let X denotes the number of games played in a series between two
teams where a team to win four games wins the the Series. Then X
assumes the value 4,5,6 or 7.
3 A shipment of 20 similar laptop computers to a retail outlet contains 3
that are defective. Let X denotes the number of defective laptops
then X assumes the value 0, 1, 2, or 3. If a school makes a random
purchase of 2 of these computers, X denotes the number of defective
laptops for the school then X assumes the value 0, 1 or 2.
4 Let X be a random variable giving the number of heads minus the
number of tails in three tosses of a coin then X assumes the value 3,
1,-1 or -3.

Dr. Zubair Ali Probability and Statistics 12 / 62


A stockroom clerk hands over three safety helmets at
random to three steel mill employees who had previously
checked them. If Smith, Jones, and Brown, in that order,
receive one of the three hats, list the sample points for the
possible orders of returning the helmets, and find the value
m of the random variable M that represents the number of
correct matches.

Sample Space m
SJB 3
SBJ 1
BJS 1
JSB 1
BSJ 0
JBS 0
Dr. Zubair Ali Probability and Statistics 13 / 62
Probability Distribution or Distribution

A probability distribution or, briefly, a distribution, shows


the probabilities of events in an experiment.

A discrete probability distribution consists of


the values a random variable can assume and the corresponding
probabilities of the values.

The probabilities are determined theoretically or by observation.

When three coins are tossed, the sample space is represented as

TTT , TTH, THT , HTT , HHT , HTH, THH, HHH;


If X is the random variable for the number of heads, then X assumes the
value 0, 1, 2, or 3.

Dr. Zubair Ali Probability and Statistics 14 / 62


If X is the random variable for the number of heads, then X
assumes the value 0, 1, 2, or 3.

Dr. Zubair Ali Probability and Statistics 15 / 62


Two Requirements for a Probability Distribution

1 The probability of each event in the sample space must be between or


equal to 0 and 1. That is,

0 ≤ P(X ) ≤ 1

2 The sum of the probabilities of all the events in the sample space must
equal 1; that is, X
P(X ) = 1

Dr. Zubair Ali Probability and Statistics 16 / 62


Determine whether each distribution is a probability
distribution.

Dr. Zubair Ali Probability and Statistics 17 / 62


Construct a probability distribution for rolling a single die.

Since the sample space is 1, 2, 3, 4, 5, 6 and each outcome has a


probability of , the distribution is as shown.

Outcomes X 1 2 3 4 5 6
1 1 1 1 1 1
P(X) 6 6 6 6 6 6

Dr. Zubair Ali Probability and Statistics 18 / 62


The baseball World Series is played by the winner of the National League
and the American League. The first team to win four games wins the
World Series. In other words, the series will consist of four to seven games,
depending on the individual victories. The data shown consist of the
number of games played in the World Series from 1965 through 2005.
(There was no World Series in 1994.) The number of games played is
represented by the variable X. Find the probability P(X) for each X,
construct a probability distribution, and draw a graph for the data.

X Number of games played


4 8
5 7
6 9
7 16

X 4 5 6 7
P(X) 0.2 0.175 0.225 0.4
we write f (x) = P(X = x); that is, f (4) = P(X = 4), f (5) = P(X = 5)
and so on. .
Dr. Zubair Ali Probability and Statistics 19 / 62
Discrete Random Variables and Distributions

By definition, a random variable X and its distribution are discrete if X


assumes only finitely many or at most countably many values

x1 , x2 , x3 , ··· ,

called the possible values of, with positive probabilities

p1 = P(X = x1 ), p2 = P(X = x2 ), · · · , pj = P(X = xj ) · · · ,

whereas the probability P(X ∈ I ) is zero for any interval I containing no


possible value.
Clearly, the discrete distribution of X is also determined by the probability
function of X , defined by

pj , if x = xj ;
f (x) = (j = 1, 2, 3, · · · ), (1)
0, otherwise.

Dr. Zubair Ali Probability and Statistics 20 / 62


A stockroom clerk hands over three safety helmets at random to three steel
mill employees who had previously checked them. If Smith, Jones, and
Brown, in that order, receive one of the three hats, list the sample points
for the possible orders of returning the helmets, and find the value m of the
random variable M that represents the number of correct matches.

Sample Space m
SJB 3
SBJ 1
m 0 1 3
BJS 1
p(m) 2/6 3/6 1/6
JSB 1
BSJ 0
JBS 0

Dr. Zubair Ali Probability and Statistics 21 / 62


The set of ordered pairs (x, f (x)) is a probability mass function of the
discrete random variable X if, for each possible outcome x,
1 f (x) ≥ 0
P
x f (x) = 1
2

3 P(X = x) = f (x)

The function f (x) is a probability density function (pdf) for the


continuous random variable X , defined over the set of real numbers, if
1 f (x) ≥ 0, for all x ∈ R.
R∞
−∞ f (x)dx = 1
2

Rb
3 P(a < X < b) =
a f (x)dx.

In case of continuous random variables we shall concern with computing


probabilities for various intervals such as P(a < X ≤ b), P(W ≥ c), and so
forth. Note that when X is continuous,
P(a < X ≤ b) = P(a < X < b) + P(X = b) = P(a < X < b).
Dr. Zubair Ali Probability and Statistics 22 / 62
1 Suppose that the error in the reaction temperature, in o C, for a
controlled laboratory experiment is a continuous random variable X
having the probability density function
 x2
3 −1 < x < 2
f (x) =
0 otherwise

(a) Verify that f(x) is a density function.


(b) Find P(0 < X ≤ 1).
2 Find the constant c such that the function
 2
cx 0 < x < 3
f (x) =
0 otherwise

is a density function.

Dr. Zubair Ali Probability and Statistics 23 / 62


A shipment of 20 similar laptop computers to a retail outlet contains 3 that
are defective. If a school makes a random purchase of 2 of these
computers, find the probability distribution for the number of defectives.

Dr. Zubair Ali Probability and Statistics 24 / 62


A shipment of 20 similar laptop computers to a retail outlet contains 3 that
are defective. If a school makes a random purchase of 2 of these
computers, find the probability distribution for the number of defectives.
Let X be a random variable whose values x are the possible numbers of
defective computers purchased by the school. Then x can only take the
numbers 0, 1, and 2. Now find f(x), for x=0,1,2

Dr. Zubair Ali Probability and Statistics 24 / 62


A shipment of 20 similar laptop computers to a retail outlet contains 3 that
are defective. If a school makes a random purchase of 2 of these
computers, find the probability distribution for the number of defectives.
Let X be a random variable whose values x are the possible numbers of
defective computers purchased by the school. Then x can only take the
numbers 0, 1, and 2. Now find f(x), for x=0,1,2

Number of ways of selecting x


defective computers are
Number of ways of selecting 2
n(x) = Cx3 C2−x
17 computers are C220

n(0) = C03 C217 x 0 1 2


68 51 3
f(x) 95 190 190
n(1) = C13 C117
n(2) = C23 C017

Dr. Zubair Ali Probability and Statistics 24 / 62


Find the probability distribution of boys and girls in families with 3
children, assuming equal probabilities for boys and girls.
In case of n mutually independent trials, where each trial had just two
possible outcomes, A and Ac , with respective probabilities p and q = 1 − p.
It was found that the probability of getting exactly xA0 s in the n trials is

Cxn p x q n−x .

Under the assumption that successive births (the “trial”) are independent as
far as the sex of the child is concerned. Thus, with A being the event “a
boy”, n = 3, p = 12 = q, we have

P(Exactly x boys) = P(X = x) = f (x) = Cx3 p x q 3−x

Dr. Zubair Ali Probability and Statistics 25 / 62


Find the probability distribution of boys and girls in families with 3
children, assuming equal probabilities for boys and girls.
In case of n mutually independent trials, where each trial had just two
possible outcomes, A and Ac , with respective probabilities p and q = 1 − p.
It was found that the probability of getting exactly xA0 s in the n trials is

Cxn p x q n−x .

Under the assumption that successive births (the “trial”) are independent as
far as the sex of the child is concerned. Thus, with A being the event “a
boy”, n = 3, p = 12 = q, we have

P(Exactly x boys) = P(X = x) = f (x) = Cx3 p x q 3−x

x 0 1 2 3
f(x) 1/8 3/8 3/8 1/8
Dr. Zubair Ali Probability and Statistics 25 / 62
If a car agency sells 50% of its inventory of a certain foreign car equipped
with side airbags, find a formula for the probability distribution of the
number of cars with side airbags among the next 4 cars sold by the agency.

Dr. Zubair Ali Probability and Statistics 26 / 62


If a car agency sells 50% of its inventory of a certain foreign car equipped
with side airbags, find a formula for the probability distribution of the
number of cars with side airbags among the next 4 cars sold by the agency.
p: probability of car equipped with airbags
q: probability of car without airbags
1
p=q=
2
Let x be the random variable, for x = 0, 1, 2, 3, 4 we have
 x  4−x
1 1 C4
f (x) = Cx4 p x q 4−x = Cx4 = x
2 2 16

x 0 1 2 3 4
1 1 3 1 1
f (x) 16 4 8 4 16

Dr. Zubair Ali Probability and Statistics 26 / 62


PMF & PDF

The set of ordered pairs (x, f (x)) is called the Probability Mass
Function(PMF) of the discrete random variable X .
X 4 5 6 7
P(X) 0.2 0.175 0.225 0.4
x 0 1 2
68 51 3
f(x) 95 190 190

x 0 1 2 3
f(x) 1/8 3/8 3/8 1/8

Probability Density Function (PDF)


The function f(x) is a probability density function (PDF) for the continuous
random variable X.

Dr. Zubair Ali Probability and Statistics 27 / 62


Cumulative Distribution Function (CDF)

From PMF, we obtain the cumulative distribution function by taking


sums,
X X
F (x) = f (xj ) = pj . (2)
xj ≤x xj ≤x

The cumulative distribution function F(x) of a continuous random


variable X with density function f(x) is,
Z x
F (x) = P(X ≤ x) = f (t)dt (3)
−∞

dF (x)
We can write P(a < X < b) = F (b) − F (a) and f (x) = dx

Dr. Zubair Ali Probability and Statistics 28 / 62


If X takes on only a finite number of values x1 , x2 , · · · , xn ,
then the distribution function is given by



 0 −∞ ≤ x ≤ x1
f (x ) x1 ≤ x ≤ x2

1



 f (x1 ) + f (x2 ) x2 ≤ x ≤ x3

F (x) = f (x1 ) + f (x2 ) + f (x3 ) x3 ≤ x ≤ x4


 .
.. ..
.




f (x1 ) + f (x2 ) + · · · + f (xn ) xn ≤ x ≤ ∞

Dr. Zubair Ali Probability and Statistics 29 / 62


x 0 1 2 3 4
1 1 3 1 1
f (x) 16 4 8 4 16

1 1 1 5
F (0) =f (0) = , F (1) = f (0) + f (1) = + = ,
16 16 4 16
1 1 3 11
F (2) =f (0) + f (1) + f (2) = + + = ,
16 4 8 16
1 1 3 1 15
F (3) =f (0) + f (1) + f (2) + f (3) = + + + = ,
16 4 8 4 16
1 1 3 1 1
F (4) =f (0) + f (1) + f (2) + f (3) + f (4) = + + + + = 1.
16 4 8 4 16


 0, for x < 0,
 1 , for 0 ≤ x < 1,



 16
 5 , for 1 ≤ x < 2,

F (x) = 16 11
16 , for 2 ≤ x < 3,



15
 16 , for 3 ≤ x < 4,




1, for x ≥ 4.

Dr. Zubair Ali Probability and Statistics 30 / 62


Note that
f (2) = F (2) − F (1)

Dr. Zubair Ali Probability and Statistics 31 / 62


A stockroom clerk hands over three safety helmets at random to three steel mill
employees who had previously checked them. If Smith, Jones, and Brown, in that
order, receive one of the three hats, list the sample points for the possible orders
of returning the helmets, and find the value m of the random variable M that
represents the number of correct matches.
Sample Space m
SJB 3
SBJ 1
BJS 1 m 0 1 3
JSB 1 p(m) 2/6 3/6 1/6
BSJ 0
JBS 0



 0 m<0
2/6 0 ≤ m < 1

F (m) =
 5/6 1 ≤ m < 3

1 m>3

Dr. Zubair Ali Probability and Statistics 32 / 62


The random variable X = Sum of the two numbers
two fair dice turn up is discrete and has the possible
values (1 + 1) = 2, (1 + 2) = 3, · · · , (6 + 6) = 12

Dr. Zubair Ali Probability and Statistics 33 / 62


The random variable X = Sum of the two numbers
two fair dice turn up is discrete and has the possible
values (1 + 1) = 2, (1 + 2) = 3, · · · , (6 + 6) = 12

Dr. Zubair Ali Probability and Statistics 33 / 62


The random variable X = Sum of the two numbers
two fair dice turn up is discrete and has the possible
values (1 + 1) = 2, (1 + 2) = 3, · · · , (6 + 6) = 12

Probability function f (x) and distribution function F(x) of the random


variable X = Sum of the two numbers obtained in tossing two fair dice once
Dr. Zubair Ali Probability and Statistics 33 / 62
The cumulative distribution f (x) is
Z x
F (x) = P(X ≤ x) = f (t)dt
−∞

As an immediate consequence of above Definition, one can write the two


results

d
f (x) = F (x)
P(a < X < b) = F (b) − F (a) dx

Dr. Zubair Ali Probability and Statistics 34 / 62


For the probability density function
 x2
f (x) = 3 −1 < x < 2
0 otherwise,
find F(x), and use it to evaluate P(0 < X ≤ 1).

Dr. Zubair Ali Probability and Statistics 35 / 62


For the probability density function
 x2
f (x) = 3 −1 < x < 2
0 otherwise,
find F(x), and use it to evaluate P(0 < X ≤ 1).

x −1 x x
x2
Z Z Z Z
F (x) = P(X ≤ x) = f (t)dt = f (t)dt + f (t)dt = dt
−∞ −∞ −1 −1 3


 0 x < −1
F (x) = x 3 +1
9 −1 ≤ x < 2
1 x ≥2

P(a < X < b) = F (b) − F (a) =⇒ P(0 < X ≤ 1) = F (1) − F (0)

Dr. Zubair Ali Probability and Statistics 35 / 62


The distribution function for a random variable X is

1 − e −2x x ≥ 0

F (x) =
0 x <0
Find (a) the density function, (b) the probability
that X > 2 and (c) the probability that −3 < X ≤ 4.

Z ∞
d
f (x) = F (x) P(X > 2) = f (x)dx
dx 2

Z 4
P(−3 < X ≤ 4) = f (x)dx
−3

Can you calculate these using F (x)?

Dr. Zubair Ali Probability and Statistics 36 / 62


Find the probability distribution for the number of jazz CDs
when 4 CDs are selected at random from a collection
consisting of 5 jazz CDs, 2 classical CDs, and 3 rock CDs.
Express your results by means of a formula.

Let X be a random variable representing the number of jazz CD’s among


the 4 selected CDs. Then X assumes the values 0,1,2,3,4
Total ways of selection of 4 CDs out of 10
Ways of selecting x jazz CDs

Dr. Zubair Ali Probability and Statistics 37 / 62


Let W be a random variable giving the number of heads minus the number
of tails in three tosses of a coin. List the elements of the sample space S
for the three tosses of the coin and to each sample point assigna value w
of W .
1 Find the probability distribution of the random variable W assuming
that the coin is biased so that a head is twice as likely to occur as a
tail.
2 Find the cumulative distribution function of the random variable W .
Using F (w ), find
(a) P(W > 0);
(b) P(−1 ≤ W < 3).
The sample space S for the three tosses of the coin is:

SS HHH HHT HTH THH THT HTT TTH TTT


w 3 1 1 1 -1 -1 -1 -3

Dr. Zubair Ali Probability and Statistics 38 / 62


SS HHH HHT HTH THH THT HTT TTH TTT
w 3 1 1 1 -1 -1 -1 -3
Since the coin is biased, the probability of getting a head for one toss is
2/3 and the prob. of getting a tail is 1/3. We can get the probability mass
function
1 1 1 1
P(x = −3) = P(TTT ) = . . =
3 3 3 27  
2 1 1 2
P(x = −1) = P(HTT ) + P(THT ) + P(TTH) = 3 . . =
3 3 3 9
 
2 2 1 4
P(x = 1) = P(HHT ) + P(HTH) + P(THH) = 3 . . =
3 3 3 9
2 2 2 8
P(x = 3) = P(HHH) = . . =
3 3 3 27

X -3 -1 1 3
P(X) 1/27 2/9 4/9 8/27
Dr. Zubair Ali Probability and Statistics 39 / 62
Formula for the Mean of a Probability Distribution

The mean of a random variable with a discrete probability distribution is


X
µ = X1 P(X1 ) + X2 P(X2 ) + · · · + Xn P(Xn )= X .P(X )

where X1 , X2 , X3 , · · · , Xn are the outcomes and P(X1 ), P(X2 ), P(X3 ),


. . . , P(Xn ) are the corresponding probabilities.

Dr. Zubair Ali Probability and Statistics 40 / 62


Let X be a random variable with probability distribution
f(x). The mean, or expected value, of X is

Let X be a random variable with probability distribution f (x). The mean,


or expected value, of X is
X
µ= xf (x) (Discrete distribution)
Zx ∞
µ= xf (x)dx (Continuous distribution)
−∞

and the variance σ 2 (sigma square) by


X
σ2 = (x − µ)2 f (x) (Discrete distribution)
Zx ∞
σ2 = (x − µ)2 f (x)dx (Continuous distribution)
−∞

Dr. Zubair Ali Probability and Statistics 41 / 62


Find the mean of the number of spots that appear when a
die is tossed.

Since the sample space is 1, 2, 3, 4, 5, 6 and each outcome has a


probability of , the distribution is as shown.

Outcomes X 1 2 3 4 5 6
1 1 1 1 1 1
P(X) 6 6 6 6 6 6

X 1 1 1 1 1 1
µ= X .P(X ) =1 · +2· +3· +4· +5· +6·
6 6 6 6 P 6 6
1+2+3+4+5+6 X
= = = 3.5
6 N

Dr. Zubair Ali Probability and Statistics 42 / 62


If three coins are tossed, find the mean of the number of
heads that occur.

Dr. Zubair Ali Probability and Statistics 43 / 62


Find mean of score per ball when a batsman score his fifty in 20 balls.
Following this sequence of his scores

0, 1, 1, 2, 0, 4, 6, 6, 0, 4, 2, 1, 4, 0, 4, 2, 0, 6, 1, 6

Dr. Zubair Ali Probability and Statistics 44 / 62


Find mean of score per ball when a batsman score his fifty in 20 balls.
Following this sequence of his scores

0, 1, 1, 2, 0, 4, 6, 6, 0, 4, 2, 1, 4, 0, 4, 2, 0, 6, 1, 6
50
µ= = 2.5
20

Dr. Zubair Ali Probability and Statistics 44 / 62


Find mean of score per ball when a batsman score his fifty in 20 balls.
Following this sequence of his scores

0, 1, 1, 2, 0, 4, 6, 6, 0, 4, 2, 1, 4, 0, 4, 2, 0, 6, 1, 6
50
µ= = 2.5
20

Make a probability distribution of score


Runs X 0 1 2 3 4 5 6
nX 5 4 3 0 4 0 4
5 4 3 4 4
P(X) 20 20 20 0 20 0 6

Dr. Zubair Ali Probability and Statistics 44 / 62


Find mean of score per ball when a batsman score his fifty in 20 balls.
Following this sequence of his scores

0, 1, 1, 2, 0, 4, 6, 6, 0, 4, 2, 1, 4, 0, 4, 2, 0, 6, 1, 6
50
µ= = 2.5
20

Make a probability distribution of score


Runs X 0 1 2 3 4 5 6
nX 5 4 3 0 4 0 4
5 4 3 4 4
P(X) 20 20 20 0 20 0 6

X 5 4 3 4 4
µ= X · P(X ) = 0 ·
+1· +2· +4· +6·
20 20 20 20 20
4 6 16 24 50
= + + + = = 2.5
20 20 20 20 20

Dr. Zubair Ali Probability and Statistics 44 / 62


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.

Dr. Zubair Ali Probability and Statistics 45 / 62


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.

X denotes number of good components, X = 0, 1, 2, 3

Dr. Zubair Ali Probability and Statistics 45 / 62


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.

X denotes number of good components, X = 0, 1, 2, 3


Total number of ways of selecting 3 components out of 7, C37

Dr. Zubair Ali Probability and Statistics 45 / 62


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.

X denotes number of good components, X = 0, 1, 2, 3


Total number of ways of selecting 3 components out of 7, C37
Selecting x good components out of 7 (4 good and 3 defective)
C 4C 3
f (x) = x 73−x , where x = 0, 1, 2, 3
C3

Dr. Zubair Ali Probability and Statistics 45 / 62


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.

X denotes number of good components, X = 0, 1, 2, 3


Total number of ways of selecting 3 components out of 7, C37
Selecting x good components out of 7 (4 good and 3 defective)
C 4C 3
f (x) = x 73−x , where x = 0, 1, 2, 3
C3
xf (x) = 12
P
µ= 7

Dr. Zubair Ali Probability and Statistics 45 / 62


The probability mass function (PMF):

Cx4 C3−x
3
f (x) = where x = 0, 1, 2, 3.
C37

C04 C3−0
3
1·1 1 C14 C3−1
3
4·3 12
f (0) = 7
= = , f (1) = 7
= = ,
C3 35 35 C3 35 35
4
C C 3 4
C C 3
6·3 18 4·1 4
f (2) = 2 73−2 = = , f (3) = 3 73−3 = =
C3 35 35 C3 35 35

Dr. Zubair Ali Probability and Statistics 46 / 62


The probability mass function (PMF):

Cx4 C3−x
3
f (x) = where x = 0, 1, 2, 3.
C37

C04 C3−0
3
1·1 1 C14 C3−1
3
4·3 12
f (0) = 7
= = , f (1) = 7
= = ,
C3 35 35 C3 35 35
4
C C 3 4
C C 3
6·3 18 4·1 4
f (2) = 2 73−2 = = , f (3) = 3 73−3 = =
C3 35 35 C3 35 35
These probabilities match the ones we calculated before.

Dr. Zubair Ali Probability and Statistics 46 / 62


The probability mass function (PMF):

Cx4 C3−x
3
f (x) = where x = 0, 1, 2, 3.
C37

C04 C3−0
3
1·1 1 C14 C3−1
3
4·3 12
f (0) = 7
= = , f (1) = 7
= = ,
C3 35 35 C3 35 35
4
C C 3 4
C C 3
6·3 18 4·1 4
f (2) = 2 73−2 = = , f (3) = 3 73−3 = =
C3 35 35 C3 35 35
These probabilities match the ones we calculated before.
Now, let’s calculate the expected value using these probabilities:
3
X
E (X ) = x · f (x)
x=0

1 12 18 4
E (X ) = 0 · +1· +2· +3·
35 35 35 35

Dr. Zubair Ali Probability and Statistics 46 / 62


The probability mass function (PMF):

Cx4 C3−x
3
f (x) = where x = 0, 1, 2, 3.
C37

C04 C3−0
3
1·1 1 C14 C3−1
3
4·3 12
f (0) = 7
= = , f (1) = 7
= = ,
C3 35 35 C3 35 35
4
C C 3 4
C C 3
6·3 18 4·1 4
f (2) = 2 73−2 = = , f (3) = 3 73−3 = =
C3 35 35 C3 35 35
These probabilities match the ones we calculated before.
Now, let’s calculate the expected value using these probabilities:
3
X
E (X ) = x · f (x)
x=0

1 12 18 4 12 36 12 12
E (X ) = 0 · +1· +2· +3· = + + =
35 35 35 35 35 35 35 7

Dr. Zubair Ali Probability and Statistics 46 / 62


Let X be the random variable that denotes the life in hours
of a certain electronic device. The probability density
function is  20,000
f (x) = x 3 , x > 100;
0, otherwise.
Find the expected life of this type of device.

Dr. Zubair Ali Probability and Statistics 47 / 62


Let X be the random variable that denotes the life in hours
of a certain electronic device. The probability density
function is  20,000
f (x) = x 3 , x > 100;
0, otherwise.
Find the expected life of this type of device.

Z ∞
E [X ] = µ = xf (x)dx =⇒
−∞

Dr. Zubair Ali Probability and Statistics 47 / 62


Let X be the random variable that denotes the life in hours
of a certain electronic device. The probability density
function is  20,000
f (x) = x 3 , x > 100;
0, otherwise.
Find the expected life of this type of device.

Z ∞ Z 100 Z ∞
E [X ] = µ = xf (x)dx =⇒ E [X ] = xf (x)dx + xf (x)dx
−∞ −∞ 100


20, 000
Z
E [X ] = x· dx = 200
100 x3

Dr. Zubair Ali Probability and Statistics 47 / 62


PDF Papulation
P
P X
Mean µ E [X ] x x.f (x) P N
(X −µ)2
E [(X − µ)2 ] (x − µ)2 f (x)
P
Variance
Px P 2N
X
σ2 E [X 2 ] − µ2 x x 2 .f (x) − µ2 N −µ
2

= E [X 2 ] − (E [X ])2

Dr. Zubair Ali Probability and Statistics 48 / 62


Now let us consider a new random variable g (X ), which depends on X .
For instance, g (X ) might be X 2 or 3X − 1, and whenever X assumes the
value 2, g (X ) assumes the value g (2).
In particular, if X is a discrete random variable with probability distribution
f (x), for x = −1, 0, 1, 2, and g (X ) = X 2 , then we have the following
distribution,
P[g (X ) = 0] = P(X = 0) = f (0),
P[g (X ) = 1] = P(X = −1) + P(X = 1) = f (−1) + f (1),
P[g (X ) = 4] = P(X = 2) = f (2),

X -1 0 1 2
g(X) 1 0 1 4
f(g(X)) f(-1) f(0) f(1) f(2)

Dr. Zubair Ali Probability and Statistics 49 / 62


Let X be a random variable with probability distribution
f(x). The mean, or expected value, of g (x) is

X -1 0 1 2 x2 0 1 4
f(x 2 ) f(-1) f(0) f(1) f(2) f(x 2 ) f(0) f(-1)+f(1) f(2)

E [X 2 ] = µX 2 =02 f (0) + (−1)2 f (−1) + (1)2 f (1) + (2)2 f (2)


=0f (0) + 1[f (−1) + f (1)] + 4f (2)
=g (0)f (0) + g (1)[f (−1) + f (1)] + g (2)f (2)
X
= g (x)f (x)

Dr. Zubair Ali Probability and Statistics 50 / 62


X
µg (x) = E [g (x)] = g (x)f (x) (Discrete distribution)
x
Z ∞
µg (x) = E [g (x)] = g (x)f (x)dx (Continuous distribution)
−∞

Dr. Zubair Ali Probability and Statistics 51 / 62


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:
X 4 5 6 7 8 9
1 1 1 1 1 1
f(X) 12 12 4 4 6 6

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.
X X
E [g (X )] = g (X )f (X ) = (2X − 1) f (X )
1 1 1 1
(2(4) − 1)( ) + (2(5) − 1)( ) + (2(6) − 1)( ) + (2(7) − 1)( )
12 12 4 4
1 1
+ (2(8) − 1)( ) + (2(9) − 1)( ) = 12.67
6 6
Dr. Zubair Ali Probability and Statistics 52 / 62
A box contains 5 balls. Two are numbered 3, one is
numbered 4, and two are numbered 5. The balls are mixed
and one is selected at random. After a ball is selected, its
number is recorded. Then it is replaced. If the experiment is
repeated many times, find the variance and standard
deviation of the numbers on the balls.

Number on balls X 3 4 5
2 1 2
Probabilites f(X) 5 5 5
X
µ = E [X ] = Xf (X ) =
X
σ = E [X 2 ] − µ2 = X 2 f (X ) − µ2

Dr. Zubair Ali Probability and Statistics 53 / 62


One thousand tickets are sold at $ 1 each for a color television valued at
$350. What is the expected value of the gain if you purchase one ticket?

1 999
E (x) = $349. + (−$1) = −$0.65
1000 1000

Dr. Zubair Ali Probability and Statistics 54 / 62


The weekly demand for a drinking-water product, in
thousands of liters, from a local chain of efficiency stores is
a continuous random
 variable X having the probability
2(X − 1) 1 < x < 2
density f (X ) =
0 otherwise
Find the mean and variance of X

Z ∞
2 2 2 2
σ = E [(X − µ) ] = E [X ] − µ = x 2 f (x)dx − µ2
−∞

Note That E [X 2 ] 6= (E [X ])2

Dr. Zubair Ali Probability and Statistics 55 / 62


Dr. Zubair Ali Probability and Statistics 56 / 62
Corollary
If a and b are constants, then

E [aX + b] = aE [X ] + b
Var (aX + b) = a2 Var (X )

X 4 5 6 7 8 9
1 1 1 1 1 1
f(X) 12 12 4 4 6 6

E [2X − 1] = 2E [X ] − 1 = 2[(4 + 5)/12 + (6 + 7)/4 + (8 + 9)/6] − 1


 
9 13 17 82
2[ + + ]−1=2 − 1 = 12.67
12 4 6 12
Var (2x − 1) =?

Dr. Zubair Ali Probability and Statistics 57 / 62


Calculate the variance of g (X ) = 2X + 3, where X is a
random variable with probability distribution
X 0 1 2 3
F(X) 1/4 1/8 1/2 1/8

Var [g (X )] = Var [2X + 3] =?

Dr. Zubair Ali Probability and Statistics 58 / 62


If g (X ) = X r for r = 0, 1, 2, 3, · · · , an expected value called
the r th moment about the origin of the random variable X,
which we denote by µ0r .

X
µ0r = E [X r ] = x r f (x) (Discrete distribution)
x
Z ∞
µ0r r
= E [X ] = x r f (x)dx (Continuous distribution)
−∞

Note that 2
µ = µ01 , σ 2 = µ02 − µ01

Dr. Zubair Ali Probability and Statistics 59 / 62


Suppose that an antique jewelry dealer is interested in
purchasing a gold necklace for which the probabilities are
0.22, 0.36, 0.28, and 0.14, respectively, that she will be able
to sell it for a profit of $250, sell it for a profit of $150,
break even, or sell it for a loss of $150. What is her
expected profit?

Dr. Zubair Ali Probability and Statistics 60 / 62


1 f (x) ≥ 0 1 f (x) ≥ 0, for all x ∈ R.
R∞
−∞ f (x)dx = 1
2
P
x f (x) = 1
2
Rb
3 P(X = x) = f (x) 3 P(a < X < b) = a f (x)dx.
P Rx
4 F (x) = xj ≤x f (xj ) 4 F (x) = P(X ≤ x) = −∞ f (t)dt
P R∞
5 µ = x xf (x) 5 µ = −∞ xf (x)dx
R∞
σ 2 = x (x − µ)2 f (x) σ 2 = −∞ (x − µ)2 f (x)dx
P
6 6

µg (x) = µ
R g∞(x) = E [g (x)] =
7 7
P
E [g (x)] = g (x)f (x) −∞ g (x)f (x)dx
0 r
Px r R∞
8 µr = E [X ] = x x f (x) 8 µ0r = E [X r ] = −∞ x r f (x)dx

Dr. Zubair Ali Probability and Statistics 61 / 62


1 The probability distribution of the discrete random variable X is
 x  3−x
1 3
f (x) = Cx3 , x = 0, 1, 2, 3.
4 4

Find the mean of X, also Find the expected value of the random
variable g (X ) = X 2 .
2 The density function of the continuous random variable X, the total
number of hours, in units of 100 hours, that a family runs a vacuum
cleaner over a period of one year, is given in

 x 0<x <1
f (x) = 2−x 1≤x <2
0 otherwise

Find the average number of hours per year that families run their
vacuum cleaners.

Dr. Zubair Ali Probability and Statistics 62 / 62

You might also like