Question: Case 3: 2 1 3 Matrix 3: Bag size 0kg 1kg 2kg 3kg 4kg 5kg 0 (no item) 0 0 0 0 0 0 2

 Case 3: 2 1 3 Matrix 3: Bag size 0kg 1kg2kg 3kg 4kg 5kg 0 (no item) 0 0 0 0 0

Case 3: 2 1 3

Matrix 3:

Bag size

0kg

1kg

2kg

3kg

4kg

5kg

0 (no item)

0

0

0

0

0

0

2 (item2)

0

A5

B5

C5

D5

E5

1 (item2/1)

0

F5

G5

H5

I5

J5

3 (item2/1/3)

0

K5

L5

M5

N5

O5

A5: show the math calculation

B5:

O5:

Table 3 (steal or not):

Bag size

0kg

1kg

2kg

3kg

4kg

5kg

0 (no item)

0

0

0

0

0

0

2 (item2)

0

A6

B6

C6

D6

E6

1 (item2/1)

0

F6

G6

H6

I6

J6

3 (item2/1/3)

0

K6

L6

M6

N6

O6

Analysis for Case 3 (2, 1, 3):

0/1 Knapsack problem: dynamic programming There are 3 items in your house. The thief will come to your house. His maximum bag size is 5kg. The thief wants to maximize the profit, but he can not take more than 5kg.For each item, he can steal (1) or not steal (0). Item1: value =$5, weight =3kg Item2: value =$3, weight =2kg Item3: value =$4, weight =1kg No coding is needed. 1. Please fill in the matrix of bag size (column) and item (row) for the case of 2,1,3 And show the math calculation process for each cell in the matrix (bag size, item) 2. Also fill in the table of steal or not steal 3. show the traverse process in the matrix and the analysis for the optimal solution. The optimal solution is that the thief steals item 1 and item 3 with profit of 9 and weight of 4kg. The solution for each case should look like this

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!