Answer:Expression given below
Step-by-step explanation:
Given mass of spring
![\left ( m_1\right )=0.5 kg](https://img.qammunity.org/2020/formulas/physics/college/jkumf248v0uy86e0ztjtelebhtymw1t7s5.png)
Compression in the spring
![\left ( x\right )=20 cm](https://img.qammunity.org/2020/formulas/physics/college/ci2asuo06zese9lkkx1ya1f8m5a0bzvvyp.png)
Let the spring constant be K
Using Energy conservation
potential energy stored in spring =Kinetic energy of Block
![\left ( m_1\right )](https://img.qammunity.org/2020/formulas/physics/college/76apdfzdhyn7ibqkz9gb7v94rd7946g3sm.png)
![(1)/(2)Kx^2=(1)/(2)m_1v^2](https://img.qammunity.org/2020/formulas/physics/college/oa11q827d2glz0fy3u1x5zyack47fbpbpp.png)
![v=x\sqrt{(k)/(m_1)}](https://img.qammunity.org/2020/formulas/physics/college/kn6s99spku1dndsq34um56uqz6714mgnxh.png)
now conserving momentum
![m_1v=\left ( m_1+m_2\right )v_0](https://img.qammunity.org/2020/formulas/physics/college/6uv458dgb62hsqee9259lj78ti6kmfs32e.png)
![v_0=(m_1)/(m_1+m_2)v](https://img.qammunity.org/2020/formulas/physics/college/eylopv3l6wq6yfgpi5nvjf920yfvrf9sy7.png)
where
is the final velocity