probabilities for obtaining 3 dice result

75 Views Asked by At

I am developing an app that needs a 3 dice result and there are two methods I can use:

method a) create a matrix of 216 possible combinations and choose 1 randomly

method b) or generate 3 dice results separately

I am not a math pro but for instance for a result of 3 (1-1-1) is there any difference in chances/probabilities between these two methods ?

Which one is preferable?

1

There are 1 best solutions below

3
On

What you're asking is: Does generating three numbers each using Int(Rnd(6)+1) have a significantly different distribution to looking up an indexed array of all the possible triplets with Int(Rnd(216)?

It should not.

There is a very minor saving in computation time in doing one calculation and lookup verses doing three calculation. On the other hand there is the overhead of populating and storing the global array. So I'd advise generating each roll separately as the way to proceed; unless you needed to make a very large number of calls to the generating procedure.