we have that
Sam ate 1/8 of the pizza
Peter ate 3/8 of the pizza
Jim ate 1/4 of the pizza------> is equivalent to 2/8
Remember that
the complete pizza represents the fraction 8/8
Adds the fractions
1/8+3/8+2/8=(1+3+2)/8=6/8
Find out the difference
8/8-6/8=(8-6)/8=2/8
Simplify
2/8=1/4
therefore
The remaining pizza is 1/4