Counting Elements in a List How many integers in the list from 1 to 10? How many integers in the list from m to n? (assuming m <= n)

Slides:



Advertisements
Similar presentations
Chapter 2 Probability. 2.1 Sample Spaces and Events.
Advertisements

1 Counting. 2 Situations where counting techniques are used  You toss a pair of dice in a casino game. You win if the numbers showing face up have a.
Chapter 3 Probability.
Counting and Probability The outcome of a random process is sure to occur, but impossible to predict. Examples: fair coin tossing, rolling a pair of dice,
Multiplication Rule. A tree structure is a useful tool for keeping systematic track of all possibilities in situations in which events happen in order.
Probability Probability Principles of EngineeringTM
Discrete Structures Chapter 4 Counting and Probability Nurul Amelina Nasharuddin Multimedia Department.
Discrete Structures Chapter 4 Counting and Probability Nurul Amelina Nasharuddin Multimedia Department.
Discrete Mathematics Lecture 7 More Probability and Counting Harper Langston New York University.
Basics of Probability. Trial or Experiment Experiment - a process that results in a particular outcome or “event”. Simple event (or sample point), E i.
Discrete Mathematics Lecture 5
Discrete Mathematics Lecture 6 Alexander Bukharovich New York University.
Copyright © Cengage Learning. All rights reserved. CHAPTER 9 COUNTING AND PROBABILITY.
Probability Chapter 3. § 3.1 Basic Concepts of Probability.
Copyright (c) 2004 Brooks/Cole, a division of Thomson Learning, Inc. Chapter 2 Probability.
Sets, Combinatorics, Probability, and Number Theory Mathematical Structures for Computer Science Chapter 3 Copyright © 2006 W.H. Freeman & Co.MSCS SlidesProbability.
Sets, Combinatorics, Probability, and Number Theory Mathematical Structures for Computer Science Chapter 3 Copyright © 2006 W.H. Freeman & Co.MSCS SlidesProbability.
4. Counting 4.1 The Basic of Counting Basic Counting Principles Example 1 suppose that either a member of the faculty or a student in the department is.
Counting Principles (Permutations and Combinations )
Counting and Probability Sets and Counting Permutations & Combinations Probability.
5.1 Basic Probability Ideas
Conditional Probability and Independence If A and B are events in sample space S and P(B) > 0, then the conditional probability of A given B is denoted.
You probability wonder what we’re going to do next!
1 Melikyan/DM/Fall09 Discrete Mathematics Ch. 6 Counting and Probability Instructor: Hayk Melikyan Today we will review sections 6.4,
Finding Probability Using Tree Diagrams and Outcome Tables
Topics to be covered: Produce all combinations and permutations of sets. Calculate the number of combinations and permutations of sets of m items taken.
Counting and Probability. Counting Elements of Sets Theorem. The Inclusion/Exclusion Rule for Two or Three Sets If A, B, and C are finite sets, then N(A.
9.3 Addition Rule. The basic rule underlying the calculation of the number of elements in a union or difference or intersection is the addition rule.
Section 2.6: Probability and Expectation Practice HW (not to hand in) From Barr Text p. 130 # 1, 2, 4-12.
You probability wonder what we’re going to do next!
CPSC 531: Probability Review1 CPSC 531:Probability & Statistics: Review Instructor: Anirban Mahanti Office: ICT Class.
Chapter 6, Counting and Probability
Quiz 10-1, Which of these are an example of a “descrete” set of data? 2.Make a “tree diagram” showing all the ways the letters ‘x’, ‘y’, and ‘z’
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.
Week 9 - Wednesday.  What did we talk about last time?  Exam 2  Before that: review  Before that: relations.
Week 21 Conditional Probability Idea – have performed a chance experiment but don’t know the outcome (ω), but have some partial information (event A) about.
7th Probability You can do this! .
Copyright © Cengage Learning. All rights reserved. 8.6 Probability.
Copyright © 2006 Brooks/Cole, a division of Thomson Learning, Inc. Sets and Counting6 Sets and Set Operations The Number of Elements in a Finite Set The.
1 Melikyan/DM/Fall09 Discrete Mathematics Ch. 6 Counting and Probability Instructor: Hayk Melikyan Today we will review sections 6.1,
Review Homework pages Example: Counting the number of heads in 10 coin tosses. 2.2/
5.1 Randomness  The Language of Probability  Thinking about Randomness  The Uses of Probability 1.
Copyright © 2006 Brooks/Cole, a division of Thomson Learning, Inc. Sets and Counting6 Sets and Set Operations The Number of Elements in a Finite Set The.
Probability Basic Concepts Start with the Monty Hall puzzle
Natural Language Processing Giuseppe Attardi Introduction to Probability IP notice: some slides from: Dan Jurafsky, Jim Martin, Sandiway Fong, Dan Klein.
Discrete Mathematics, 1st Edition Kevin Ferland Chapter 6 Basic Counting 1.
PROBABILITY BINGO STAAR REVIEW I am based on uniform probability. I am what SHOULD happen in an experiment.
+ Chapter 5 Overview 5.1 Introducing Probability 5.2 Combining Events 5.3 Conditional Probability 5.4 Counting Methods 1.
Counting II: Recurring Problems And Correspondences Great Theoretical Ideas In Computer Science V. AdamchikCS Spring 2006 Lecture 6Feb 2, 2005Carnegie.
Week 21 Rules of Probability for all Corollary: The probability of the union of any two events A and B is Proof: … If then, Proof:
Spring 2016 COMP 2300 Discrete Structures for Computation Donghyun (David) Kim Department of Mathematics and Physics North Carolina Central University.
Algebra-2 Counting and Probability. Quiz 10-1, Which of these are an example of a “descrete” set of data? 2.Make a “tree diagram” showing all.
Mr. Mark Anthony Garcia, M.S. Mathematics Department De La Salle University.
Warm Up: Quick Write Which is more likely, flipping exactly 3 heads in 10 coin flips or flipping exactly 4 heads in 5 coin flips ?
Probability. Definitions Probability: The chance of an event occurring. Probability Experiments: A process that leads to well- defined results called.
Week 9 - Friday.  What did we talk about last time?  Partial orders  Total orders  Basic probability  Event  Sample space  Monty Hall  Multiplication.
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.
PROBABILITY AND STATISTICS WEEK 2 Onur Doğan. Introduction to Probability The Classical Interpretation of Probability The Frequency Interpretation of.
Counting and Probability
Discrete Mathematics Lecture 8 Probability and Counting
What is Probability? Quantification of uncertainty.
Minds on! If you choose an answer to this question at random, what is the probability you will be correct? A) 25% B) 50% C) 100% D) 25%
4.5 – Finding Probability Using Tree Diagrams and Outcome Tables
PROBABILITY AND STATISTICS
Probability Probability underlies statistical inference - the drawing of conclusions from a sample of data. If samples are drawn at random, their characteristics.
Chapter 3 Probability.
1. Probabilistic Models.
First lecture fsalamri Faten alamri.
Digital Lesson Probability.
Presentation transcript:

Counting Elements in a List How many integers in the list from 1 to 10? How many integers in the list from m to n? (assuming m <= n)

How many in a list divisible by something: How many positive three digit integers are there? –(this means only the ones that require 3 digits) –999 – = 900 How many three digit integers are divisible by 5? –think about the definition of divisible by x | y   k  Z, y = kx and then count the k’s that work 100, 101, 102, 103, 104, 105, 106,… 994, 995, 996, 997, 998, *5 21*5 … 199*5 –count the integers between 20 and 199 –199 – = 180

Probability likelihood of a specific event Sample Space = set of all possible outcomes Event = subset of sample space Equal Probability Formula: –Given a finite sample space S where all outcomes are equally likely –Select an event E from the sample space S –The probability of event E from sample space S:

Flipping Two Coins Sample Space = {(H,H), (H,T), (T,H), (T,T)} Probability of no heads Probability of at least one head Probability of same sides on the two coins Note: probability & actual outcomes often differ

Standard Playing Cards values: 2,3,4,5,6,7,8,9,10,J,Q,K,A suits: D(  ), H( ), S(  ), C(  ) probability of drawing the Ace of Spades probability of drawing a Spade probability of drawing a face card probability of drawing a red face card

Rolling Two Six-Sided Dice Sample Space {(1,1),(1,2),(1,3),(1,4),(1,5),(1,6), (2,1),(2,2),(2,3),(2,4),(2,5),(2,6), … (6,1),(6,2),(6,3),(6,4),(6,5),(6,6 )} Probability of rolling a 10 Probability of rolling a pair

Multi-level Probability If I toss a coin once – the probability of Head = ½ If I toss that coin 5 times –the probability of all heads –the probability of exactly 4 heads

Multiplication Rule 1 st step can be performed n 1 ways 2 nd step can be performed n 2 ways … K th step can be performed n k ways operation can be performed n 1 *n 2 *…*n k ways Cartesian product n(A)=3, n(B)=2, n(C)=4 –n(AxBxC) = 24 –n(AxB) = 6 n((AxB)xC) = 24

Tournament Play Team A and Team B in “Best of 3” Tournament where they each have an equal likelihood of winning each game –Do leaves add up to 1? –Do we have to play 3 games? –Do A and B have an equal chance of winning?

What if A wins 2 of every 3 games? Each line for A must have a 2/3 Each line for B must have a 1/3 How likely is A to win the tournament? How likely is B to win the tournament?

Using the Multiplication Rule for Selecting a PIN Number of 4 digit PINs of (0,1,2,.) –with repetition allowed = 4*4*4*4=256 –with no repetition allowed = 4*3*2*1=24 Extra Rules : –. (the period) can’t be first or last –0 can’t be first with repetition allowed = 2*4*4*3 without repetition allowed = 2*2*2*1

Probabilities with PINs Number of 4 digit PINs of (0,1,2,.) –with repetition allowed = 4*4*4*4=256 –with no repetition allowed = 4*3*2*1=24 What is the probability that your 4 digit PIN has no repeated characters? What is the probability that your 4 digit PIN does have repeated characters? probability of the complement of an event P(E’) = P(E c ) = 1-P(E)

Difference Rule Formally If A is a finite set and B  A, then n(A-B) = n(A) – n(B) One Application: probability of the complement of an event P(E’) = P(E c ) = 1-P(E)

PINs with less specified length Addition Rule Assume it can be a 2,3 or 4 length PIN Partition the problem number of 2 length PINs w/rep allowed: 4*4 = 16 number of 3 length PINs w/rep allowed: 4*4*4 = 64 number of 4 length PINs w/rep allowed: 4*4*4*4 = 256 Number PINs if allowing length of 2,3 or 4 = 336

Addition Rule Formally if A 1  A 2  A 3  …  A k =A and A 1, A 2, A 3,…,A k are pairwise disjoint in other words, if these subsets form a partition of A n(A) = n(A 1 )+n(A 2 )+n(A 3 )+…+n(A k )

Another example for Multiplication Rule and Addition Rule How many 3 digit integers are divisible by 5? –How many end in a 0? 9*10*1 = 90 –How many end in a 5? 9*10*1 = 90 –These form a partition with the set of numbers divisible by 5 so – = 180

Where Multiplication Rule Doesn’t Work People= {Angel, Bob, Carol, Dan} need to be appointed as –president, vice-president, and treasurer –nobody can hold more than one office –Angel doesn’t want to be president –Only Bob and Dan want to be vice-president

Inclusion/Exclusion Rule If there are two sets: n(A  B) = n(A) + n(B) – n(A  B) If there are three sets: n(A  B  C) = n(A) + n(B) + n(C) – n(A  B) – n(A  C) – n(B  C) +n(A  B  C)

Permutations Different ways of arranging objects –in a line or circle –without duplication/ all items distinguishable –note: order is taken into account Number of linear permutations of N objects = N! N possible for 1 st position * (N-1) for 2 nd * …* (1) for last Number of circular permutations of N objects = (N-1)! Fix one person, then (N-1) possible for next position * (N-2) for 2 nd * …* (1) for last

r-Permutations If there are n things in the set, and you want to line-up only r of them. Example: Class = {Alice, Bob, Carol, Dan} –select a president and a vice president to represent the class

Combinations Different ways of selecting objects –Counting Subsets –without duplication/ all items distinguishable –note: order is not taken into account Examples: Class = {Alice, Bob, Carol, Dan} –select two class representatives –select three class representatives

Harder Examples selecting “class representatives” Class = {Alice,Bob,Carol,Dan, Erin, Fred} select 2 – no restrictions select 2 – assuming Alice and Bob must stay together select 3 – no restrictions select 3 – assuming Alice and Bob must stay together select 3 – assuming Alice and Bob refuse to serve together

Different Types of Members {Alice, Bob, Carol, Dan, Erin, Fred, George, Harry} pink names are girls and blue names are boys 8 people in the set: 3 girls & 5 boys make a 5 member team of 2 girls and 3 boys make a 5 member team that has only one girl make a 5 member team that has no girls make a 5 member team that has at least one girl

Permutations but of indistinguishable items Assume you have a set of 15 beads –3 Red –2 Black –4 orange –6 green Select positions of R’s, then B’s, then O’s then G’s

Combinations with Repetition {a,b,c,d,e} How many 3-combinations can I make without repetition? How many 3-combinations can I make with unlimited repetition allowed? these are multisets [a,b,c] –not sets {a,b,c} –not tuples (a,b,c)

Probability with Combinations Assume there are 32 people in the class And that 7 will be chosen to get extra homework What is the probability that you get extra homework Number of ways to select the “lucky 7” Number of ways to select if “I get HW” P(I get HW)

Properties of r-Permutations and proofs of those properties P(n,1) = n P(n,2) = n 2 -n P(n,2) + P(n,1) = n 2 P(n,n) = n! P(n,n-1) = n!

Properties of Combinations and their proofs

Binomial Theorem (x+y) 2 (x+y) 3 … (x+y) n

Notice Similarities The number of Non-negative Integer Solutions of the equation The number of selections, with repetition, of size r from a collection of size n. The number of ways r identical objects can be distributed among n distinct containers.

Conditional Probability Probability of B given that A is known to have happened If P(B) = P(B|A) then event B is Independent of event A