<?xml version="1.0"?>
<!DOCTYPE activity SYSTEM "escot.dtd" >
<activity name="PI Machine" size="704,539" escotVersion="1.2.13" puzzle_id="23">
  <page name="Introduction">
    <component class="org.escot.demo.HTMLViewer" position="6,5" size="636,476" visible="true" portid="HTMLViewer-1">
      <![CDATA[<html>
	<body bgcolor="white"	<p>Have you ever wondered what the value of pi is, or where this number came from?</p>
		<p>By definition, Pi is a ratio that compares the circumference of a circle to its diameter. One very interesting fact about this ratio is that its value is always the same number, no matter which circle you use to compute it! Let's take a look at some examples of different circles:</p>
		<p>
		<table border="1" cellpadding="1" cellspacing="1" width="520">
			<tr>
				<td bgcolor="silver">&nbsp;</td>
				<td bgcolor="silver" width="100"><b>Diameter(d)</b></td>
				<td bgcolor="silver" width="120"><b>Circumference(c)</b></td>
				<td bgcolor="silver" width="110"><b>What is the ratio of c/d (pi)?</b></td>
			</tr>
			<tr>
				<td><b>Billiard ball</b></td>
				<td width="100">
					<center>
						7.50 cm</center>
				</td>
				<td width="120">
					<center>
						23.8 cm</center>
				</td>
				<td width="110">&nbsp;</td>
			</tr>
			<tr>
				<td><b>Soda can</b></td>
				<td width="100">
					<center>
						8.20 cm</center>
				</td>
				<td width="120">
					<center>
						26.5 cm</center>
				</td>
				<td width="110">&nbsp;</td>
			</tr>
			<tr>
				<td><b>Coffee mug</b></td>
				<td width="100">
					<center>
						11.8 cm</center>
				</td>
				<td width="120">
					<center>
						37.2 cm</center>
				</td>
				<td width="110">&nbsp;</td>
			</tr>
			<tr>
				<td><b>Coffee can</b></td>
				<td width="100">
					<center>
						13.3 cm</center>
				</td>
				<td width="120">
					<center>
						41.8 cm</center>
				</td>
				<td width="110">&nbsp;</td>
			</tr>
			<tr>
				<td><b>Earth</b></td>
				<td width="100">
					<center>
						12,742 km</center>
				</td>
				<td width="120">
					<center>
						40,010 km</center>
				</td>
				<td width="110">&nbsp;</td>
			</tr>
			<tr>
				<td><b>Official WNBA Game Ball</b></td>
				<td width="100">
					<center>
						9.07 inches</center>
				</td>
				<td width="120">
					<center>
						28.5 inches</center>
				</td>
				<td width="110">&nbsp;</td>
			</tr>
			<tr>
				<td><i>Try some of your own!</i></td>
				<td width="100">&nbsp;</td>
				<td width="120">&nbsp;</td>
				<td width="110">&nbsp;</td>
			</tr>
		</table>
		</p>
		<p>Another interesting thing about pi is that it is an irrational number. This means that it cannot be written as a fraction (note: 22/7 is just an approximation of the value), and it cannot be written as a repeating or terminating decimal. Therefore, we can only estimate its value, we could never really write all the digits of pi down even if we tried!</p>
		<p>In this investigation, we will attempt to estimate the value of pi using a new method. Instead of measuring and creating ratios, we are going to use the computer. Because the computer can generate random numbers very quickly, we can use it to create a simulation, which is a re-enactment of an actual experiment. The experiment that we are simulating works like this: pretend you had some rice in your hands, and you drop all the grains onto a dart-board which is lying on the floor. We can simulate the way that the rice falls by generating random points on a circular board.
	</body>

</html>
]]>
    </component>
  </page>
  <page name="Activity Page.">
    <component class="edu.colorado.agentsheets.AgentSheetsWrapper" position="388,1" size="286,253" visible="true" portid="AgentSheetsWrapper-1">
      <property name="classname" value="pimachine_week1"/>
      <property name="XMLPropertysheet" value="pim1.sip"/>
      <property name="XMLWorksheet" value="week1.ws"/>
    </component>
    <component class="org.escot.demo.ButtonPanel" position="387,250" size="112,34" visible="true" portid="ButtonPanel-1">
      <property name="font" value="dialog,Dialog,0,12"/>
    </component>
    <component class="virtuoso.logo.LogoScript" position="73,617" size="28,17" visible="false" portid="LogoScript-1">
      <export name="In Circle" type="number">0.0</export>
      <export name="In Square" type="number">0.0</export>
      <export name="ProbInCircle" type="number">0.0</export>
      <export name="4xCol3" type="number">0.0</export>
      <![CDATA[]]>
      <property name="toolBarShowing" value="false"/>
    </component>
    <component class="com.sri.escot.NumberEntry" position="511,258" size="165,24" visible="true" portid="NumberEntry-1">
      <property name="value" value="100.0"/>
      <property name="minimumDecimalPlaces" value="0"/>
      <property name="allowNegative" value="false"/>
      <property name="editable" value="true"/>
      <property name="maximumDecimalPlaces" value="0"/>
      <property name="label" value="Number of Points"/>
      <property name="suffix" value=""/>
    </component>
    <component class="org.escot.demo.SimpleNumberTable" position="365,283" size="328,88" visible="true" portid="SimpleNumberTable-1">
      <customProperty name="models" value="In Circle,In Square,ProbInCircle,4xCol3"/>
      <property name="orientation" value="1"/>
      <property name="maximumFractionDigits" value="4"/>
      <property name="minimumFractionDigits" value="0"/>
      <property name="font" value="dialog,Dialog,0,12"/>
      <property name="live" value="false"/>
    </component>
    <component class="com.sri.escot.EscotLabel" position="9,-2" size="89,18" visible="true">
      <property name="background" value="204,204,204"/>
      <property name="text" value="Instructions:"/>
      <property name="foreground" value="0,0,0"/>
      <property name="font" value="dialog,Dialog,0,12"/>
    </component>
    <component class="org.escot.demo.HTMLViewer" position="5,15" size="358,356" visible="true" portid="HTMLViewer-1">
      <![CDATA[<html>

	<body bgcolor="white">
		<b>Part A: Make a mathematical prediction.</b>
		<p>Imagine a circle of radius =1 that is drawn inside a square so that it touches all four sides of the square like the picture to the left. Now imagine that points were generated randomly anywhere in the square. Which of the following four choices do you think best estimates what percentage of the points would fall on the circle?<br>
		1. 25% (0.25)<br>
		2. 50% (0.5)<br>
		3. 75% (0.75)<br>
		4. 95% (0.95)<br>
		<br>
		Record your prediction in the answer section below.<br>
		<br>
		<br>
		<br>
		<b>Part B: Collect data to investigate your prediction.</b></p>
		<p>Run the simulation provided in this page and collect data to support your answers. This simulation generates random points in the board. If the point is in the circle, it appears with a red color. If the point is outside the circle and in the square, it appears with a blue color. Please note that the more points are generated in the same position, the darker the color becomes.</p>
		<p><b>To run the simulation for your experiments, follow these steps:</b><br>
		1. If you do not see a circle in the square in this page, hit the Reset button until you get it.  It may take some time to reload the picture in the simulation window, so please be patient!<br>
		2. Click in the box called Number of Points and enter the number of points you want the simulation to generate.<br>
		3. Click on the &quot;Run&quot; button (located under the simulation).<br>
		4. When the simulation is done (the Number of Points will count down to 0), click on the &quot;Sample&quot; button (located above the table). Notice how the chart indicates the results of your experiment.<br>
		5. Examine the results in the table to answer the activity questions.<br>
		6. Repeat the experiment for a different number of points. Before running the simulation again, you need hit the &quot;Reset&quot; button. Wait for the picture in the simulation window to completely reload. Enter another number of points and repeat steps 3, 4 and 5 above.<br>
		<br>
		We suggest that you experiment with 100, 1000, 10000, and 100000 points. Please note that the more points you use the more accurate and consistent the results.<br>
		<br>
		<br>
		<br>
		<b>Part C: Reflections</b></p>
		<p>Notice that the third column in the chart tells you the percentage of points that fall in the circle (expressed as a decimal number). Are numbers close to the estimate you chose in part A above? Can you explain why or why not? To get full credit for this question, write a mathematical explanation of what happened. To do this, you want to think about comparing the areas of each of the figures. <b>Hint:</b> recall that the radius of the circle is 1. Use the answer area below.<br>
		<br>
		<br>
		<br>
		<b>Part D: Conclusion and Extension</b></p>
		<p>There is something very interesting about these results. If you multiply the decimal numbers in the third column of the spreadsheet by 4, you get an approximation for pi! Use the last column of the spreadsheet to check this for yourself. Can you give a mathematical explanation for why this happens? Write your answer in the answer area below.<br>
<BR>
<BR>
<b>Note</b>: You should close the ESCOT Browser when you finish this activity.  If you want to run other activities, run the Browser again.

	</body>

</html>
]]>
    </component>
    <component class="org.escot.demo.TextEditor" position="5,373" size="688,103" answerText="true" portid="TextEditor-1" visible="true">
      <![CDATA[Please record your answers here.

Part A: What is your prediction for Part A? Which of the following four choices do you think best estimates the percentage of the random points that would be inside the circle?
1. 25% (0.25)
2. 50% (0.50)
3. 75% (0.75)
4. 95% (0.95)
Please explain.




Part B & C: Are the numbers that you got from the different experiments with the simulation close to the estimate you chose in part A above? Can you explain why or why not? To get full credit for this question, write a mathematical explanation of what happened.

HINT 1: Consider the area of each of the figures (the circle and the square).
HINT 2: Recall that the radius of the circle is 1.




Part D: Can you give a mathematical explanation of why the multiplication of the decimal numbers in the "ProbInCircle" column of the table by 4 yields an approximation for Pi?

]]>
      <property name="background" value="255,255,255"/>
      <property name="foreground" value="0,0,0"/>
      <property name="font" value="Arial,Application,0,10"/>
    </component>
    <wire type="org.escot.Broker">
      <from portid="NumberEntry-1" name="number"/>
      <to portid="AgentSheetsWrapper-1" name="NUMBEROFPOINTS"/>
    </wire>
    <wire type="org.escot.Broker">
      <from portid="AgentSheetsWrapper-1" name="NUMBEROFPOINTS"/>
      <to portid="NumberEntry-1" name="number"/>
    </wire>
    <wire type="org.escot.Broker">
      <from portid="AgentSheetsWrapper-1" name="POINTSINCIRCLE"/>
      <to portid="LogoScript-1" name="In Circle"/>
    </wire>
    <wire type="org.escot.Broker">
      <from portid="AgentSheetsWrapper-1" name="POINTSINSQUARE"/>
      <to portid="LogoScript-1" name="In Square"/>
    </wire>
    <wire type="org.escot.Broker">
      <from portid="AgentSheetsWrapper-1" name="PROBABILITYINCIRCLE"/>
      <to portid="LogoScript-1" name="ProbInCircle"/>
    </wire>
    <wire type="org.escot.Broker">
      <from portid="AgentSheetsWrapper-1" name="PI"/>
      <to portid="LogoScript-1" name="4xCol3"/>
    </wire>
    <wire type="org.escot.Broker">
      <from portid="LogoScript-1" name="In Circle"/>
      <to portid="SimpleNumberTable-1" name=""/>
    </wire>
    <wire type="org.escot.Broker">
      <from portid="LogoScript-1" name="In Square"/>
      <to portid="SimpleNumberTable-1" name=""/>
    </wire>
    <wire type="org.escot.Broker">
      <from portid="LogoScript-1" name="ProbInCircle"/>
      <to portid="SimpleNumberTable-1" name=""/>
    </wire>
    <wire type="org.escot.Broker">
      <from portid="LogoScript-1" name="4xCol3"/>
      <to portid="SimpleNumberTable-1" name=""/>
    </wire>
    <wire type="org.escot.Broker">
      <from portid="SimpleNumberTable-1" name="Sample"/>
      <to portid="ButtonPanel-1" name=""/>
    </wire>
  </page>
</activity>

