CSC-2259 Discrete Structures

Slides:



Advertisements
Similar presentations
Beginning Probability
Advertisements

Lecture Discrete Probability. 5.2 Recap Sample space: space of all possible outcomes. Event: subset of of S. p(s) : probability of element s of.
Lecture Discrete Probability. 5.3 Bayes’ Theorem We have seen that the following holds: We can write one conditional probability in terms of the.
Discrete Probability Chapter 7.
Chapter 2 Concepts of Prob. Theory
Probability Theory Part 1: Basic Concepts. Sample Space - Events  Sample Point The outcome of a random experiment  Sample Space S The set of all possible.
Chapter 6: Probability : The Study of Randomness “We figured the odds as best we could, and then we rolled the dice.” US President Jimmy Carter June 10,
Probability Fall 2011, CISC1400 Dr. Zhang.
March 31, 2015Applied Discrete Mathematics Week 8: Advanced Counting 1 Discrete Probability Example I: A die is biased so that the number 3 appears twice.
Probability Sample Space Diagrams.
22C:19 Discrete Structures Discrete Probability Fall 2014 Sukumar Ghosh.
Lec 18 Nov 12 Probability – definitions and simulation.
1 Discrete Math CS 280 Prof. Bart Selman Module Probability --- Part a) Introduction.
Probability Distributions
1 Copyright M.R.K. Krishna Rao 2003 Chapter 5. Discrete Probability Everything you have learned about counting constitutes the basis for computing the.
Probability and combinatorics Notes from Virtual Laboratories in Probability and Statistics.
LING 438/538 Computational Linguistics Sandiway Fong Lecture 17: 10/24.
Binomial & Geometric Random Variables
5.1 Basic Probability Ideas
1 9/8/2015 MATH 224 – Discrete Mathematics Basic finite probability is given by the formula, where |E| is the number of events and |S| is the total number.
Copyright © Cengage Learning. All rights reserved. 5 Probability Distributions (Discrete Variables)
1 9/23/2015 MATH 224 – Discrete Mathematics Basic finite probability is given by the formula, where |E| is the number of events and |S| is the total number.
Lecture Discrete Probability. 5.1 Probabilities Important in study of complexity of algorithms. Modeling the uncertain world: information, data.
PROBABILITY AND STATISTICS FOR ENGINEERING Hossein Sameti Department of Computer Engineering Sharif University of Technology Independence and Bernoulli.
Topics to be covered: Produce all combinations and permutations of sets. Calculate the number of combinations and permutations of sets of m items taken.
Section 7.1. Section Summary Finite Probability Probabilities of Complements and Unions of Events Probabilistic Reasoning.
1 2. Independence and Bernoulli Trials Independence: Events A and B are independent if It is easy to show that A, B independent implies are all independent.
Probability Theory 1.Basic concepts 2.Probability 3.Permutations 4.Combinations.
Chapter 7 With Question/Answer Animations. Section 7.1.
Section 7.2. Section Summary Assigning Probabilities Probabilities of Complements and Unions of Events Conditional Probability Independence Bernoulli.
You probability wonder what we’re going to do next!
Discrete Math Lecture 6: Discrete Probability
CPSC 531: Probability Review1 CPSC 531:Probability & Statistics: Review Instructor: Anirban Mahanti Office: ICT Class.
Warm Up 1. Determine whether each situation involves permutations or combinations 2. Solve each problem (set up…if you can simplify…you’re great!) Arrangement.
CSE 321 Discrete Structures Winter 2008 Lecture 19 Probability Theory TexPoint fonts used in EMF. Read the TexPoint manual before you delete this box.:
Discrete Probability CSC-2259 Discrete Structures Konstantin Busch - LSU1.
Chapter 16 Probability. Activity Rock-Paper-Scissors Shoot Tournament 1)Pair up and choose one person to be person A and the other person B. 2)Play 9.
Probability The calculated likelihood that a given event will occur
Computing Fundamentals 2 Lecture 6 Probability Lecturer: Patrick Browne
Independence and Bernoulli Trials. Sharif University of Technology 2 Independence  A, B independent implies: are also independent. Proof for independence.
Chapter 2: Probability · An Experiment: is some procedure (or process) that we do and it results in an outcome. A random experiment: is an experiment we.
22C:19 Discrete Structures Discrete Probability Spring 2014 Sukumar Ghosh.
40S Applied Math Mr. Knight – Killarney School Slide 1 Unit: Statistics Lesson: ST-5 The Binomial Distribution The Binomial Distribution Learning Outcome.
PROBABILITY, PROBABILITY RULES, AND CONDITIONAL PROBABILITY
ICS 253: Discrete Structures I Discrete Probability King Fahd University of Petroleum & Minerals Information & Computer Science Department.
Conditional Probability Mass Function. Introduction P[A|B] is the probability of an event A, giving that we know that some other event B has occurred.
Discrete Mathematics, 1st Edition Kevin Ferland Chapter 6 Basic Counting 1.
1.Addition Rule 2.Multiplication Rule 3.Compliments 4.Conditional Probability 5.Permutation 6.Combinations 7.Expected value 8.Geometric Probabilities 9.Binomial.
Section 7.1. Probability of an Event We first define these key terms: An experiment is a procedure that yields one of a given set of possible outcomes.
3/7/20161 Now it’s time to look at… Discrete Probability.
Chapter 7 With Question/Answer Animations. Chapter Summary Introduction to Discrete Probability Probability Theory Bayes’ Theorem Expected Value and Variance.
Introduction to probability (3) Definition: - The probability of an event A is the sum of the weights of all sample point in A therefore If A1,A2,…..,An.
13 Lesson 1 Let Me Count the Ways Fundamental Counting Principle, Permutations & Combinations CP Probability and Statistics FA 2014 S-ID.1S-CP.3S-CP.5.
Chapter 7. Section 7.1 Finite probability  In a lottery, players win a large prize when they pick four digits that match, in the correct order, four.
PROBABILITY AND STATISTICS WEEK 2 Onur Doğan. Introduction to Probability The Classical Interpretation of Probability The Frequency Interpretation of.
1 COMP2121 Discrete Mathematics Principle of Inclusion and Exclusion Probability Hubert Chan (Chapters 7.4, 7.5, 6) [O1 Abstract Concepts] [O3 Basic Analysis.
Probability Theory Basic concepts Probability Permutations
Introduction to Discrete Probability
Now it’s time to look at…
Introduction to Discrete Probability
ICS 253: Discrete Structures I
Chapter 6: Discrete Probability
CS104:Discrete Structures
Conditional Probability
Discrete Probability Chapter 7 With Question/Answer Animations
PROBABILITY AND STATISTICS
Now it’s time to look at…
Now it’s time to look at…
Now it’s time to look at…
Presentation transcript:

CSC-2259 Discrete Structures Discrete Probability CSC-2259 Discrete Structures Konstantin Busch - LSU

Introduction to Discrete Probability Unbiased die Sample Space: All possible outcomes

any subset of sample space Event: any subset of sample space Experiment: procedure that yields events Throw die Konstantin Busch - LSU

Probability of event : Note that: since Konstantin Busch - LSU

What is the probability that a die brings 3? Event Space: Sample Space: Probability:

What is the probability that a die brings 2 or 5? Event Space: Sample Space: Probability:

Two unbiased dice Sample Space: 36 possible outcomes First die Second die Ordered pair

What is the probability that two dice bring (1,1)? Event Space: Sample Space: Probability:

What is the probability that two dice bring same numbers? Event Space: Sample Space: Probability:

Game with unordered numbers Game authority selects a set of 6 winning numbers out of 40 Number choices: 1,2,3,…,40 i.e. winning numbers: 4,7,16,25,33,39 Player picks a set of 6 numbers (order is irrelevant) i.e. player numbers: 8,13,16,23,33,40 What is the probability that a player wins? Konstantin Busch - LSU

a single set with the 6 winning numbers Winning event: a single set with the 6 winning numbers Sample space: Konstantin Busch - LSU

Probability that player wins: Konstantin Busch - LSU

each kind has 4 suits (h,d,c,s) A card game Deck has 52 cards 13 kinds of cards (2,3,4,5,6,7,8,9,10,a,k,q,j), each kind has 4 suits (h,d,c,s) Player is given hand with 4 cards What is the probability that the cards of the player are all of the same kind? Konstantin Busch - LSU

Event: each set of 4 cards is of same kind Sample Space: Konstantin Busch - LSU

Probability that hand has 4 same kind cards: Konstantin Busch - LSU

Game with ordered numbers Game authority selects from a bin 5 balls in some order labeled with numbers 1…50 Number choices: 1,2,3,…,50 i.e. winning numbers: 37,4,16,33,9 Player picks a set of 5 numbers (order is important) i.e. player numbers: 40,16,13,25,33 What is the probability that a player wins? Konstantin Busch - LSU

Sampling without replacement: After a ball is selected it is not returned to bin Sample space size: 5-permutations of 50 balls Probability of success: Konstantin Busch - LSU

Sampling with replacement: After a ball is selected it is returned to bin Sample space size: 5-permutations of 50 balls with repetition Probability of success: Konstantin Busch - LSU

Probability of Inverse: Proof: End of Proof Konstantin Busch - LSU

What is the probability that a binary string of 8 bits contains Example: What is the probability that a binary string of 8 bits contains at least one 0? Konstantin Busch - LSU

Probability of Union: Proof: End of Proof Konstantin Busch - LSU

What is the probability that a binary string of 8 bits Example: What is the probability that a binary string of 8 bits starts with 0 or ends with 11? Strings that start with 0: (all binary strings with 7 bits 0xxxxxxx) Strings that end with 11: (all binary strings with 6 bits xxxxxx11) Konstantin Busch - LSU

Strings that start with 0 and end with 11: (all binary strings with 5 bits 0xxxxx11) Strings that start with 0 or end with 11: Konstantin Busch - LSU

Probability Theory Sample space: Probability distribution function : Konstantin Busch - LSU

Heads (H) with probability 2/3 Tails (T) with probability 1/3 Notice that it can be: Example: Biased Coin Heads (H) with probability 2/3 Tails (T) with probability 1/3 Sample space: Konstantin Busch - LSU

Uniform probability distribution: Sample space: Example: Unbiased Coin Heads (H) or Tails (T) with probability 1/2 Konstantin Busch - LSU

For uniform probability distribution: Probability of event : For uniform probability distribution: Konstantin Busch - LSU

What is the probability that the die outcome is 2 or 6? Example: Biased die What is the probability that the die outcome is 2 or 6? Konstantin Busch - LSU

Combinations of Events: Complement: Union: Union of disjoint events: Konstantin Busch - LSU

Conditional Probability Three tosses of an unbiased coin Tails Heads Tails Condition: first coin is Tails Question: What is the probability that there is an odd number of Tails, given that first coin is Tails? Konstantin Busch - LSU

Restricted sample space given condition: first coin is Tails Konstantin Busch - LSU

Event without condition: Odd number of Tails Event with condition: first coin is Tails Konstantin Busch - LSU

the sample space changes to Given condition, the sample space changes to (the coin is unbiased) Konstantin Busch - LSU

Notation of event with condition: event given Konstantin Busch - LSU

Conditional probability definition: (for arbitrary probability distribution) Given sample space with events and (where ) the conditional probability of given is: Konstantin Busch - LSU

What is probability that a family of two children has two boys Example: What is probability that a family of two children has two boys given that one child is a boy Assume equal probability to have boy or girl Sample space: Condition: one child is a boy Konstantin Busch - LSU

Conditional probability of event: both children are boys Conditional probability of event: Konstantin Busch - LSU

Events and are independent iff: Independent Events Events and are independent iff: Equivalent definition (if ): Konstantin Busch - LSU

4 bit uniformly random strings : a string begins with 1 Example: 4 bit uniformly random strings : a string begins with 1 : a string contains even 1 Events and are independent Konstantin Busch - LSU

Experiment with two outcomes: success or failure Bernoulli trial: Experiment with two outcomes: success or failure Success probability: Failure probability: Example: Biased Coin Success = Heads Failure = Tails Konstantin Busch - LSU

Independent Bernoulli trials: the outcomes of successive Bernoulli trials do not depend on each other Example: Successive coin tosses Konstantin Busch - LSU

Throw the biased coin 5 times What is the probability to have 3 heads? Heads probability: (success) Tails probability: (failure) Konstantin Busch - LSU

Total numbers of ways to arrange in sequence 5 coins with 3 heads: HHHTT HTHHT HTHTH THHTH Total numbers of ways to arrange in sequence 5 coins with 3 heads: Konstantin Busch - LSU

Probability that any particular sequence has 3 heads and 2 tails is specified positions: For example: HHHTT HTHHT HTHTH Konstantin Busch - LSU

Probability of having 3 heads: st 1st sequence success (3 heads) 2nd sequence success (3 heads) sequence success (3 heads) Konstantin Busch - LSU

Throw the biased coin 5 times Probability to have exactly 3 heads: Probability to have 3 heads and 2 tails in specified sequence positions All possible ways to arrange in sequence 5 coins with 3 heads Konstantin Busch - LSU

Probability to have successes in independent Bernoulli trials: Theorem: Probability to have successes in independent Bernoulli trials: Also known as binomial probability distribution: Konstantin Busch - LSU

in specified positions Proof: Total number of sequences with successes and failures Probability that a sequence has successes and failures in specified positions Example: SFSFFS…SSF End of Proof Konstantin Busch - LSU

Random uniform binary strings probability for 0 bit is 0.9 Example: Random uniform binary strings probability for 0 bit is 0.9 probability for 1 bit is 0.1 What is probability of 8 bit 0s out of 10 bits? i.e. 0100001000 Konstantin Busch - LSU

Birthday collision: two people have birthday in same day Birthday Problem Birthday collision: two people have birthday in same day Problem: How many people should be in a room so that the probability of birthday collision is at least ½? Assumption: equal probability to be born in any day Konstantin Busch - LSU

If the number of people is 367 or more 366 days in a year If the number of people is 367 or more then birthday collision is guaranteed by pigeonhole principle Assume that we have people Konstantin Busch - LSU

:probability that people have all different birthdays We will compute :probability that people have all different birthdays It will helps us to get :probability that there is a birthday collision among people Konstantin Busch - LSU

Sample space: Cartesian product Sample space size: 1st person’s Birthday choices 2nd person’s Birthday choices nth person’s Birthday choices Sample space size: Konstantin Busch - LSU

each person’s birthday is different Event set: each person’s birthday is different 1st person’s birthday 2nd person’s birthday nth person’s birthday #choices #choices #choices Sample size: Konstantin Busch - LSU

Probability of no birthday collision Probability of birthday collision: Konstantin Busch - LSU

Probability of birthday collision: Therefore: people have probability at least ½ of birthday collision Konstantin Busch - LSU

The birthday problem analysis can be used to determine appropriate hash table sizes that minimize collisions Hash function collision: Konstantin Busch - LSU

Randomized algorithms: algorithms with randomized choices (Example: quicksort) Las Vegas algorithms: randomized algorithms whose output is always correct (i.e. quicksort) Monte Carlo algorithms: randomized algorithms whose output is correct with some probability (may produce wrong output) Konstantin Busch - LSU

A Monte Carlo algorithm Primality_Test( ) { for( to ) { if (Miller_Test( ) == failure) return(false) // n is not prime } return(true) // most likely n is prime Konstantin Busch - LSU

Miller_Test( ) { for ( to ) { if ( or ) return(success) } return(failure) Konstantin Busch - LSU

A prime number passes the Miller test for every A composite number passes the Miller test in range for fewer than numbers false positive with probability: Konstantin Busch - LSU

If the primality test algorithm returns false then the number is not prime for sure If the algorithm returns true then the answer is correct (number is prime) with high probability: for Konstantin Busch - LSU

Bayes’ Theorem Applications: Machine Learning Spam Filters Konstantin Busch - LSU

Bayes’ Theorem Proof: Konstantin Busch - LSU

Konstantin Busch - LSU

End of Proof Konstantin Busch - LSU

Example: Select random box then select random ball in box Question: If a red ball is selected, what is the probability it was taken from box 1? Konstantin Busch - LSU

Question probability: select red ball select box 1 select green ball select box 2 Question probability: Question: If a red ball is selected, what is the probability it was taken from box 1? Konstantin Busch - LSU

We only need to compute: Bayes’ Theorem: We only need to compute: Konstantin Busch - LSU

select red ball select box 1 select green ball select box 2 Box 1 Probability to select box 1 Probability to select box 2 Konstantin Busch - LSU

select red ball select box 1 select green ball select box 2 Box 1 Probability to select red ball from box 1 Probability to select red ball from box 2 Konstantin Busch - LSU

Final result Konstantin Busch - LSU

What if we had more boxes? Generalized Bayes’ Theorem: Sample space mutually exclusive events Konstantin Busch - LSU

Spam Filters Training set: Spam (bad) emails Good emails A user classifies each email in training set as good or bad Konstantin Busch - LSU

Find words that occur in and number of spam emails that contain word number of good emails that contain word Probability that a good email contains Probability that a spam email contains Konstantin Busch - LSU

Event that X contains word A new email X arrives Event that X is spam Event that X contains word What is the probability that X is spam given that it contains word ? Reject if this probability is at least 0.9 Konstantin Busch - LSU

We only need to compute: 0.5 0.5 simplified assumption Computed from training set Konstantin Busch - LSU

Training set for word “Rolex”: Example: Training set for word “Rolex”: “Rolex” occurs in 250 of 2000 spam emails “Rolex” occurs in 5 of 1000 good emails If new email contains word “Rolex” what is the probability that it is a spam? Konstantin Busch - LSU

“Rolex” occurs in 250 of 2000 spam emails “Rolex” occurs in 5 of 1000 good emails Konstantin Busch - LSU

If new email X contains word “Rolex” what is the probability that it is a spam? Event that X is spam Event that X contains word “Rolex” Konstantin Busch - LSU

We only need to compute: 0.5 0.5 simplified assumption Computed from training set Konstantin Busch - LSU

New email is considered to be spam because: spam threshold Konstantin Busch - LSU

Better spam filters use two words: Assumption: and are independent the two words appear independent of each other Konstantin Busch - LSU