### Problem Set #1

#### Due: Sep 15th, 2015 at 2pm

1. How many permutations are there on the set A={1,...,10}?

2. Recall in class that we built a substitution cipher on the set R = {A,B,C,...,Z} by filling in a table with a permutation of R. Suppose we wanted to build a modern block cipher in the same way. Let's say we want a block-size of 64 bits and a key size of 56 bits (just like DES). Each key will name a table that we will build explicitly by filling in with random numbers according to the restriction that each table named by a key must be a permutation.
How much memory would our block cipher description require? Please show your work.

3. Go look up "cycle notation" for permutations (if you don't already know it). Write down all permutations, in cycle notation, on the set B={1,2,3}.

4. What is the probability that a random permutation on set A (see problem 1) is represented by one cycle?

5. (Harder.) What is the probability that a random permutation on A is an involution?

6. Learn Python. (Just learn a little bit... we'll use it later.) You can do this online or buy/borrow a book if you like. As a warm up, write a program to generate a random permuation on A and output it in cycle notation. Please run your program 5 times and include the output and along with your source code.

7. Run you program again, but on the set C={1,...,1000}. Do not output your random permutation this time; instead quietly run your program 10,000 times and give the average length of the longest cycle. Please include source code with your answer.