Loading

1.
Statement for linked Answer Questions ::
The subset –sum problem is defined as follows. Given a set of n positive integers, S = {a_{1}, a_{2}, a_{3}, ......, a_{n}} and a positive integer W, is there a subset of S whose elements sum of W? A dynamic program for solving this problem uses a 2dimensional Boolean array, X, with W+1 rows and n columns X[i, j], 1 ≤ i ≤ n, 0 ≤ j ≤ W, is TRUE if and only if there is a subset of {a_{1}, a_{2}, …., a_{i}} whose elements sums to j.
[1] Which of the following is valid for 2 ≤ i ≤ n and a_{i} ≤ j ≤ W? [2 marks]
(A) X[i, j] = X[i – 1, j] ∨ X[i, j – a_{1}]
(B) X[i, j] = X[i – 1, j] ∨ X[i – 1, j – a_{1}]
(C) X[i, j] = X[i – 1, j] Λ X[i, j – a_{1}]
(D) X[i, j] = X[i – 1, j] Λ X[i – 1, j – a_{1}][2] Which entry of the array X, if TRUE, implies that there is a subset whose elements sum to W? [2 marks]
(A) X[ 1, W]
(B) X[ n, 0]
(C) X[ n, W]
(D) X[n – 1, n]asked in Mechanical Engineering, 2008
View Comments [0 Reply]

2.

3.
A company is offered the following price breaks for order quantity
Order quantity Price (Rs.) 0100 150 101 and above 100
[5 marks]
asked in Mechanical Engineering, 2001
View Comments [0 Reply]

4.

5.

6.