2/3 x eaten, 1/3 x remains.

2/3 (1/3 x) eaten, 1/3 (1/3 x) = 1/9 x remains.

1/2 (1/9 x) eaten, 1/2 (1/9 x) remains and gets thrown out.

So 1/18 of the banana gets thrown out.

Note: 2/3 x + 2/9 x + 1/18 x = 17/18 x. Add the bit that gets thrown out and you have 1 x.