As we have read in the above article the normal shift produced by a glass slab is,

for the mirror the object is placed at a distance (32 - Δx) = 30 cm from it. Applying mirror formula


(a) When x = 5 cm : The light falls on the slab on its return journey as shown. But the slab will again shift it by a distance Δx = 2 cm. Hence, the final real image is formed at a distance (15 + 2) = 17 cm from the mirror.

(b) When x = 20 cm : This time also the final image is at a distance 17 cm from the mirror but it is virtual as shown.