Discrete Mathematics Lecture 6 Alexander Bukharovich New York University.

Slides:



Advertisements
Similar presentations
Counting. Counting in Algorithms How many comparisons are needed to sort n numbers? How many steps to compute the GCD of two numbers ? How many steps.
Advertisements

Counting Chapter 6 With Question/Answer Animations.
Counting Techniques: Combinations
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.
Discrete Structures Chapter 4 Counting and Probability Nurul Amelina Nasharuddin Multimedia Department.
CSE115/ENGR160 Discrete Mathematics 04/17/12
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.
1 Discrete Math CS 280 Prof. Bart Selman Module Probability --- Part a) Introduction.
CSE 321 Discrete Structures Winter 2008 Lecture 16 Counting.
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
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
Discrete Mathematics Lecture 7 Harper Langston New York University.
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.
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Combinatorics.
Combinatorics 3/15 and 3/ Counting A restaurant offers the following menu: Main CourseVegetablesBeverage BeefPotatoesMilk HamGreen BeansCoffee.
Counting Chapter 6 With Question/Answer Animations.
Copyright © Cengage Learning. All rights reserved. CHAPTER 9 COUNTING AND PROBABILITY.
Probability – Models for random phenomena
7 Further Topics in Algebra © 2008 Pearson Addison-Wesley. All rights reserved Sections 7.4–7.7.
Counting. Techniques for counting Rule 1 Suppose we carry out have a sets A 1, A 2, A 3, … and that any pair are mutually exclusive (i.e. A 1  A 2 =
1 Melikyan/DM/Fall09 Discrete Mathematics Ch. 6 Counting and Probability Instructor: Hayk Melikyan Today we will review sections 6.4,
Advanced Mathematics Counting Techniques. Addition Rule Events (tasks) A and B are mutually exclusive (no common elements/outcomes) and n(A) = a, n(B)
Basic Counting. This Lecture We will study some basic rules for counting. Sum rule, product rule, generalized product rule Permutations, combinations.
Chapter The Basics of Counting 5.2 The Pigeonhole Principle
Topics to be covered: Produce all combinations and permutations of sets. Calculate the number of combinations and permutations of sets of m items taken.
Discrete Mathematical Structures (Counting Principles)
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.
Chapter 6 With Question/Answer Animations 1. Chapter Summary The Basics of Counting The Pigeonhole Principle Permutations and Combinations Binomial Coefficients.
Permutations and Combinations
Fall 2002CMSC Discrete Structures1 One, two, three, we’re… Counting.
March 10, 2015Applied Discrete Mathematics Week 6: Counting 1 Permutations and Combinations How many different sets of 3 people can we pick from a group.
Dr. Eng. Farag Elnagahy Office Phone: King ABDUL AZIZ University Faculty Of Computing and Information Technology CPCS 222.
1 Lecture 4 (part 1) Combinatorics Reading: Epp Chp 6.
ICS 253: Discrete Structures I Counting and Applications King Fahd University of Petroleum & Minerals Information & Computer Science Department.
Chapter 6, Counting and Probability
September1999 CMSC 203 / 0201 Fall 2002 Week #9 – 21/23/25 October 2002 Prof. Marie desJardins.
1 Melikyan/DM/Fall09 Discrete Mathematics Ch. 6 Counting and Probability Instructor: Hayk Melikyan Today we will review sections 6.1,
The Pigeonhole Principle. The pigeonhole principle Suppose a flock of pigeons fly into a set of pigeonholes to roost If there are more pigeons than pigeonholes,
1 Melikyan/DM/Fall09 Discrete Mathematics Ch. 6 Counting and Probability Instructor: Hayk Melikyan Today we will review sections 6.6,
Discrete Mathematics Lecture # 25 Permutation & Combination.
CS 103 Discrete Structures Lecture 16
Counting Principles Multiplication rule Permutations Combinations.
Some other set notation We will use the notation to mean that e is an element of A. We will use the notation to mean that e is not an element of A.
1 CS 140 Discrete Mathematics Combinatorics And Review Notes.
UNIT 3. OUTLINE: Sets and Subsets Set Operations the Laws of Set Theory Counting and Venn Diagrams. A First Word on Probability. The Axioms of Probability.
Spring 2016 COMP 2300 Discrete Structures for Computation Donghyun (David) Kim Department of Mathematics and Physics North Carolina Central University.
Spring 2016 COMP 2300 Discrete Structures for Computation Donghyun (David) Kim Department of Mathematics and Physics North Carolina Central University.
2/24/20161 One, two, three, we’re… Counting. 2/24/20162 Basic Counting Principles Counting problems are of the following kind: “How many different 8-letter.
CS 104: Discrete Mathematics
Section The Pigeonhole Principle If a flock of 20 pigeons roosts in a set of 19 pigeonholes, one of the pigeonholes must have more than 1 pigeon.
Week 9 - Friday.  What did we talk about last time?  Partial orders  Total orders  Basic probability  Event  Sample space  Monty Hall  Multiplication.
ICS 253: Discrete Structures I Counting and Applications King Fahd University of Petroleum & Minerals Information & Computer Science Department.
Discrete Mathematics and Its Applications Sixth Edition By Kenneth Rosen Chapter 5 Counting 歐亞書局.
COUNTING Discrete Math Team KS MATEMATIKA DISKRIT (DISCRETE MATHEMATICS ) 1.
Section 6.3. Section Summary Permutations Combinations.
The Pigeonhole Principle
Discrete Mathematics Lecture 8 Probability and Counting
9. Counting and Probability 1
9. Counting and Probability 1 Summary
COUNTING AND PROBABILITY
Basic Counting.
COUNTING AND PROBABILITY
Basic Counting Lecture 9: Nov 5, 6.
Day 2 - Combinations.
Presentation transcript:

Discrete Mathematics Lecture 6 Alexander Bukharovich New York University

Counting and Probability Coin tossing Random process Sample space is the set of all possible outcomes of a random process. An event is a subset of a sample space Probability of an event is the ratio between the number of outcomes that satisfy the event to the total number of possible outcomes Rolling a pair of dice and card deck as sample random processes

Possibility Trees Teams A and B are to play each other repeatedly until one wins two games in a row or a total three games. –What is the probability that five games will be needed to determine the winner? Suppose there are 4 I/O units and 3 CPUs. In how many ways can I/Os and CPUs be attached to each other when there are no restrictions?

Multiplication Rule Multiplication rule: if an operation consists of k steps each of which can be performed in n i ways (i = 1, 2, …, k), then the entire operation can be performed in  n i ways. Number of PINs Number of elements in a Cartesian product Number of PINs without repetition Number of Input/Output tables for a circuit with n input signals Number of iterations in nested loops

Multiplication Rule Three officers – a president, a treasurer and a secretary are to be chosen from four people: Alice, Bob, Cindy and Dan. Alice cannot be a president, Either Cindy or Dan must be a secretary. How many ways can the officers be chosen?

Permutations A permutation of a set of objects is an ordering of these objects The number of permutations of a set of n objects is n! An r-permutation of a set of n elements is an ordered selection of r elements taken from a set of n elements: P(n, r) P(n, r) = n! / (n – r)! Show that P(n, 2) + P(n, 1) = n 2

Exercises How many odd integers are there from 10 through 99 have distinct digits? How many numbers from 1 through contain exactly one each of the digits 2, 3, 4, and 5? Let n = p 1 k1 p 2 k2 …p m km. –In how many ways can n be written as a product of two mutually prime factors? –How many divisors does n have? –What is the smallest integer with exactly 12 divisors?

Addition Rule If a finite set A is a union of k mutually disjoint sets A 1, A 2, …, A k, then n(A) =  n(A i ) Number of words of length no more than 3 Number of integers divisible by 5 If A is a finite set and B is its subset, then n(A – B) = n(A) – n(B) How many students are needed so that the probability of two of them having the same birthday equals 0.5?

Inclusion/Exclusion Rule n(A B) = n(A) + n(B) – n(A B) Derive the above rule for 3 sets How many integers from 1 through 1000 are multiples of 3 or multiples of 5? How many integers from 1 through 1000 are neither multiples of 3 nor multiples of 5?

Exercises Suppose that out of 50 students, 30 know Pascal, 18 know Fortran, 26 know Cobol, 9 know both Pascal and Fortran, 16 know both Pascal and Cobol, 8 know Fortran and Cobol and 47 know at least one programming language. –How many students know none of the three languages? –How many students know all three languages –How many students know exactly 2 languages?

Exercises Calculator has an eight-digit display and a decimal point which can be before, after or in between digits. The calculator can also display a minus sign for negative numbers. How many different numbers can the calculator display? A combination lock requires three selections of numbers from 1 to 39. How many combinations are possible if the same number cannot be used for adjacent selections?

Exercises How many integers from 1 to contain the digit 6 exactly once / at least once? What is a probability that a random number from 1 to will contain two or more occurrences of digit 6? 6 new employees, 2 of whom are married are assigned 6 desks, which are lined up in a row. What is the probability that the married couple will have non-adjacent desks?

Exercises Consider strings of length n over the set {a, b, c, d}: –How many such strings contain at least one pair of consecutive characters that are the same? –If a string of length 10 is chosen at random, what is the probability that it contains at least on pair of consecutive characters that are the same? How many permutations of abcde are there in which the first character is a, b, or c and the last character is c, d, or e? How many integers from 1 through contain each of the digits 1, 2, and 3 at least once?

Combinations An r-combination of a set of n elements is a subset of r elements: C(n, r) Permutation is an ordered selection, combination is an unordered selection Quantitative relationship between permutations and combinations: P(n, r) = C(n, r) * r! Permutations of a set with repeated elements Double counting

Team Selection Problems There are 12 people, 5 men and 7 women, to work on a project: –How many 5-person teams can be chosen? –If two people insist on working together (or not working at all), how many 5-person teams can be chosen? –If two people insist on not working together, how many 5- person teams can be chosen? –How many 5-person teams consist of 3 men and 2 women? –How many 5-person teams contain at least 1 man? –How many 5-person teams contain at most 1 man?

Poker Problems What is a probability to contain one pair? What is a probability to contain two pairs? What is a probability to contain a triple? What is a probability to contain straight? What is a probability to contain flush? What is a probability to contain full house? What is a probability to contain caret? What is a probability to contain straight flush? What is a probability to contain royal flush?

Exercises An instructor gives an exam with 14 questions. Students are allowed to choose any 10 of them to answer: –Suppose 6 questions require proof and 8 do not: How many groups of 10 questions contain 4 that require a proof and 6 that do not? How many groups of 10 questions contain at least one that require a proof? How many groups of 10 questions contain at most 3 that require a proof? A student council consists of 3 freshmen, 4 sophomores, 3 juniors and 5 seniors. How many committees of eight members contain at least one member from each class?

Combinations with Repetition An r-combination with repetition allowed is an unordered selection of elements where some elements can be repeated The number of r-combinations with repetition allowed from a set of n elements is C(r + n –1, r) How many monotone triples exist in a set of n elements?

Integral Equations How many non-negative integral solutions are there to the equation x 1 + x 2 + x 3 + x 4 = 10? How many positive integral solutions are there for the above equation?

Algebra of Combinations and Pascal’s Triangle The number of r-combinations from a set of n elements equals the number of (n – r)- combinations from the same set. Pascal’s triangle: C(n + 1, r) = C(n, r – 1) + C(n, r)

Exercises Show that: 1 * * 3 + n * (n + 1) = 2 * C(n + 2, 3) Prove that C(n, 0) 2 + C(n, 1) 2 + … + C(n, n) 2 = C(2n, n)

Binomial Formula (a + b) n =  C(n, k)a k b n-k Show that  C(n, k) = 2 n Show that  (-1) k C(n, k) = 0 Express  kC(n, k)3 k in the closed form