68f78b 273dde47e9234003ae689f26d2b5db32

advertisement
MATH2411
Applied Statistics
Tutorial Notes 1
A brief summary of course materials:
(1) Sample Space S, Sample Point
(2) Event A; A0 — the Complement of an event A ; Φ — the Empty Set
(3) Intersection of Events; Disjoint and Mutually Exclusive of events
Example 1 (Box-plot)
(a) Produce a box-plot with the following sorted data given:
9, 11, 13, 15, 17, 19, 21, 23, 25, 27, 139
13 + 15
3rd data + 4th data
=
= 14
2
2
11 × 0.5 + 0.5 = 6 so median = 6th data = 19
23 + 25
8th data + 9th data
=
= 24
11 × 0.75 + 0.5 = 8.75 so UQ =
2
2
11 × 0.25 + 0.5 = 3.25 so LQ =
(4) Union of Events; Exhaustive Events
1.5 IQR = 1.5(24 − 14) = 15
(5) Associative Law: A ∪ (B ∪ C) = (A ∪ B) ∪ C
A ∩ (B ∩ C) = (A ∩ B) ∩ C
so (LQ − 1.5IQR) = −1 and (UQ + 1.5IQR) = 39
(6) Distributive Law: A ∩ (B ∪ C) = (A ∩ B) ∪ (A ∩ C)
A ∪ (B ∩ C) = (A ∪ B) ∩ (A ∪ C)
the largest data smaller than 39 is 27,
(7) De Morgan’s Law: (A ∪ B)0 = A0 ∩ B 0
(A ∩ B)0 = A0 ∪ B 0
(8) For any event A: P (Φ) = 0 6 P (A) 6 1 = P (S)
(9) For any event A, B and C:
P (A ∪ B) = P (A) + P (B) − P (A ∩ B)
P (A ∪ B ∪ C) = P (A) + P (B) + P (C) − P (A ∩ B) − P (B ∩ C) − P (C ∩ A)
+P (A ∩ B ∩ C)
In general, what can you say about the probability of a family of events
P (A1 ∪ A2 ∪ A3 ∪ · · · ∪ An ) =?
(10) If A, B and C are mutually exclusive events, then
P (A ∪ B) = P (A) + P (B)
P (A ∪ B ∪ C) = P (A) + P (B) + P (C)
How about the probability of a family of mutually exclusive events
P (A1 ∪ A2 ∪ A3 ∪ · · · ∪ An ) =?
(11) If A, B are exhaustive events, then P (A ∪ B) = P (S) = 1.
The smallest data larger than −1 is 9 while
so the outlier is 139.
(b) Find the sample mean, median, variance, standard deviation, and IQR of the
given data.
Mean =
319
1
(9 + 11 + 13 + 15 + 17 + 19 + 21 + 23 + 25 + 27 + 139) =
= 29
11
11
Variance =
1
{[(9 − 29)2 + (11 − 29)2 + · · · + (27 − 29)2 ] + (139 − 29)2 }
10
1
[(102 + 82 + · · · + 22 ) + 1102 ]
10
= 1344
=
Example 2 (Counting Principle)
In a poker hand consisting of 5 cards, find the probability of holding
(a) 3 aces;
Required prob. =
(12) For a natural number n, the Factorial Notation is defined as:
n! = n · (n − 1) · (n − 2) · · · 3 · 2 · 1, where 0! = 1.
(13) Number of Permutations of n distinct objects taken r(r 6 n) at a time:
n!
Prn =
= n · (n − 1) · (n − 2) · · · (n − r + 1)
(n − r)!
(14) Number of Combinations of n distinct objects taken r(r 6 n) at a time:
n!
Pn
= r
Crn =
(n − r)!r!
r!
52−4
C34 C5−3
=
C552
48×47
2
52×51×50×49×48
5×4×3×2×1
4×
=
94
47
=
13 × 17 × 10 × 49
54145
(b) 4 hearts and 1 club.
Required prob. =
C413 C113
=
C552
13×12×11×10
× 13
4×3×2×1
52×51×50×49×48
5×4×3×2×1
=
13 × 12 × 11 × 13
143
=
52 × 51 × 49 × 48
39984
Example 3 (Venn Diagram)
In a high school graduating class of 100 students, 54 studied mathematics, 69 studied
history, and 35 studied both mathematics and history. If one of these students is
selected at random, find the probability that
(d) list the elements corresponding to the event A ∩ C;
{(5, 4), (5, 5), (5, 6), (6, 3), (6, 4), (6, 5), (6, 6)}
(a) the student took mathematics or history;
P (M ∪ H) = P (M ) + P (H) − P (M ∩ H) = 0.54 + 0.69 − 0.35 = 0.88
(e) list the elements corresponding to the event A ∩ B;
∅
(b) the students did not take either of these subjects;
P (M 0 ∩ H 0 ) = P ((M ∪ H)0 ) = 1 − P (M ∪ H) = 1 − 0.88 = 0.12
(f) list the elements corresponding to the event B ∩ C;
{(5, 2), (6, 2)}
(c) the student took history but not mathematics.
P (H \ M ) = P (H \ (H ∩ M )) = P (H) − P (H ∩ M ) = 0.69 − 0.35 = 0.34
Exercise 1
An experiment involves tossing a pair of dice , 1 green and 1 red, and recording the
numbers that come up. If x equals the outcomes on the green die and y the outcome
on the red die, then:
Denote (G, R) as the numbers coming up from the green and red dices.
(a) list the elements corresponding to the event A that the sum is greater than 8;
{(3, 6), (4, 5), (4, 6), (5, 4), (5, 5), (5, 6), (6, 3), (6, 4), (6, 5), (6, 6)}
(b) list the elements corresponding to the event B that a 2 occurs on either die;
{(1, 2), (2, 1), (2, 2), (2, 3), (2, 4), (2, 5), (2, 6), (3, 2), (4, 2), (5, 2), (6, 2)}
(c) list the elements corresponding to the event C that a number greater than 4
comes up on the green die;
{(5, 1), (5, 2), (5, 3), (5, 4), (5, 5), (5, 6), (6, 1), (6, 2), (6, 3), (6, 4), (6, 5), (6, 6)}
(g) construct a Venn diagram to illustrate the intersections of the events A,B and C.
Exercise 2
The probability that an American industry will locate in Munich is 0.6, the probability
that it will locate in Brussels is 0.3, and the probability that it will locate in both
Munich and Brussels is 0.15. What is the probability that the industry will locate:
Operations of Probabilities and Basic Counting Principles
A brief summary of course materials:
(1) Let A and B be two events in a sample space S with P (B) > 0.
The Conditional Probability of A given B is defined as
(a) in either cities?
Required probability = (0.6 − 0.15) + (0.3 − 0.15) = 0.6
P (A|B) =
P (A ∩ B)
P (B)
(2) Let A and B be two events in a sample space S. A and B are called
independent if P (A ∩ B) = P (A)P (B).
(b) in neither city?
Required probability = 1 − P (in Munich ∪ in Brussels)
= 1 − (P (in Munich + P (in Brussels) − P (in both))
(3) The following statements are equivalent:
(i) A and B are independent;
= 1 − (0.6 + 0.3 − 0.15)
(ii) A0 and B are independent;
= 1 − 0.75
(iii) A and B 0 are independent;
(iv) A0 and B 0 are independent.
= 0.25
(4) Let B1 , B2 , · · · , Bn be a partition (both exhaustive and mutually exclusive)
Exercise 3
If 3 books are picked at random from a shelf containing 5 novels, 3 books of poems,
and a dictionary, what is the probability that
There are (5 + 3 + 1) = 9 books in total.
of the sample space S such that P (Bi ) 6= 0 for all i.
Then for an event A:
n
n
X
X
P (A) =
P (A ∩ Bi ) =
P (A|Bi )P (Bi ) (Law of total probability)
i=1
i=1
(a) the dictionary is selected?
C 9−1 C 1
Required probability = 3−1 9 1 =
C3
8×7
2
9×8×7
3×2×1
1
=
3
(b) 2 novels and 1 book of poems are selected?
C5 C3
Required probability = 2 9 1 =
C3
5×4
×3
2
9×8×7
3×2×1
=
5
14
and for all i = 1, 2, 3, · · · , n :
P (Bi |A) =
P (A|Bi )P (Bi )
P (A|Bi )P (Bi )
= Pn
(Bayes’ Theorem)
P (A)
j=1 P (A|Bj )P (Bj )
Example 4 (Permutation of class of indistinguishable objects)
Suppose that Kitty’s ITSC password consists of 3 letter ”K”s, 2 letter ”I”s, 5 letter
”T”s and 4 letter ”Y”s. In how many times can one be guaranteed to crack her
password?
Number of permutations =
(3 + 2 + 5 + 4)!
14 × 13 × 12 × 11 × 10 × 9 × 8 × 7 × 6
=
3! 2! 5! 4!
6 × 2 × 24
= 14 × 1001 × 10 × 9 × 2
= 2522520
Example 5 (Condition Probability)
In the seniors year of a high school graduating class of 100 students, 42 studied
mathematics, 68 studied psychology, 54 studied history, 22 studied both mathematics
and history, 25 studied both mathematics and psychology, 7 studied history but
neither mathematics or psychology, 10 studied all three subjects, and 8 did not take
any of the three.
(b) a wife watches the show given that her husband does;
Required probability = P (W |M ) =
P (M ∩ W )
0.35
=
= 0.875
P (M )
0.4
If a student is selected at random, find the probability that:
(a) a person enrolled in psychology takes all three subjects;
P (M ∩ P s ∩ H|P s) =
10/100
10
5
P ((M ∩ P s ∩ H) ∩ P s)
=
=
=
P (P s)
68/100
68
34
(c) at least 1 person of a married couple will watch the show.
Required probability = P (M ∪ W )
= P (M ) + P (W ) − P (M ∩ W )
= 0.3 + 0.4 − 0.35 = 0.55
(b) a person not taking psychology is taking both history and mathematics.
P (M ∩ H|P s 0 ) =
P ((M ∩ H) ∩ P s 0 )
(22 − 10)/100
12
3
=
=
=
0
P (P s )
(100 − 68)/100
32
8
Example 7 (Bayes’ Theorem)
Alice has two coins in her pocket, a fair coin (head on one side and tail on the other
side) and a two-headed coin. She picks one at random from her pocket, tosses it and
obtains head. What is the probability that she flipped the fair coin?
Required probability = P (fair|H) =
Example 6 (Conditional Probability)
The probability that a married man watches a certain television show is 0.4 and the
probability that a married woman watches the show is 0.5. The probability that a
man watches the show, given that his wife does, is 0.7. Find the probability that
=
=
(a) a married couple watches the show;
P (a Men & his Wife watch) =
P (a Men & his Wife watch)
× P (Wife watches)
P (Wife watches)
= P (Men watches|Wife watches)×P (Wife watches)
= 0.7 × 0.5
P (fair ∩ H)
P (H)
P (fair ∩ H)
P (fair ∩ H) + P (two-headed ∩ H)
1
2
×
1
2
×
1
2
+
1
4
3
4
=
=
1
2
1
3
1
2
Example 8 (Bayes’ Theorem)
An HIV test gives a positive result with probability 98% when the patient is indeed
affected by HIV, while it gives a negative result with 99% probability when the
patient is not affected by HIV.
Given that 0.1% of the population are affected by HIV.
(a) What is the probability that the test result is correct?
Required probability = P (affected ∩ correct) + P (not affected ∩ correct)
= P (affected)P (correct|affected) + P (not affected)P (correct|not affected)
= P (affected)P (+ve|affected) + P (not affected)P (−ve|not affected)
= 0.1% · 98% + (1 − 0.1%) · 99%
Example 9 (Bayes’ Theorem)
Police plan to enforce speed limits by using radar traps at 4 different locations within
the city limits. The radar traps at each of the locations L1 , L2 , L3 , and L4 are
operated 40%, 30%, 20%, and 30% of the time, and if a person who is speeding on
his way to work has probabilities of 0.2, 0.1, 0.5, and 0.2, respectively, of passing
through these locations. Suppose that he will pass and only pass through one of these
locations.
Denote by R the event that the man receives a ticket.
(a) What is the probability that he will receive a speeding ticket?
P (R) = P (R ∩ L1 ) + P (R ∩ L2 ) + P (R ∩ L3 ) + P (R ∩ L4 )
= P (R|L1 )P (L1 ) + P (R|L2 )P (L2 ) + P (R|L3 )P (L3 ) + P (R|L4 )P (L4 )
= 0.4 · 0.2 + 0.3 · 0.1 + 0.2 · 0.5 + 0.3 · 0.2
= 98.999%
= 0.27
(b) A person is randomly drawn from the population and he is found positive, what
is the probability that he is affected by HIV?
Required probability = P (affected|positive)
=
P (affected ∩ positive)
P (positive)
=
P (affected ∩ positive)
P (affected ∩ positive) + P (not affected ∩ positive)
=
0.1% · 98%
0.1% · 98% + (1 − 0.1%) · (1 − 99%)
98
1097
≈ 8.9%
=
(b) If he received a speeding ticket on his way to work, what is the probability that
he passed through the radar trap located at L2 ?
P (L2 |R) =
0.3 · 0.1
1
P (L2 ∩ R)
=
=
P (R)
0.27
9
Exercise 4 (2010 Spring Midterm)
A robot manufacturer produces robots which contain hundreds of circuits. From years
of production, it’s known that 2 out of 1000 robots are defective. For a certain test
method, if a robot is not defective, the test is negative 97% of the time, while if a
robot is defective, the test is positive 99.5% of the time.
Exercise 5 (2011 Spring Midterm)
A conservative university decided to test all 10000 students for hard drug use and all
students agreed to take the test. 99% of hard drug users will get positive result. If
a student does not use hard drugs, there is a 5% chance that the test will come up
positive. Suppose 2% of the students are hard drug users.
Denote by D the event that the robot is defective.
(a) How many students will get a positive result?
(a) What is the probability that a randomly selected robot will get a negative result?
Method 1
The number of students getting a positive result is:
P (−ve) = P (−ve|D) · P (D) + P (−|D0 ) · P (D0 )
(10000 · 2%) · 99% + (10000 − 10000 · 2%) · 5%
= 0.005 · 0.002 + 0.97 · 0.998
= 200 · 0.99 + 9800 · 0.05
= 0.96807
= 198 + 490 = 688
Method 2
Denote by H the event that the student is a hard drug user;
P (+ve) = P (+ve |H) · P (H) + P (+ve |H 0 ) · P (H 0 )
= 0.99 · 0.02 + 0.05 · 0.98 = 0.0688
(b) If a randomly selected robot gets a positive result, what is the probability that it
is defective?
P (D| + ve) =
=
∴ the number of students getting a positive result is 10000 × 0.0688 = 688
P (D ∩ +ve)
P (+ve)
P (+ve|D) · P (D)
1 − P (−ve)
(b) What percentage of those students who were tested positive are actually not
hard drug users?
Method 1
=
0.995 · 0.002
1 − 0.96807
Method 2
P (H 0 | + ve) =
=
199
3193
Required percentage =
8125
490
× 100% =
% ≈ 71.22%
688
86
P (H 0 ∩ +ve)
P (+ve |H 0 ) · P (H 0 )
0.05 · 0.98
=
=
≈ 71.22%
P (+ve)
P (+ve)
0.0688
≈ 0.0623
(Answers will be available at http://ihome.ust.hk/~makittylee)
Download