The Basis of Counting.

Slides:



Advertisements
Similar presentations
1 Basics of Counting CS/APMA 202 Epp sections 6.2 & 6.3 Aaron Bloomfield.
Advertisements

Basic Counting Rosen 4.1. Sum Rule If a first task can be done in n 1 ways and a second task can be done in n 2 ways, and if these tasks cannot be done.
Counting. Counting = Determining the number of elements of a finite set.
Lecture 4 4.1,4.2 Counting. 4.1 Counting Two Important Principles: Product Rule and Sum Rule. Product Rule: Assume we need to perform procedure 1 AND.
MR NAHAL Books open in Silence Today’s date 01/12/08 Ready for Lesson Objectives.
Recursively Defined Functions
Section 4.1: The Basics of Counting As we have seen, one way to count the number of objects in a finite set S is to produce a one-to-one correspondence.
after UCI ICS/Math 6A, Summer Counting-1 Counting: Product and Sum Rules Product Rule: Assuming a)We need to.
College of Information Technology & Design
The Basis of Counting. Imagine you go out for lunch, and as a 1st course you can have soup or pate (but not both) you can have chicken soup or carrot.
MATHPOWER TM 12, WESTERN EDITION Chapter 7 Combinatorics.
Copyright © Zeph Grunschlag, Counting Techniques Zeph Grunschlag.
1 Section 4.1 Basics of Counting. 2 Basic Counting Principles: Sum Rule Suppose you have two tasks to perform: –The first task can be done in n 1 ways;
CSE115/ENGR160 Discrete Mathematics 04/10/12
1 Discrete Structures – CNS2300 Text Discrete Mathematics and Its Applications (5 th edition) Kenneth H. Rosen Chapter 4 Counting.
Chapter The Basics of Counting 5.2 The Pigeonhole Principle
Discrete Maths Objective to introduce some of the counting rules (product, sum, subtraction, division, pigeonhole) through examples , Semester 2,
Basic Counting Lecture 12: Oct 28. This Lecture We will study some basic rules for counting. Sum rule, product rule, generalized product rule Permutations,
Basic Counting. This Lecture We will study some basic rules for counting. Sum rule, product rule, generalized product rule Permutations, combinations.
October 2010 Week 1 High School Menu Lunch $3.00.
Fall 2002CMSC Discrete Structures1 One, two, three, we’re… Counting.
Ch. 5: Counting. 5.1: The Basics of Counting Intro Example #1: If we have a class of 6 math majors and 7 CS majors (with no double majors) – A) In how.
The Basics of Counting Section 6.1.
Section Section Summary The Product Rule The Sum Rule The Subtraction Rule The Division Rule Examples, Examples, and Examples Tree Diagrams.
Module #15: Combinatorics Rosen 5 th ed., §§ & §6.5 Now we are moving on to Ch. 4 It is the study of arrangement of objects e.g. enumeration, counting.
Fundamental Counting. How do you count? Try counting these dots… 5 7 5×7= 35 So, there are 35 dots. Is this any easier?
Unit 2 - Permutations and Organized Counting
Counting Techniques. L172 Agenda Section 4.1: Counting Basics Sum Rule Product Rule Inclusion-Exclusion.
Nutrition Learning the food groups with my pyramid By: Tara Bunch, Brigitte Madrid, Madison French.
1 Basics of Counting CS/APMA 202 Rosen section 4.1 Aaron Bloomfield.
Unit VI Discrete Structures Permutations and Combinations SE (Comp.Engg.)
DAY 6: FUNDAMENTAL COUNTING PRINCIPLE Classwork: pptx examples in class Discrete Pre- Test (not a grade in HAC) Unit 2 Project- Due day 13 Homework (day.
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.
Introduction Suppose that a password on a computer system consists of 6, 7, or 8 characters. Each of these characters must be a digit or a letter of the.
Section Basic Counting Principles: The Product Rule The Product Rule: A procedure can be broken down into a sequence of two tasks. There are n 1.
CS 104: Discrete Mathematics
EXAMPLE 1 Count permutations
addition and multiplication
ICS 253: Discrete Structures I
Copyright © Zeph Grunschlag,
The Pigeonhole Principle
COCS DISCRETE STRUCTURES
Topic: Probability Aim: How do we find the probability of compound events? Do Now: Three-course dinners can be made from the menu shown. (a) Find the sample.
Aim: What is the counting principle?
The Skillet Monday, December 4th Breakfast 7am-8am Continental
Copyright © Zeph Grunschlag,
Recursively Defined Functions
One, two, three, we’re… Counting.
Counting Principles and Tree Diagrams
CS100: Discrete structures
Smart Choice Level 1 Do you like spicy food? Unit 3 Vocabulary.
November 2018 Lunch Menu Monday Tuesday Wednesday Thursday Friday
Math/CSE 1019: Discrete Mathematics for Computer Science Fall 2011
Module #15: Combinatorics
Basic Counting.
104- Ch. 11 part 1; 260- Ch. 5 pt. 2 master_prob_pc.pptx
Divisibility Rules.
Module #15: Combinatorics
Basic Counting Lecture 9: Nov 5, 6.
Discrete Structures Counting.
Representations of Integers
Discrete Mathematics and its Applications
04/09/2017 to 08/09/2017 Buffet de ensaladas Gratin tomatoes
Copyright © Zeph Grunschlag,
Copyright © Zeph Grunschlag,
Tree Diagrams Monday, October 15, 2012 Mr. Pearson
Tree Diagrams Section 5.
{ a } { a, b } { a, b, c } { a, c } { b } 8 subsets. { b, c } { c }
Vegetables, salad and puddings will be available as normal
Counting and Probability
Presentation transcript:

The Basis of Counting

The Sum Rule Imagine you go out for lunch, and as a 1st course you can have soup or pate (but not both) you can have chicken soup or carrot soup or minestrone you can have duck pate or liver pate How many different 1st courses could you have?

The Sum Rule you can have chicken soup or carrot soup or minestrone duck pate or liver pate Chicken soup, or carrot soup, or minestrone, or duck pate, or liver pate

The Sum Rule The sum rule: If a first task can be done in M ways and a second task can be done in N ways, and you can either do the first or the second task (but not both) then there are N + M ways to choose

Product Rule For a main course you can have grilled salmon or steak or lasagne With the main course you can have baked potato or salad or chips or assorted vegetables How many different choices do you have for the main course?

Product Rule For a main course you can have grilled salmon or steak or lasagne With the main course you can have baked potato or salad or chips or assorted vegetables Grilled salmon and baked potato, or grilled salmon and salad, or grilled salmon and chips, or grilled salmon and assorted vegetables, or steak and baked potato, or steak and salad, or steak and chips, or steak and assorted vegetables, or lasagne and baked potato, or lasagne and salad, or lasagne and chips, or lasagne and assorted vegetables

Product Rule The Product Rule: If there are M ways to do a 1st task and N ways to do the second and you must do both, then there are M.N ways of doing them

Example How many passwords are there, where the passwords must have 6 alpha numeric characters first character must be a capital letter

23,819,453,632 How many passwords are there, where the passwords must have 6 alpha numeric characters first character must be a capital letter There are 26 choices for the 1st position (i.e. A or B or C or … or Z) 26 + 26 + 10 for the 2nd, 3d, 4th, 5th and 6th (a to z, A to Z, or 0 to 9) i.e. 62 for each of the other 5 positions 23,819,453,632 Think of it as 26 times a 5 digit number to the base 62

Inclusion-Exclusion Principle How many bit strings of length 8 either start with a 1 or end with 00? (a) There are 28 bit strings of length 8 (just so you know) (b) There are 27 bit strings of length 8 that start with a 1 note, this also includes strings that start with a 1 and end with a 00 (c) There are 26 bit strings of length 8 that end with 00 note, this also includes strings that start with a 1 (d) Using sum rule there are 27 + 26 bit strings that start with 1 or end with 00 but we have over-counted, adding in twice the strings that start with 1 and end with 00 (e) There are 25 bit strings of length 8 that start with a 1 and end with 00 (f) therefore we should have 27 + 26 - 25 bit strings

Inclusion-Exclusion Principle The Inclusion-Exclusion Principle: If there are M ways to do task A and N ways to do task B and both can be done at the same time, then if we use the sum rule alone (i.e. M+N) we over-count by the amount P, where P is when we do A and B simultaneously This is just like over-counting the cardinality of the union of 2 sets See Rosen page 308

Inclusion-Exclusion Principle How many bit strings of length 8 either start with a 1 or end with 00? Overcounted 1*****00 1******* ******00

fin