The Purpose of This Problem Is to Get Experience with MATLAB by Writing a Short Section

Total Page:16

File Type:pdf, Size:1020Kb

The Purpose of This Problem Is to Get Experience with MATLAB by Writing a Short Section

Determination of 

The purpose of this problem is to get experience with MATLAB by writing a short section of code to compute a sequence of approximations to  .

Model: We recognize  as the ratio of the circumference of a circle to its diameter. We can approximate the circumference of the circle by the perimeter of regular polygons by a an increasingly large number of sides. Since these perimeters converge to the circumference of the circle, the ratios of the perimeters to the limiting circle's diameter should provide a sequence with limit equal to  . Assume the circle has a radius of one (i.e., a "unit circle") and thus a diameter n of 2. Let pn represent the perimeter of a regular polygon with 2 sides that is inscribed in the unit circle. We claim:

p lim n   n 2

n = 2 n = 3 n = 4

Analysis: We know that if we can determine the length of a side of the regular polygon of 2n n sides that is inscribed in the unit circle (call this length sn ) then pn  2 sn . Simple geometry for the inscribed square tells us that s2  2 . Our idea is to use the value of s2 to determine s3 , the side of the inscribed regular octagon, then to use that to get s4 , the side of the inscribed regular hexadecagon, and so on. The general step is to use sn to obtain sn1 .

Consider the following depiction of the inscribed polygon with 2n sides. The side of the polygon of 2n1 sides is indicated and is obtained by bisecting the arc subtended by the side of length sn .:

Noticing the two right triangles and applying the Pythagorean Theorem twice, we have: s 2 (1 x)2  GFn JI  1 H2 K and 2 2 Fsn I 2 x  GJ  sn1 H2 K Solving for x in the first equation, we have s 2 x  1 1 GFn JI H2 K Thus s 2 F s 2 I x2  1 2 1 GFn JI  1 GFn JI H2 K HGH2 KKJ s 2 s 2  2  2 1 GFn JI  GFn JI H2 K H2 K and by substituting this into the second equation above, we finally obtain: 2 Fsn I 2 2  2 1 GJ  sn1 H2 K or F 2 I Fsn I sn1  2G1 1 GJ J HG H2 KKJ

n n1 Remembering that pn  2 sn and thus pn1  2 sn1 , we can remove the variables representing the sides and express everything in terms of the polygon perimeters: p F p 2 I n1  2 1 1 F n I n1 G G n J J 2 HG H22 KKJ that is p F p 2 I n1  2n 2 1 1 F n I G G n J J 2 HG H22 KKJ

p and recalling that n for n  2,3,... is the sequence of quantities that converges to  , let is use 2 the label Pn for this approximation to  , and finally we obtain the recurrence relation that F P 2 I P  2n 2 1 1 Fn I n1 G Gn J J HG H2 KKJ for n  2,3,... p 4s which we start with P  2  2  2 2 , which is the approximation to  based upon the 2 2 2 inscribed square.

Problem: Write a short section of Matlab code that uses the recurrence above to produce

P2 , P3 ,..., P40 . Make sure you use the "format long e" command to see all of the digits.

Recommended publications