Is reversal of velocity always equivalent to reversal of time? Let us imagine there is a container full of small particles which are allowed to collide with each other and the container walls (in 2D). If I initialise the system with given velocities and positions at $t = 0$, and reverse the velocity of every particle at $t = 5$, then at $t = 10$ the particles should exactly return to their initial velocities and positions.
However, when I simulate this experiment with simple 2D physics, the particles fail to return to the initial state if they are allowed to both collide with each other and container walls. So the question is Is my understanding of the physics wrong or is there something wrong with the simulation itself ?
When only collision with container walls or collision with other particles is allowed, the particles more or less return to the same situation. However, when both are allowed they just don't. The only interactions in the simulation are 2D collisions between the particles which conserve momentum and collisions with the "walls" which just reverse the corresponding $x$ or $y$ component of the velocity.
 A: You are rediscovering the chaotic behavior of non-integrable systems. 
The reason the system does not recover exactly its original state is due to the unavoidable round-off which makes the final dynamic configuration slightly, but definitely different from the exact evolution. Even after a few steps. When velocities are reversed, since the system is not starting from the exact final state, after the same number of steps of the direct evolution, it does not go back to the original starting point. It is a direct check of the exponential divergence of chaotic trajectories.
The simplest situations you may use to check the phenomenon are the so called chaotic billiards, i.e. two-dimensional surfaces exhibiting the same phenomenon of exponential divergences of close trajectories even for a single point-like particle experiencing elastic collisions. Probably the simplest are the "Sinai billiard" and the "Stadium billiard". Writing a computer code to exploit their chaotic dynamics  is a simple but rewarding exercise.
