Problem 2. Code-breaking
Your friend, who is also taking 6.00, is really excited about the program she wrote for Problem 1
of this problem set. She sends you emails, but they’re all encrypted with the Caesar cipher!
The problem is, you don’t know which shift key she is using. The good news is, you know your
friend only speaks and writes English words. So if you can write a program to find the decoding
that produces the maximum number of words, you can probably find the right decoding (There’s
always a chance that the shift may not be unique. Accounting for this would probably use
statistical methods that we won’t require of you.)
Part a: Pseudocode
Think about an algorithm you could use to solve this problem. Write the steps down and save in
the textfile named ps4.txt.
Dostları ilə paylaş: |