w1 = 85, v1 = 5;
w2 = 110, v2 = 5;
w3 = 80, v3 = 3;
w4 = 20, v4 = 3;
capacity = 200
solve the knapsack problem for the given weights, values and capacity. Which items are chosen and give the maximum value
Let B = [V1, V2, V3] and B' = [W1, W2, W3] be bases for a vector space V and Vi = W1 + 5W2 – W3 U2 = W1 U3 -W1 - 4w2 – 2w3 If (U)b = (1,-1,2), then the coordinates of v relative to the basis B' are c1 = C2 = and cz
For given capacity of knapsack W and n items {i1,i2,...,in} with its own value {v1,v2,...,vn} and weight {w1,w2,...,wn}, find a greedy algorithm that solves fractional knapsack problem, and prove its correctness. And, if you naively use the greedy algorithm to solve 0-1 knapsack problem with no repetition, then the greedy algorithm does not ensure an optimal solution anymore. Give an example that a solution from the greedy algorithm is not an optimal solution for 0-1 knapsack problem.
Let H = Span{V1, V2} and K = Span{V3,V4}, where V1, V2, V3, and V4 are given below. 1 V1 V2 V4 - 10 7 9 3 -6 Then Hand K are subspaces of R3. In fact, H and K are planes in R3 through the origin, and they intersect in a line through 0. Find a nonzero vector w that generates that line. W= [Hint: w can be written as C1 V2 + c2V2 and also as c3 V3...
Jones company has two manufacturing plants A and B, and three warehouses, W1, W2, W3. Each week Jones ships product from the plants to the warehouses. The system is balanced: A produces 500 units of product and B produces 300 units of product. Warehouse W1 needs 200 units of product, W2 needs 300 units of product, and W3 needs 300 units of product. Thus, over the entire system, there are 800 units produced by the two plants and 800 units...
5 3 1 0 Problem 10 Let wi = ,W2 W3 Let W = Span{W1,W2, W3} C R6. 11 9 1 2 a) [6 pts] Use the Gram-Schmit algorithm to find an orthogonal basis for W. You should explicitly show each step of your calculation. 10 -7 11 b) [5 pts) Let v = Compute the projection prw(v) of v onto the subspace W using the 5 orthogonal basis in a). c) (4 pts] Use the computation in b) to...
Please show work Problem 2. Consider the vectors [1] 1 1 v1 = 1, V2 = -1, V3 = -3 , 04 = , 05 = 6 Let S CR5 be defined by S = span(V1, V2, V3, V4, 05). A. Find a basis for S. What is the dimension of S? B. For each of the vectors V1, V2, V3, V4.05 which is not in the basis, express that vector as linear combination of the basis vectors. C. Consider...
5. Given a linear map f R3R3 if V Vi, V2, va) is a basis of R3, and further, a) State the defining matrix of f under the basis vi, V2, vs) -3 2 0 b) Let W-(w1, w2, w3) be another basis of R3 and P42 be the change- 01-1 of-coordinate matrix from V to W. Let A be the defining matrix for f under the basis W diagonalize A. 5. Given a linear map f R3R3 if V...
Consider a problem with seven items whose weight and values are given below. w1, w2,.., W7 (40, 50, 30, 10, 10, 40, 30) p1, p2,.,, p7 (40, 60, 10, 10, 3, 20, 60) The total allowable weight in the knapsack w = 100, solve this problem using backtracking and draw a complete DFS tree. Consider a problem with seven items whose weight and values are given below. w1, w2,.., W7 (40, 50, 30, 10, 10, 40, 30) p1, p2,.,, p7...
In the circuit below, V1 = 2 Volts, V2 = 10 Volts, V3 = 46 Volts, V4 =3 Volts, and R3 = 5 Ohms. Battery 1 (V1) is chosen to the guess the initial current directions as discussed in the procedure in the Powerpoint and in class and main current is the current through V1, current 1 is the current through V2, and current 2 is the current through battery 3. If the correct loop equations are solved correctly, the...
Recall that in the "Knapsack Problem", there are n items having respective values V1..n) and weights W1..n), all greater than 0 and one needs to maximize the total value of the subset of the items placed in the knapsack limited by a weight capacity of W In the 0-1 Knapsack Problem, each item must be either be included or excluded in its entirety, in light of the fact that this problem is to be "NP-Complete", how can one solve the...