At a quick look in one case this function was generating more 1s than 0s.
It seems also that it generated very often a 1 after a 0 (more than twice as many times than it generates another 0).
Now I got curious, I'll do more tests and look at the documentation for Math.random
Certainly I won't ever use it for any important feature of a website!
EDIT: it seems that with large enough numbers it's not too bad, so I might be able to say more after reading the documentation. At any rate using the strings generated with the khanacademy link I was able to win few times in a row.