Lecture 2
Lecture 2
Lecture 2
Probability
Dr Yufei Huang
Contents
• Set Theory
- Definitions
- Union, Intersection, Compliment
• Probability Theory
- Definitions
- Probability rules
- Conditional probability
- Bayes theorem
Excel
3
Brain Teaser
Q: There are three doors. Behind one of them is a prize. Monty Hall, the
host, asks you to pick a door. Suppose you pick Door #1. Monty opens
one of the other two doors (say Door #3) and show, there is nothing
behind Door #3. He gives you the choice of either sticking with your
original choice, #1, or switching to Door #2.
4
Set Theory
• Definition. A set is a collection of objects, called elements or members.
• Examples:
– R is the set of all real numbers between -∞ and ∞.
– {1,2,4,7} is the set including the numbers 1,2,4,7.
– Intervals are also sets, e.g. all numbers between 3 and 4
– Set of daily prices of the stock of HP during the last year.
6
Set Theory
• Definition. A subset is any collection of elements in a set. An empty set
is a set which contains no elements (Φ).
• Examples
– (3,4] is a subset of R.
– The price of HP’s stock on the first day of each month is a subset
of the set of its daily prices during a year.
– The empty set is a subset of any set.
7
Set Theory: Union
• Union. Let A,B, be two sets. Their union is the
set which includes all elements which are in A or A B
in B. It is denoted by A∪B.
• Example:
A: the set of daily prices of HP’s stock between
A∪B
January and April 2014.
B: the set of HP’s daily prices between March
and May 2014.
A∪B: the set of HP’s daily prices between
January and May 2014.
8
Set Theory: Intersection
• Intersection. Let A,B, be two sets. Their
intersection is the set which includes all A B
elements which are in A and in B. It is denoted
by A∩B. A∩B
• Example:
A: the set of daily prices of HP’s stock between
January and April 2014.
B: the set of HP’s daily prices between March
and May 2014.
A∩B: the set of HP’s prices between March and
April.
9
Set Theory: Compliment
• Example.
D is the set of a survey results.
A is the set of men’s answers.
ഥ is the set of the women’s answers.
A
• Example.
If A={1,2,3}, the set of all subsets consists of:
{ Φ ,{1},{2},{3},{1,2},{1,3},{2,3},{1,2,3}}.
Probability Theory: Definitions
• An experiment is any process or procedure for which more than one outcome is
possible.
• Examples:
– Tossing a coin: Possible outcome: head
– Rolling a die: Possible outcome: 6
– The price of IBM’s stock tomorrow: Possible outcome: $187.81
• Probability Measure is a function P from the set of all of the events of a sample
space Ω to [0,1], which satisfies for all disjoint events
A1, A2,…, An:
- P(A) ≥ 0
- P(A1 ∪ A2 ∪… ∪An)= P(A1) + P(A2) + … + P(An).
- P(Ω) = 1
12
Types of Probability
• Subjective Probability
13
Subjective Probability
• Subjective Probability: Probability values are assigned subjectively by people.
• Example:
- I have a feeling that the probability that IBM’s stock price tomorrow will be
higher than $190 is 80%.
- Someone less optimistic might estimate this probability by 50%.
• Disadvantage: Subjective
- Bilgin (2012) showed that people judge losses to have higher probabilities
than gains
- “It is very likely that this will happen” → Estimate the probability
14
A-priori Classical Probability
• A-priori classical probability: the probability is determined according to a certain
theory.
• Example: Random walk model predicts that the probability that IBM’s stock price
will increase tomorrow is 50%, because according to the random walk model,
the probability of an increase in the price equals to the probability of decrease.
• Advantages:
– May be used to develop theories
– Helps calculations
• Disadvantages:
– One needs a trustworthy theory
15
Empirical Classical Probability
• Empirical classical probability:
– Probability is based on observed data.
Number of cases in which the event occured
P(event) =
The total number of cases
• Example: One monitors a very large number of trading days, e.g. 1000.
and observes, 481 times that the price increased, then Prob.=481/1000=0.481.
• Advantages:
– Does not require a theory
– Based on real data
• Disadvantages:
– Requires collection of data (time, money,…)
– Based on the assumption that probability distributions do not change.
(Is this assumption true?)
16
Exercise
In a marketing survey, 1000 consumers were asked whether they intend to
buy a new product or not, and in a follow-up survey, the same group of
consumers were asked whether they have bought this product. The data is
shown below:
Actually Purchased
Planned to Purchase Yes No Total
17
Solution
Actually Purchased
Planned to Purchase Yes No Total
1. The probability that a person plans to purchase this product within a year is:
18
Probability Rules
1. ഥ)=1
P(A)+P(A
2. P(A ∩B)+P(A∩B ഥ)=P(A)
3. P(A ∪ B) = P(A) + P(B) - P(A ∩ B)
A B
19
Conditional Probability
• Definition: The probability of certain events depends on the
probability of other events.
• Example:
- Fruit and veges depend on the sun.
(http://www.nzherald.co.nz/lifestyle/news/article.cfm?c_id=6&objectid=11723008 )
P(A B)
• If P(B)≠0, then P(A | B) =
P(B)
20
Exercise
In a marketing survey, 1000 consumers were asked whether they intend to
buy a new product or not, and in a follow-up survey, the same group of people
were asked whether they have bought this product. The data is shown below:
Actually Purchased
Planned to Purchase Yes No Total
• What is the probability that a consumer purchased this product given that he or
she planned to purchase?
• What is the probability that a consumer did not purchase this product given
that he or she planned to purchase?
21
Solution
Actually Purchased
Planned to Purchase Yes No Total
22
Bayes Theorem
P(A | B)P(B)
• Bayes' Theorem: P(B | A) =
P(A | B)P(B) + P(A | B )P( B)
• ഥ) and P(B
Purpose: If we know P(A|B),P(B),P(A|B ഥ), then we can calculate P(B|A).
• Example: A factory manager uses quality test to identify defective products. The
probability that a product is defective is 0.03. When the product is defective, the
probability that this quality test will give a positive result is 0.90. When the
product is not defective, the probability of a positive test result is 0.02. Suppose
that the quality test has given a positive result. What is the probability that the
product is actually defective?
24
Independent Events
• Definition: Two events, A and B are called independent if P(A|B)=P(A).
Namely, the outcome of B does not affect the probability of occurrence
of A.
• Example: Two coin tosses are independent if the coins are fair.
26
Exercise
In a marketing survey, 1000 consumers were asked whether they intend to
buy a new product or not, and in a follow-up survey, the same group of
consumers were asked whether they have bought this product. The data is
shown below:
Actually Purchased
Planned to Purchase Yes No Total
• Given that a consumer planned to purchase, what is the probability that he/she
finally purchased the product?
• Given that a consumer planned not to purchase, what is the probability that
he/she finally purchased the product?
• Are consumers’ willingness to purchase and their actual purchase decisions
independent or not? Why?
27
Solution
Actually Purchased
Planned to Purchase Yes No Total
• Solution.
P(Purchased and planned) 200/1000 200
P(Purchased | Planned) = = = = 0.6667
P(Planned) 300/1000 300
28
The Birthday Problem
To start, P(two people share birthday) = 1 - P(no people share birthday).
The probability of two people sharing birthday is difficult to get, but we can get the
probability of no people sharing birthday:
• One person
This person can have any birthday. P(no)=(365/365)=1
• Two persons
P(no)=(365/365) * (364/365)=99.73%
• Three persons
P(no)=((365/365) * (364/365) * (363/365)=99.18%
……
• n persons
P(no)=((365/365) * ((365-1)/365) * ((365-2)/365)*…*((365-n+1)/365)
=365! / ((365-n)! * 365^n)=[365*364*…*(365-n+1)]/ 365^n
30
MSIN0154 Statistics for Business Research
Seminar 2
Probability
Reminder: Definitions
• An experiment is any process or procedure for which more than one
outcome is possible.
• Sample Space is the set of all possible outcomes of an experiment.
• An event is a subset of a sample space.
1. P(A) ≥ P(Φ) = 0
2. P(A1 ∪ A2 ∪… ∪An)= P(A1) + P(A2) + … + P(An).
3. P(Ω) = 1
Reminder
• Bayes' Theorem.
P(A | B)P(B) A ∩B
P(B | A) =
P(A | B)P(B) + P(A | B)P( B)
• Definition. Two events, A and B are called A B
independent if P(A|B)=P(A).
A∪B
Exercise 1
The ratings of Windows 8.1 on
Amazon.co.uk and Amazon.com
are given in the figures.
Any Questions?
53