jeudi 9 février 2017

Generate Binary Outcome Based on Given ProbabilitY

I'm writing code that requires the generation of a binary outcome from a given probabilities or list. I'm looking at the random module but was unable to find anything that would solve the problem.

Example

RETURN 1 30% of the time

EXAMPLE

RETURN 1 OR 0 45% and 55% of the time




Aucun commentaire:

Enregistrer un commentaire