dados

dados preview image

1 collaborator

Default-person carlos paladea (Author)

Tags

(This model has yet to be categorized with any tags)
Visible to everyone | Changeable by everyone
Model was written in NetLogo 5.2.0 • Viewed 205 times • Downloaded 16 times • Run 0 times
Download the 'dados' modelDownload this modelEmbed this model

Do you have questions or comments about this model? Ask them here! (You'll first need to log in.)


COPYRIGHT AND LICENSE

Copyright 2004 Uri Wilensky.

CC BY-NC-SA 3.0

This work is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License. To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-sa/3.0/ or send a letter to Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA.

Commercial licenses are also available. To inquire about commercial licenses, please contact Uri Wilensky at uri@northwestern.edu.

This model was created as part of the projects: PARTICIPATORY SIMULATIONS: NETWORK-BASED DESIGN FOR SYSTEMS LEARNING IN CLASSROOMS and/or INTEGRATED SIMULATION AND MODELING ENVIRONMENT. The project gratefully acknowledges the support of the National Science Foundation (REPP & ROLE programs) -- grant numbers REC #9814682 and REC-0126227.

Comments and Questions

Please start the discussion about this model! (You'll first need to log in.)

Click to Run Model

globals [
 
  frecuencia_1                          ; frecuencia de cada cara
  frecuencia_2
  frecuencia_3
  frecuencia_4
  frecuencia_5
  frecuencia_6
  n ; contador 
  tirada       
  exitos  
  #x
                                        ; the original combination
  #y
  media
  varianza
   ]

to iniciar
     
   set n 0 
   set frecuencia_1 0                          ; frecuencia de cada cara
   set exitos 0
   set frecuencia_2 0
   set frecuencia_3 0
   set frecuencia_4 0
   set frecuencia_5 0
   set frecuencia_6 0
   
  set #x []
  set #y []
   clear-all
   create-turtles 1    [ ;set shape "1"  
                             set size 4 
                             setxy 0 0
                             set heading 0
                             set color 9.0
                             set size 16
                       ]
   ask patches [ set pcolor green - 2 ]
end 

to tirar
  reset-ticks
  if n > muestra
    [ media_varianza 
      stop]  
  set tirada (random 7) + 1
  ask turtles [    
    if tirada = 1  [ set shape "1" set frecuencia_1  (frecuencia_1 + 1) ]
    if tirada = 2  [ set shape "2" set frecuencia_2  (frecuencia_2 + 1) ] 
    if tirada = 3  [ set shape "3" set frecuencia_3  (frecuencia_3 + 1) ]
    if tirada = 4  [ set shape "4" set frecuencia_4  (frecuencia_4 + 1) ]
    if tirada = 5  [ set shape "5" set frecuencia_5  (frecuencia_5 + 1) ]
    if tirada = 6  [ set shape "6" set frecuencia_6  (frecuencia_6 + 1) ]
  
    ]
  
  if tirada = puntos [set exitos (exitos + 1)]
  set n ( n + 1 ) 
 ; ^
end 

to media_varianza
     set media  ( 1 * frecuencia_1 + 2 * frecuencia_2 + 3 * frecuencia_3 + 4 * frecuencia_4 + 5 * frecuencia_5 + 6 * frecuencia_6 ) / n
    ; set varianza  ((( 1 - media) ^ 2  ) + (( 2 - media) ^ 2  ) + (( 3 - media) ^ 2  ) + (( 4 - media) ^ 2  ) + (( 5 - media) ^ 2  ) + (( 6 - media) ^ 2  )/ n )
     set varianza  ((( 1 - media) ^ 2  ) + (( 2 - media) ^ 2  ) + (( 3 - media) ^ 2  ) + (( 4 - media) ^ 2  ) + (( 5 - media) ^ 2  ) + (( 6 - media) ^ 2  ) ) / n
end 







 


  

  
  

There is only one version of this model, created over 9 years ago by carlos paladea.

Attached files

File Type Description Last updated
dados.png preview Preview for 'dados' over 9 years ago, by carlos paladea Download

This model does not have any ancestors.

This model does not have any descendants.