CSI 403 Spring 2011

Syllabus and course policies.

Besides the learning objectives written in the original syllabus, I've added others: (a) Implement, test, debug and measure performance on big and small problem sizes of algorithms based on their exposition and pseudo-code descriptions in textbooks like CLRS. (b) Write reports of what are the topics and facts stated and/or proved in specified sections or chapters of textbooks like CLRS. (c) Write demonstrations on paper of algorithmic ideas applied to novel problems and runs of algorithms described in English, pseudo-code or practical code.

This is the website for course assignments, notes and other resources. Blackboard is used for submitting homework, conducting discussions and tracking grades. Some homework must be submitted on paper, some including all programs must be submitted to Blackboard, and some homework can be submitted on Blackboard or on paper, your choice.

General Resources

Week by week record

What will happen in lectures:

  1. Quizzes on reading and lecture attention, that will count toward your grade!
  2. Quizzes on what you might or might not know yet!
  3. A few members or the whole class asked to demonstrate an algorithm in their seats!
  4. Live demos of programming in Java! Watch your professor get stuck on syntax errors and bugs!
  5. Think-pair-and-share to figure out how algorithms work and how to program them!
  6. Notes scribbled electronically by professor and presentation materials that you don't have to copy because they will go on the Web!
  7. Occasionally, cool, corny videos from UTube or visits to other cool web sites!
  8. Discussions to clear up confusion before getting frustrated at the computer!
  9. End of class quizzes or "minute papers" to see how well you learned: counts toward grade too!

Week 1

Day Readings/Assignments/Topics Resources
C01 Thu Jan 20

6.

Week 2

Readings: Chapter 1 and Chapter 2

Day Readings/Assignments/Topics Resources
C02 Tue Jan 25

1. 2. 6.

  • Quiz on the reading
  • Describe the sorting problem, before learning how CLRS do it.
  • Introduction to algorithms via two algorithms and programs for the sorting problem.
  • Lecfure notes (.pdf)
C03 Thu Jan 27

1. 3. 6.

Week 3

Readings: Chapter 4 (just skim the Strassen section) and Chapter 6 (1-4).

Day Readings/Assignments/Topics Resources
C04 Tue Feb 1
  • Don't get "snowed" Write for each subsection (that is subsection under a boldface heading) write one sentence that says what is done in that subsection. After you are finished writing one sentence for each subsection, go back and write another sentence for each subsection that sanswers "How?"
C05 Thu Feb 3
  • Suprise quiz: Draw an example of a heap with 7 keys.
  • New views on "What is the sorting problem" from class members.
  • Homework Assignment 3: T1: (Paper) Demonstrate HEAP-SORT on paper. P1: (Blackboard) Program HEAP-SORT as described in the text into your sorting code benchmarking program. E1: (Paper) Plot, on linear and log-log grids and compare the actual running times for the entire range of practical problem sizes for (1) your best MERGE-SORT implementation with (2) your HEAP-SORT implementation.
  • HEAP-SORT: An application of trees. How to read a CS book. Our order: 6.4, 6.1, 6.2, 6.3 Mostly class discussion using the chalkboard. Everything covered except the run time analysis. "Clever ideas" pointed out.
  • Homework idea: Scribble on a recursion history tree the time-on-the-clock when each activation started and each activation finished.

Week 4

Readings: CLRS Sections 8.1, 8.2, 8.3, 8.4

Day Readings/Assignments/Topics Resources
C06 Tue Feb 8
C07 Thu Feb 10

2., 6., 7.

  • In class quiz: Make your own decision tree for sorting (a1,a2,a3).

    The decision tree model for sorting is defined so each question is only of the form "Is ai < aj ?" for just two keys. This question has only a yes-no answer. A decision tree for sorting (a1,a2,a3) MUST (1) Be only one tree and (2) have 6 leaves, one for each of the 6 answers which are the orders of distinct keys.

  • Tree-lore: Number of nodes, total, internal and leaves, in a complete binary tree of a given height.
  • Homework 1 returned and graphs of merge versus selection sort times viewed and compared.
  • Homework Assignment 4 (slipped DUE Mar. 3 after break, but extra credit if in by Thursday, Feb 17, 9 days, everything on PAPER)

    In Chapter 8, the decision tree model for comparison sorting is explained and used, and then sorting based on NUMERIC properties of keys, over and above their ordering, is discussed. We showed that the computer can figure out exactly where key

    532,231 should be placed when all the keys are in the 1-1,000,000 range of integers.

    T1:(a) In your own words, explain the conclusion of 8.1.(b) Draw your one decision tree for sorting (a1,a2,a3,a4): Make sure it has 24 leaves. Hint: Write out the 24=4! leaves first.

    T2: (a) In your own words, explain the conclusion of section 8.2. (b) Exercise 8.2-1

    T3: (a) In your own words, explain the conclusion of 8.3. (b) Exercise 8.3-1.

    T4: (a) In your own words, explain the conclusion of 8.4. (b) Exercise 8.4-1.

    T5: Exercise 8.4-2. Hint: An algorithm can be a combination of algorithms.

Week 5

Readings:

Day Readings/Assignments/Topics Resources
C08 Tue Feb 15
  • Notes of last week and this week.
  • HW 4 (see above) due Thurs, Mar. 3 (Extra credit if in before the break.)
  • Half rounded up of the nodes are at the bottom level!
  • Figuring out formulas for things like the number of nodes in a complete 3-ary tree when you don't know the answer already. (meta-education)
  • Runtime analysis of HEAP-SORT and its supporting sub-algorithms: Why BUILD-HEAP takes O(N) time instead of O(N log N) (applies Calculus).
C09 Thu Feb 17
  • Comparison idea and decision tree model for distinguishing among 9 "Jewels": Discussion and application to the sorting problem log(N!) comparison lower bound.
  • The ratio test of calculus applied to help know that the BUILD-HEAP step (Phase 1 of Heap-sort) takes O(N) time and not O(N log N).
  • Cleverness of counting sort (just began)

Winter break

Week 6

Readings:

Day Readings/Assignments/Topics Resources
C10 Tue Mar 1
C11 Thu Mar 3
    • T0: Begin to review the chapters on Data Structures in CLRS. Write an assessment of how much understand of each section. That will guide how much we cover of it in class.
    • T1: CLRS Exercise 5.1-2 Only do it when b-a+1 (number of possible return values for RANDOM(a,b)) is a power of 2, so it is easy to use binary search.
    • T2: CLRS Exercise 7.1-1.
    • P1: Add QUICKSORT to your sorting laboratory program.
    • E1: (a) Add to your laboratory program the ability to initiallize the array to be sorted with random values. (b) Benchmark and plot one running time for the usual sequence of sizes of arrays to be sorted with QUICKSORT. Use the same environment that you used for other experiments.
    • T3: Demonstrate the faster divide and conquer multiplication algorithm from class for multiplying 12345678 (base ten) by 87654321.

Week 7

Readings:

Day Readings/Assignments/Topics Resources
C12 Tue Mar 8
C13 Thu Mar 10

Week 8

Readings:

Day Readings/Assignments/Topics Resources
C14 Tue Mar 15
C15 Thu Mar 17

Midterm Exam in class

Week 9

Readings:

Day Readings/Assignments/Topics Resources
C16 Tue Mar 22
C17 Thu Mar 24
  • HW 7 (Due Mar 31 as usual)
    • T1: Exercise 10.1-2 Write pseudo-code AND demonstrate on a small example.
    • T2: Exercise 10.3-1 MUST demostrate the array-representation idea: Learn it by reading.
    • T3: Exercises 10.4-2 AND 10.4-3 Demonstrate on the SAME SMALL GENERIC binary tree.
    • T4: Exercise 10.4-6 Draw a picture. Hint: Use the same pointer fields(s) for different purposes.
    • P1: Demonstrate Exercise 11.1-2 with a BitVector Java class. Find out about Java bit operations. The constructor must accept ints m. Hints: The constructor constructs an array of Java ints. Access involves dividing by 32 and getting the remainder mod 32..
    • T5: Exercise 11.4-1
    • Reading: The chapter on B-trees. (Ch. 18).
  • Discussion of
    • balanced trees
    • hashing including the fact about the same address sequence for open addressing
    • intro to B-trees.

Week 10

Readings:

Day Readings/Assignments/Topics Resources
C18 Tue Mar 29

Midterm-Makeup Problem: Problems versus Algorithms

Write on 5 separate pages the following for each of the 5 problems below.

What to write:

  • The problem statement, informatively, terms of input and output (NOTHING MUST BE MENTIONED ABOUT ALGORITHMS or the problem's difficulty)
  • Brief descriptions of two different algorithms that solve the described problem, where the two algorithms MUST have different asymptotic worst case running times. For example, for the MERGE problem, one algorithm is the simple merge procedure which takes O(N) time and another is MERGE-SORT (applied to the two subarrays together) which takes O(N log N) time.

The Problems:

  1. Sorting (p. 16)
  2. Searching (p. 22)
  3. Merging (class notes only-not written out explicitly in CLRS)
  4. Maximum subarray (p.69: You write your own input/output formal statement).
  5. Selection problem (p.213)

Students who answered the midterm question to state and compare PROBLEMS without reference to ALGORITHMS got 14 points on the midterm for this. Everyone else will get those 14 midterm exam points from doing this homework. DUE (like taxes) Thu, April 14.).

C19 Thu Mar 31

Week 11

Readings: Chapter 17

Day Readings/Assignments/Topics Resources
C20 Tue Apr 5
C21 Thu Apr 7

(2)

  • In class quiz: Write the recursive pseudo-code for the in-order traversal of a binary tree with a rank field in each node that causes the rank field to become set to the rank of the node in binary search order. Hint: Use a global counter variable G to keep track of the last rank value assigned.

Week 12

Readings:

Day Readings/Assignments/Topics Resources
C22 Tue Apr 12
C23 Thu Apr 14
  • hw 10 Due Thurs, Apr 28
    • T1 15.1-5
    • T2 15.2-1
    • T3 15.3-2
    • T3 25.2-1

Spring Break

Week 13

Readings:

Day Readings/Assignments/Topics Resources
C24 Tue Apr 26
C25 Thu Apr 28

Week 14

Readings:

Day Readings/Assignments/Topics Resources
C26 Tue May 3
  • Post-midterm topic summary.
  • Shortest paths with Dijkstra's algorithm
    1. Learning from theorems stated in books or papers: (a) What the theorem says. (b) Why it is true, if it is, is explained with a proof.
    2. The power of an invariant to understand why a subtle algorithm like Dijkstra's solves its problem correctly.

Advice for studying for the final exam:

  1. Open books/notes (as with the midterm)
  2. Use textbook coverage of EACH ALGORITHM we covered from around the midterm to the end of the semester to review the algorithm. Refer to your homework papers, class notes, recollections from class and reading or rereading of the textbook.
  3. Review exactly what problem each covered algorithm solves. You might be asked to solve an example of the problem WITHOUT reference to an algorithm, like to find the best way to multiply a sequence of 3 or compatible matrices of different sizes.
  4. Review the IDEA(s) of each algorithm. Also review its asymptotic running time.

List of textbook sections emphasized after the midterm:

Final Exam: Thursday, May 12, 1:00PM-3:00PM.