Consider two blocks A and B of masses $m_1 = 10\ \text{kg}$ and $m_2 = 5\ \text{kg}$ that are placed on a frictionless table. The block A moves with a constant speed $v = 3\ \text{m/s}$ towards the block B kept at rest. A spring with spring constant $k = 3000\ \text{N/m}$ is attached to the block B as shown in the figure. After the collision, suppose that the blocks A and B, along with the spring in constant compression state, move together. Then the compression in the spring is: (Neglect the mass of the spring)
Answer: (C) $0.1\ \text{m}$
When the blocks move together, momentum conservation gives
$$v_c = \frac{10\times3}{10 + 5} = 2\ \text{m/s}$$
The lost kinetic energy is stored in the spring:
$$\tfrac12kx^2 = \tfrac12(10)(3)^2 - \tfrac12(15)(2)^2 = 45 - 30 = 15\ \text{J}$$
$$x^2 = \frac{2\times15}{3000} = 0.01 \Rightarrow x = 0.1\ \text{m}$$
Solution by Sreeraj P, M.Sc Physics