Assembly-line Scheduling Program - Assignment | ECS 122A, Assignments of Computer Science

Material Type: Assignment; Professor: Bai; Class: Algorithm Design; Subject: Engineering Computer Science; University: University of California - Davis; Term: Spring 2009;

Typology: Assignments

Pre 2010

Uploaded on 07/31/2009

koofers-user-nop
koofers-user-nop ๐Ÿ‡บ๐Ÿ‡ธ

8 documents

1 / 1

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
ECS122A: Algorithm Design and Analysis Due: 4:00pm, Thursday, April 30, 2009
Homework Assignment #3
1. In the assembly-line scheduling problem, let
a="465824
834647#, t ="32121
13231#
and
e=h4 2 i, x =h1 3 i.
Determine what stations should be chosen from line 1 and from line 2 in order to minimize the
total time through the factory.
2. Do Exercise 15.1-2
3. Do Exercise 15.1-3
4. For the sequences X=hB , C, A, A, B, AiY=hA, B, A, C, B ifill in the dynamic programming
table including the arrows (as in Figure 15.5 of CLRS on page 354) for the longest common
subsequence (LCS) of the two sequences. List the final LCS.
5. Two character strings may have many common substrings. Substrings are required to be con-
tiguous in the original string. For example, photograph and tomography have several common
substrings of length one (i.e., single letters), and common substrings ph,to, and ograph (as well
as all the substrings of ograph). The maximum common substring length is 6.
Let X=x1x2ยทยทยทxmand Y=y1y2ยทยทยทynbe two character strings.
(a) Give a dynamic programming algorithm to find the maximum common substring length for
Xand Y.
(b) Analyze the worst-case running time and space requirements of your algorithm as functions
of nand m.
(c) Demonstrate your dynamic programming algorithm for finding the maximum common sub-
string length of character strings
(c.1) photograph and tomography
(c.2) cabccb and babcba.
by construct a dynamic programming table similar to Figure 15.5 of CLRS on page 354.
6. Suppose that the denominations of the coins in a country are d1< d2<ยทยทยท < dn(e.g., 1, 5, 10,
25 for the United States). The problem to consider is:
Given an integer A, what is the minimum number of coins needed to make Acents in
change?
(a) Under what condition(s) on the denominations diare you able to make change for any amount
A?
(b) Give a dynamic programming algorithm to solve the problem.
(c) How fast is your algorithm?
1

Partial preview of the text

Download Assembly-line Scheduling Program - Assignment | ECS 122A and more Assignments Computer Science in PDF only on Docsity!

ECS122A: Algorithm Design and Analysis Due: 4:00pm, Thursday, April 30, 2009 Homework Assignment #

  1. In the assembly-line scheduling problem, let

a =

[ 4 6 5 8 2 4 8 3 4 6 4 7

] , t =

[ 3 2 1 2 1 1 3 2 3 1

]

and e =

[ 4 2

] , x =

[ 1 3

] .

Determine what stations should be chosen from line 1 and from line 2 in order to minimize the total time through the factory.

  1. Do Exercise 15.1-
  2. Do Exercise 15.1-
  3. For the sequences X = ใ€ˆB, C, A, A, B, Aใ€‰ Y = ใ€ˆA, B, A, C, Bใ€‰ fill in the dynamic programming table including the arrows (as in Figure 15.5 of CLRS on page 354) for the longest common subsequence (LCS) of the two sequences. List the final LCS.
  4. Two character strings may have many common substrings. Substrings are required to be con- tiguous in the original string. For example, photograph and tomography have several common substrings of length one (i.e., single letters), and common substrings ph, to, and ograph (as well as all the substrings of ograph). The maximum common substring length is 6. Let X = x 1 x 2 ยท ยท ยท xm and Y = y 1 y 2 ยท ยท ยท yn be two character strings.

(a) Give a dynamic programming algorithm to find the maximum common substring length for X and Y. (b) Analyze the worst-case running time and space requirements of your algorithm as functions of n and m. (c) Demonstrate your dynamic programming algorithm for finding the maximum common sub- string length of character strings (c.1) photograph and tomography (c.2) cabccb and babcba. by construct a dynamic programming table similar to Figure 15.5 of CLRS on page 354.

  1. Suppose that the denominations of the coins in a country are d 1 < d 2 < ยท ยท ยท < dn (e.g., 1, 5, 10, 25 for the United States). The problem to consider is:

Given an integer A, what is the minimum number of coins needed to make A cents in change?

(a) Under what condition(s) on the denominations di are you able to make change for any amount A? (b) Give a dynamic programming algorithm to solve the problem. (c) How fast is your algorithm?