Solution Set for CS 482, Prelim 2 April 8, 2008 Questions in red, solutions in black. PROBLEM 1 (20 points)
PART A (15 points) Find a maximum flow and minimum s-t cut in the flow network G shown here.
5
1/25/08 - Greedy Scheduling Algorithms
Lecture: Greedy scheduling algorithms Reading: Chapter 4.1, 4.2 Interval Scheduling (jobs) Input: A set of pairs (si, ti)Ti=1 0 si ti T, si, ti N Output:
Introduction to Algorithms CS 482, Spring 2008
Solution Set 7
(1) First, we prove that Party Invitation is in NP. There is a polynomial-time verier that takes an instance I of Party Invitation cons
6
1/28/08 - Five Representative Problems
Lecture: Five representative problems Reading: Chapter 1.2 Earliest Start Time with Pre-emption (1) Preprocess the input to remove jobs whose interval contain
Introduction to Algorithms CS 482, Spring 2008
Solution Set 3
(1) (a) Heres a counterexample in which n = 3. Week 1 Week 2 Week 3 1 1 1 0 3 10
i
hi
The optimal solution picks the low-stress job i
Introduction to Algorithms CS 482, Spring 2008
Solution Set 2
(1) The algorithm restores the websites in decreasing order of ci /ti , where ci is the rate of lost dollars per hour for site i, and ti
CS 482 FINAL EXAM SOLUTION SET
(1) (10 points) Each of the following statements is false. Give a counterexample to each of them. (1a) (5 points) If G is any graph with non-negative edge costs, and e
Introduction to Algorithms CS 482, Spring 2008
Solution Set 3
(1) We describe an algorithm Test(S) whose input is a set S of bank cards and whose output is: a bank card x S such that more than hal
Introduction to Analysis of Algorithms
CS4820 Spring 2013
Sample Homework Solutions
Thursday, January 24, 2013
Based on the original version by Constadino Moraites and Bobby Kleinberg, CS 4820 S12.
1
Introduction to Algorithms CS 482, Spring 2008
Solution Set 1
(1) This problem can be solved using a greedy algorithm which always attempts to place the next cell phone tower as far east as possible
CS 1110, LAB 1: EXPRESSIONS AND ASSIGNMENTS
http:/www.cs.cornell.edu/courses/cs1110/2017sp/labs/lab01.pdf
First Name:
Last Name:
NetID:
Learning goals: (1) get hands-on experience using Python in inte
Introduction to Algorithms (CS 482)
Instructor: Bobby Kleinberg
Cornell University
Lecture Notes, 25 April 2008
The Miller-Rabin Randomized Primality Test
1
Introduction
Primality testing is an import
CS 1110, LAB 3: STRINGS; TESTING
http:/www.cs.cornell.edu/courses/cs1110/2017sp/labs/lab03.pdf
First Name:
Last Name:
NetID:
Getting Credit: Deadline: the first 10 minutes of (your) lab two weeks from
CS 1110, LAB 02: FUNCTIONS AND (IN) MODULES SOME HI-LIGHTS
http:/www.cs.cornell.edu/courses/cs1110/2017sp/labs/lab02.pdf
Last Name:
First Name:
NetID:
Lab updated from the printed version on Feb 6 4:3
CS 1110 Spring 2017, Assignment 1: Currency Conversion
http:/www.cs.cornell.edu/courses/cs1110/2017sp/assignments/hw1.pdf
February 14, 2017
Figure 1: BTC stands for the cryptocurrency Bitcoin, but we
Problem 4.9 solution
a. If we consider a clique where an edge u has weight 2 and the rest of them having the
weight 3, a MST will certainly contain u, while a minimum bottleneck wont. This shows
that
Introduction to Algorithms (CS 482)
Instructor: Bobby Kleinberg
Cornell University
Lecture Notes, 30 April 2008
Online Prediction Algorithms
1
Binary prediction with one perfect expert
As a warm-up fo
Announcements
Anatomy of a Specification
One line description,
Announcements will be made in lecture about:
Lab 3
Assignment 1
Extra help
More detail about the
Greeting has format 'Hello <n>!' fun
Introduction to Algorithms CS 482, Spring 2008
Solution Set 6
(1) (a) To compute whether the blood on hand meets the projected demand, one can construct a ow network with 10 vertices. A super-sourc
Problem 27
Lets first try to see what happens if for two different spanning trees of G, there is exactly one
edge that is into one of the spanning trees and not in the second. This case, according the
Problem 1.2
Decide whether you think the following statement is true or false. If it is true, give a short explanation. If it is false,
give a counter example.
True or false? Consider an instance of t
Exercises 1
Decide whether you think the following statement is true or false. If it is true, give a short explanation. If it is false,
give a counterexample. True or false? In every instance of the S
38
4/21/08 - Randomized algorithms
Randomized Algorithms Review Ch. 13.12, read 13.1 - 6. A probability space consists of a sample set (nite in CS 482) and a probability 0 Pr(x) 1 for every x , s
Introduction to Algorithms CS 482, Spring 2008
Solution Set 9
(1) Let T be the number of trucks used by the algorithm, and suppose the trucks are labeled 1, 2, . . . , T in the order that the algori