필터 지우기
필터 지우기

Please help..About probability ?

조회 수: 1 (최근 30일)
yahya aktas
yahya aktas 2012년 4월 23일
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
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 ...
yahya aktas
yahya aktas 2012년 4월 23일
but I really dont know have to solve this solution I just wrote that:
x=input('Please enter number of throws: ');
while
y(i)=4*rand(1,2)+1;
y1=int2str(y(i));

댓글을 달려면 로그인하십시오.

채택된 답변

Richard Brown
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
  댓글 수: 1
yahya aktas
yahya aktas 2012년 4월 23일
thank you so much Richard.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Interactive Control and Callbacks에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by