0% found this document useful (0 votes)
4 views

ch 7

notes for stats

Uploaded by

Gujar Jutt
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)
4 views

ch 7

notes for stats

Uploaded by

Gujar Jutt
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/ 44

Lecture 9

RANDOM VARIABLES &


Probability Distributions

Reference: Ch 3 (Walpole)
Objectives

1. Distinguish between discrete and continuous random


variables
2. Determine a probability distribution for a discrete
random variable
3. Describe the connection between probability
distributions and populations
4. Compute the mean of a discrete random variable
5. Compute the variance and standard deviation of a
discrete random variable

Copyright ©2014 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Random Variable

If we roll a fair die, the possible outcomes are the numbers 1, 2,


3, 4, 5, and 6, and each of these numbers has probability 1/6.
Rolling a die is a probability experiment whose outcomes are
numbers. The outcome of such an experiment is called a
random variable.

A random variable is a numerical outcome of a


probability experiment.
The sum of numbers showing on two true dices.
8
7
7 7 9 10 11 12
6 7 8 9 10 11 12
6 1
5
6 6 7 8 9 10 11
5
5 2
4
5 6 7 8 9 10
4
3
3
3 4 4 5 6 7 8 9

3 4 5 6 7 8 4
2
2
3
1
2 3 4 5 6 7 5
1
2
0
0 0
1
1 2
2 3
3 4
4 5
5
6 7
6
0 1 2 3 4 5 6 7

X 2 3 4 5 6 7 8 9 10 11 12 Total
1 2 3 4 5 6 5 4 3 2 1
PX(x) 36 36 36 36 36 36 36 36 36 36 36 1

Examples Probability distribution


Random variables

Introduction
In an experiment of chance, outcomes occur randomly.
We often summarize the outcome from a random experiment by a
simple number.

Definition
A variable is a symbol such as X, Y, Z, x or H, that assumes
values for different elements. If the variable can assume only one
value, it is called a constant.

A random variable is a variable whose value is determined by


the outcome of a random experiment.
Example 1
A balanced coin is tossed two times. List the elements of the
sample space, the corresponding probabilities and the
corresponding values X, where X is the number of getting head.

Solution:
Random Variable, X : the numbers of head

Elements of sample space Probability X

HH ¼ 2
HT ¼ 1
TH ¼ 1
TT ¼ 0 (No head)

Also we can write P(X=1)=2/4, for example, for the probability


of the event that the random variable X will take on the value 1.
Example 2
Experiment:
testing two components. (D=defective, N=non-defective)

Sample space: S={DD,DN,ND,NN}


Let X = number of defective components when two
components are tested.
Assigned numerical values to the outcomes are:
Sample point Assigned
(Outcome) Numerical Value (x)
DD 2
DN 1
ND 1
NN 0

❑Notice that, the set of all possible values of the random


variable X is {0, 1, 2}.
Example 3

• The time to recharge the flash light is tested in three cell


phone cameras.
• The probability a camera passes the test is 0.8 and the
camera perform independently.
• List the elements of the sample space, the corresponding
probabilities and the corresponding values of X, where X
denotes the number of camera passes the test.
Solution
X : the number of cameras that pass the test

Camera 1 Camera 2 Camera 3 Probability X


Pass Pass Pass 0.512 3
Pass Pass Fail 0.128 2
Pass Fail Pass 0.128 2
Pass Fail Fail 0.032 1
Fail Pass Pass 0.128 2
Fail Pass Fail 0.032 1
Fail Fail Pass 0.032 1
Fail Fail Fail 0.008 0
Random Variables
Definition:
A random variable X is a function that associates each element
in the sample space with a real number (i.e., X : S → R.)

Notation: " X " denotes the random variable .


" x " denotes a value of the random variable X.

• It is a Parameter that cannot be predicted with certainty


• It is an outcome of a random or uncertain process
e.g- flipping a coin or picking out a card from deck
• It Can be discrete or continuous
Objective 1
Distinguish between discrete and continuous
random variables

Copyright ©2014 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
TWO TYPES OF RANDOM VARIABLES

Discrete Random Variables


• A random variable is discrete if its set of possible
values consist of discrete points on the number
line.
• e.g., The number of siblings a randomly chosen person
has.
Continuous Random Variables
• A random variable is continuous if its set of
possible values consist of an entire interval on the
number line.
• e.g., The amount of rain that falls within a certain
period.
More EXAMPLES
Examples of discrete Examples of continuous
random variables: random variables:

number of scratches on electrical current


a surface
length
number of defective
parts among 1000
tested Time

number of transmitted Temperature


bits received error
weight
Discrete random variable
Definition:
Discrete Random Variable
A random variable is discrete if its set of possible values
consist of discrete points on the number line.

Examples of discrete random variable:


• number of scratches on a surface
• proportion of defective parts among 1000 tested
• number of transmitted bits received error
Note:
A discrete random variable often represents count data, such
as the number of defectives in a sample of k items.
Continuous random variable

Definition:
Continuous Random Variable
A random variable is continuous if its set of possible values
consist of an entire interval on the number line.

Examples of Continuous random variable:


• height, weight, electrical current, length
• pressure, time, voltage etc.

Note:
A continuous random variable often represents measured data,
such as height, length etc.
Discrete and Continuous Random Variables

• A random variable is discrete if it can


assume a countable number of values.
• A random variable is continuous if it can
assume an uncountable number of values.

Discrete random variable Continuous random variable


After the first value is defined
After the first value is defined,
the second value, and any value
any number can be the next one
thereafter are known.

0 1 2 3 ... 0 1/16 1/4 1/2 1


Therefore, the number of Therefore, the number of
values is countable values is uncountable
Objective 2
Determine a probability distribution for a
discrete random variable

Copyright ©2014 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
DISCRETE PROBABILITY DISTRIBUTIONS

Definition:
• If X is a discrete random variable, the function given by f(x)=P(X=x)
for each x within the range of X is called the probability
distribution of X.

• Requirements for a discrete probability distribution:

1) The probability of each value of the discrete random variable


is between 0 and 1, inclusive. That is, 0  P( X = x)  1
2) The sum of all the probabilities is 1. That is,  P( X = x) = 1
xS
Some Examples:

Decide if each of the following is a probability distribution:


x 1 2 3 4
P(x) 0.25 0.65 –0.30 0.11

This is not a probability distribution. P(3) is not between 0 and 1.


x 3 4 5 6 7
P(x) 0.17 0.25 0.31 0.22 0.05

This is a probability distribution. All the probabilities are between 0 and 1,


and they add up to 1.
x 0 1 2 3
P(x) 1.02 0.31 0.90 0.43

This is not a probability distribution. P(0) is not between 0 and 1.

Copyright ©2014 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Example 4
Check whether the distribution is a probability distribution.

X 0 1 2 3 4
P(X=x) 0.125 0.375 0.025 0.375 0.125

 P( X = x) = P( X = 0) + P( X = 1) + P( X = 2) + P( X = 3) + P( X = 4)
0

= 0.125+0.375+0.025+0.375+0.125
= 1.025
1 Since the summation of all probabilities is not
equal to 1, so the distribution is not a
probability distribution
Example 5
• Check whether the given function can serve as the
probability distribution random variable

x+2
f ( x) = for x =1,2,3,4,5
25
Solution
5 5
x+2
1
f ( x) = 
1 25
= f (1) + f (2) + f (3) + f (4) + f (5)
1+ 2 2 + 2 3 + 2 4 + 2 5 + 2
= + + + +
25 25 25 25 25
3 4 5 6 7
= + + + +
25 25 25 25 25
25
=
25
=1

# so the given function is a probability distribution of a discrete


random variable.
Example 6

Four patients have made appointments to have their blood pressure checked at
a clinic. Let X be the number of them that have high blood pressure. Based on
data from the National Health and Examination Survey, the probability
distribution of X is
x 0 1 2 3 4
P(x) 0.23 0.41 0.27 0.08 0.01

(a) Find P(2 or 3)


(b) Find P(More than 1)
(c) Find P(At least one)

Copyright ©2014 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Solution

x 0 1 2 3 4
P(x) 0.23 0.41 0.27 0.08 0.01

Solution:
(a) Find P(2 or 3)
The events “2” and “3” are mutually exclusive, since they cannot both happen.
We use the Addition Rule for Mutually Exclusive events:
P(2 or 3) = P(2) + P(3) = 0.27 + 0.08 = 0.35
(b) Find P(More than 1)
“More than 1” means “2 or 3 or 4.” We use the Addition Rule for Mutually
Exclusive events:
P(More than 1) = P(2 or 3 or 4) = 0.27 + 0.08 + 0.01 = 0.36

Copyright ©2014 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Solution

x 0 1 2 3 4
P(x) 0.23 0.41 0.27 0.08 0.01

Solution:
(c) Find P(At least one)
We use the Rule of Complements:
P(At least one) = 1 – P(0) = 1 – 0.23 = 0.77

Copyright ©2014 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Objective 3
Describe the connection between probability
distributions and populations

Copyright ©2014 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Probability Distributions and Populations

Statisticians are interested in studying samples drawn from


populations.

Random variables are important because when an item is drawn


from a population, the value observed is the value of a random
variable.

The probability distribution of the random variable tells how


frequently we can expect each of the possible values of the
random variable to turn up in the sample.

Copyright ©2014 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Example 7

In a town with a population of 1000 households, 142 of the households have


no car, 378 have one car, 423 have two cars, and 57 have three cars. A
household is sampled at random. Let X represent the number of cars in the
randomly sampled household. Find the probability distribution of X.
Solution:
To find the probability distribution, we must list the possible values of X and
then find the probability of each of them.
The possible values of X are 0,1,2,3. We find their probabilities.

Number of households with 0 cars 142


P (0) = = = 0.142
Total number of households 1000
Number of households with 1 car 378
P (1) = = = 0.378
Total number of households 1000
Copyright ©2014 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Solution

In a town with a population of 1000 households, 142 of the households have


no car, 378 have one car, 423 have two cars, and 57 have three cars. A
household is sampled at random. Let X represent the number of cars in the
randomly sampled household. Find the probability distribution of X.

Solution (continued):
Number of households with 2 cars 423
P (2) = = = 0.423
Total number of households 1000
Number of households with 3 cars 57
P (3) = = = 0.057
Total number of households 1000

The probability distribution is


x 0 1 2 3
P(x) 0.142 0.378 0.423 0.057

Copyright ©2014 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Objective 4
Compute the mean of a discrete random
variable

Copyright ©2014 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Expected Value of a Random
Variable
 Expected value is just the average or mean (µ)
of random variable x.

 It’s sometimes called a “weighted average”


because more frequent values of X are weighted
more highly in the average.

 It’s also how we expect X to behave on-average


over the long run (“frequentist” view again).
Expected Value
Discrete Case:

E( X ) =  x p(x )
all x
i i

Continuous Case:

E( X ) = 
all x
xi p(xi )dx
Symbol Interlude
 E(X) = µ
 These symbols are used interchangeably
Mean of a Random Variable

The mean of a random variable provides a measure of center


for the probability distribution of a random variable.

To find the mean of a discrete random variable, multiply each


possible value by its probability, then add the products.
In symbols,

µX = Σ[x·P(x)].

Copyright ©2014 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Example 8

A computer monitor is composed of a very large number of points of light


called pixels. It is not uncommon for a few of these pixels to be defective.
Let X represent the number of defective pixels on a randomly chosen monitor.
The probability distribution of X is as follows. Find the mean number of
defective pixels.
x 0 1 2 3
P(x) 0.2 0.5 0.2 0.1

Solution:

The mean is
µX = 0(0.2) + 1(0.5) + 2(0.2) + 3(0.1)
= 1.2.

Copyright ©2014 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Expected gain and Expected loss

There are many occasions on which people want to predict


how much they are likely to gain or lose if they make a
certain decision or take a certain action.

Often, this is done by computing the mean of a random


variable.

In such situations, the mean is sometimes called the


“expected value” and is sometimes denoted by E(X).
If the expected value is positive, it is an expected gain, and
if it is negative, it is an expected loss.
Example 9

A mineral economist estimated that a particular mining venture had probability 0.4
of a $30 million loss, probability 0.5 of a $20 million profit, and probability 0.1
of a $40 million profit. Let X represent the profit, in millions of dollars. Find the
probability distribution of the profit and the expected value of the profit. Does this
venture represent an expected gain or an expected loss?
Solution:
The probability distribution of X is as follows:
x –30 20 40
P(x) 0.4 0.5 0.1

The expected value is the mean of X


E(X) = µX = (–30)(0.4) + (20)(0.5) + (40)(0.1) = 2.0

The expected value is positive, so this is an expected gain of $2 million.

Copyright ©2014 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Objective 6
Compute the variance and standard deviation of
a discrete random variable

Copyright ©2014 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Variance/Standard Deviation

2 = Var(x) = E(x-)2
“The expected (or average) squared distance (or
deviation) from the mean”

 = Var ( x) = E[( x −  ) ] =  ( xi −  ) p(xi )


2 2 2

all x
Variance
Discrete Case:

Var ( X ) =  (x
all x
i −  ) p(xi )
2

Continuous Case:

Var ( X ) =  ( xi −  ) p(xi )dx


2

all x
Variance and Standard Deviation of a Random Variable

The variance of a random variable provides a measure of


spread for the probability distribution of a random variable.

The variance of a discrete random variable X is given by


 x2 =  ( x − x )2  P ( x )
An equivalent expression that is often easier when computing
by hand is
 x2 =   x 2  P ( x ) − x2

The standard deviation of X is the square root of the variance:

 x =  x2

Copyright ©2014 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Symbol Interlude

 Var(X)= 2
 SD(X) = 

 these symbols are used interchangeably


Example 10

Let X represent the number of defective pixels on a randomly chosen computer


monitor. The probability distribution of X is as follows. Find the variance and
standard deviation of the number of defective pixels.
x 0 1 2 3
P(x) 0.2 0.5 0.2 0.1

Solution:
In a previous example, we found that the mean µX = 1.2. Now,
 x2 =  ( x − x )2  P ( x ) = (0 − 1.2)2  0.2 + (1 − 1.2)2  0.5 + (2 − 1.2)2  0.2 + (3 − 1.2)2  0.1

= 0.76
The standard deviation is the square root of the variance:

 x =  x2 = 0.76 = 0.872

Copyright ©2014 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
H.W

Walpole Exercise of Ch 3,
Reading: Sec 3.1-3.2 (with all examples)
Q 1- Q30 (Do all Qs relevant to this lecture)

Tbook Sher M Chaudhry Ch 7


(Do all Qs relevant to this lecture)

You might also like