-- May 13 - Final Review
Problem 10: Give the TRIM(L,δ) algorithm we used as part of our fully p-time approximation algorithm for SUBSET-SUM. Give an example of applying it to a list of integers.
TRIM(L, δ)
We assume L = (y[1], ..., y[m])
1 let m be the length of L
2 L' = (y[1])
3 last = y[1]
4 for i = 2 to m
5 if y[i] > last * (1 + δ) // y[i] ≥ last because L is sorted
6 append y[i] to L'
7 last = y[i]
8 return L'
`\frac{y}{1 + δ} ≤ z ≤ y `
For Example if `δ = 0.1` and `L = ⟨12,13,23,25,26,40,45,60,77⟩`
`L^' = ⟨12, 23, 26, 40, 45, 60, 77⟩`(
Edited: 2019-05-15)
'''Problem 10:''' Give the TRIM(L,δ) algorithm we used as part of our fully p-time approximation algorithm for SUBSET-SUM. Give an example of applying it to a list of integers.
<pre>
TRIM(L, δ)
We assume L = (y[1], ..., y[m])
1 let m be the length of L
2 L' = (y[1])
3 last = y[1]
4 for i = 2 to m
5 if y[i] > last * (1 + δ) // y[i] ≥ last because L is sorted
6 append y[i] to L'
7 last = y[i]
8 return L'
</pre>
<br/>
<math>\frac{y}{1 + δ} ≤ z ≤ y </math>
<br/>
<br/>
For Example if <math>δ = 0.1</math> and <math>L = ⟨12,13,23,25,26,40,45,60,77⟩</math>
<br/>
<br/>
<math>L^' = ⟨12, 23, 26, 40, 45, 60, 77⟩</math>