Exercise #2

# Exercise #2 - a consider your student number as three...

This preview shows page 1. Sign up to view the full content.

Exercise #2 1. Fibonacci numbers and golden ratio: F(19) = 4181, what is F(20)? 2. What is an exponential algorithm? (Avoid circular definition, such as using the word exponential) 3. Given the Full O n , find Partial O n and Big-O Algorithm Full O n Partial O n Big-O 1 340n 6 + 2n 4 + 4n +5000 2 5nlog(n) + 0.04n! 3 7(n-1) 2 + (5n 2 +8) 4. Consider the following pseudocode which manages and reallocates memory usage by a program based on the size of a file which that program manages: As the file size n increases, memory will be consumed at what rate? (Perform Big-O analysis) 5. Prove modular addition 6. Why does hash function require a large prime number? 7. Define a hash function for your 9-digit student number, under following conditions:
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: a. consider your student number as three 3-digit numbers b. use a prime number greater than 100, for example, 101 8. Given two prime numbers, 23 and 31. Find public and private key 9. You were given two algorithms to compute a b mod N for large values of a, b, N a. Which algorithm is faster? Why? b. Which algorithm breaks first as N increases in size? Why? while (file still open) let n = size of file for every 100,000 kilobytes of increase in file size double the amount of memory reserved modexp1(a,b,N) set ans=1 for i=1 . . . b ans=ans*a mod N return ans modexp2(a,b,N) if b=0 return 1 ans=modexp2(a, floor(b/2), N) if b is even return ans 2 mod N else return a * ans 2 mod N...
View Full Document

## This note was uploaded on 03/31/2012 for the course MIE 335 taught by Professor Frances during the Spring '12 term at University of Toronto.

Ask a homework question - tutors are online