4 students to a table.  Work with a partner! 

Discuss challenges with your partner - help them solve their challenges.  Work together!  If you and your partner are stuck - ask for help!  Class time is limited and PG and TAs are here to make this learning time more efficient!


You may need to refer to this week's reading assignment throughout the exercises. 


Announcements

  • If you are struggling, make time to attend office hours!   We will help you get the work done more efficiently! 

  • You do need to get caught up because we are going to learn some cool stuff soon - you won't want to miss it....

  • Office hours on Mondays are less crowded, come then for more focused attention. 

Remember, you will get better results with our special On Demand server:  

https://ood2.hpc.virginia.edu/pun/sys/dashboard/batch_connect/sessions

Goals

  • Learn how to use functions.

0) Get the GitHub repository and clone it to your area in Rivanna. 


Use this link to accept the assignment and create your repository: https://classroom.github.com/a/nK2TnHlN   

After you accept the assignment and the repository and it exists in your GitHub, clone it to your Rivanna working area.

1) Functions


1a)

Work through the Class12.ipynb  Jupyter Notebook.  Thinking about what is happening in each step. 

1b)

Based on what you learned in the Notebook and if time remains: Write a Python program (a script) called pi_functions_error.py.  This program should import the module that I wrote pi_functions.py so that it can use the functions within.  In your program, write functions that will a) do the MC integration (using code in pi_functions.py)  many times set by a command line variable at the top of your program, N_LOOPS (make sure to use a different random seed for each calculation).  Calculate the mean and standard deviation of your N_LOOPS results and print it to the screen. 


Done?  Add some documentation to your programs, and push them to your GitHub repository:     pi_functions_error.py. and class12.ipynb.

  • No labels