The end of Pi… For Me Anyway… Statistical Computation at its finest

I finally had time to run my program last night during the storm.  It just so happens that R wouldn’t calculate pi by rounding farther than the 14th digit.  Here is my data produced from R, the first column is the number of sides used to approximate pi by inscribing and circumscribing the polygon and the second column is the number of digits computed accurately of pi with rounding:

          [,1] [,2]

 [1,]       28    2

 [2,]       54    3

 [3,]       76    4

 [4,]     1050    5

 [5,]     1748    6

 [6,]     5177    7

 [7,]    42805    8

 [8,]    53280    9

 [9,]   207163   10

[10,]   704426   11

[11,]  1911702   12

[12,]  6695507   13

[13,] 31255428   14

I next plotted the data to visualize my hypothesis of an exponentially increasing relationship of the number of sides needed to approximate pi accurately and the amount of digits found accurately.

 

A log transformation did an excellent job transforming the data to produce a linear relationship.  I would normally use some objective approach to this transformation using something like a box-cox transformation, but for pure fun, I used a log base pi to produce the transformation which was very close to the box-cox recommended transformation.  Here is the data plotted after the transformation:

 

I next performed some regression analysis to determine the approximate amount of sides(s) needed to approximate pi accurately to d digits.  The following is the function for this estimate:

s=π-.37+1.1d

Where s is the number of sides needed of a regular polygon’s perimeter being inscribed and circumscribed around a circle and averaged, and d is the number of digits of pi being computed accurately after rounding to that digit.

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s