V8's implementation of Math.random() was fucked



  • @Ashley_Sheridan said:

    @jmp sorry, but you just don't understand probability then. Any series of 100 dice rolls, there's the same chance of 100 6's as any other combination. Any combination has the same 1/6**99 (assuming your math is correct). It's a fallacy that random numbers ought to be random by a general persons observation. There's a big difference between actual random and perceived random.

    I'll just jump in and point out that you are talking about permutations, not combinations. Let's consider the rather simpler case of rolling two dice that are coloured or marked differently (or even rolling one die two times), so you can tell them apart. I can roll a double-6 exactly one way, 6 on the first, 6 on the second. Same for any other double-N. For 3-and-4, there are two results. Saying "3 and 4" like that - where we imply that the order is irrelevant - names a "combination". The two results are "3 then 4" and "4 then 3". These are "permutations".

    So in the 100-dice case, "all sixes" describes a permutation that is as likely as any other permutation. That is, it is just as likely as 99 sixes then a five. Or 98 sixes then a five then a six. Or 97 sixes then a five then 2 sixes. Or ... The union of these permutations is the combination "99 sixes AND a five in no particular order. This combination is 100 times more likely than the combination "100 sixes" because it occurs in 100 different permutations.



  • @xaade said:

    oh, so the side facing down is the number

    This one is more intuitive


    In both cases, you read the number that's upright...


  • ♿ (Parody)

    @jmp said:

    I'm just saying if you had rolled a d6 a hundred times every second since the start of the universe you still wouldn't expect it to have happened.

    I'd have to know more about the procedure for making a roll before I'd agree with you.



  • I grew up with the type I posted and can’t get used to the other one. Get off my lawn 😄


  • kills Dumbledore

    @cartman82 said:

    Just call it 2-3rand() times in a loop, what's the big deal, eh?

    FTFY.


Log in to reply