Monte Carlo assignment - CS 1025
Computational Modeling and Simulation


  1. MC Hammer: Monte Carlo resources...

  2. Its DONE now: VIDEO TUTORIAL - about 11 minutes 23 seconds long. Camtasia video tutorial on NetLogo and Monte Carlo models. My computer has frozen up in 5 different attempts to create a demonstration of NetLogo and a 7 wide by 7 tall square grid of 49 patches. I did something different this time and did not attempt what gave the problems and freeze up.
  3. The main things the video tutorial is needed for is to explain the code for the turnFarAwayCowsToStars procedure and show the NetLogo help for the die statement and for the hatch statement.

  4. Monte Carlo concepts explained and illustrated with 20 darts on a previous semester's quiz question: MonteCarlo20darts.pdf and extra example.
  5. Assignment for Monte Carlo - Ten Questions to answer using Monte Carlo simulation. Online students will can disregard the with a partner suggestion.

    1. If you wish to have an answer sheet see either the PDF MonteCarloNetLogoCirclesAnswerSheet.pdf or download and open up the Word document MonteCarloNetLogoCirclesAnswerSheet.docx

    2. MonteCarloCircles.jpg for questions 1, 2 and 3.

    3. For questions 7, 8 and 9: Monte_11_16.jpg is the output of another NetLogo simulation run.

    4. To download and be able to open up and modify the model, right mouse button click and SAVE to your computer. MonteCarloCircles.nlogo. To just look at the code, left mouse button click on the link.

  6. Two circles and seven enclosed areas. What is the area between the two circles? December4th.html will expand your problem solving ability and help you understand radians like never before. Plants, Stars, Cows and Cars.
  7. The Ellipse is more complicated to draw than a circle. The oval shape is also more complicated to assess whether a turtle is inside the ellipse or outside the ellipse. Thankfully, all you need to do to use it is to count the cows and the houses and the turtles total and the patches. Using the cows as the numerator and the turtles as the denominator you get a proportion. Multiply that proportion times the patches count and you have the estimate of the area of the ELLIPSE.
  8. Formula for the AREA of an Ellipse and the equation for creating an ellipse centered at the origin, i.e. at patch (0, 0) of the turtle world.

  9. Stars, Planes, and Flowers: The slope of the line is 1.8 and the intercept of the line is 3. For a given turtles xcor Xcoordinate position we can calculate where it would be if it were on the straight line. y = 1.8 * xcor + 3 would be the predicted y, and you can hang your hat on that. (Note: y-hat is a term in statistics). If the turtle's actual ycor is less than the predicted y, we know its BELOW THE LINE. If the turtles actual ycor is greater than the predicted y, we know it is ABOVE THE LINE. Every turtle has an xcor Xcoordinate and a ycor Ycoordinate. That is its position is 2D two-dimensional space (xcor, ycor). MonteCarloNCAA.html
  10. Here is a segment of the code from ITEM #3 above. It is especially relevant for questions 4 and 6 of the TEN QUESTIONS assignment.
  11. breed [cows cow]
    breed [leaves leaf]
    breed [stars star]
    
    globals [stepSize]
    
    to monteCarlo
       ca
       checkerboard
       
       drawCircles
       
       crt numberOfTurtles
          
       ask turtles 
       [
          setxy random-xcor random-ycor
          
          ifelse (distancexy 0 0) > innerCircleRadius 
             [       
                 hatch-cows 1 [ set color black set shape "cow" ]
                 die 
             ]
             [
                 hatch-leaves 1 [ set color blue set shape "leaf" ]
                 die
             ]
       ]  
    END
       
    TO turnFarAwayCowsToStars
       
    END
    
    ;; What is InnerCircleRadius?  How does it play a role above in the code?
    ;; Hint:  OuterCircleRadius is a SLIDER too.  
              Will it play a role in the turnFarAwayCowsToStars NetLogo procedure?
              Where are the FAR AWAY COWS?  They are outside of the BIG CIRCLE, the Outer Circle!
    
  12. ...