SixFaces
Do you have questions or comments about this model? Ask them here! (You'll first need to log in.)
WHAT IS IT?
Simulates the rolling of a dice, and the objective is to estimate how many throws you need to obtain the six different faces. The statistical value is 14.7.
HOW IT WORKS
There is one agent for each possible result between 1 and 33. The ith agent jumps forward each time you need i throws to obtain the six results.
HOW TO USE IT
Step controls the number of throws: the turtle moves forward 10^step each time. Reset places 33 agents in the starting line. Go starts the race.
THINGS TO NOTICE
-
THINGS TO TRY
You can just Reset for a new experiment.
EXTENDING THE MODEL
--
NETLOGO FEATURES
--
RELATED MODELS
--
CREDITS AND REFERENCES
Author: Francisco Restivo (frestivo@gmail.com).
Comments and Questions
; How many times you need to throw a dice to obtain the 6 possible face values? ; At least 6 times, of course ; Mean value is 14.7 sharp ; Simulation by Francisco Restivo, frestivo@gmail.com globals [valor faces serie nseries media fim] to setup clear-all crt 33 ; 33 turtles, for lengths from 1 to 33 ask turtles [ set label (who + 1) setxy (who - 16) -16 set heading 0 set pen-size 9 pd ] reset-ticks set faces [0 0 0 0 0 0] set serie 0 set nseries 0 set fim 0 end to throw tick set valor random 6 set serie serie + 1 if item valor faces = 0 [ set faces replace-item valor faces 1 ] if faces = [1 1 1 1 1 1] [ ; got the 6 faces? if serie <= 33 [ ask turtle (serie - 1) [ forward 10 ^ step if ycor >= 16 [ ; race ended? set fim 1] ] ] set faces [0 0 0 0 0 0] set nseries (nseries + 1) set media (ticks / nseries) set serie 0 ] end to go if fim = 0 [ throw ] end
There is only one version of this model, created over 7 years ago by Francisco Restivo.
Attached files
File | Type | Description | Last updated | |
---|---|---|---|---|
SixFaces.png | preview | Preview for 'SixFaces' | over 7 years ago, by Francisco Restivo | Download |
This model does not have any ancestors.
This model does not have any descendants.