Proposition 1.1 De Moargan’s Laws

Download Report

Transcript Proposition 1.1 De Moargan’s Laws

Chapter 4. Probability: The Study of
Randomness
http://mikeess-trip.blogspot.com/2011/06/gambling.html
1
Uses of Probability
• Gambling
• Business
– Product preferences of consumers
– Rate of returns on investments
• Engineering
– Defective parts
• Physical Sciences
– Locations of electrons in an atom
• Computer Science
– Flow of traffic or communications
2
4.1: Randomness - Goals
• Be able to state why probability is useful.
• Be able to state what randomness and probability
mean.
• Be able to identify where randomness occurs in
particular situations.
• Be able to state when trials are independent.
3
Trial and Experiment
• Trial
• Experiment
4
Random and Probability
• We call a phenomenon random if individual
outcomes are uncertain but there is
nonetheless a regular distribution of
outcomes in a large number of repetitions.
• The probability of any outcome of a chance
process is the proportion of times the
outcome would occur in a very long series of
repetitions.
5
Frequentist Interpretation
6
Independent
• Independent: the outcome of each situation is
not influenced by the result of the previous
trial
• Example
a) What is the probability of drawing a heart?
b) What is the probability that I will draw a
heart on the second draw?
7
4.2: Probability Models - Goals
• Be able to write down a sample space in specific
circumstances.
• Be able to state and apply the five probability rules
(this goal will reappear later)
• Be able to determine what type of probability is
given in a certain situation.
• Be able to assign probabilities assuming an equally
likelihood assumption.
8
Probability Models
• The sample space S of a chance process is the
set of all possible outcomes.
• An event is an outcome or a set of outcomes
of a random phenomenon. That is, an event is
a subset of the sample space.
• A probability model is a description of some
chance process that consists of two parts: a
sample space S and a probability for each
outcome.
9
Sample Space
What is the sample space in the following
situations? Are each of the outcomes equally
likely?
a) I roll one 4-sided die.
b) I roll two 4-sided dice.
c) I toss a coin until the first head appears.
d) A mortgage can be classified as fixed rate (F) or
variable (V) and we are considering 2 houses.
e) The number of minutes that a college student
uses their cell phone in a day.
10
Probability Rules
Rule 1. The probability P(A) of any event A
satisfies 0 ≤ P(A) ≤ 1.
Rule 2. If S is the sample space in a probability
model, then P(S) = 1.
Rule 3. addition rule for disjoint events: If A and
B are disjoint, P(A or B) = P(A) + P(B).
Rule 4: The complement of any event A is the
event that A does not occur, written AC.
P(AC) = 1 – P(A).
11
Examples: Probability Rules
Additivity:
a) Roll two 4-sided dice: What is the probability
that the sum is 2 or 3?
b) Mortgage: What is the probability that both
houses have the same type of mortgage?
12
Examples: Probability Rules
Compliment:
c) Roll two 4-sided dice: What is the probability
that the sum is greater than 2?
d) Mortgage: What is the probability that both
houses do not have fixed mortgages?
13
Types of Probabilities
• Subjective
• Empirical
𝑛𝑢𝑚𝑏𝑒𝑟 𝑜𝑓 𝑡𝑖𝑚𝑒𝑠 𝑡ℎ𝑎𝑡 𝐴 𝑜𝑐𝑐𝑢𝑟𝑠
𝑃 𝐴 =
𝑡𝑜𝑡𝑎𝑙 𝑛𝑢𝑚𝑏𝑒𝑟 𝑜𝑓 𝑡𝑖𝑚𝑒𝑠
• Theoretical (equally likely)
𝑛𝑢𝑚𝑏𝑒𝑟 𝑜𝑓 𝑜𝑢𝑡𝑐𝑜𝑚𝑒𝑠 𝑖𝑛 𝐴
𝑃 𝐴 =
𝑛𝑢𝑚𝑏𝑒𝑟 𝑜𝑓𝑜𝑢𝑡𝑐𝑜𝑚𝑒𝑠 𝑖𝑛 𝑆
14
Example: Types of Probabilities
For each of the following, determine the type of
probability and then answer the question.
1) What is the probability of rolling a 2 on a fair
4-sided die?
2) What is the probability of having a girl in the
following community?
Girl 0.52
Boy 0.48
3) What is the probability that Purdue Men’s
Basketball team will beat IU later this
season?
15
Examples: Legitimate Probabilities
Which of the following probabilities are
legitimate? Why or why not?
Outcome #1
#2
#3
#4
#5
1
2
3
4
0
0.1
0.5
0.4
0.1
0.1
0.1
0.1
0.5
-0.2
0.3
0.4
1.1
0.1
0.1
0.1
0.25
0.25
0.25
0.25
16
Probability Rules
Rule 5. Multiplication Rule for Independent
Events.
Two events A and B are independent if knowing
that one occurs does not change the
probability that the other occurs.
If A and B are independent:
P(A and B) = P(A)  P(B)
17
Example: Independence
Are the following events independent or
dependent?
1) Winning at the Hoosier (or any other) lottery.
2) The marching band is holding a raffle at a
football game with two prizes. After the first
ticket is pulled out and the winner
determined, the ticket is taped to the prize.
The next ticket is pulled out to determine the
winner of the second prize.
18
Example: Independence
1. Deal two cards without replacement
A = 1st card is a heart
B = 2nd card is a heart
C = 2nd card is a club.
a) Are A and B independent?
b) Are A and C independent?
2. Repeat 1) with replacement.
19
Disjoint vs. Independent
In each situation, are the following two events
a) disjoint and/or b) independent?
1) Draw 1 card from a deck
A = card is a heart B = card is not a heart
2) Toss 2 coins
A = Coin 1 is a head B = Coin 2 is a head
3) Roll two 4-sided dice.
A = red die is 2
B = sum of the dice is 3
20
Example: Complex Multiplication Rule (1)
The following circuit is in a series. The current
will flow only if all of the lights work. Whether
a light works is independent of all of the other
lights. If the probability that A will work is 0.8,
P(B) = 0.85 and P(C) = 0.95, what is the
probability that the current will flow?
A
B
C
http://www.berkeleypoint.com/learning/parallel_circuit.html
21
Example: Complex Multiplication Rule (2)
The following circuit to the right
is parallel. The current will
flow if at least one of the
lights work. Whether a light
works is independent of all of
the other lights. If the
probability that A will work is
0.8, P(B) = 0.85 and P(C) =
0.95, what is the probability
that the current will flow?
http://www.berkeleypoint.com/learning/parallel_circuit.html
A
B
C
22
Example: Complex Multiplication Rule (3)
A diagnostic test for a certain disease has a
specificity of 95%. The specificity is the same as
true negative, that is the test is negative when the
person doesn’t have the disease.
a) What is the probability that one person has a
false positive (the test is positive when they don’t
have the disease)?
b) What is the probability that there is at least one
false positive when 50 people who don’t have the
disease are tested?
23
4.3: Random Variables - Goals
• Be able to define what a random variable is.
• Describe the probability distribution of a discrete
random variable.
• Use the distribution of a discrete random variable
to calculate probabilities of events.
• Describe the probability distribution of a
continuous random variable.
• Use the distribution of a continuous random
variable to calculate probabilities of events.
24
Random Variables
• A random variable takes numerical values that
describe the outcomes of some chance
process.
• The probability distribution of a random
variable gives its possible values and their
probabilities.
25
Discrete Random Variables
• A discrete random variable X takes a fixed set
of possible values with gaps between.
• They are usually displayed in table form
value
x1
x2
…
probability p1
p2
…
• These probabilities must satisfy the following:
1. 0 ≤ pi ≤ 1
2. Sum of all the pi’s is 1
26
Examples: Probability Histograms
Probability
0.6
#1
0.4
0.2
1E-15
1
-0.2
3
4
Outcomes
0.6
Probability
2
#2
0.4
0.2
0
1
2 Outcomes 3
4
27
Example: Discrete Random Variable
In a standard deck of cards, we want to know
the probability of drawing a certain number of
spades when we draw 3 cards. Let X be the
number of spades that we draw.
a) What is the distribution?
b) What is the probability that you draw at least
1 spade?
c) What is the probability that you draw at least
2 spades?
28
Probability
Example: Discrete (cont.)
0.6
0.5
0.4
0.3
0.2
0.1
0
Spades Example
0
1
2
3
Number of Spades
29
Normal Distribution: Example
A particular rash has shown up in an elementary
school. It has been determined that the length of
time that the rash will last is normally distributed
with mean 6 days and standard deviation 1.5 days.
a) What is the percentage of students that have the
rash for longer than 8 days?
b) What is the percentage of students that the rash
will last between 3.7 and 8 days?
30
4.4: Means and Variances of Random
Variables - Goals
• Be able to use a probability distribution to find the
mean of a discrete (or continuous) random variable.
• Be able to use the law of large numbers to describe
the behavior of the sample mean.
• Calculate means using the rules for means.
• Be able to use a probability distribution to find the
variance of a discrete (or continuous) random
variable.
• Calculate variances using the rules for variances for
both correlated and uncorrelated random variables.
31
Formulas for the Mean of a Random
Variable
• Discrete
𝐸 𝑋 = 𝜇𝑋 =
𝑥𝑖 𝑝𝑖
𝑖
32
Example: Expected value
What is the expected value of the following:
a) A fair 4-sided die
X
1
2
3
4
Probability 0.25 0.25 0.25 0.25
33
Statistical Estimation
What would happen if we took many samples?
Population
Sample
Sample
Sample
Sample
Sample
Sample
Sample
?
Sample
34
Law of Large Numbers
• Draw independent observations at random
from any population with finite mean µ. The
law of large numbers says that, as the number
of observations drawn increases, the sample
mean of the observed values gets closer and
closer to the mean µ of the population.
• Our intuition doesn’t do a good job of
distinguishing random behavior from
systematic influences. This is also true when
we look at data.
35
Rules for Means
Rule 1: If X is a random variable and a and b are
fixed numbers, then:
µa+bX = a + bµX
Rule 2: If X and Y are random variables, then:
µXY = µX  µY
Rule 3: If X is a random variable and g is a function
of X, then:
𝐸 𝑔 𝑋
=
𝑔(𝑥𝑖 )𝑝𝑖
36
Example: Expected Value
An individual who has automobile insurance form a
certain company is randomly selected. Let X be the
number of moving violations for which the individual
was cited during the last 3 years. The distribution of X
is
X
0
1
2
3
px
0.60
0.25
0.10
0.05
a) Verify that E(X) = 0.60.
b) If the cost of insurance depends on the following
function of accidents, g(y) = 400 + (100y -15), what
is the expected value of the cost of the insurance?
37
Example: Expected Value
Five individuals who have automobile insurance from a
certain company are randomly selected. Let X and Y be
two different accident profiles in this insurance company:
X
px
0
0.60
1
0.25
2
0.10
3
0.05
Y
pY
0
0.40
1
0.35
2
0.15
3
0.10
E(X) = 0.60
E(Y) = 0.95
c) What is the expected value the total number of
accidents of the people if 2 of them have the
distribution in X and 3 have the distribution in Y?
38
Example: Expected value
An individual who has automobile insurance
form a certain company is randomly selected.
Let X be the number of moving violations for
which the individual was cited during the last 3
years. The distribution of X is
X
px
0
0.60
1
0.25
2
0.10
3
0.05
d) Calculate E(X2).
39
Variance of a Random Variable
𝑠2 =
𝑛
𝑖=1
𝑥𝑖 − 𝑥
𝑛−1
2
Var(X) = E X − 𝜇𝑋
2
=
(𝑥𝑖 − X )2 ∙ 𝑝𝑖
= E(X2) – (E(X))2
𝜎𝑋 =
𝑉𝑎𝑟(𝑋)
40
Example: Variance
An individual who has automobile insurance
form a certain company is randomly selected.
Let X be the number of moving violations for
which the individual was cited during the last 3
years. The distribution of X is
X
px
0
0.60
1
0.25
2
0.10
3
0.05
e) Calculate Var(X).
41
Rules for Variance
Rule 1: If X is a random variable and a and b are
fixed numbers, then:
σ2a+bX = b2σ2X
Rule 2: If X and Y are independent random
variables, then:
σ2XY = σ2X + σ2Y
Rule 3: If X and Y have correlation ρ, then:
σ2XY = σ2X + σ2Y  2ρσXσY
42
Correlation
(x


r
 x)(y i  y)
i
n  1 s XsY
(x


i
  X )(yi   Y )p X,Y 
XY
43
Example: Variance
An individual who has automobile insurance form a
certain company is randomly selected. Let X be the
number of moving violations for which the individual was
cited during the last 3 years. The distribution of X is
X
px
0
0.60
1
0.25
2
0.10
3
0.05
a) Calculate the variance of this distribution.
b) If the cost of insurance depends on the following
function of accidents, g(y) = 400 + (100y -15), what is
the standard deviation of the cost of the insurance?
44
Example: Variance
5 individuals who have automobile insurance from a
certain company are randomly selected. Let X and Y be
two different independent accident profiles in this
insurance company:
X
0
1
2
3
px
0.60
0.25
0.10
0.05
Y
pY
0
0.40
1
0.35
2
0.15
3
0.10
Var(X) = 0.74
Var(Y) = 0.95
What is the standard deviation of the difference between
the 2 who have insurance using the X distribution and
the 3 who have insurance using the Y distribution?
45
4.5: General Probability Rules - Goals
•
•
•
•
•
•
•
Apply the five rules of probability (again).
Apply the generation addition rule.
Be able to calculate conditional probabilities.
Apply the general multiplication rule.
Be able to use tree diagram.
Use Bayes’s rule to find probabilities.
Determine if two events with positive probability
are independent.
46
Probability Rules
Rule 1. The probability P(A) of any event A
satisfies 0 ≤ P(A) ≤ 1.
Rule 2. If S is the sample space in a probability
model, then P(S) = 1.
Rule 3. If A and B are disjoint,
P(A or B) = P(A) + P(B).
Rule 4: For any event A, P(AC) = 1 – P(A).
Rule 5: If A and B are independent:
P(A and B) = P(A) P(B)
47
General Addition Rule
P(A or B) = P(A) + P(B) – P(A and B)
Select a card at random from a deck of cards.
What is the probability that the card is either
an Ace or a Heart?
48
Example: Venn Diagrams
At a certain University, the probability that a
student is a math major is 0.25 and the
probability that a student is a computer science
major is 0.31. In addition, the probability that a
student is a math major and a student science
major is 0.15.
a) What is the probability that a student is a math
major or a computer science major?
b) What is the probability that a student is a
computer science major but is NOT a math
major?
49
Conditional Probability
http://stats.stackexchange.com/questions/
423/what-is-your-favorite-data-analysis-cartoon
50
Conditional Probability: Example
A news magazine publishes three columns entitled "Art"
(A), "Books" (B) and "Cinema" (C). Reading habits of a
randomly selected reader with respect to these
columns are
Read
A
B
C
A and B A and C B and C
Regularly
Probability 0.14 0.23 0.37 0.08
0.09
0.13
a) What is the probability that a reader reads the Art
column given that they also read the Books column?
b) What is the probability that a reader reads the Books
column given that they also read the Art column?
51
Example: General Multiplication Rule
Suppose that 8 good and 2 defective fuses have
been mixed up. To find the defective fuses we
need to test them one-by-one, at random.
Once we test a fuse, we set it aside.
a) What is the probability that we find both of
the defective fuses in the first two tests?
b) What is the probability that when testing 3 of
the fuses, the first tested fuse is good and the
last two tested are defective?
52
Independence Revisited
General multiplication rule:
P(A and B) = P(A) P(B|A)
If A and B are independent:
P(A and B) = P(A)  P(B)
Therefore, if A and B are independent:
P(B|A) = P(B)
53
Example: Tree Diagram/Bayes’s Rule
A diagnostic test for a certain disease has a 99%
sensitivity and a 95% specificity. Only 1% of the
population has the disease in question. If the
diagnostic test reports that a person chosen at
random from the population tests positive, what
is the probability that the person does, in fact,
have the disease?
54
Bayes’s Rule
• Suppose that a sample space is decomposed
into k disjoint events A1, A2, … , Ak —none of
which has a 0 probability—such that
𝑘
𝑃(𝐴𝑖 ) = 1
𝑖=1
• Let B be any other event such that P(B) is not
0. Then
𝑃 𝐵 𝐴𝑗 𝑃(𝐴𝑗 )
𝑃 𝐴𝑗 𝐵 = 𝑘
𝑖=1 𝑃(𝐵|𝐴𝑖 )𝑃(𝐴𝑖 )
55
Law of Total Probability
1
4
3
B and 4
B and 3
5
6
B and 6
B and 7
2
7
B
56