Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Case 3: 3 2 1 Matrix 3: Bag size 0kg 1kg 2kg 3kg 4kg 5kg 0 (no item) 0 0 0 0 0 0 3
Case 3: 3 2 1
Matrix 3:
Bag size
| 0kg | 1kg | 2kg | 3kg | 4kg | 5kg |
0 (no item) | 0 | 0 | 0 | 0 | 0 | 0 |
3 (item3) | 0 | A11 | B11 | C11 | D11 | E11 |
2 (item3/2) | 0 | F11 | G11 | H11 | I11 | J11 |
1 (item3/2/1) | 0 | K11 | L11 | M1 | N11 | O11 |
A11: show the math calculation
B11:
O11:
Table 3 (steal or not):
Bag size
| 0kg | 1kg | 2kg | 3kg | 4kg | 5kg |
0 (no item) | 0 | 0 | 0 | 0 | 0 | 0 |
3 (item3) | 0 | A12 | B12 | C12 | D12 | E12 |
2 (item3/2) | 0 | F12 | G12 | H12 | I12 | J12 |
1 (item3/2/1) | 0 | K12 | L12 | M12 | N12 | O12 |
Analysis for Case 3 (3, 2, 1):
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 3,2,1 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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started