Docsity

Discrete Mathematics Lecture 18: Probability Theory - Prof. Kemal Akkaya, Study notes of Discrete Mathematics

Partial preview of the text

Download Discrete Mathematics Lecture 18: Probability Theory - Prof. Kemal Akkaya and more Study notes Discrete Mathematics in PDF only on Docsity!

Discrete Mathematics

DISCRETE MATHEMATICS Kemal Akkaya

Lecture 18 Dr. Kemal Akkaya

Department of Computer Science

Discrete Mathematics

§6.1-2 Why Probability?^ z^ In the real world, we often don’t know whether agiven proposition is true or false.^ z^ Probability theory gives us a way to reason aboutpropositions whose truth isKemal Akkaya

uncertain

z^ It is useful in weighing evidence, diagnosingproblems, and analyzing situations whose exactdetails are unknown. z^ Many CS applications: Networking, randomizedalgorithms

Discrete Mathematics

Events^ z^ An^ event E Kemal Akkaya

is any set of possible

outcomes in

S …

z^ That is,

E^ ⊆^ S

z^ E.g., the event that “less than 50 peopleshow up for our next class” is representedas the set {1, 2, …, 49} of values of thevariable

V^ = (# of people here next class). z^ Can be anything from 1 up to 49

Discrete Mathematics

Probability^ z^ The^ probability p Kemal Akkaya

= Pr[ E ]^ ∈

[0,1] of an event

E^ is

a real number representing our degree ofcertainty that

E^ will occur. z^ If Pr[ E ] = 1, then

E^ is absolutely certain to occur, z^ If Pr[ E ] = 0, then

E^ is absolutely certain

not^ to occur,

z^ If Pr[ E ] = ½, then we are

maximally uncertain

about

whether^ E

will occur; that is, z^ How do we interpret other values of

p? Note:^ We could also define probabilities for moregeneral propositions, as well as events.

Discrete Mathematics

Probability: Laplacian Definition^ z^ First, assume that all individual outcomes inthe sample space are Kemal Akkaya

equally likely

to each

other … z Then, the probability of any event

E^ is

given by, Pr[

E ] = | E |/|

S |.^ Very simple!

z^ Problems:

Still needs a definition for

equally likely

, and depends on the

existence of

some^ finite sample space

S^ in

which all outcomes in

S^ are, in fact, equally

likely.

Discrete Mathematics

Example^ z^ What is the probability that a five cardpoker hand contains exactly one ace?^ z^ There are 4 ways to specify the ace.^ z^ Once the ace is chosen there are C(48,4)ways to choose non-aces^ z^ So 4C(48,4) hands with exactly one ace.^ z^ Since there are C(52,5) equally likely hands^ z^ Then 4C(48,4)/C(52,5) = .30Kemal Akkaya

Discrete Mathematics

Probability Distribution^ z^ When there are n possible outcomes^ x^ , x, x^12 Kemal Akkaya

, … x 3 n and each outcome is assigned a probability p(s) such that the probability of each outcome is anonnegative real number no greater than 1 and the sum of theprobabilities of all possible outcomes is 1, THEN: The function p from the set of all events of the sample space S iscalled a probability distribution.

1 0 (^ )

1

1, 2,...,( ) 1 i p x for in i i

n^ and p x = ≤^ ≤

= =∑

Discrete Mathematics

11

Probabilities of Mutually ComplementaryEvents^ z^ Let^ E^ be an event in a sample spaceKemal Akkaya

S.

z^ Then,

E^ represents the

complementary

event, saying that the actual value of

V ∉ E.

z^ Theorem

: Pr[ E ] = 1

−^ Pr[ E ]

z^ This can be proved using the Laplaciandefinition of probability, since Pr[

E ] = | E |/ |S
(| S |−| E |)/|
S | = 1^ −^
| E |/| S | = 1

−^ Pr[ E ].

z^ Other definitions can also be used to prove it.

Discrete Mathematics

13

Example 1: Balls-and-Urn^ z^ Suppose an urn contains 4 blue balls and 5 red balls.^ z^ An example^ Kemal Akkaya

experiment:

Shake up the urn, reach in (without looking) and pull out a ball. z A^ random variable

V : Identity of the chosen ball. z^ The^ sample space

S : The set of all possible values of

V : z^ In this case,

S^ = { b ,…,^1

b }^9 z^ An^ event

E : “The ball chosen is blue”: E = { ______________ } z^ What are the odds in favor of

E?

z^ What is the probability of

E? z^ (Use Laplacian def’n.)

b^1 b^2^ b^ b^ b^53^ b^4^ b^6

b^97 b 8

Discrete Mathematics

Example 2: Seven on Two Dice^ z^ Experiment: Kemal Akkaya

Roll a pair of

fair (unweighted) 6-sided dice. z Describe a sample space for thisexperiment that fits the Laplaciandefinition. z Using this sample space, represent anevent^ E

expressing that “the upper spots

sum to 7.” z What is the probability of

E?

Discrete Mathematics

Example^ z^ What is the probability that a positive integer selectedat random from the set of positive integers notexceeding 100 is divisible by either 2 or 5?^ Let Ebe the event that integer is divisible by 2^1 Let Ebe the event that integer is divisible by 5.^2 Then E^ ∪^ E^ is the event that is either 2 or 5 and E^1 2 Kemal Akkaya

∩^ E^1

is the event that is divisible by both 2 and 5 orequivalently that is divisible by 10. p(E^ ∪^ E^ ) = p(E^1

) + p(E^ ) – p(E 12

∩^ E^ ) 1 2 = 50/100 + 20/100 – 10/100 = 3/

Discrete Mathematics

Mutually Exclusive Events^ z^ Two events Kemal Akkaya

E ,^ E are called^1

mutually

exclusive

if they are disjoint:

E ∩ E^12

=^ ∅

z^ Note that two mutually exclusive events^ cannot both occur

in the same instance of a

given experiment. z For mutually exclusive events,^ Pr[ E ∪^1

E ] = Pr[^2

E ] + Pr[^1

E ].^2

z^ Follows from the sum rule of combinatorics.

Discrete Mathematics

19

Independent Events^ z^ Two events Kemal Akkaya

E , F^ are called

independent

if

Pr[ E ∩ F

] = Pr[ E

]·Pr[ F ].

z^ Relates to the product rule for the numberof ways of doing two independent tasks. z^ Example:

Flip a coin, and roll a die.

Pr[(coin shows heads)

∩^ (die shows 1)] = Pr[coin is heads]

×^ Pr[die is 1] = ½

×1/

Discrete Mathematics

20

Conditional Probability^ z^ Let^ E , F^ be any events such that Pr[ Kemal Akkaya

F ]>0.

z^ Then, the

conditional probability of E given F

written Pr[

E | F ], is defined as Pr[ E | F ] :≡

Pr[ E ∩ F ]/Pr[

F ].

z^ This is what our probability that

E^ would turn

out to occur should be, if we are given

only^ the

information that

F^ occurs. z^ If^ E^ and

F^ are independent then Pr[

E | F ] =

Pr[ E ].^ Q^ Pr[ E | F

] = Pr[ E ∩ F

]/Pr[ F ] = Pr[

E ]×Pr[ F ]/Pr[

F ] = Pr[ E ]