L02_MoreCounting_print

L02_MoreCounting_print - COMP170 Discrete Mathematical...

Info icon This preview shows pages 1–9. Sign up to view the full content.

View Full Document Right Arrow Icon
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
Image of page 1

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

View Full Document Right Arrow Icon
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
Image of page 2
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 { 0 , . . . 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 { 0 . . . 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?
Image of page 3

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

View Full Document Right Arrow Icon
4 The entry code to our office is 4 characters long where each character is a number between { 0 . . . 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 ∈ { 0 , 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?
Image of page 4
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
Image of page 5

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

View Full Document Right Arrow Icon
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 { 0 , . . . 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
Image of page 6
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 = m k =1 i k lists in S . We have just seen examples of L 3 L 1 L 2 L m . . . i m i 2 i 1 i 3 × × × × . . .
Image of page 7

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

View Full Document Right Arrow Icon
8 Combining Sum and Product Principles A password for a certain computer system is supposed to be between 4 and 8 characters long and composed of lowercase and/or uppercase letters. How many passwords are possible? This is a counting problem! Should we use sum or product principle?
Image of page 8
Image of page 9
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern