graded randomness

Abdur-Rahmaan Janhangeer arj.python at gmail.com
Fri Dec 28 07:15:23 EST 2018


greetings,

let us say that i have a box of 5 balls,

green balls - 2 with probability 2/5
red balls 2 - with probability 2/5
blue balls 1 - with probability 1/5

how to program the selection so that the random choices reflect the
probabilities?

-- 
Abdur-Rahmaan Janhangeer
http://www.pythonmembers.club | https://github.com/Abdur-rahmaanJ
Mauritius

<https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail>
Garanti
sans virus. www.avast.com
<https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail>
<#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>


More information about the Python-list mailing list