samedi 13 avril 2019

Ints or doubles when modelling random events

Theoretically, if I want to model an event in which the probability is 50%, I could merely generate a Boolean and do the event if it returned true, for example.

Now, this could also be achieved by generating a random double, between 0 and 100 (inclusive) and do the event if the number is greater than 50.

Theoretically, both these solutions would work. However, in practice, I know that random number generators are in fact pseudo random number generators, and that this is a somewhat complex topic.

Nonetheless, I'd like to know what are the implications, if any, of implementing one method or the other.




Aucun commentaire:

Enregistrer un commentaire