Let v be the velocity of the particle of mass m just before the collision,
v1 be the velocity of center of rod and w1, the angular velocity of the rod about its center just after the collision.
By conservation of linear momentum,
mv = Mv1
v1 = mv/M
From conservation of angular momentum,
mvL/2 = lw1 = 1/12 ( ML^2w1)
w1 = 6mv/ ML
If T is the time taken by the rod to turn through right angle,
T = pi/ 2wr = pi ML/ 12mv
Since v1 is a constant, we have
x = v1 * T = pi L/12
if M=4m, the kinetic energy of particle rod system after the collision is
kf=1/2Mv12+1/2(ML2)/12w12=1/24mv12+1/2(ML2)/12w12 = 2m(v/4)2 + (mL2/6)∗36∗m2v2/16m2L2
Hence, mv2/6+3mv2/6=1/2mv2=ki