Message Boards Message Boards

1
|
2385 Views
|
1 Reply
|
1 Total Likes
View groups...
Share
Share this post:

I need an Answers

Posted 10 years ago
e. Design a generator of random for a state of four options having the same probability ?
POSTED BY: Elaf Salah
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
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract