Skip to content

Commit 3830328

Browse files
committed
Removing column formatting
1 parent e263eb1 commit 3830328

File tree

1 file changed

+0
-35
lines changed

1 file changed

+0
-35
lines changed

01-slides/5_optimization.ipynb

-35
Original file line numberDiff line numberDiff line change
@@ -198,9 +198,7 @@
198198
"The escape vent can carry only 4 kg of goods. The items are:\n",
199199
"\n",
200200
"- Stereo: \\$3000, 4 kg\n",
201-
"\n",
202201
"- Laptop: \\$2000, 3 kg\n",
203-
"\n",
204202
"- Guitar: \\$1500, 1 kg\n",
205203
"\n",
206204
"We've established the brute force is not a valid general solution (although feasible in this case)\n",
@@ -209,72 +207,39 @@
209207
"\n",
210208
"## Guitar Row\n",
211209
"\n",
212-
"::: columns\n",
213-
"::: {.column width=\"50%\"}\n",
214210
"- Each dynamic programming problem starts with a grid\n",
215-
"\n",
216211
"- Each cell contains a list of items that can fit at that point\n",
217-
"\n",
218212
"- For cell Guitar 1, a guitar will fit there. It will also fit in cell Guitar 2, 3, 4\n",
219-
"\n",
220213
"- Sounds redundant, but let's keep going\n",
221-
":::\n",
222214
"\n",
223-
"::: {.column width=\"50%\"}\n",
224215
"![](images/dynamic.png)\n",
225-
":::\n",
226-
":::\n",
227216
"\n",
228217
"## Stereo Row\n",
229218
"\n",
230-
"::: columns\n",
231-
"::: {.column width=\"50%\"}\n",
232219
"- In the second row, we can steal the stereo or the guitar.\n",
233-
"\n",
234220
"- At 1 kg, you can only steal the guitar, same as for every other cell until Stereo 4, at which point you can steal the stereo and only the stereo.\n",
235-
":::\n",
236221
"\n",
237-
"::: {.column width=\"50%\"}\n",
238222
"![](images/dynamic.png)\n",
239-
":::\n",
240-
":::\n",
241223
"\n",
242224
"## Laptop Row\n",
243225
"\n",
244-
"::: columns\n",
245-
"::: {.column width=\"50%\"}\n",
246226
"- Now we can steal all 3 items\n",
247-
"\n",
248227
"- In the first two columns, we still can only steal the guitar. But in Laptop 3, we can steal the laptop\n",
249-
"\n",
250228
"- Laptop 4 is the interesting step. We could steal only the stereo, or the laptop and something else for 1 kg. What is that 1 kg item?\n",
251-
"\n",
252229
"- According to the above row, the max value for 1 kg is the guitar!\n",
253-
":::\n",
254230
"\n",
255-
"::: {.column width=\"50%\"}\n",
256231
"![](images/dynamic.png)\n",
257-
":::\n",
258-
":::\n",
259232
"\n",
260233
"## Solution\n",
261234
"\n",
262-
"::: columns\n",
263-
"::: {.column width=\"50%\"}\n",
264235
"- If we stole the guitar and laptop, the total value is 3500, which is greater than just stealing the stereo\n",
265-
"\n",
266236
"- Thus, we should steal guitar and laptop\n",
267-
":::\n",
268237
"\n",
269-
"::: {.column width=\"50%\"}\n",
270238
"![](images/dynamic.png)\n",
271-
":::\n",
272-
":::\n",
273239
"\n",
274240
"## Formula for each cell\n",
275241
"\n",
276242
"- We skipped some very trivial steps in calculating cells aside from the last one\n",
277-
"\n",
278243
"- Here's the explicit formula to calculate each cell's value\n",
279244
"\n",
280245
"Let $i$ be the row and $j$ be the column.\n",

0 commit comments

Comments
 (0)