CPE412 Pattern Recognition (Week 3)
CPE412 Pattern Recognition (Week 3)
➢simulation
Coin flipping:
The sample space S of a random phenomenon is the
set of all possible outcomes.
Even
Even
t5
t2
Rolling an odd
number={2,4,6
}
Rolling an even
number={2,4,6}
Sample Space
={1,2,3,4,5,6}
Rolling a prime
number={2,3,5}
Random phenomenon: roll pair of fair dice.
Sample space:
11
Random phenomenon: Arrange 52 card deck in a zigzag way
Sample space:
0 ¼ or .25 ½ or .5 ¾ or .75 1
# 𝑓𝑎𝑣𝑜𝑟𝑎𝑏𝑙𝑒 𝑜𝑢𝑡𝑐𝑜𝑚𝑒𝑠 3 1
𝑃 𝑒𝑣𝑒𝑛 # = = =
#𝑝𝑜𝑠𝑠𝑖𝑏𝑙𝑒 𝑜𝑢𝑡𝑐𝑜𝑚𝑒𝑠 6 2
# 𝑓𝑎𝑣𝑜𝑟𝑎𝑏𝑙𝑒 𝑜𝑢𝑡𝑐𝑜𝑚𝑒𝑠 1
𝑃 𝐻𝑒𝑎𝑑 = =
#𝑝𝑜𝑠𝑠𝑖𝑏𝑙𝑒 𝑜𝑢𝑡𝑐𝑜𝑚𝑒𝑠 2
# 𝒇𝒂𝒗𝒐𝒓𝒂𝒃𝒍𝒆 𝒐𝒖𝒕𝒄𝒐𝒎𝒆𝒔 𝟏𝟑 𝟏
𝑃 𝐻𝑒𝑎𝑟𝑡 = = =
#𝒑𝒐𝒔𝒔𝒊𝒃𝒍𝒆 𝒐𝒖𝒕𝒄𝒐𝒎𝒆𝒔 𝟓𝟐 𝟒
The probability of picking a heart is 1 out of 4
0 P( E ) 1
P( E ) + P( E ) = 1
Properties of Probability:
P( E ) = 1 − P( E )
P( E ) = 1 − P( E )
Complementary Events
❖ Example I: A sequence of 5 bits is randomly generated. What is the
probability that at least one of these bits is zero?
❖ Solution: There are 25 = 32 possible outcomes of generating such a
sequence.
Define event E as at least one of the bits is zeros
ത “none of the bits is zero”, includes only one
Then event 𝐸,
of these outcomes, namely the sequence 11111.
ത = 1/32.
Therefore, p(𝐸)
Now p(E) can easily be computed as
ത = 1 – 1/32 = 31/32.
p(E) = 1 – p(𝐸)
❖ We talk about conditional probability when the probability of one
event depends on whether or not another event has occurred.
❖ e.g. There are 2 red and 3 blue counters in a bag and, without
looking, we take out one counter and do not replace it.
❖ The probability of a 2nd counter taken from the bag being red
depends on whether the 1st was red or blue.
❖ Conditional probability problems can be solved by considering the
individual possibilities or by using a table, a Venn diagram, a tree
diagram or a formula.
P(A B) means
100
e.g. 1. The following table gives data on the type of car, grouped
by petrol consumption, owned by 100 people.
36
Design classifiers to recommend decisions
that minimize some total expected ”risk”.
The simplest risk is the classification error
(i.e., costs are equal).
Typically, the risk includes the cost
associated with different decisions.
37
State of nature ω (random variable):
◦ e.g., ω1 for sea bass, ω2 for salmon
Probabilities P(ω1) and P(ω2) (priors):
◦ e.g., prior knowledge of how likely is to get a
seabassor a salmon
Probability density function p(x) (evidence):
◦ e.g., how frequently we will measure a pattern with
feature value x (e.g., x corresponds to lightness)
38
39
40
41
42
43
44