1 views

Uploaded by ajgemini

- JENSEN, A Bayesian-Network Tool for Automated Diagnosis of Printing Systems
- A Bijective Proof of Garsia's Q-Lagrange
- 09 Chapter 1
- 5 GATE CS 2000 GeeksforGeeks
- Mipt 2014 Burunduk1.En
- GT Math 3012 Homework 2
- ssdbm2012
- Advanced Data Structures and Algorithms
- A g r a p h t h e o r e t i c m o d e l o f d a t a s t r u c t u r e s
- ADA Chap 1
- 9547-44987-1-PB
- Term Paper
- L14 Graph Part03
- CS236 Project 6: Report
- 9783319662626-c2
- c 343 Final Study
- Stefan Forcey- Convex Hull Realizations of the Multiplihedra
- Uml 2
- PSO
- Olympiad Combinatorics (1)

You are on page 1of 4

Profs. Erik Demaine, Srini Devadas, and Nancy Lynch Problem Set 1

Problem Set 1

This problem set is due at 11:59pm on Thursday, February 12, 2015.

This assignment, like later assignments, consists of exercises and problems. Hand in solutions

to the problems only. However, we strongly advise that you work out the exercises also, since they

will help you learn the course material. You are responsible for the material they cover.

Please turn in each problem solution separately. Each submitted solution should start with

your name, the course number, the problem number, your recitation section, the date, and the

names of any students with whom you collaborated.

We will often ask you to “give an algorithm” to solve a problem. Your write-up should take the

form of a short essay. Start by deﬁning the problem you are solving and stating what your results

are. Then provide:

We will give full credit only for correct solutions that are described clearly.

Sort all the functions below in increasing order of asymptotic (big-O) growth. If some have the

same asymptotic growth, then be sure to indicate that. As usual, lg means base 2.

1. 5n

2. 4 lg n

3. 4 lg lg n

4. n4

5. n1/2 lg4 n

6. (lg n)5 lg n

7. nlg n

8. 5n

4

9. 4n

n

10. 44

n

11. 55

2 Problem Set 1

12. 55n

1/5

13. nn

14. nn/4

15. (n/4)n/4

Give asymptotic upper and lower bounds for T (n) in each of the following recurrences. Assume

that T (n) is constant for n ≤ 2. Make your bounds as tight as possible, and justify your answers.

(b) T (n) = 4T (n/5) + 5n

(c) T (n) = 5T (n/4) + 4n

(d) T (n) = 25T (n/5) + n2

(e) T (n) = 4T (n/5) + lg n

√

(f) T (n) = 4T (n/5) + lg5 n n

√

(g) T (n) = 4T ( n) + lg5 n

√

(h) T (n) = 4T ( n) + lg2 n

√

(i) T (n) = T ( n) + 5

(j) T (n) = T (n/2) + 2T (n/5) + T (n/10) + 4n

Drunken Donuts, a new wine-and-donuts restaurant chain, wants to build restaurants on many

street corners with the goal of maximizing their total proﬁt.

The street network is described as an undirected graph G = (V, E), where the potential restaurant

sites are the vertices of the graph. Each vertex u has a nonnegative integer value pu , which describes

the potential proﬁt of site u. Two restaurants cannot be built on adjacent vertices (to avoid self-

competition). You are supposed to design an algorithm that outputs the chosen set U ⊆ V of sites

that maximizes the total proﬁt u∈U pu .

First, for parts (a)–(c), suppose that the street network G is acyclic, i.e., a tree.

(a) [5 points]

proﬁt vertex u0 in the tree (breaking ties according to some order on vertex names) and

put it into U . Remove u0 from further consideration, along with all of its neighbors

in G. Repeat until no further vertices remain.

Give a counterexample to show that this algorithm does not always give a restaurant

placement with the maximum proﬁt.

Problem Set 1 3

(b) [9 points]

(c) [6 points]

Suppose that, in the absence of good market research, DD decides that all sites are

equally good, so the goal is simply to design a restaurant placement with the largest

number of locations. Give a simple greedy algorithm for this case, and prove its

correctness.

(d) [5 points]

Now suppose that the graph is arbitrary, not necessarily acyclic. Give the fastest cor

rect algorithm you can for solving the problem.

Prof. Wheeler at the Federal Communications Commission (FCC) has a huge pile of requests from

radio stations in the Continental U.S. to transmit on radio frequency 88.1 FM. The FCC is happy to

grant all the requests, provided that no two of the requesting locations are within Euclidean distance

1 of each other (distance 1 might mean, say, 20 miles). However, if any are within distance 1, Prof.

Wheeler will get annoyed and reject the entire set of requests.

Suppose that each request for frequency 88.1 FM consists of some identifying information plus

(x, y) coordinates of the station location. Assume that no two requests have the same x coordinate,

and likewise no two have the same y coordinate. The input includes two sorted lists, Lx of the

requests sorted by x coordinate and Ly of the requests sorted by y coordinate.

(a) [3 points]

Suppose that the map is divided into a square grid, where each square has dimensions

1

2

× 12 .

Why must the FCC reject the set of requests if two requests are in, or on the

(b) [14 points]

Design an efﬁcient algorithm for the FCC to determine whether the pile of requests

contains two that are within Euclidean distance 1 of each other; if so, the algorithm

should also return an example pair. For full credit, your algorithm should run in

(c) [8 points]

Describe how to modify your solution for Part (b) to determine whether there are three

requests, all within distance 1 of each other. For full credit, your algorithm should run

in O(n lg n) time, where n is the number of requests.

MIT OpenCourseWare

http://ocw.mit.edu

Spring 2015

For information about citing these materials or our Terms of Use, visit: http://ocw.mit.edu/terms.

- JENSEN, A Bayesian-Network Tool for Automated Diagnosis of Printing SystemsUploaded byarthurmelani
- A Bijective Proof of Garsia's Q-LagrangeUploaded byPiyushYadav
- 09 Chapter 1Uploaded bySimran Khanna
- 5 GATE CS 2000 GeeksforGeeksUploaded byjoshna1234
- Mipt 2014 Burunduk1.EnUploaded byVishal Golcha
- GT Math 3012 Homework 2Uploaded byKwane
- ssdbm2012Uploaded byMumbai Academics
- Advanced Data Structures and AlgorithmsUploaded byToaster97
- A g r a p h t h e o r e t i c m o d e l o f d a t a s t r u c t u r e sUploaded byChristie Sajitha
- ADA Chap 1Uploaded byAyesha Ahmad
- 9547-44987-1-PBUploaded byLM
- Term PaperUploaded byNorshida Calibi
- L14 Graph Part03Uploaded byEnmusk
- CS236 Project 6: ReportUploaded byJeff Pratt
- 9783319662626-c2Uploaded bynvthanh1994
- c 343 Final StudyUploaded byGabriela Garcia
- Stefan Forcey- Convex Hull Realizations of the MultiplihedraUploaded bySwertyy
- Uml 2Uploaded byRohit Prasad
- PSOUploaded byshibin143kt
- Olympiad Combinatorics (1)Uploaded bybus9
- Linear Bisection-Newton - CopyUploaded byNayr JT
- Design and Analysis of AlgorithmUploaded byJenloDiamse
- MATHSUploaded byDeepak Kumar
- L29_Dynamic Programming (continued).pptUploaded byNirmit
- Co-extracting Opinion Targets and Opinion Words From Online Reviews Based on the Word Alignment ModelUploaded bynutsinstitute
- AN APPLICATION OF Gd-METRIC SPACES AND METRIC DIMENSION OF GRAPHSUploaded byMegan Bell
- EXP-11Uploaded byTrupti Pawar
- Module 2Uploaded byNimmymolManuel
- Paperiros Srt hUploaded byKiki Riki Miki
- FffUploaded byM bashir rehan

- Lecture 17 310hUploaded byroshantejthota
- MIT6 046JS15 FinalUploaded byMiskir Be
- MIT6_046JS15_pset1.pdfUploaded byajgemini
- MIT6_046JS15_quiz1.pdfUploaded byajgemini
- MIT6_046JS15_quiz1.pdfUploaded byajgemini
- MIT6_046JS15_quiz1.pdfUploaded byajgemini
- UnderArmour.pdfUploaded byajgemini
- UnderArmour.pdfUploaded byajgemini
- Algo SampleUploaded byjefftam1234
- Algo SampleUploaded byjefftam1234
- Write Up BomblabUploaded byajgemini
- x64_cheatsheetUploaded byajgemini
- exam2-f10.pdfUploaded byajgemini
- HW01 Ch03 My Guitar ShopUploaded byajgemini
- _data-lab.pdfUploaded byajgemini
- _data-lab.pdfUploaded byajgemini

- Annual Planning for Additional Mathematics1 2017editedUploaded byAzmizi Abdullah
- Inverse[1]Uploaded byscribdsurya4u
- Smu Mba Operations Research Semester2 QuestionpaperUploaded byPankaj Sharma
- set2-brute (4) (1)Uploaded byPradita Eko Prasetyo Utomo
- CIVE 320 Lecture 5Uploaded bymcgill user
- On Thi Olympic Toan Sinh VienUploaded byPhan Khải
- dfs notesUploaded byDhiraj Thakkar
- The Hough TransformUploaded bylizhi0007
- algebra.pdfUploaded byMizanur Rahman
- Numerical Methods Notes by Ioenotes.edu.NpUploaded byPraz Aarash
- madlabUploaded byAshRofin Moch
- dsp unit 2Uploaded byrahulsaraswat_ece
- GENERALIZED SEMICOMMUTATIVE RINGSUploaded byNguyen Tuan
- Chatper 4 FEM Procedure and spring element.pdfUploaded byVijay Singh
- DiffGeomNotes.pdfUploaded byAngelo Ho
- Surface IntegralsUploaded byTomicaTomicatomica
- Unit 4A Student Guide HONORS 16-17Uploaded byAurolver
- Algebra 1 Ch. 1 Extra PracticeUploaded bywenatchee25
- Barreira, Valls - Dynamical Systems an IntroductionUploaded byPsyndrom Ventura
- ECE605_ADVANCED-SIGNAL-PROCESSING_ETH_1.00_AC21.pdfUploaded by;(
- 100796340 a Text Book of Engineering Mathematics Volume II by Pandey RajeshUploaded byPintohedfang
- ode3Uploaded bySaad Parvaiz Durrani
- Chap1 Chap3(New)Uploaded bycasiofx
- Paper 24-Solving the MDBCS Problem Using the Metaheuric–Genetic AlgorithmUploaded byEditor IJACSA
- Switching and Finite Automata Theory_ Z. KohaviUploaded bychakri474
- e 174460Uploaded byanon_33416438
- Aproximation Algorithm for Facility Location ProblemUploaded byTyas Agustina
- supply chain magementUploaded byChaz Mcbride
- Pages From Modern Power Systems Analysis by D P Kothari & I J NagrathUploaded bygavinilaa
- Chapter10 Linear Programming.docUploaded bysmkpthoe