APPROXPI Archimedes Method to Approximate Pi BRIEF ABSTRACT This analytic geometry problem is well described by its title. It fits well early in a calculus course. GENERAL INFORMATION FileName: APPROXPI Full title: Archimedes Method to Approximate Pi Last Update: 6/1/96 Developers: Sandra K. Dawson, Glenbrook South High School, Glenview, IL 60025. Dave Horn, Rogers High School, Michigan City, IN 46360. Aaron Klebanoff, Rose Hulman Institute of Technology, Terre Haute, IN 47803. Contact: Aaron Klebanoff, Department of Mathematics, Rose-Hulman Institute of Technology, Terre Haute IN 47803 USA. Phone: 812-877-8151. Email: Aaron.Klebanoff@rose-hulman.edu. FAX: 812-877-3198. Support: The production of this material is supported by the National Science Foundation under Division of Undergraduate Education grant DUE-9352849: Development Site for Complex, Technology-Based Problems in Calculus with Applications in Science and Engineering. STATEMENT OF PROBLEM Our goal in this lesson is to approximate the value of Pi through the estimation of the area of a unit circle. To estimate the area, we will compute the areas of inscribed and circumscribed polygons. As the number of sides of the polygons increases, the area of the polygons will get closer and closer to the area of the unit circle (which is exactly Pi.) This is the method that was used by the Greek mathematician Archimedes over two thousand years ago. 1. Develop a general formula for the area of an n-sided equilateral polygon which is inscribed in a circle of radius r. Hint: Draw a sketch of a typical triangular piece of the n-sided polygon. 2. Develop a general formula for the area of an n-sided equilateral polygon which is circumscribed about a circle of radius r. Hint: Draw a sketch of a typical triangular piece of the n-sided polygon. 3. Using a radius of one, r = 1, generate a table of values which will display the area of the inscribed and circumscribed n-sided polygons. Let the values of n range from 10 to 400. (You need not include every value of n. Instead step by, say, 10 or 20.) a. How many decimal places of accuracy do you have when n = 400? b. How many decimal places of accuracy do you have in the average of the inscribed and circumscribed areas? 4. a. For what value of n will you have one more digit of accuracy than you had in part (3a) in both approximations ? b. For what value of n will you have six decimal places of accuracy in both approximations? 5. Plot the data in your table on a graph of area versus number of sides. Include in your graph the horizontal line area=Pi in order to compare the values of the areas for the inscribed and circumscribed polygons. 6. Which converges faster: circumscribed or inscribed polygons? Justify your answer. KEYWORDS Limits, Pi, inscribed and circumscribed polygons, area approximations, Archimedes, trigonometry TEACHER NOTES ISSUES RELATED TO THE PROBLEM Prerequisites Trigonometry and area of right triangle. Time allotment - time management Expectations Future payoffs An intuitive introduction to limits, infinite series convergence, and area approximations. Extensions References and Sources POSSIBLE SOLUTION(S) 1. Inscribed Area = n/2 Sin[2 Pi / n]. Code and Figures. In[2]:= circle = PolarPlot[1, {th, 0, 2 Pi}, DisplayFunction -> Identity]; In[3]:= norm1 = Sqrt[1 + Tan[Pi/5]^2]; norm3 = Sqrt[1 + Tan[3 Pi/5]^2]; norm5 = Sqrt[1 + Tan[5 Pi/5]^2]; norm7 = Sqrt[1 + Tan[7 Pi/5]^2]; norm9 = Sqrt[1 + Tan[9 Pi/5]^2]; In[8]:= lines = ParametricPlot[{ {t/norm1, Tan[Pi/5] t/norm1}, {-t/norm3, Tan[3 Pi/5] t/norm3}, {-t/norm5, Tan[5 Pi/5] t/norm5}, {-t/norm7, Tan[7 Pi/5] t/norm7}, {t/norm9, Tan[9 Pi/5] t/norm9}}, {t, 0, 1}, DisplayFunction -> Identity]; In[9]:= secants = ParametricPlot[{ {Cos[Pi/5] + (Cos[3 Pi/5] - Cos[Pi/5]) t, Sin[Pi/5] + (Sin[3 Pi/5] - Sin[Pi/5]) t}, {Cos[3 Pi/5] + (Cos[5 Pi/5] - Cos[3 Pi/5]) t, Sin[3 Pi/5] + (Sin[5 Pi/5] - Sin[3 Pi/5]) t}, {Cos[5 Pi/5] + (Cos[7 Pi/5] - Cos[5 Pi/5]) t, Sin[5 Pi/5] + (Sin[7 Pi/5] - Sin[5 Pi/5]) t}, {Cos[7 Pi/5] + (Cos[9 Pi/5] - Cos[7 Pi/5]) t, Sin[7 Pi/5] + (Sin[9 Pi/5] - Sin[7 Pi/5]) t}, {Cos[9 Pi/5] + (Cos[Pi/5] - Cos[9 Pi/5]) t, Sin[9 Pi/5] + (Sin[Pi/5] - Sin[9 Pi/5]) t}}, {t, 0, 1}, DisplayFunction -> Identity]; In[10]:= p1 = Show[circle, lines, secants, DisplayFunction -> $DisplayFunction, Prolog -> AbsoluteThickness[3]] Out[10]= -Graphics- In[11]:= morenorm = Sqrt[1 + Tan[Pi/5]^2]; In[12]:= morelines = ParametricPlot[{{Cos[Pi/5] t, 0}, {Cos[Pi/5] t, Sin[Pi/5] t}, {Cos[Pi/5] t, -Sin[Pi/5] t}, {Cos[Pi/5], Sin[Pi/5] - Sin[Pi/5] t}, {Cos[Pi/5], -Sin[Pi/5] + Sin[Pi/5] t}}, {t, 0, 1}, PlotStyle -> {AbsoluteThickness[5]}, DisplayFunction -> Identity]; In[13]:= Show[p1, morelines, DisplayFunction -> $DisplayFunction] Out[13]= -Graphics- The area of one of the bold triangles is (1/2)*Cos[theta]*Sin[theta] (where in this case theta=Pi/5. Thus, the area of one of the n (or 5 in this case) is Cos[theta] Sin[theta] leaving an Area = n Cos[theta] Sin[theta]. Remark: One can compactly represent the area equivalently by Area = n/2 Sin[2 Pi/n] 2. Circumscribedarea = n Tan[Pi/n] Code and Figures In[14]:= n1 = Sqrt[1 + Tan[Pi/5]^2]; n3 = Sqrt[1 + Tan[3 Pi/5]^2]; n5 = Sqrt[1 + Tan[5 Pi/5]^2]; n7 = Sqrt[1 + Tan[7 Pi/5]^2]; In[18]:= c1 = 1; d1 = Tan[Pi/5]; c2 = -n1/n3; d2 = c2 Tan[3 Pi/5]; c3 = -n1/n5; d3 = c3 Tan[5 Pi/5]; c4 = -n1/n7; d4 = c4 Tan[7 Pi/5]; c5 = 1; d5 = Tan[9 Pi/5]; In[23]:= lines = ParametricPlot[{{c1 t, d1 t}, {c2 t, d2 t}, {c3 t, d3 t}, {c4 t, d4 t}, {c5 t, d5 t}}, {t, 0, 1}, DisplayFunction -> Identity]; In[24]:= tangents = ParametricPlot[{ {c1 + (c2 - c1) t, d1 + (d2 - d1) t}, {c2 + (c3 - c2) t, d2 + (d3 - d2) t}, {c3 + (c4 - c3) t, d3 + (d4 - d3) t}, {c4 + (c5 - c4) t, d4 + (d5 - d4) t}, {c5 + (c1 - c5) t, d5 + (d1 - d5) t}}, {t, 0, 1}, DisplayFunction -> Identity]; In[25]:= p1 = Show[circle, lines, tangents, DisplayFunction -> $DisplayFunction, Prolog -> AbsoluteThickness[3]] Out[25]= -Graphics- In[26]:= triangle = ParametricPlot[{{t, 0}, {1, d1 t}, {c1 t, d1 t}}, {t, 0, 1}, PlotStyle -> AbsoluteThickness[6], DisplayFunction -> Identity]; In[27]:= Show[p1, triangle, DisplayFunction -> $DisplayFunction] Out[27]= -Graphics- If we call the angle from the x-axis inside the bold triangle theta = 2 Pi/n, then the area of the triangle is (1/2) (1) Tan[theta] So, the area of each of the n triangles formed by circumscribing the circle is 2 (1/2) (1) Tan[2 Pi/n] = Tan[2 Pi/n] and since there are n such triangles, the area is Area = n Tan[2 Pi/n]. 3. At n = 400, there are three decimal places of accuracy in both the Inscribed and Circumscribed cases. The average of the two values yields four decimal places of accuracy. The following Mathematica code will generate a table of values of approximations of Pi for n = 4 to 400 in steps of 22. The table offers the Inner and Outer polygon estimates. The Average Error in the table is Abs[(Inner + Outer)/2] In[28]:= TableForm[ Table[ {n,N[n/2 Sin[2 Pi/n],10],N[n Tan[Pi/n],10], N[Abs[(n/2 Sin[2 Pi/n] + n Tan[Pi/n])/2], 10]}, {n,4,400,22}], TableHeadings->{{},{"n", "Inner(n)", "Outer(n)", "Average Area"}}] Out[28]//TableForm= n Inner(n) Outer(n) Average Area 4 2. 4. 3. 26 3.111103636 3.156971564 3.1340376 48 3.132628613 3.146086215 3.139357414 70 3.137375812 3.143703625 3.140539718 92 3.139151015 3.142814328 3.140982671 114 3.14000234 3.142388173 3.141195256 136 3.140475188 3.142151565 3.141313377 158 3.140764693 3.142006732 3.141385712 180 3.140954703 3.141911687 3.141433195 202 3.141086089 3.141845973 3.141466031 224 3.141180703 3.141798653 3.141489678 246 3.141251088 3.141763453 3.141507271 268 3.141304863 3.141736561 3.141520712 290 3.14134687 3.141715554 3.141531212 312 3.141380309 3.141698832 3.141539571 334 3.141407361 3.141685305 3.141546333 356 3.141429554 3.141674207 3.141551881 378 3.141447987 3.14166499 3.141556488 400 3.141463462 3.141657252 3.141560357 In[29]:= N[Pi,10] Out[29]= 3.141592654 In[30]:= TableForm[ Table[ {n, N[Abs[Pi - n/2 Sin[2 Pi/n]]], N[Abs[Pi - n Tan[Pi/n]]], N[Abs[(n/2 Sin[2 Pi/n] + n Tan[Pi/n])/2], 10]}, {n,4,400,22}], TableHeadings->{{},{"n", "Inner Error", "Outer Error", "Average Error"}}] Out[30]//TableForm= n Inner Error Outer Error Average Error 4 1.14159 0.858407 3. 26 0.030489 0.0153789 3.1340376 48 0.00896404 0.00449356 3.139357414 70 0.00421684 0.00211097 3.140539718 92 0.00244164 0.00122167 3.140982671 114 0.00159031 0.000795519 3.141195256 136 0.00111747 0.000558912 3.141313377 158 0.000827961 0.000414079 3.141385712 180 0.00063795 0.000319033 3.141433195 202 0.000506564 0.000253319 3.141466031 224 0.000411951 0.000206 3.141489678 246 0.000341565 0.000170799 3.141507271 268 0.000287791 0.000143907 3.141520712 290 0.000245783 0.0001229 3.141531212 312 0.000212344 0.000106179 3.141539571 334 0.000185292 0.0000926511 3.141546333 356 0.000163099 0.0000815534 3.141551881 378 0.000144667 0.0000723364 3.141556488 400 0.000129191 0.000064598 3.141560357 4. The easiest method of solution is by trial and error (see note in ISSUES IN SOLUTIONS.) 4 digits - Inscribed case: 473 In[31]:= N[n/2 Sin[2 Pi/n] /. n -> 473, 10] N[n/2 Sin[2 Pi/n] /. n -> 472, 10] N[Pi, 10] Out[31]= 3.141500262 Out[32]= 3.14149987 Out[33]= 3.141592654 So, n = 473 is the smallest such n. 4 digits - Circumscribed case: 1187 In[34]:= N[n Tan[Pi/n] /. n -> 1186, 10] N[n Tan[Pi/n] /. n -> 1187, 10] N[Pi, 10] Out[34]= 3.141600001 Out[35]= 3.141599989 Out[36]= 3.141592654 So, n = 1187 is the smallest such n. 6 digits - Inscribed case: 5624 In[37]:= N[n/2 Sin[2 Pi/n] /. n -> 5623, 15] N[n/2 Sin[2 Pi/n] /. n -> 5624, 15] N[Pi, 10] Out[37]= 3.14159199982404 Out[38]= 3.14159200005651 Out[39]= 3.141592654 So, n = 5624 is the smallest such n. 6 digits - Circumscribed case: 5463 In[40]:= N[n Tan[Pi/n] /. n -> 5462, 15] N[n Tan[Pi/n] /. n -> 5463, 15] N[Pi, 10] Out[40]= 3.1415930000274 Out[41]= 3.14159299990058 Out[42]= 3.141592654 So, n = 5463 is the smallest such n. 5. While one could use ListPlot, we simply graph the curves that go through the data points. In[43]:= Plot[{n/2 Sin[2 Pi/n],n Tan[Pi/n],Pi}, {n, 10, 400}, AxesLabel -> {"n", "Area"}, DisplayFunction -> $DisplayFunction] Out[43]= -Graphics- 6. By sight from the curves graphed to the solution to problem #5, it appears that the circumscribed area converges to Pi faster than the inscribed area. Below we also plot the differences to see which ones go to zero first. In[44]:= InError = Pi - n/2 Sin[2 Pi/n]; CircError = Pi - n Tan[Pi/n]; In[46]:= Plot[InError, {n, 10, 400}, AxesLabel -> {"n", "Inscribed Error"}, DisplayFunction -> $DisplayFunction] Out[46]= -Graphics- In[47]:= Plot[CircError, {n, 10, 400}, AxesLabel -> {"n", "Circumscribed Error"}, DisplayFunction -> $DisplayFunction] Out[47]= -Graphics- ISSUES IN SOLUTION By asking for decimal places of accuracy, we make the problem easier to do by trial and error. Note that, say, 5 decimal places of accuracy does not mean that the error is < 0.000009. See the example below. In[48]:= FindRoot[ Pi - n/2 Sin[2 Pi/n] == 0.000009, {n, 1000}] Out[48]= {n -> 1512.95} In[49]:= n5 = Floor[n /. %] + 1 Out[49]= 1513 In[50]:= N[n/2 Sin[2 Pi/n] /. n -> n5, 10] N[Pi, 10] Out[50]= 3.141583624 Out[51]= 3.141592654 So, n5 = 1513 doesn't even give 5 decimal places of accuracy, but it gives a starting place. In[52]:= N[n/2 Sin[2 Pi/n] /. n -> 2790, 10] Out[52]= 3.141589998 In[53]:= N[n/2 Sin[2 Pi/n] /. n -> 2791, 10] Out[53]= 3.14159 So, n5 = 2791 is the smallest integer yielding 5 decimal places of accuracy; the difference is given below. In[54]:= N[Pi - n/2 Sin[2 Pi/n] /. n -> 2791, 10] Out[54]= -6 2.653619049 10 It's interesting to note that the circumscribed case starts off requiring larger n-values to well approximate Pi to a fixed number of digits, but it rapidly over takes the inscribed case. Of course, if only considering absolute error, the circumscribed case is always better.