Group Abstract Group Abstract

Message Boards Message Boards

I need an Answers

GROUPS:
e. Design a generator of random for a state of four options having the same probability ?
POSTED BY: Elaf Salah
Answer
4 months 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.
Histogram[
Table[RandomChoice[{1, 2, 3, 4}], {k, 1, 100000}], {0.5, 4.5, 1}]

M.
POSTED BY: Marco Thiel
Answer
4 months ago