In the 2004 movie National Treasure, Ben and Riley are attempting to guess Abagail’s password to enter the room with the Declaration. They are able to determine the passphrase to get into the vault room by doing a scan that detects the buttons pushed (not due to chocolate but just due to the natural oils on fingers). They notice that the buttons pushed include the characters AEFGLORVY.
Assuming these characters are used only once each, how many possible passphrases are possible?
In this case, the order of the characters matters but all of the characters are distinct. Since we have 9 characters provided, the we can consider each character as an event with the first event as a choice from the 9, the second event as a choice from the remaining 8, etc. This gives \(9 \times 8 \times ... \times 1 = 362880\) possible passphrases.
Assuming that some of the characters could be used more than once, how many passphrases need to be considered if the total length of passphrase can be at most 12 characters?
Notice, in this case you don’t know which characters might be reused and so the number of possible outcomes will be much larger. What is the answer?
You can break this problem down into distinct cases:
- Using 9 characters: The answer was computed above.
- Using 10 characters: In this case, 1 character can be used twice. To determine the number of possibilities, let’s first pick which character can be doubled. There are 9 options for picking that character. Next, if we consider the two instances of that letter as distinct values then we can just count the number of ways to arrange unique 10 characters which is 10! However, swapping the two characters (which are actually identical) would not give a new passphrase. Since these are counted twice, let’s divide these out to give 10!/2.
- Using 11 characters: In this situation we have two unique options:
-
One character is used three times and the others just once.Continuing as in the previous case, 11!/3!.Two characters are used twice and the others just once.
-
- Using 12 characters
With this large collection of possible outcomes, how are the movie characters able to determine the correct "VALLEYFORGE" passphrase?