CSE 2320 - Assignments - Assignment 2

Submit to Blackboard before the deadline. You will be able to revise your answers until the deadline with no penalty.


Task 1 (5 pts.)

(This is Problem 2.10 from the textbook).

Add columns to Table 2.1 for N(log N)2 and N3/2.


Task 2 (5 pts.)

(This is Problem 2.11 from the textbook).

Add rows to Table 2.1 for 107 and 108 instructions per second.


Task 3 (10 pts.)

(This is Problem 2.14 from the textbook).

How many digits are there in the decimal representation of 1 million factorial?


Task 4 (10 pts.)

(This is Problem 2.15 from the textbook).

How many bits are there in the binary representation of log(N!)?


Task 5 (10 pts.)

(This is a modification of Problem 2.19 from the textbook).

Give the largest value of N for which you can solve a problem that requires at least f(N) instructions on a machine that can execute 109 instructions per second, for the following functions f(N): N3/2, N5/4, 2NHN, N log N log log N, and N2 lg N. Assume that your program running time cannot exceed 24 hours.


Task 6 (10 pts.)

(This is Problem 2.23 from the textbook).

Show that N ln N = O(N3/2).

NOTE: In your answer, feel free to use the fact that ln(N) = O(N), you do not have to prove that.


Task 7 (10 pts.)

(This is a modification of Problem 2.30 from the textbook).

You are given the information that the running time of one algorithm A is always about 100* (N log N) and that the running time of another algorithm B is always about N3. For example, for N=5:

Calculate the ranges of N under which each algorithm will run faster than the other one.


Task 8 (10 pts.)

Suppose that CN = CN/2 + 5. Show that CN = O(log N).


Task 9 (10 pts.)

(This is Problem 2.40 from the textbook).

Solve the recurrence:

            CN = CN/2 + N2,       for N >= 2, with C1 = 0,

when N is a power of 2.


Task 10 (10 pts.)

(This is Problem 2.42 from the textbook).

Solve the recurrence:

            CN = α CN/2,       for N >= 2, with C1 = 1,

when N is a power of 2.


Task 11 (10 pts.)

(This is Problem 2.43 from the textbook).

Solve the recurrence:

            CN = (CN/2)2,       for N >= 2,

when N is a power of 2.


How to submit

The assignment should be submitted via Blackboard. Submit a file called answers.xxx, that is a PDF or Word file containing your solutions for all tasks (there are no programming tasks in this assignment).

IMPORTANT: Pay close attention to all specifications on this page, including file names and submission format. Even in cases where your answers are correct, points will be taken off liberally for non-compliance with the instructions given on this page (such as wrong file names, wrong compression format for the submitted code, and so on). The reason is that non-compliance with the instructions makes the grading process significantly (and unnecessarily) more time consuming. Contact the instructor or TA if you have any questions.


Back to the list of assignments.