t - Time elapsed
m₁ - Mass of the red body
m₂ - Mass of the blue body
v₁ - Initial velocity of the red body
v₂ - Initial velocity of the blue body
t - Time elapsed
m₁ - Mass of the red body
m₂ - Mass of the blue body
v₁ - Initial velocity of the red body
v₂ - Initial velocity of the blue body
Notice that after the blocks collide with the container's walls, their momentum becomes zero. From momentum conservation, the initial momentum $p_{i} = m \cdot v + M \cdot 0$ (where $m$ is the mass of the block, $v$ is its velocity, $M$ is the mass of the wall, but multiplied by $V = 0$, since it does not move) has to be equal to the final momentum, $p_{f} = m \cdot V + M \cdot V = (m + M) \cdot V$. From that, $$m \cdot v = (m + M) \cdot V$$ and by rearranging, we get that $$V = \frac{m}{m + M} \cdot v.$$ We know that the wall is way heavier than the block, $M \gg m$, and so $$\frac{m}{m + M} \approx \frac{m}{M} \approx 0$$ and $$V \approx 0.$$ So we can safely assume that the wall does not move, but it does stop our block.