Thank you very much it's great. A very good visual demonstration. Regards P-A Dreyfuss. >Dreyfuss Pierre-Andre wrote: > >> I'm just working with probability too with my kids. >> Here is a MSWlogo ( or UCB) program for throwing two dices. >> to run it ; run try < number of tests> >> try 36 or try 360 is easy to compare probabilities. > ><snip> > > >Hi, > >Here's an MSWLogo graphic simulation for the statistics of tossing a pair of dice. > >The red bars represent the experimental results for sums [2 .. 12], the yellow lines represent the >theoretically anticipated values. > >The program goes on "tossing dice" until one of the red bars reaches 255, then stops. Ideally the >simulation consists of 1524 tosses, but as we use random numbers, it might be somewhat more or less. If you >want to know the exact number - add inside procedure THEORY the following line: > > pr :counter > >Regards... > >[[Yehuda]] > > ------------------------------------------------------------------------ > >to main ; dice >cs ht rt 90 >for[die 2 12][make :die 0] ; setup >draw rnd 0 >end > >to draw :die :counter >if ycor>254[theory stop] >sp 24*:die-173 thing :die >setpc(se distance[0 0] 0 0) >fd 11 ; horizontal line >make :die 1+ycor ; store location >draw rnd 1+:counter >end > >to rnd ; toss pair of dice >op(sum 2 random 6 random 6) >end > >to theory ; calculated length >lt 90 setpc 6 ; drawn in yellow >for[x 1 6][sp -144+24*:x 0 fd :counter*:x/36] >for[x 5 1][sp 144-24*:x 0 fd :counter*:x/36] >end > >to sp :x :y ; library procedure >pu setxy :x :y pd >end > > > Free web-based email, Forever, From anywhere! http://www.mailexcite.com --------------------------------------------------------------- Please post messages to the Logo forum to logo-l@gsn.org. Mail questions about the list administration to logofdn@gsn.org. To unsubscribe send unsubscribe logo-l to majordomo@gsn.org.
Global SchoolNet Foundation -
Linking Kids Around the World!
Copyright GSN - All Rights Reserved
- Comments
& Questions
Visit GSN's
Global
Schoolhouse for more exciting learning resources!
Search our Site
-
Home