Monthly Archives: January 2015

Tutorial #3 Problems

  1. Consider the problem of making change for n cents, using the least number of coins. The input to this problem is the integer n, and the output is a sequence of coin values (where each value is allowed to appear multiple times) whose sum adds up to n.
    1. Describe a greedy algorithm to make change consisting of quarters (25 cents), dimes (10 cents), nickels (5 cents) and pennies (1 cent, a blast from the past).
    2. Give an example showing that there are set of coin values (although obviously not quarters, dimes, nickels, and pennies) for which the greedy algorithm does not always return a solution using the least possible number of coins.
  2. In the Exhibition Guarding Problem, we are given a line L that represents a long hallway in a show room. We are also given an unordered set X = {x0, x1, … xn-1} of real numbers that represent the positions of precious objects or sculptures in this hallway. Suppose that a single guard can protect all the objects within distance at most d of his or her position, on both sides.
    1. Design an algorithm for finding a placements of guards that uses the minimum number of guards to guard all the objects with positions in X.
    2. Analyze the running time of your algorithm as a function of n, the number of objects that need guarding.
    3. Prove that your algorithm works (write as complete an argument as you can in the time available in the tutorial).

Slides #7: Greedy Clustering

Let’s work some problems centering on pictures of Naomi. (The primary target of my image-capturing devices.)

Just for fun: UBC CS’s most cited paper (last I checked!), by David Lowe, looks at how to find similar features between images using the SIFT algorithm.

Our reading question was to determine for a particular interval in the following unweighted scheduling problem whether that interval would be considered by the textbook’s greedy algorithm before or after the interval labeled A. Which interval you needed to look at depended on your section and student #.

2015-01-23-rq-8am

Read Before 2015/01/23 Class

  • Section 4.1 (and the intro to Chapter 4)

Optional, just for fun:

If you’d like to get ahead, we’ll be reading sections 4.3, 4.5, 4.6, and 4.7. Section 4.4 should be review of CPSC 221. Then, we’ll move on to Chapter 5.