On the topic of choosing random numbers, I came across an interesting phenomenon when working on my thesis.
I had to choose points on the surface of a sphere to evaluate a function. I could choose more points to get more constraints to (hopefully) get a more accurate solution down the line. So at first I figured, well, there sphere can be parameterized by an angle in [0,2\pi] and an angle in [0, \pi]. So, let's draw two random numbers from that range and look at
<cos(theta)cos(phi), sin(theta)cos(phi), sin(phi)>
However, a uniform distribution of the angles will not actually lead to "uniformly" spaced points on the unit sphere. The reason, of course, is that the sphere is curved and the area element (sin(phi)*dtheta*dphi) is maximal around the equator and minimal around the poles. So the points would "bunch" up, which ultimately lead to a higher probability of rank deficiency in a big matrix as more and more points were chosen.
It took me a while to understand that was what was going on (though it's clear once you think about it). I ended up taking a more quasirandom approach. (Taking points that were solutions to some standard polynomial family (Legendre I guess)).
I think I will not spoiler this post.