
(b) When block $R$ collides with block $P$, it transfers its momentum to block $P$, due to which it moves towards blocks $Q$. The spring connecting blocks $P$ and $Q$ gets compressed, which will push the block $Q$ outwards. Due to outward motion of the block $Q$, the spring gets stretched, the block $Q$ is pulled back. The spring gets compressed, it pushes the block $P$ towards left and so on