Submit, in hardcopy, answers to the following problems
generated form LaTeX source according to the usual
homework submission guidelines.
Also build up your CVS repository with the following:
/homework/cmsi282/hw2.tex
/homework/cmsi282/src/main/java/edu/lmu/cs/yourloginname/sort/Bozosorter.java
/homework/cmsi282/src/main/java/edu/lmu/cs/yourloginname/collections/PriorityQueue.java
/homework/cmsi282/src/test/java/edu/lmu/cs/yourloginname/collections/PriorityQueueTest.java
/homework/cmsi282/src/main/java/edu/lmu/cs/yourloginname/numbers/PrimalityTester.java
/homework/cmsi282/src/test/java/edu/lmu/cs/yourloginname/numbers/PrimalityTesterTest.java
/homework/cmsi282/src/main/java/edu/lmu/cs/yourloginname/crypto/AutoKeyVigenere.java
/homework/cmsi282/src/test/java/edu/lmu/cs/yourloginname/crypto/AutoKeyVigenereTest.java
Make sure that you have run the setup-class
script so that I can checkout and run your code from CVS while grading.
- Implement a Java class edu.lmu.cs.xxx.sort.Bozosorter (where xxx is
your login name) with a single static method called sort whose job it is
is to sort an array of integers using the Bozosort algorithm.
Perform some empirical runtime studies on your method.
That is, for list sizes of 2, 3, 4, 5, 6, ... (to as high as
you want to go), give the average runtime of your method over
several trial runs. Present your results in a nicely formatted
LaTeX generated table.
- Implement a priority queue class with a heap implementation, and
a unit test. Use Java or Groovy.
- Implement a Java class called PrimalityTester with a static method called
isProbablePrime that takes in a value k and a BigInteger n and returns whether
n is prime with a margin of error of 2-k using the Soloway-Strassen
test. Write a unit tester that checks various values for k=40 (assume the
primality test in java.lang.BigInteger is always correct).
- Implement the Autokey Vigenere cipher, from scratch, in Java.
Treat characters as codepoints.
- The following ciphertext was intercepted. You know the message
is in English and that the sender used a monoalphabetic substitution
cipher. What is the plaintext?
UIQLDEVORHIWLTQTOKMQMWROUOQQMQLKIQWQVIEWRDQTLEQMWRWXFTWHTOA
DMRDQIOKWXMAOHMRMRHQVOQWLTAOMRQODPMDQWMRDQTLEQOEWAFLQITBVOQ
QWKWUIQLDEWREIRQTOQITOQVITWRIJFUOMRMRHQWVLAORSIMRHDBVOQBIBO
RQOEWAFLQITQWKW
- Decrypt the following ciphertext, given that you know it was
encrypted with the bifid algorithm in which the Polybius square
was laid out in the usual fashion using the keyphrase "Darn, not
another cryptanalysis question".
TWBTLLAEPODTUBTWBTLTDLDDVSNNHEETLSKDDSIFGIIMWLYDKDDSPHBPQKOFHMDLSKRS
- If someone's RSA public key is (729880581317, 5), what is her private
key? Give a detailed derivation, showing all work..