Probablity and Random Variables
Probablity and Random Variables
Probablity and Random Variables
e2
Car
e3
e4
Exercise
Suppose three fuses are examined
in sequence and each receive a pass
(P) or fail
(F) rating as a result of this inspection.
1. Construct a tree diagram to
show the outcomes of the experiment.
2. Write down the sample space.
3. Let A denote the event that exactly one fuse
fails inspection. How would A be defined?
4. Let E denote the event that at most one fuse
fails inspection. What is Ē? A and E? A or E?
Probability
Probability refers to the chance that a particular
event will occur.
The probability of an event is the proportion of
times the event is expected to occur in repeated
experiments.
Let A be an event, then P(A) denotes the
probability that A will occur.
Assigning Probabilities
Classical Method
Assigning probabilities based on the assumption of
equally likely outcomes.
Number of ways Ai can occur
P(Ai)
Total number of elementary events
=
Relative Frequency Method
Assigning probabilities based on experimentation or
historical data.
Number of times Ai occurs
Relative Freq. of Ai
N
=
Assigning probabilities based on the assignor’s
Subjective
judgment.Method
Exercises
1. A quiz contains multiple-choice questions
with five possible answers, only one of which
is correct. A student plans to guess the
answers because he knows absolutely
nothing about the subject.
a) Produce the sample space for each question
b) Assign probabilities to the simple
events in the sample space you
produced.
c) Which approach did you use to answer part b.
d) Interpret the probabilities you
assigned in part b.
Exercise
2. The manager of a computer store has kept track
of the number of computers sold per day. On
the basis of this information, the manager
produced the following list of the number of
daily sales: Number of Probability
6 computers?
Rules of Probability
Rules for
Possible Values
and Sum
k
0 ≤ P(Ai) ≤ 1
For any event Ai P(A ) 1i
where: i1
k = Number of elementary events
in the sample space
Ai = ith elementary event 12
Complement Rule
The complement of an event A is the
collection of all possible elementary events
not contained in event A. The complement of
event E is represented by Ā.
A
Complement Rule:
P(A) 1 Ā
P(A)
Or P(A) P(A)
, 1
The Addition Rule
If A and B are mutually exclusive(if they cannot
occur at the same time), then the probability that
A or B (the union of A and B) will occur is
P(A or B) = P(A) + P(B)-P(Aand B)
where P(Aand B)=0
General addition Rule for mutually exclusive
events:
If A1, A2,…, AN are mutually exclusive, then
P (A B ) = P (A )+ P (B ) P (A
B)
0.65 0.50 0.25 0.90
What is the probability that a household does not
subscribe to Atlantic Journal?
P (A ) = 1 P (A )
1 0.65 0.35
Exercises
1) A student is randomly selected from a class
where 35% of the class is left-handed and 50%
are sophomores. We further know that 5% of
the class consists of left-handed sophomores.
What is the probability of selecting:
a) a student that is either left-handed OR a
sophomore?
b) a right-handed sophomore?
c) Are the events of selecting a left-handed student
and selecting a sophomore considered to be
mutually exclusive? Why or why not?
Exercises
2) 42% of the sales force at a large insurance
company have laptop computers, 65% have desk
computers and 24% have both types of computer. A
sales person is selected at random.
a) What is the probability that he/she does not
have a laptop computer?
b) What is the probability that he/she has at
least one of the two types of computer?
Conditional Probability
The probability of event A occurring, given
that event B has occurred, is called the
conditional probability of event A given event
B, denoted P(A|B):
P(AB)
P(A|B)
P(B)
where P(B)>0
Multiplication Rule:
P(A B)=P(A|B)P(B)
Example: Newspaper Subscribers
Of the households that subscribe to the Atlantic
Journal, what is the probability that they also
subscribe to the Beacon News?
0.25
P A B 0.3846
P B | A 0.65
P A
households
Of the that subscribe to the Beacon
News, what is the probability that they also
subscribe to the Atlantic Journal?
P A B 0.25
0.50
P A | B P B 0.50
Example
Of the cars on a used car lot, 70% have air
conditioning (AC) and 40% have a CD player (CD).
20% of the cars have both. What is the probability
that a car has a CD player, given that it has AC ?
CD No CD Total
AC .2 .5 .7
No AC .2 .1 .3
Total .4 .6 1.0
Dependent Events
Occurrence of one affects the probability of the
other
E1 = rain forecasted on the news
E2 = take umbrella to work
Independent Events
Suppose a jar contains 3 red and 4 white marbles. If two marbles are
drawn with replacement, find the following probabilities using a tree
diagram.
Let RR be the event that the marble drawn is red, and let W be the event
that the marble drawn is white.
b)The probability that the first marble is red and the second is white is
P(RW)=3/7*4/7=12/49
c) For the probability that one marble is red and the other is white, we
observe that this can be satisfied if the first is red and the second is white, or
if the first is white and the second is red. The “or” tells us we’ll be using the
Addition Rule from Section 7.2.
Let RR be the event that the marble drawn is red, and let W be the event that the
marble drawn is white.
Therefore
PP(one marble is red and the other marble is white)
=P(RW or WR)=P(RW)+P(WR)=12/42+12/42=24/42
=P(RW or WR)=P(RW)+P(WR)=12/42+12/42=24/42
Example 3
About 13% of the population is left-handed. If
two people are randomly selected, what is the
probability both are left-handed? What is the
probability at least one is right-handed?
Let E1 be the event that the first selected person is
a left-handed and E2 be the event that the second
selected person is a left-handed.
We have P(E1)=P(E2)=0.13, so
P(E1E2)=P(E1)P(E2)=(0.13)(0.13)=0.0169
P(At least one is right-handed)=1-
P(E1E2)
=1- 0.0169=0.9831
Example 1: Newspaper
Subscribers
Example 1:
Suppose you have 3 shirts (call them A , B , and C ), and 4
pairs of pants (call them w, x, y , and z ). Then you have
3 × 4 = 12 possible outfits:
A , B , C or w, x, y, z
No Repetition:
For example -the first three people in a running race. You can't be first and second.
Permutations
Repetition is Allowed:
When a thing has n different types ... we have n
choices each time!
For example: choosing 3 of those things, the
permutations are:
n×n×n
(n multiplied 3 times)
Which is easier to write down using an exponent of r:
Example: In the bank ATM, there are 10 numbers to choose from (0,1,2,3,4,5,6,7,8,9) and we
choose 4 of them:
10 × 10 ×10×10 = 10^4
= 1,0000 permutations
Permutations without Repetition
In this case, we have to reduce the number of available
choices each time.
For example -
What order could 16 pool balls be in when it is without
replacement ?
So, our first choice has 16 possibilities, and our next choice has
15 possibilities,then 14, 13, etc.
And the total permutations are: 16 × 15 × 14 × 13 × ... =
20,922,789,888,000
But maybe we don't want to choose them all, just 3 of them, and
that is then:
16 × 15 × 14 = 3,360
But maybe we don't want to choose them all, just 3 of
them, so that is only:
16 × 15 × 14 = 3,360
Without repetition our choices get reduced each time.
But how do we write that mathematically?
So, when we want to select all of the billiard balls the permutations
are:
16! = 20,922,789,888,000
But when we want to select just 3 we don't want to multiply after 14.
How do we do that? There is a neat trick: we divide by 13!
16 × 15 × 14 × 13 × 12 ...13 × 12 ... = 16 × 15 × 14
That was neat. The 13 × 12 × ... etc gets "cancelled out", leaving
only 16 × 15 × 14.
Example-
How many permutations of 4 different letters are there, chosen from the
twenty six letters of the alphabet?
Solutions-
The number of permutations of 4 letters chosen from 26 is 26 p 4
= 26 × 25 × 24 × 23
= 358,800
COMBINATION
A combination is a mathematical technique that determines the
number of possible arrangements in a collection of items where the
order of the selection does not matter. In combinations, you can select
the items in any order.
Example
From a group of 7 men and 6 women, five persons are to be selected to form a
committee so that at least 3 men are there on the committee. In how many ways
can it be done?
Solutions-
We may have (3 men and 2 women) or (4 men and 1 woman) or (5 men only).
T 0 1/4 = .25
T H 1 2/4 = .50
2 1/4 = .25
H T
Probability
.50
H .25
H 0 1 x 35
2
Example 2
Let x be the random variable of the
number of radios sold per week
Number of Radios Sold at Sound City
in a Week
x 5 -6 10 0
p(x) .01 .01 .01 .97
=2.40
x =(0-2.4) (.05)+(1-2.4) (.15)+(2-2.4)
2
(.35) 2 2 2
+(3-2.4)2 (.25)+(4-2.4)2(.20)
=1.24
x=1.11
Exercises
1. A chemical supply company currently has in stock
100 lb of a certain chemical, which it sells to
customers in 5-lb lots. Let X = the number of lots
ordered by a randomly chosen customer, and
suppose that X has probability distribution:
x 1 2 3 4
p(x) 0.2 0.4 0.3 0.1
Binomial Probabilities
Several Binomial Distributions
Finding probabilities in EXCEL
If X has Binomial dist with parameters (n, p), then:
P(X = k) can be obtained from Excel by typing in an
empty cell =binomdist(k, n, p, false) and
returning.
P(X ≤ k) can be obtained from Excel by typing in an
empty cell =binomdist(k, n, p, true) and returning.
In MegaStat:
MegaStat Probability Discrete Probability
Distributions
Choose Binomial and enter the values of n
and p
Click in the Display Graph if the plot of the distribution is
desired.
Click OK and the output will be given.
Example
Records show that 30% of the customers in a
shoe store make their payments using a credit
card. This morning 20 customers purchased
shoes.
a) What is the probability that 12 customers used a
credit card?
This is a binomial experiment with n=20 and
p=.30.
20!
P (X 12) 8!12! (0.30)12 (0.70)8 0.0039
In Excel, =BINOMDIST(12,20,0.3,0)
Example
b) What is the probability that at most 7 customers
used a credit card?
20! 20!
P (X 7) (0.3) (0.7)
0 20
(0.3) 7
(0.7)13
0! 20! 7!13!
0.7723
In Excel,
=BINOMDIST(7,20,0
.3,1)
X cd (d c )
2 X2 12
2
The Uniform Probability Curve
Example
The amount of time it takes for a student to
complete a statistics quiz is uniformly
distributed between 30 and 60 minutes.
The pdf is given by
0.035
1
0.030
0.025
1
for 30 x 60
f x = 30
0.020
Densit
0.015
0
y
otherwise 0.010
0.005
0.000
30 60
X
Example
a) One student is selected at random. Find the
probability that the student requires more
than 55 minutes to complete the quiz.
P(X>55) = (60-55)/(60-30)=0.167
0.035
0.167
0.030
0.025
0.020
Density
0.015
0.010
0.005
0.000
30 55 60
X
Example
b) One student is selected at random. Find the
probability that the student requires 45 to
55 minutes to complete the quiz.
P(45<X<55) = (55-45)/(60-30)=0.3333
0.035
0.333
0.030
0.025
0.020
Density
0.015
0.010
0.005
0.000
30 45 55 60
X
Example
c) Find the expected value and the variance of
the amount of time it takes a student to
complete a statistics quiz.
The expected value is:
x=(30+60)/2=45
The variance is:
x =(60-30)
/122
=75 2
Exercise
The length of time patients must wait to see a
doctor in a local clinic is uniformly distributed
between 15 minutes and 2½ hours.
a) What is the probability of a patient waiting
exactly 50 minutes?
b) What is the probability that a patient would
have to wait between 45 minutes and 2 hours?
c) Compute the probability that a patient would
have to wait over 2 hours.
d) Determine the expected waiting time and its
standard deviation.
The Normal Distribution
It is the most important continuous distribution:
Many random variables can be properly
modeled as normally distributed.
Many distributions can be approximated by a normal
distribution.
The normal distribution is the cornerstone distribution
of statistical inference.
A random variable X with mean and variance is
normally distributed, abbreviated by N(, ), if its
probability density function is given by
1
f (x) e (1/ 2)[( x ) x
/ ]2
2
Properties of Normal Distribution
Bell Shaped and Symmetrical
Mean=Median=Mode
Spread is determined by σ
Location is determined by μ
The total area under the curve is 1.
It has two tails extending from - to +
A random variable has a standard normal
distribution provided that it follows N(0, 1).
Many Normal Distributions
0.977
Example: 0.3
0.1
0.0
0 2
Z Table example
Suppose x is normal with mean 8.0 and
standard deviation 5.0. Find P(8 < x <
8.6)
=8 =0
=5 =1
x z
8 0
8.6 0.12
Density
0.05
0.03 0.5478
0.01
= 0.5478 0.00
8.6
0.09
0.07
0.05
Density
= 1-P(z < 0.40) 0.04
0.03
= 0.3446
0.01
0.00
8 10
Finding probabilities in Excel
For Standard normal distribution:
P(Z a) =normsdist(a)
For normal distribution with mean and standard
deviation :
P(X a) =normdist(a, , , 1)
In MegaStat:
Probability Continuous Probability Distributions
Choose normal and enter the values of and
Enter the value of x is the “Calculate p given x” window
Click Preview to see the probability below and above x
or OK to produce the output.
Note: You can also use Probability Normal distribution
for computations and graphs.
“Backward” Normal Calculations
We could find the observed value (x) of a given
proportion in N(, 2) by unstandardizing the
z- value.
State the problem
Draw a picture
Use the normal table to find the probability
closest to the one you need and read off the
z- value
Unstandardize x= + z
Example
Find the z-score that
0
0.4
area of 0.3632.
Densit
0.2
P(Z<z)=0.3632
y
z=-0.35
0.1 0.3632
0.0
-0.350 0
Density
P(Z>z)=0.1075 0.2
z=1.24 0.1
0.1075
0.0
0 1.24
Finding quartiles in Excel
The value of c such that P(Z c) = , with known, can be
obtained c=normsinv().
The value of c such that P(X c) = , with known, can be
obtained c=norminv(, , ).
In MegaStat:
Probability Continuous Probability Distributions
Choose normal and enter the values of and
Enter the value of x is the “Calculate x given p” window
Click Preview to see the desired quartile or OK to
produce the output.
Note: You can also use Probability Normal distribution
for computations and graphs.
Example
If X has Normal distribution with =60 and =4, then
P(X 68) = 0.97725