If you insert 4 rows into a table, and join it on itself without any conditional criteria, it will result in a cartesian product of 16 rows (Select * from a, a)
Do that cartesian join three more times, and you have over 4 billion results.
Then you simply need to use the random function in conjunction with division, rounding and case statements to get the desired random numbers.