Download 684.71 KB - KFUPM Resources v3

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts

History of statistics wikipedia , lookup

Statistics wikipedia , lookup

Inductive probability wikipedia , lookup

Birthday problem wikipedia , lookup

Ars Conjectandi wikipedia , lookup

Probability interpretations wikipedia , lookup

Probability wikipedia , lookup

Transcript
Raid Anabosi
1 of 15
STAT 319–Ch.3
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 15
STAT 319–Ch.3
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.
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:
Raid Anabosi
3 of 15
STAT 319–Ch.3
Let S  e1 ,e 2 ,...,e8  and E1  e1 , e3 , e5 , e7  , E2  e2 , e4 , e6 , e8  , are the two event
Mutually exclusive? Why?
Answer: Yes, because E1 ∩ E2 = φ = { }.
Example 6:
Drawing one card from a 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}
Writing the sample space using a tree diagram:
Example 7:
Tossing a coin two times, write
the sample space using a tree
diagram.
H
H
T
START
So the sample space is:
S = {(H,H),(H,T),(T,H),(T,T)}
T
H
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
Black 2
2
Red
Total 4
Not Ace
24
24
48
Total
26
26
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
Raid Anabosi
4 of 15
STAT 319–Ch.3
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}
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 true-false 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.
Raid Anabosi
5 of 15
STAT 319–Ch.3
Referring back to example 1 above, we can generalize according to the following
theorem:
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
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!

n Cr    
r!
r ! n  r !
r
Example 5:
In how many different ways can 3 of 20 lab assistants be chosen to assist with an
experiment?
Raid Anabosi
6 of 15
STAT 319–Ch.3
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 = 7!×9!/(2!×5!×3!×6!) = 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 2 defective parts?
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.
Assuming all the outcome are equally likely, the chance of occurrence of
the event E is defined by the equation: If: Ei = {e1, e2, e3,…,em}, then
P(Ei) = 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
Probability of event =
Number of times the event occurrs
f

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:
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
Raid Anabosi
7 of 15
STAT 319–Ch.3
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 an the other will not.
Answer: O: Operating, N: Not operating
a. P(2O) = 8C2/10C2 = (8/10)×(7/9) = 56/90 = 0.622
b. P(O,N) = (8/10)×(2/9) = 16/90 = 0.178
c. P(1O) = 8C1×2C1/10C2 = 2×(8/10)×(2/9) = 32/90 = 0.356
Example 3:
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 4:
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
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:
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:
Raid Anabosi
8 of 15
STAT 319–Ch.3
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):
1. P(A) = 1/3, P(B) = 1/3, and P(C ) = 1/3. valid
2. P(A) = 0.64, P(B) = 0.38, and P(C ) = – 0.02. not valid
3. P(A) = 0.35, P(B) = 0.52, and P(C ) = 0.26. not valid
4. 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,


Ei  = 0 and
 i 1 
If E1, E2, …, Ek are mutually exclusive, then P 
k
P(
i 1
Ei ) =
k
k
 P(E )
i 1
i
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
Raid Anabosi
9 of 15
STAT 319–Ch.3
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 children, the following table is obtained:
Weight
2.5 - 3 kg
> 3 kg
Gender < 2.5 kg
Boy
4
35
10
49
Girl
3
22
6
31
7
57
16
80
a. Based on the relative frequency assessment method, what is the
probability that a child is a boy?
b. What is the probability that a child is over weight?
c. What is the joint probability that a child is a girl and her weight is between
2.5 and 3 kg?
d. Suppose a child was chosen at random. Consider the two events: the event
that a boy was chosen and the event that over weight was chosen. Are
these two events mutually exclusive? Explain.
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.
Example 3:
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.
a. What is the probability that a car has a CD player, given that it has AC?
b. What is the probability that a car with no CD and no AC?
c. What is the probability that a car with no CD but with AC?
Answer: P(AC)=0.7, P(CD)=0.4, P(AC∩CD)=0.2
a. P(CD|AC)= P(AC∩CD)/P(AC)=0.2/0.7=0.287
b. P(CD’∩AC’)=0.1
c. P(CD’∩AC)=0.5
2-4 CONDITIONAL PROBABILITY
Conditional probability for any two events A , B:
P( A|B) 
Example 1:
P( A  B)
where P  B  0
P( B)
Raid Anabosi
10 of 15
STAT 319–Ch.3
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:
Defective
D
D'
Total
F
10
30
40
Surface Flaws
F'
18
342
360
Total
28
372
400
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?
b. have surface Flaws given that they are non-Defectives?
Answer:
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) = ∑
(
= P(B|E1) P( E1) + P(B|E2) P( E2) + … + P(B|Ek) P( Ek) = ∑
) ( )
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
Raid Anabosi
11 of 15
STAT 319–Ch.3
 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
b. P  E1   .1+.1+.01+.01 = 0.22
c. P  E3   .1+.1+.05+.43 = 0.68
d. P  E4   1 – (.15+.01+.01) = 1 – 0.17 = 0.83
e. P  E1 or E3   0.22 + 0.68 – 0.2 = 0.7
f. P  E1 or E2   0.22 + 0.78 – 0 = 1
g. P  E1 or E3   1 – 0.7 = 0.3
h. P  E1 E3   0.2 / 0. 68 = 0.294
i. Are E1 and E4 independent? Explain. No
Example 2:
Tossing a coin two times, such that P{H} = 2/3. Defined the events:
F = heads on first flip of the coin
C = heads on second flip of same coin
a. Are the two events independent?
b. What is the probability of getting both heads?
c. What is the probability of getting only one head?
Example 3:
Historically, on a certain day the weather in certain city has the following
distribution:
Raid Anabosi
12 of 15
STAT 319–Ch.3
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
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)
b. P(J,S)+P(J,F)+P(J,J)= 2C1×5C1×/10C2=
c.
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
256
940
1196
S
340
784
1124
J
596
1724
2320
Total
If a student is randomly selected, find the following
a. The probability that the student is from the eastern province.
b. The probability that the student is a sophomore.
c. The probability that the student is a sophomore, given that he is from the
eastern province.
Example 6:
Raid Anabosi
13 of 15
STAT 319–Ch.3
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.
b. Business conditions will be good this year and bad next year.
c. Business conditions will be bad both years.
d. Business conditions will be good next year.
e. Given that business conditions are good next year, what is the probability
that they were good this year?
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:
0.010
0.001
Probability of Failure 0.100
High
Medium Low
Contamination level
If in a particular production run, 20% of chips are subjected to High levels of
contamination and 30% are subjected to Medium level. What is the probability a
randomly selected chip from that run fails?
Answer:
Probability of Failure
Probability of contamination
Contamination level
Product
0.100
0.010
0.001
High
Medium
Low
Bayes theorem is used to revise previously calculated probabilities based on new
information
From the given diagram
Raid Anabosi
E1
14 of 15
STAT 319–Ch.3
E2
Ek
B
P(E j |B) 
P(E j  B)
P( B)

P( B|E j )P(E j )
k
 P(B|E )P(E )
i 1
i
i
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:
1. The probability that part of the project will not be submitted on time.
2. If part of the project was not submitted on time, what is the probability that
it was from section 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.
Raid Anabosi
15 of 15
STAT 319–Ch.3
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.