Math 152 (Spring 2009, Bates) Lab 6 Due March 24, 2009

advertisement
Math 152 (Spring 2009, Bates) Lab 6
Due March 24, 2009
This should be a fairly quick one for you. This was intentional since Lab 5 was a little nastier than I had
anticipated.
1. (4 points) Copy the Caesar cypher procedures out of the lab .mw file into your homework file. Now
write a procedure which spits out the 26 possible messages for any given encrypted message, i.e., have
it take in a list and spit out 26 strings, one for each possible shift.
2. (2 points) Apply your function to the message ”weet zer...iulud feydji veh oek!”
3. (4 points) Short answer questions (?!) – you can just add these to the bottom of your lab as comments:
(a) Suppose you want to cut down on the number of lines you need to stare at in your code. What
is something you could do to identify output lines that are clearly incorrect? One (feasible) idea
is enough.
(b) Briefly, in just a couple sentences at most, how would you implement that/those idea(s)?
(c) Deciphering Caesar is trivial. How could you decipher viginere? In particular, how could you
systematically try keys if you knew that the key had at most m letters?
(d) How would you implement that (again, very briefly)?
1
Download