Chapter 02

Download as pdf or txt
Download as pdf or txt
You are on page 1of 24

Raid Anabosi 1 of 24 STAT 319–Ch.

Chapter 2
PROBABILITY
Objectives
1. To define the random experiment and its sample space.
2. To define the event of an experiment and its type.
3. To find out the number of ways an experiment can take place.
4. To introduce three approaches to assessing probabilities.
5. To check the validity of the axioms of probability.
6. To apply common rules of probability (Addition Rule & Multiplication
Rule).
7. To calculate the conditional probability of an event.
8. To determine the independence of events.
9. To use Bayes’ Theorem to calculate conditional probabilities.
10. To define the random variable based on a sample space.

Probability allows quantifying the variability in the outcome of any experiment


whose exact outcome cannot be predicted with certainty.

2-1 SAMPLE SPACES AND EVENTS


2-1.1 Random Experiments

Experiment: a process of obtaining outcomes for uncertain events.


Formally speaking, an experiment that can result in different outcomes, even
though it is repeated in the same manner every time, is called a random
experiment.

2-1.2 Sample Spaces


A Sample Space: is the collection, the set, of all possible elementary outcomes of
a random experiment and is denoted by S.

A sample space is discrete if it consists of finite or countable infinite set of


outcomes. A sample space is continuous if it contains an interval (either finite or
infinite) of real numbers.

2-1.3 Events
Elementary Event: the most basic outcome possible from a simple experiment
Events: a subset of the sample space satisfying a certain condition.
Joint events: an event that has two or more characteristic.
Raid Anabosi 2 of 24 STAT 319–Ch.2

Example 1: Tossing a coin one time, write the sample space.


Answer: S = {H , T}

Example 2: Tossing a coin two times, write the sample space.


Answer: S = {HH , HT , TH , TT}

Example 3: Rolling a die one time, write the sample space.


Answer: S = {1 , 2 , 3 , 4 , 5 , 6}

Example 4: Rolling a die two times, write the sample space.


Answer: S = {(1,1) , (1,2) , (1,3) , (1,4) , (1,5) , (1,6) , (2,1) , … , (2,6) , (3,1) , …
, (3,6) , (4,1 ) , … , (4,6) , (5,1) , … , (5,6) , (6,1) , … , (6,6)}

Intersection of events: the common elements in both events and is denoted by


“AND” or ∩.
Union of events: all the elements in both events without repetition and is denoted
by “OR” or .
Complement of an event: is the subset of S that contains all the elements of S that
are not in the event and is denoted by E  .
Note: Venn diagrams can be used to depict the relationships among events.
Raid Anabosi 3 of 24 STAT 319–Ch.2

Mutually Exclusive (disjoint) Events


The events are mutually exclusive if they cannot occur together.
 If the event A occurs, then the event B cannot occur
 The events A and B have no common elements, i.e. A ∩ B = φ

Collectively Exhaustive Events


 One of the events must occur
 The set of events covers the entire sample space (a list of the possible
events that can result from an experiment includes every possible
outcome), i.e. A ⋃ B = S.

The distributive laws:


A⋂(B⋃C) = (A⋂B)⋃(A⋂C) and A⋃ (B⋂C) = (A⋃B) ⋂ (A⋃C)

DeMorgan’s laws:
(A⋃B)’ = A’ ⋂ B’ and (A⋂B)’ = A’ ⋃ B’

Example 5:
Let S  e1 , e 2 ,...,e 8  and E1  e1 , e3 , e5 , e7  , E2  e2 , e4 , e6 , e8  , are the two events
mutually exclusive? Why?
Answer: Yes, because E1 ∩ E2 = φ = { }.

Example 6:
Drawing one card from an ordinary deck of cards. Defined the events E1 = a
queen card; E2 = a clubs card. Are the two events mutually exclusive? Why?
Answer: No, because E1 ∩ E2 = {QC}
E1 = {Queen Spades , Queen Clubs , Queen Hearts , Queen Diamonds} & E2 =
{AC , 2C , 3C , … , 10C , JC , QC , KC}
Raid Anabosi 4 of 24 STAT 319–Ch.2

Writing the sample space using a tree diagram:


Example 7:
Tossing a coin two times, write
H
the sample space using a tree H
diagram. T
START
So the sample space is: H
T
S = {(H,H),(H,T),(T,H),(T,T)} T

Writing the sample space using Contingency table:


Example 8:
Drawing one card from a deck of cards. If E is the event of drawing a red which
is an ace, then

Ace Not Ace Total


Black 2 24 26
Red 2 24 26
Total 4 48 52

E = {Ace of Hearts , Ace of Diamonds}

Example 9:
An automobile consultant records fuel type and vehicle type for a sample of
vehicles
Two fuel types: Gasoline, Diesel
Three vehicle types: Truck, Car, SUV

List all the possible elementary events

6 possible elementary events:


e1: Gasoline, Truck
e2: Gasoline, Car
e3: Gasoline, SUV
e4: Diesel, Truck
e5: Diesel, Car
e6: Diesel, SUV
S = {e1 , e2 , e3 , e4 , e5 , e6}
Raid Anabosi 5 of 24 STAT 319–Ch.2

Example 10:
If two customers are asked to list their choice of ice cream flavor from among
vanilla, chocolate and strawberry. List the sample space showing the possible
outcomes.
Answer: S = {V1 , C1 , S1 , V2 , C2 , S2}

2-1.4 Counting Techniques


In many examples it can be difficult or tedious to determine the number of
elements in a finite sample space by direct enumeration.

Multiplication Rule
Theorem If sets A1, A2, …, Ak contain respectively, n1, n2, …, nk elements,
there are n1•n2•••nk ways of choosing first an element of A1, then an element of
A2, …, and finally an element of Ak.

Example 1:
In how many different ways can a union with 25 members choose a president and
a vice president?
Answer: #ways = 25×24 = 600 ways

Example 2:
If a test consists of 12 questions, in how many different ways can a student mark
the test paper?
Answer: #ways = 212 = 4096 ways

Permutations
Let us denote the number of permutations of n different elements by
n! = n(n–1)( n–2)…3.2.1 and let 0! = 1 by definition.
Referring back to example 1 above, we can generalize according to the following
theorem:
Raid Anabosi 6 of 24 STAT 319–Ch.2

Permutations Subsets
Theorem The number of permutations of r objects selected (ordered) from a
set of n distinct objects is
n!
n Pr  n  n  1  n  2  ...  n  r  1  
n  r !

Example 3:
In how many different ways can a union with 25 members choose a president, a
vice president, a secretary, and a clerk?
Answer: #ways = 25P4 = 25!/21! = 303600 ways

Permutations of Similar Objects


The number of permutations of n = n1 + n2 +…+ nr objects of which n1 are of one
type, n2 are of a second type,…, and nr are of an rth type is
n!
n1 ! n2 ! n3 !...nr !

Example 4:
In bar-code labeling, a part is labeled by printing with four thick lines, three
medium lines, and two thin lines. If each ordering of the nine lines represents a
Raid Anabosi 7 of 24 STAT 319–Ch.2

different bar-code label, how many different labels can be generated using this
scheme?

If the order is not important then the number of ways, certainly, will become,
significantly, less as given the following theorem:

Number of combinations of n objects taken r at a time


Theorem The number of ways in which r objects can be selected from a set of
n distinct objects is
 n  n  n  1 n  2  ...  n  r  1 n!
Cr     
r !n  r !
n
r r!

Example 5:
In how many different ways can 3 of 20 lab assistants be chosen to assist with an
experiment?
Answer: #ways = 20C3 = 20!/(3!×17!) = 1140 ways

Example 6:
In how many different ways can the director of a research lab choose 2 chemists
from among 7 applicants and 3 physicists form among 9 ones?
Answer: #ways = 7C2×9C3 = 1764 ways

Example 7:
A bin of 50 manufactured parts contains 3 defective parts and 47 nondefective
parts. A sample of 6 parts is selected without replacement. How many different
samples are there of size 6 that contain exactly
defective parts?
Raid Anabosi 8 of 24 STAT 319–Ch.2

2-2 INTERPRETATIONS AND AXIOMS OF PROBABILITY


There are three types of probability:
1. A priori probability (Classical Probability Assessment):
The probability of success is based on prior knowledge of process involved.
The chance of occurrence of the event E is defined by the equation:
If: A = {e1, e2, e3,…,em}, then
P(A) = P(e1) + P(e2) + P(e3)+ …+ P(em)

But, what to do if the elementary events cannot all be regarded as equally likely?
It would be more convenient to employ the relative frequency concept.
2. Empirical probability (Relative Frequency of Occurrence):
The chance of occurrence of the event is defined by the equation

Number of times the event occurrs f


Probability of event = 
Total number of trials of the experiment n

3. Subjective probability
Based on a combination of an individual’s past experience, personal
opinion, and analysis of a particular situation

Example 1:
What is the probability of drawing an ace from an ordinary deck of 52 playing
cards?
Answer: P(Ace) = 4/52 = 1/13 = 0.077.

Example 2:
If records shows that 294 of 300 ceramic insulators tested were able to withstand
a certain thermal shock, what is the probability that any one untested insulator
will be able to withstand the thermal shock?
Answer: P(withstand) = 294/300 = 0.98.

Example 3:
Raid Anabosi 9 of 24 STAT 319–Ch.2

A professor is to select a group of 5 assistants from his class of 5 freshmen, 6


sophomores, and 7 juniors. If he does NOT want to include any of the freshmen
in his selection, what is the probability that he will select 2 sophomores?
Answer: P(0F,2S,3J) = 5C0×6C2×7C3/18C5 = 525/8568 = 0.061

Example 4:
Suppose 10 motors have been fabricated but that in spite of tests performed on
the individual motors, 2 will not operate satisfactorily when placed into a capsule.
To fabricate a new capsule, 2 motors will be randomly selected (each pair of
motors has the same chance of being selected). Find the probability that
a. both motors will operate satisfactorily in the capsule.
b. the first operates but not the second.
c. one motor will operate satisfactorily and the other will not.
Answer: W: Working, N: Not working
a. P(2W) = (8C2)(2C0)/10C2 = = 56/90 = 0.622

b. P(W,N) = (8/10)×(2/9) = 16/90 = 0.178

c. P(1W) = (8C1×2C1)/10C2 = = 32/90 = 0.356

Axioms of Probability
We define the set function P(.): S  [0,1].
If the sample space of an experiment is S = {e1, e2, e3,…, ek}
1. Individual values (Axiom 1):
0 ≤ P(ei) ≤ 1, for any event ei
2. Sum of all values (Axiom 2)
k
P(S) =  P( e ) = 1
i 1
i

where:
Raid Anabosi 10 of 24 STAT 319–Ch.2

k = Number of elementary events in the sample space.


ei = ith elementary event.

3. Addition Rule for Elementary Events


If: Ei = {e1, e2, e3,…,em}
then: P(Ei) = P(e1) + P(e2) + P(e3)+ …+ P(em)

Example 1:
If an experiment has the three possible and mutually exclusive outcomes A, B,
and C, check, in each case, whether the assignment of probabilities is permissible
(valid):
a. P(A) = 1/3, P(B) = 1/3, and P(C ) = 1/3. valid
b. P(A) = 0.64, P(B) = 0.38, and P(C ) = – 0.02. not valid
c. P(A) = 0.35, P(B) = 0.52, and P(C ) = 0.26. not valid
d. P(A) = 0.57, P(B) = 0.24, and P(C ) = 0.19. valid

2-3 ADDITION RULES


Addition Rule for Two Events
P(A or B) = P(A) + P(B) – P(A and B)
P(A ⋃ B) = P(A) + P(B) – P(A ⋂ B)

Addition Rule for Mutually Exclusive Events (Axiom 3):


If A and B are mutually exclusive, then P(A ⋂ B) = 0 and
P(A ⋃ B) = P(A) + P(B)

Similarly,
P(A U B U C) = P(A) + P(B) + P(C) – P(A ⋂ B) – P(B ⋂ C) – P(A ⋂ C)
+ P(A⋂B⋂C)

Similarly,
k k
 k

If E1, E2, …, Ek are mutually exclusive, then P  Ei  = 0 and P( Ei ) =  P(E )i
 i 1  i 1 i 1
Raid Anabosi 11 of 24 STAT 319–Ch.2

Complement Rule
E’ is the collection of all possible elementary events not contained in
event E. Sometimes it is denoted by E or Ec .
P(E)  1  P(E) or P(E)  P(E)  1

Example 1:
Drawing one card from a deck of cards. Defined the events
A = Ace; B = Black card;
D = Diamonds; R = Red pictures
Are all events collectively exhaustive? No
Are all events mutually exclusive? No
Are the events B, D and R collectively exhaustive? No
Are the events B, D and R mutually exclusive? No

Example 2:
For a sample of 80 recently born babies, the following table is obtained:
Weight
Gender < 2.5 kg 2.5 - 3 kg > 3 kg
Boy 4 35 10 49
Girl 3 22 6 31
7 57 16 80
a. What is the probability that a randomly selected baby is a boy?
b. What is the probability that a baby is over weight?
c. What is the probability that a baby is a girl and her weight is between 2.5
and 3 kg?
d. Suppose a baby was chosen at random. Consider the two events: the event
that a boy was chosen and the event that an over weight baby was chosen.
Are these two events mutually exclusive? Explain.
e. What is the probability that a randomly chosen baby is a girl given that she
is under weight?
Answer: N(B)=49, N(G)=31, N(bAv)=7, N(Av)=57, N(aAv)=16
N(B∩Av)=35, N(G∩aAv)=6
a. P(B)=49/80 b. P(aAV)=16/80 c. P(G∩Av)=22/80

d. No.

e.
Raid Anabosi 12 of 24 STAT 319–Ch.2

Example 3:
Of the cars on a used car lot, 70% have air conditioning (AC) and 40% have a
CD player (CD), and 20% of the cars have both.
a. What is the probability that a car has a CD player or it has an AC?
b. What is the probability that a car has a CD player, given that it has an AC?
c. What is the probability that a car has no CD and has no AC?
d. What is the probability that a car has no CD but has an AC?
Answer: P(AC)=0.7, P(CD)=0.4, P(AC∩CD)=0.2

a. P(AC ⋃ CD) = P(AC) + P(CD) – P(AC ⋂ CD)=0.9

b. P(CD|AC)= P(AC∩CD)/P(AC)=0.2/0.7=0.287

c. P(CD’∩AC’)=0.1

d. P(CD’∩AC)=0.5

2-4 CONDITIONAL PROBABILITY


Conditional probability for any two events A , B:
P( A  B)
P( A|B)  where P  B  0
P( B)
Raid Anabosi 13 of 24 STAT 319–Ch.2

Example 1:
The table below shows the classification of 400 parts by surface Flaws and as
Defective.
If you know that 90% of them are of no surface Flaws, 64.3% of the Defectives
have no surface Flaws and 75% are non-Defectives given that they have surface
Flaws. How many parts:
a. have a surface Flaw?
b. are Defectives given that they have surface Flaws?
c. have a surface Flaw given that they are non-Defectives? Can you?
Answer:

Surface Flaws
Defective F F' Total
D
D'
Total 0.1 0.9 1
Raid Anabosi 14 of 24 STAT 319–Ch.2

2-5 MULTIPLICATION AND TOTAL PROBABILITY RULES


Multiplication Rule:
P(A∩B) = P(B|A) P(A) = P(A|B) P(B)
If we know that, B = (A∩B) U (A'∩B) then,

Total Probability Rule:


P(B) = P(A∩B) + P(A'∩B) = P(B|A) P(A) + P(B|A’) P(A’)

Example 1:
Recall example 1 before. How many parts:
a. are Defectives? 0.07003 28.0112
b. have surface Flaws given that they are non-Defectives?
Answer:
Raid Anabosi 15 of 24 STAT 319–Ch.2

Total Probability Rule (multiple events):


If E1, E2, … , Ek are mutually exclusive and exhaustive of B then,
P(B) = P(B⋂E1) + P(B⋂E2) + … + P(B⋂Ek) = ∑𝑘𝑖=1 𝑃(𝐵 ∩ 𝐸𝑖 )
= P(B|E1) P( E1) + P(B|E2) P( E2) + … + P(B|Ek) P( Ek) = ∑𝑘𝑖=1 𝑃 (𝐵|𝐸𝑖 )𝑃 (𝐸𝑖 )

2-6 INDEPENDENCE
Independent and Dependent Events
 Independent: The two events are independent if the occurrence of one
does not affect the occurrence of the other, so it does not affect the
probability of the other
 Dependent: The two events are dependent if the occurrence of one
affects the probability of the other

Conditional probability for independent events A, B:


P( A | B )  P( A) where P( B )  0

P( B| A)  P( B) where P  A  0

Note: if P  A  B  P  A P  B then the two events are independent.


Note: If A and B are independent, then 1. A’ and B 2. A and B’ 3. A’ and B’
are independent.

Example 1:
Let S  e1 , e2 , e3 , e4 , e5 , e6 , e7 , e8  and E1  e1 , e3 , e5 , e7  , E2  e2 , e4 , e6 , e8 
E3  e1 , e3 , e6 , e8  , E4  e2 , e5 , e7  , and P  e1   P  e3   0.1, P  e2   P  e4   0.15
P  e5   P  e7   0.01, P  e6   0.05 , then find
a. P  e8   1 – (.1+.15+.1+.15+.01+.05+.01) = 1 – 0.57 = 0.43
Raid Anabosi 16 of 24 STAT 319–Ch.2

b. P  E1   .1+.1+.01+.01 = 0.22
c. P  E3   .1+.1+.05+.43 = 0.68
d. P  E4   1-P(E4) =1 – (.15+.01+.01) = 1 – 0.17 = 0.83
e. P  E1 or E3   P(E1 U E3)=P(E1) + P(E3) – P(E1 ∩ E3) = 0.22 + 0.68 – 0.2 =
0.7
f. P  E1 or E2   P(E1 U E2)=P(E1) + P(E2) = 0.22 + 0.78 – 0 = 1=P(S)
g. P  E 1 or E 3   1 – 0.7 = 0.3
h. P  E 1 E 3   = 0.2 / 0. 68 = 0.294
i. Are E1 and E4 independent? Explain. No
Raid Anabosi 17 of 24 STAT 319–Ch.2

Example 2:
A box contains 20 electrical fuses out of which 4 are defective. If two fuses are
randomly selected with replacement, then answer the following;
a. What is the probability that both fuses are defective? 1/25
b. What is the probability that ONLY the first fuse is defective? 4/25
c. What is the probability that the first fuse is defective? 1/5
d. What is the probability that ONLY one fuse is defective? 8/25
Raid Anabosi 18 of 24 STAT 319–Ch.2

Example 3:
Historically, on a certain day the weather in certain city has the following
distribution:
Event Relative frequency
Clear & dry 0.20
Cloudy & dry 0.30
Rain 0.40
Snow 0.10

a. What is the probability that next day will be dry? 0.5


b. What is the probability that next day will be rainy or cloudy & dry? 0.7
c. Suppose next day is dry, determine the probability that it will also be
cloudy. 0.6
Raid Anabosi 19 of 24 STAT 319–Ch.2

Example 4:
A basketball team has 10 players. Five are seniors, two are juniors and three are
freshmen. Two players are randomly selected to serve as captains for the next
game.
a. What is the probability that both players selected are seniors?
b. What is the probability that the first is junior?
c. If three players were selected, what is the probability that the first is
junior and the other two are freshmen?

Answer:
a. P(2S,0J,0F)=5C2/10C2=0.222 =(5/10)*(4/9) = 5P2/10P2 = 2/9
b. P(J,S)+P(J,F)+P(J,J)=(2P1×5P1+2P1×3P1+ 2P2)/10P2= 2/10
c. P(J,2F) = ( 2P1×3P2)/10P3 = 1/60

Notes:
1. If multiple selections take place from the SAME category (group) then it
can be calculated by either a combination or a permutation.
2. In case of selecting two units, if the second can be ANYTHING then it is
enough to find the probability of the first selection ONLY regardless of
the second selection.
Raid Anabosi 20 of 24 STAT 319–Ch.2

Example 5:
The following table represents number of students in KFUPM from eastern
province and from other provinces, and being a sophomore or a freshman
Eastern Not eastern Total
S 256 940 1196
F 340 784 1124
Total 596 1724 2320

If a student is randomly selected, find the following


a. The probability that the student is from the eastern province. 596/2320
b. The probability that the student is a sophomore. 1196/2320
c. The probability that the student is a sophomore, given that he is from the
eastern province. 256/596

Example 6:
Assume that business conditions in any year can be classified as either good or
bad. Suppose that if business is good this year, then it will be also good next year
with probability 0.7. Also suppose that if business is bad this year, then with
probability 0.4 it will be good next year. The probability that business will be
good this year is 0.6. Find the probability that the following statements are true
a. Business conditions both this year and next year will be good. 0.42
b. Business conditions will be good this year and bad next year. 0.18
c. Business conditions will be bad both years. 0.24
d. Business conditions will be good next year. 0.58
e. Given that business conditions are good next year, what is the probability
that they were good this year? 0.72
Raid Anabosi 21 of 24 STAT 319–Ch.2

2-7 BAYES' THEOREM


Let us start with this useful example:
Example 1:
Semiconductors may result in a production failure and, when manufactured, are
subject to contamination. Given the following table:

Probability of Failure given the contamination level 0.100 0.010 0.001


Contamination level High Medium Low

If in a particular production run, 20% of chips are subjected to High levels of


contamination and 30% are subjected to Medium level.
a. What is the probability a randomly selected chip from that run FAILS? 0.0235
b. What is the probability that the chip was subjected to a Medium level of
contamination given that it failed under testing? 0.128
Answer:
Probability of Failure 0.100 0.010 0.001
Probability of contamination 0.2 0.3 0.5
Contamination level High Medium Low
Product 0.02 0.003 0.0005
a. P(F) = 0.02 + 0.003 + 0.0005 = 0.0235
Raid Anabosi 22 of 24 STAT 319–Ch.2

b. P(M|F) = 0.003/0.0235=0.128

Bayes theorem is used to revise previously calculated probabilities based on new


information
From the given diagram

E1 E2 Ek

P(E j  B) P( B|E j )P(E j )


P(E j |B)   k
P( B)
 P(B|E )P(E )
i 1
i i
Raid Anabosi 23 of 24 STAT 319–Ch.2

Example 2:
Three sections each working on a big senior project, it was known that usually
from section 1 only 2% of the students does not submit the project on time, from
section 2 only 3% of the students does not submit the project on time, and from
section 3 only 4% of the students does not submit the project on time. If the three
sections were given 50%, 30%, and 20% of the work respectively, find the
following:
a. The probability that part of the project will not be submitted on time (Late).
27
= 0.027
1000
b. If part of the project was not submitted on time, what is the probability that
0.009 1
it was from section 2? = = 0.3333
0.027 3
Raid Anabosi 24 of 24 STAT 319–Ch.2

2-8 RANDOM VARIABLES


Quite often for a reason or another we need to associate real numbers to the
outcomes of a random experiment.
A random variable (r.v.): Represents a possible numerical value from a random
experiment. In other words, it is a real-valued function defined on the sample
space. That is assigning a real number to every elementary event in the sample
space, and it is denoted by X, Y, Z. X: S R.

A random variable is denoted by an upper case letter such as X. After an


experiment is conducted, the measured value of the random variable is denoted
by a lowercase letter such as x = 70 milli amperes.

There are two classes of random variables:


1. Discrete random variables are associated with finite (or countable infinite)
ranges.
Examples: number of scratches on a surface, proportion of defective parts
among 1000 tested, number of transmitted bits received in error.
2. Continuous random variables are associated with intervals (either finite or
infinite) of real numbers for its range.
Examples: electric current, length, temperature, time, voltage, weight.

Discrete random variable. Continuous random variable.

You might also like