This preview shows pages 1–2. Sign up to view the full content.
This preview has intentionally blurred sections. Sign up to view the full version.
View Full Document
Unformatted text preview: 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 InClass 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 InclusionExclusion 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 ....
View
Full
Document
This note was uploaded on 05/27/2011 for the course CS 6.042J taught by Professor Prof.albertr.meyer during the Spring '11 term at MIT.
 Spring '11
 Prof.AlbertR.Meyer
 Computer Science

Click to edit the document details