- Returned value is largest < t to within some percentage error
- Let = error bound, 0 < < 1
- Trim L of all values whose relative error is no more then away from a value in L

Trim(L, )
; L =
<*y*_{1}, .., *y*_{m}> sorted in
non-decreasing order

1
m =

2
L' =

3
last = *y*_{1}

4
for i = 2 to m

5
if last < (1 - )*y*_{i}

6
then append *y*_{i} on end of L'

7
last = *y*_{i}

8
return L'

Approx-Subset-Sum(S, t, )

1
n = S

2
*L*_{0} = 0

3
for i = 1 to n

4
*L*_{i} = Merge-Lists(
)

5
*L*_{i} = Trim(*L*_{i},
)

6
remove from *L*_{i} elements > t

7
return largest value in *L*_{n}

Error passed to Trim is
to prevent too much inaccuracy
after repeated trimmings.

**Theorem 35.8**

Approx-Subset-Sum is a fully poly-time approximation scheme for the subset-sum problem.