If you would really like to know how things work...well...here you go.
Then, there are a whole bunch of sub-equations after that. However, while I don't hold down special buttons, I just tap A as fast as I can, hoping and praying that it the Pokemon stays in the Pokeball.
When I was in the...