






Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!







UC Berkeley—CS 170 Final Lecturer: Satish Rao May 16
Print your name:
(last) (first)
Sign your name:
Write your section number (e.g., 101):
Write your SID:
Three pages of notes is permitted. No electronic devices, e.g. cell phones and calculators, are permitted. Do all your work on the pages of this examination. If you need more space, you may use the reverse side of the page, but try to use the reverse of the same page where the problem is stated.
You have 180 minutes. The questions are of varying difficulty, so avoid spending too long on any one question.
In all algorithm design problems, you may use high-level pseudocode or sketch it in English as long as you make yourself clear.
WARNING: Almost all the answers should be short. No more than a two or three sentences (or a few equations) should suffice. No novels please. Writing more may negatively impact your grade.
DO NOT TURN THE PAGE UNTIL YOU ARE TOLD TO DO SO.
Problem Score/Points Name/Section/etc. 1 / 2 / 3 / 4 / 5 / 6 / 7 / 8 / 9 / 10 / Total /
I want to make shoes: Air Jordans and Ground Raos. I make a profit of 100 dollars on Air Jordans, and a loss of 10 dollars on Ground Raos. To keep myself happy, I have to make at no fewer than 1 Ground Rao for each Air Jordan. I can only make 110 shoes in all, and each Air Jordan takes 2 units of talent where as a ground Rao takes (wastes?) 1 unit of talent. The total talent is 100.
Give a factor of two approximation algorithm for the 2-TSP problem where one is given a set of cities, distances among the cities that obey triangle inequalities, and two cities a and b, where salesmen are based. One wishes to find a tour for each salesman where each city is visited by one of the salesman (each tour return the salesman home.)