Is asteroid 2003/Q0104 going to hit Earth in May 2031, and if not, then by how much will it miss us and what effect could the near miss have on us; could it hit our moon, and if so, what would the effects be for us?
This asteroid is no longer considered to be on a collision course with Earth (or the Moon)! It was removed from this risk category back in 2003 shortly after it was discovered (http://neo.jpl.nasa.gov/risk/removed.html).
If two large objects collide in space, there are a lot of different conditions which need to be accounted for when saying exactly what the effects would be e.g. the size of the objects, their speeds etc.. If the Earth and another object e.g. an asteroid did collide, there are a range of possibilities in terms of the kind of damage it would cause. If the asteroid hit an ocean it would create a mega tsunami while if it collided with land it would cause a large crater, examples of which can be found all over the Earth e.g. Meteor Crater in Arizona, USA. Material thrown up when the crater was formed would also be thrown out of the Earth's atmosphere and would be spread around the neighboring solar system. Depending if the asteroid hit directly or with a glancing blow, this would have a significant effect on the amount of material ejected.
So in summary - there is no reason to panic in 2031! And there are a range of possible outcomes when it comes to collisions of large bodies in the solar system.