Let velocilty of 2 kg block ion reaching the 4 kg block before collision `n=u_1`
Given `V_2=0` (velocity of 4 kg block)
`:.(1/2)mxxu_1^2-(1/2)mx(1)^2=-mxxmgxxS`
`rarr u_1=sqrt((1)^2-2xx0.20xx10xx0.16)`
`rarr =0.6m/sec`
`rarr u_1=0.6m/s`
`since it is a perfectly elastic collision.
Let `v_1,v_2rarr `velocity of 2 kg and 4 kg block after collision.
`m_1xxu_1+m_2u_2=m_1v_1+m_2v_2`
`rarr 2xx0.6xx4.0=2v_1+4v_2`
`2v_1+4v_2=1.2`.......i
`Again `v_1-V_2=+(u_1-u_2)`
`=+(0.6-0)`
`=-0.6` ...ii
Substractig ii from i
`3v_2=1.2`
`rarr v_2=0.4m/s`
`:. v_1=-0.6+0.4`
`=-0.2m/s`
`:.` Putting work energy principle for 1st 2kg block when comes to rest.
`(1/2)xx2xx(0)^2+(1/2)xx2xx(0.2)^2``
`=-2xx0.2xx10xxS_1`
`rarr S_1=1cm`
Putting work energy principle for 4 kg block
`(1/2)xx4(0)^2-(1/2)xx4xx(0.4)^2`
`=-4xx0.2xx10xxS_1`
`rarr 2xx0.4xx0.4=4xx0.2xx10xxS_2`
`rarr S_2=4cm`
distnce between 2kg and 4 kg block
`=S_1+S_2=1+4=5cm`