Please help..About probability ?
1 次查看(过去 30 天)
显示 更早的评论
We will make an experiment with dices. We will throw a couple of dices an arbitrary number of times and decide how often these adds up to 6.
The m-file should ask for a number of throws and present the result ( number of 2 dices adds to 6 / total number of throws).
The m-file should produce a plot which shows this quotient in percentage plotted versus number of throws.
Add a horizontal line to the plot where one sees the probability of this experiment. For a very large number of throws this experiment should validate the true probability.
Hint: use rand !
Thank you very much for your kind answers..
2 个评论
Richard Brown
2012-4-23
When you've had a decent attempt and have some MATLAB issues that you're stuck with, *then* is the time to come to MATLAB answers.
You don't even have a question here ...
采纳的回答
Richard Brown
2012-4-23
You can do all of your dice throws with a single call to randi like this:
randi(6, 2, n)
that should get you on your way
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Logical 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!