Week 7 - Permutations, Combinations.pdf

12 Pages
544 Views

Department
Computer Science
Course Code
CSCA67H3
Professor
Anna Bretscher

This preview shows pages 1,2 and half of page 3. Sign up to view the full 12 pages of the document.
Description
Counting Pizza Toppings* The commercial’s deal was: ▯ 2 pizzas ▯ up to 5 toppings on each ▯ 11 toppings to choose from ▯ all for $7.98 (back in 1997). The commercial’s math kid claimed there are 1,048,576 possibil- ities. Let’s do the calculation ourselves. Q. How many ways can we order a pizza with 0 toppings? A. Q. How many ways can we order a pizza with 1 topping? A. *http://mindyourdecisions.com/blog/2011/04/27/math-problem-pizza-topping-combinations/ 1 Q. How many ways can we order a pizza with 2 toppings? A. Q. How many ways can we order a pizza with 3 toppings? A. ▯ ▯ Does the order that the toppings are picked matter? How many times have we over counted? Q. How many ways can we order a pizza with 4 toppings? A. Q. How many ways can we order a pizza with 5 toppings? A. 2 Therefore the total number of ways to order a pizza with up to 5 toppings when choosing from 11 toppings is: Q. How did they get 1,048,576 in the commercial? A. Q. Is 1,048,576 the correct answer? A. No. Q. What is their mistake? and how do we correct for it? A. Q. This is stilll not quite correct. Why? A. 3 Q. How do we know that this is the correct answer? A. One way to convince ourselves is try to find another way to count the same problem. We counted all possible orders and then removed duplicates. Exercise. Recount using a different method. Exercise. How many ways are there to order the pizzas, if dou- ble toppings are allowed (ie., two of the toppings are the same)? 4 Example. Creating a secure password. To create a account, you are required to give 8 or more alphanumeric characters. Q. Why so many? Why not just 4? A. Let’s count how many possible passwords there are of lengths 4 and 8 and compare. 5 Q. How many alphanumeric characters are there? A. Q. How many passwords are there of length 4? A. Q. Why do we multiply instead of add? A. Q. How many passwords are there of length 8? A. So there are more than 14 million times as many passwords of length 8 than of length 4. 6 The Sum Rule When counting we need to be able to determine whether to sum or multiply the number of objects. The Sum Rule. If an operation can be performed in n different ways, each having x possible outcomes, then the total number i of outcomes possible is Xn xi i=1 Example. Ordering pizza. Suppose a pizza shop offers 5 types of toppings, and one has the choice of a 3 topping, 2 topping or 1 topping pizza. Determine how many different pizzas can be ordered. Number of Toppings Number of Pizza Choices ix ) 1 2 3 Total number of ways to order a pizza: 3 X xi=
More Less
Unlock Document

Only pages 1,2 and half of page 3 are available for preview. Some parts have been intentionally blurred.

Unlock Document
You're Reading a Preview

Unlock to view full version

Unlock Document

Log In


OR

Join OneClass

Access over 10 million pages of study
documents for 1.3 million courses.

Sign up

Join to view


OR

By registering, I agree to the Terms and Privacy Policies
Already have an account?
Just a few more details

So we can recommend you notes for your school.

Reset Password

Please enter below the email address you registered with and we will send you a link to reset your password.

Add your courses

Get notes from the top students in your class.


Submit