CS341 Lecture : Assignment #4 This is the forth assignment from winter 2010 term

73 views2 pages

Document Summary

Please read http://www. student. cs. uwaterloo. ca/~cs341/policies. html rst for general instructions and http://www. student. cs. uwaterloo. ca/~cs341/prog. html for programming guidelines: [17 marks] given a chain with n links of lengths a1, . , an, where each ai is a positive integer, we want to fold the chain (in one dimension) so that the length of the folded chain is minimized. More formally, we want to minimize w subject to the following constraint: there exist t in the interval [0, w ] and s1, . , sn { 1, +1} such that t + (cid:80)j i=1 siai [0, w ] for all j {0, . , n}. (here, t denotes the position of the rst joint, and si = 1 depending on whether we turn rightward or leftward for the i-th link. ) Example: for a1 = 5, a2 = 1, a3 = 7, a4 = 2, a5 = 8, the minimum length w is 9. De ne the following subproblem, given 0 k n, 0 (cid:96) m:

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers
Class+
$8 USD/m
Billed $96 USD annually
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
30 Verified Answers