cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - You can subscribe to a forum, label or individual post and receive email notifications when someone posts a new topic or reply. Learn more! X

How can I draw Empirical graph of dice propblem

Andy5
2-Guest

How can I draw Empirical graph of dice propblem

I'd like to make a code which can make the empirical graph of dice when the dice is only "6"

However, as you can see, the probability is not the same as theory. 

Is there anybody telling me the mistake that I did?  The answer has to be '0.166666666...'

 

plz, help me

 

1 ACCEPTED SOLUTION

Accepted Solutions
Werner_E
24-Ruby V
(To:Andy5)


Is there anybody telling me the mistake that I did?


rnd(5) creates a float random number in the range 0 .. 5

You ask for the number being > 4 and count the range from 4 to 5 which is 1/5 of the range 0 to 5. Consequently you get a result near 0.2.

 

Use rnd(6) and condition ">5" and you get the result you'd like to see.

View solution in original post

4 REPLIES 4
AlanStevens
17-Peridot
(To:Andy5)

Something like this perhaps:

 

randomdice.JPG

 

There are other ways as well of course!

 

Alan

 

Thank U so much.

 

I learned another way thanks to U

Werner_E
24-Ruby V
(To:Andy5)


Is there anybody telling me the mistake that I did?


rnd(5) creates a float random number in the range 0 .. 5

You ask for the number being > 4 and count the range from 4 to 5 which is 1/5 of the range 0 to 5. Consequently you get a result near 0.2.

 

Use rnd(6) and condition ">5" and you get the result you'd like to see.

Thank U so much.

 

I thought that rnd Function is similar to randi in Matlab.

It is not an integer in Mathcad

Top Tags