L02_MoreCounting_print

L02_MoreCounting_print - 1 COMP170 Discrete Mathematical...

Info iconThis preview shows pages 1–8. Sign up to view the full content.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: 1 COMP170 Discrete Mathematical Tools for Computer Science Discrete Math for Computer Science K. Bogart, C. Stein and R.L. Drysdale Section 1.2, pp. 9-19 More Counting Version 2.0: Last updated, JUL 19, 2007 Slides c 2005 by M. J. Golin and G. Trippen 2 1.2 Counting Lists, Permutations, and Subsets • Using the Sum and Product Principles • Lists and Functions • The Bijection Principle • k-Element Permutations of a Set • k-Element Subsets of a Set Binomial Coefficients 3 Some Simple Examples • Hong Kong car plates are of the form L 1 L 2 D 1 D 2 D 3 D 4 where the L i are letters in { A...Z } and the D i are digits in { ,... 9 } . e.g., AB 1234 , EC 1357 . How many car plates are there? • The entry code to our office is 4 characters long where each character is a number between { ... 9 } . e.g., 1012 , 2561 . How many door codes are there? • A computer system’s pasword must be 6 characters long, where each character is in { a...z,A...Z } . e.g., abcdEF, DHrsAQ, Mickey . How many passwords are there? 4 The entry code to our office is 4 characters long where each character is a number between { ... 9 } . E.G., 1012 , 2561 . How many door codes are there? A door code is of the form X 1 X 2 X 3 X 4 where, for i = 1 , 2 , 3 , 4 , X i ∈ { , 1 ,..., 9 } ( ∈ means is in or is a member of ) There are 10 possibilities for X 1 10 possibilities for X 2 10 possibilities for X 3 10 possibilities for X 4 ⇒ 10 × 10 × 10 × 10 = 10 4 = 10 , 000 possible door codes. Note; This is really the product principle What are the sets being used? 5 A computer system’s pasword must be 6 characters long, where each character is in { a...z,A...Z } . E.G., abcdEF, DHrsAQ, Mickey . How many passwords are there? A password is of the form D 1 D 2 D 3 D 4 D 5 D 6 where for i = 1 , 2 , 3 , 4 , 5 , 6 , D i ∈ { a...z,A...Z } . Each D i has 52 possible choices so, the total number of passwords is 52 × 52 × 52 × 52 × 52 × 52 = 52 6 6 Hong Kong car plates are of the form L 1 L 2 D 1 D 2 D 3 D 4 where the L i are letters in { A...Z } and the D i are digits in { ,... 9 } . e.g., AB 1234 , EC 1357 . How many car plates are there? Each L i has 26 possibilities and each D i has 10 possibilities so the total number of car plates is 26 × 26 × 10 × 10 × 10 × 10 = 26 2 × 10 4 = 6 , 760 , 000 7 Product Principle, Version 2 If a set S of lists of length m has the properties that 1. there are i 1 different first elements of lists in S , and 2. for each j > 1 and each choice of the first j- 1 elements of a list in S , there are i j choices of elements in position j of those lists, ⇒ there are i 1 i 2 ··· i m = Q m k =1 i k lists in S . We have just seen examples of L 3 L 1 L 2 L m ......
View Full Document

This note was uploaded on 08/25/2010 for the course COMP COMP170 taught by Professor M.j.golin during the Spring '10 term at HKUST.

Page1 / 41

L02_MoreCounting_print - 1 COMP170 Discrete Mathematical...

This preview shows document pages 1 - 8. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online