Problem Set 1
Due: February 4, 2008. 1. In the bin packing problem, the input consists of a sequence of items I = {1, . . . , n} where each item i has a size, which is a real number 0 ≤ ai ≤ 1. The goal is to “pack” the items in the smallest possible number of bins of unit size. Formally, the items should be partitioned in disjoint subsets (bins), such that the total size in each bin is at most 1. The ﬁrst ﬁt heuristic scans the items one by one, and each item is assigned to the ﬁrst bin that it can ﬁt in. Prove that ﬁrst-ﬁt is a 2-approximation algorithm for bin packing. Hint. Bound from below the number of bins used by an optimal solution; and bound from above the number of bins used by ﬁrst ﬁt, using the observation that nearly all bins are at least half-full. 2. Suppose now that you want to pack as much as possible in a single bin. Formally, the input consists of a set of items I = {1, . . . , n}, where each item i has a size 0 < ai ≤ 1. A solution is a set of items S ⊂ I such that i∈S ai ≤ 1 (i.e., the size of the bag is 1). The value of a solution S is the total size of the items in the solution, i.e., i∈S ai . (a) Describe an optimal solution to the problem. What is the time complexity of your algorithm? (b) Give a polynomial-time algorithm with approximation ratio 2 (i.e., it guarantees that you ﬁll at least half of the optimal value). What is the time complexity of your algorithm? Warning. The simplest solution doesn’t work! 3. Consider the following algorithm for the m-machine load-balancing problem (S is the set of jobs): Repeat: (a) Let A be the sum of weights of all jobs in S (b) Find a subset S1 ⊆ S whose sum of weights is close to A/m (c) S ← S \ S1 ; m ← m − 1 until m = 0. Suppose that the subset sum step above is implemented using an approximation algorithm, which guarantees that its result is within a factor of 1 − ǫ from the optimal subset sum, for some 0 < ǫ < 1. What can you...

...MC0080-Analysis and Design of Algorithms
Question 1- Describe the following:
Well known Sorting Algorithms
Divide and Conquer Techniques
Answer:
Well known Sorting Algorithms
We know the following well - known algorithms for sorting a given list of numbers:
Ordered set: Any set S with a relation, say, ≤ , is said to be ordered if for any two elements x and y of S, either x ≤ y or x ≥ y is true....

...Question 1
In what follows we consider two simple algorithms for the Knapsack problem. We assume without
loss of generality, that for every object i we have si B (or else we can remove the object from the
set of objects).
Item A. Consider the following greedy algorithm for the knapsack problem: For each object i,
compute the “profit-to-size” ratio ri = pi/si. We order the objects according to ri, from big to small,
and then go over the objects in this order...

...The Design &
Analysis o f A lgorithms
~~ I_ND EDIIIQN ~
I ntroduction t o
*
The Design &
Analysis o f Algorithms
I ND EDITION "
I ntroduction t o
~
~
~
Anany Levitin
Villanova University
B oston San Francisco N ew York
L ondon T oronto S ydney Tokyo Singapore Madrid
M exico City M unich Paris C ape Town H ong K ong M ontreal
Publisher
Acquisitions E ditor
P roject E ditor
P...

...Sangandaan, Caloocan City
-------------------------------------------------
ANALYSIS OF ALGORITHMS AND ORDERS OF GROWTH
In Partial Fulfillment Of the requirements for the Degree
Bachelor of Science in Information Technology
School year 2011-2012
-------------------------------------------------
Submitted By:
Dacutanan, Francis III C.
Submitted to:
Engr. Nelson Rodelas
Chapter I
Introduction
Algorithms are one of the few...

...STA 600
ASSIGNMENT 2
CHAPTER 3: DIAGNOSTICS AND REMEDIAL MEASURES
Diagnostic For Predicted Variable
Probems can occur when:
* Outliers exist among X levels
* X levels are associated with run order when experiment is run sequentially
Useful plots of X levels:
* Dot plot for discrete data
* Histogram /stem-and-leaf plot
* Box plot
* Sequence plot (versus time order)
Departures From Model To Be Studied By Residual
1. The regression function...

...Lecture Notes on Design & Analysis of Algorithms
G P Raja Sekhar Department of Mathematics I I T Kharagpur
Acknowledgements : Ahmad Abdullah, Pronoy Sikdar, Anshul Kamra, Sugam Agrawal & Students of DAA course 2006-07, Data Structures & Algorithms 2006-07.
BUBBLE SORT
The bubble sort is the oldest and simplest sort in use. The bubble sort works by comparing each item in the list with the item next to it, and swapping them if...

3413 Words |
11 Pages

Share this Document

{"hostname":"studymode.com","essaysImgCdnUrl":"\/\/images-study.netdna-ssl.com\/pi\/","useDefaultThumbs":true,"defaultThumbImgs":["\/\/stm-study.netdna-ssl.com\/stm\/images\/placeholders\/default_paper_1.png","\/\/stm-study.netdna-ssl.com\/stm\/images\/placeholders\/default_paper_2.png","\/\/stm-study.netdna-ssl.com\/stm\/images\/placeholders\/default_paper_3.png","\/\/stm-study.netdna-ssl.com\/stm\/images\/placeholders\/default_paper_4.png","\/\/stm-study.netdna-ssl.com\/stm\/images\/placeholders\/default_paper_5.png"],"thumb_default_size":"160x220","thumb_ac_size":"80x110","isPayOrJoin":false,"essayUpload":false,"site_id":1,"autoComplete":false,"isPremiumCountry":false,"userCountryCode":"US","logPixelPath":"\/\/www.smhpix.com\/pixel.gif","tracking_url":"\/\/www.smhpix.com\/pixel.gif","cookies":{"unlimitedBanner":"off"},"essay":{"essayId":36630442,"categoryName":"Periodicals","categoryParentId":"17","currentPage":1,"format":"text","pageMeta":{"text":{"startPage":1,"endPage":3,"pageRange":"1-3","totalPages":3}},"access":"premium","title":"Design and Analysis of Algorithms","additionalIds":[7,93,2,5],"additional":["Education","Education\/Greek System","Awards \u0026 Events","Computer Science"],"loadedPages":{"html":[],"text":[1,2,3]}},"user":null,"canonicalUrl":"http:\/\/www.studymode.com\/essays\/Design-And-Analysis-Of-Algorithms-1285446.html","pagesPerLoad":50,"userType":"member_guest","ct":10,"ndocs":"1,500,000","pdocs":"6,000","cc":"10_PERCENT_1MO_AND_6MO","signUpUrl":"https:\/\/www.studymode.com\/signup\/","joinUrl":"https:\/\/www.studymode.com\/join","payPlanUrl":"\/checkout\/pay","upgradeUrl":"\/checkout\/upgrade","freeTrialUrl":"https:\/\/www.studymode.com\/signup\/?redirectUrl=https%3A%2F%2Fwww.studymode.com%2Fcheckout%2Fpay%2Ffree-trial\u0026bypassPaymentPage=1","showModal":"get-access","showModalUrl":"https:\/\/www.studymode.com\/signup\/?redirectUrl=https%3A%2F%2Fwww.studymode.com%2Fjoin","joinFreeUrl":"\/essays\/?newuser=1","siteId":1,"facebook":{"clientId":"306058689489023","version":"v2.8","language":"en_US"},"analytics":{"googleId":"UA-32718321-1"}}