Step-by-step explanation:
Let yellow ball be m1 = 0.5kg with u1 = 8 m/s and blue ball be m2 = 0.25 kg with u2 = - 4 m /s respectively.
After collision, blue ball travels 12 m/s.
Using conservation of Linear Momentum :
m1u1 + m2u2 = m1v1 + m2v2
0.5* 8 + 0.25 * - 4 = 0.5 * v1 + 0.25 * 12
v1 = 0 m/sec i.e. Yellow ball comes to rest.