The following guidelines are expected for all homework submissions:

- All homework must be typed. Homework which is not typed will be returned ungraded and will be subject to the late homework guidelines as set out on the syllabus page. PLEASE DO NOT scribble something on lined paper and rip it out of your spiral notebook — hanging chads went out with the presidential election in 2000.
- I don't care too much about what font you use or how large your margins are; however, you might want to check out a monospaced font for typing code, as it will be easy to see the indentations.
- Speaking of indenting,
**PLEASE DON'T USE TABS TO INDENT YOUR CODE**. Tabs can often get interpreted differently by different computers, peripherals, and applications, and could make code that is nicely formatted on *your* computer lookall over the map

on *my* computer or in my editor.**USE SPACES INSTEAD**. You can set up almost every modern text editor to insert spaces whenever you press the TAB key, or you can simply pound the spacebar. *On assignments 1, 2, and 3,*. I can't stress this enough; part of this policy is**WORK BY YOURSELF**. On assignments 4 and 5,**WORK WITH A PARTNER***don't split up the work –*. This activity mimics an industry code development model called**WORK TOGETHER**on the assignmentpair programming

which is part of the Extreme Programming software development method. Feel free to collaborate in your pairs as much as you want, doing the entire assignment together.- DO NOT share your work between individuals or groups. Doing so will count as plagiarism. If you
wish to discuss solutions with another group over coffee in the Lair, that's fine as long as it is
*kept at the conceptual level and you don't share your code*between groups or individuals. Each person or group needs to turn in its own version of the solutions. - You only need to turn in ONE COPY per group.
- MAKE SURE YOUR GITHUB REPO IS PRIVATE [for reasons explained on the syllabus page and in class].
- MAKE SURE TO INCLUDE ME IN YOUR REPO AS A CONTRIBUTOR so that I can upload your evaluations.
- Submit your homework through GitHub, in your repository, to which I must be a contributor or have otherwise been allowed access. I cannot evaluate what I cannot see!

This assignment is actually really easy. All you need to do is:

- Get your GitHub account set up; use the naming convention
CMSI-3630_<your_name>

so I can easily tell which one is which - Create your repository with all the required folders; use the empty file
README.md

to start the folders [GitHub won't let you create just an empty folder ~ you need something in it] - Make sure that the folder structure is set up the same as on the week one
page under the
**Assignment Submissions**section - Make sure that the repository is
**PRIVATE**for reasons explained in class - Invite your professor to participate in your repository; my GitHub name is
bjohnson05

and my squirrel drinking coffee logo should be visible - Be sure to check that your code runs from the command line, the
*REAL*one, not one that is part of an editor or IDE like Eclipse or VScode - Commit one copy of your week one in-class exercise to your homework01 directory

One easy way to determine the approximate value of PI is to use what's known as the Monte Carlo

simulation. To do this, implement the following steps:

- Imagine a
unit circle

which is a circle with a radius of one - Inscribe that circle inside a square, so that the four sides of the square are tangent to the circle on four sides; this means you have a square that is 2 units by two units with the circle inside it
- Now imagine throwing a large bunch of darts that RANDOMLY land inside the square; some will land in the circle, some will land in the square OUTSIDE the circle
- Given the area of the square is Area
_{square}= 2 * 2 = 4 units - Given the area of the circle is Area
_{circle}= PI * r * r and since r = 1, then Area_{circle}= PI units - Taking the ratio of Area
_{square}to Area_{circle}give the equation Area_{square}/ Area_{circle}= 4 / PI - Rearranging that equation gives PI = (Area
_{circle}* 4) / Area_{square} - OK, now we can create a program for this! See if you can write a program in Python that will give an
approximate value of PI using Monte Carlo Simulation. The steps are as follows:
- Generate a large number of random X and Y paired values to simulate points where darts hit
- Count how many total points there are to simulate the area of the square
- Calculate the distance of each point from the center [origin] of the circle; if it is less than or equal to one, that dart is INSIDE the circle so count it
- When all darts are thrown, use the total number thrown as Area
_{square}and the total count INSIDE the circle as Area_{circle} - Calculate and output the approximate value of PI using the equation developed above