Message Boards Message Boards

I need an Answers

e. Design a generator of random for a state of four options having the same probability ?
POSTED BY: Elaf Salah
3 years ago
Dear Elaf,

I am not sure whether I understand your question at all. Do you mean that you want a function that randomly choses any of four options that you put in? Something like this?
RandomChoice[{"option1", "option2", "option3", "option4"}]

This commands picks each option with the same probability as the following histrogram suggests.
Table[RandomChoice[{1, 2, 3, 4}], {k, 1, 100000}], {0.5, 4.5, 1}]

POSTED BY: Marco Thiel
3 years ago

Group Abstract Group Abstract