MIT6_042JS10_lec29_sol

# MIT6_042JS10_lec29_sol - Massachusetts Institute of...

This preview shows pages 1–2. Sign up to view the full content.

Massachusetts Institute of Technology 6.042J/18.062J, Spring ’10 : Mathematics for Computer Science April 16 Prof. Albert R. Meyer revised April 20, 2010, 1015 minutes Solutions to In-Class Problems Week 10, Fri. Problem 1. A certain company wants to have security for their computer systems. So they have given every- one a name and password. A length 10 word containing each of the characters: a, d, e, f, i, l, o, p, r, s, is called a cword . A password will be a cword which does not contain any of the subwords ”fails”, ”failed”, or ”drop”. For example, the following two words are passwords: adefiloprs, srpolifeda, but the following three cwords are not: a drop eﬂis, failedrop s, drop e fails . (a) How many cwords contain the subword “drop”? Solution. Such cwords are obtainable by taking the word “drop” and the remaining 6 letters in any order. There are 7! permutations of these 7 items. (b) How many cwords contain both “drop” and “fails”? Solution. Take the words “drop” and “fails” and the remaining letter “e” in any order. So there are 3! such cwords. (c) Use the Inclusion-Exclusion Principle to find a simple formula for the number of passwords. Solution. There are 7! cwords that contain “drop”, 6! that contain “fails”, and 5! that contain “failed”. There are 3! cwords containing both “drop” and “fails”. No cword can contain both “fails” and “failed”. The cwords containing both “drop” and “failed” come from taking the sub- word “failedrop” and the remaining letter “s” in any order, so there are 2! of them. So by Inclusion- exclusion, we have the number of cwords containing at least one of the three forbidden subwords is (7! + 6! + 5!) (3! + 0 + 2!) + 0 = 5!(49) 8 . Among the 10! cwords, the remaining ones are passwords, so the number of passwords is 10! 7! 6! 5! + 3! + 2! = 3 , 622 , 928 .

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

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### What students are saying

• 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.

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

• 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.

Dana University of Pennsylvania ‘17, Course Hero Intern

• 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.

Jill Tulane University ‘16, Course Hero Intern