Thursday, March 14, 2013

Errors from Rounding Pi

In honor of Pi Day, I did some calculations on the error introduced by rounding pi.  This has been done plenty of times already, but it was fun.

The key point is that rather crude approximations are still plenty accurate.  Just using 3 only leads to a 4.5% error, and the common 3.14 is good for 0.05%, which is a better tolerance than anything you're likely to do.

I also list the absolute errors when calculating circumferences of circles with various radii.  If you are calculating a circle with a radius of the observable universe, you'll need about 62 digits (first calculated in 1699) to get the error below 1 Planck length.  That ought to be enough for anybody.


 Relative error:
DigitsValueError
134.5070342%
23.11.3239353%
33.140.0506958%
43.142-0.0129662%
53.1416-0.0002338%
63.141590.0000845%
73.141593-0.0000110%
83.1415927-0.0000015%
93.141592650.0000001%
103.1415926540.0000000%

Absolute error in calculating the circumference of a circle with the given radius:
DigitsMeterMileEarthAstronomical UnitLight YearGalaxyObservable Universe
128.32 cm0.46 km1,804.17 km42,363,900 km17,908.56 AU14,159.27 ly3,993.87 Mpc
28.32 cm133.87 m529.97 km12,444,300 km5,260.62 AU4,159.27 ly1,173.19 Mpc
33.19 mm5.13 m20.29 km476,500 km201.44 AU159.27 ly44.92 Mpc
40.81 mm1.31 m5.19 km121,900 km51.52 AU40.73 ly11.49 Mpc
514.69 µm2.36 cm93.61 m2,198.01 km0.93 AU0.73 ly675,900 ly
65.31 µm0.85 cm33.81 m793.94 km50,208,700 km16,781.23 AU244,100 ly
70.69 µm1.11 mm4.41 m103.64 km6,554,400 km2,190.69 AU31,869.74 ly
892.82 nm149.38 µm0.59 m13.89 km878,100 km293.5 AU4,269.74 ly
97.18 nm11.55 µm4.57 cm1.07 km67,922.68 km22.7 AU330.26 ly
100.82 nm1.32 µm0.52 cm122.73 m7,761.55 km2.59 AU37.74 ly
1120.41 pm32.85 nm130.05 µm3.05 m193.12 km9,656,100 km0.94 ly
120.41 pm0.67 nm2.63 µm6.19 cm3.91 km195,600 km1,202.95 AU
130.41 pm0.67 nm2.63 µm6.19 cm3.91 km195,600 km1,202.95 AU
1413.52 fm21.76 pm86.16 nm2.02 mm127.94 m6,396.77 km39.34 AU
156.48 fm10.42 pm41.26 nm0.97 mm61.28 m3,063.76 km18.84 AU
160.48 fm0.77 pm3.04 nm71.35 µm4.51 m225.6 km1.39 AU
1776,925,300 ym123.8 fm0.49 nm11.51 µm0.73 m36.39 km33,476,700 km
183,074,700 ym4.95 fm19.59 pm0.46 µm2.91 cm1.45 km1,338,100 km
19925,300 ym1.49 fm5.9 pm138.42 nm0.88 cm0.44 km402,700 km
2074,713.23 ym120,239,000 ym0.48 pm11.18 nm0.71 mm35.34 m32,514.03 km
215,286.77 ym8,508,200 ym33.68 fm0.79 nm50.02 µm2.5 m2,300.72 km
22713.23 ym1,147,800 ym4.54 fm106.7 pm6.75 µm33.74 cm310.39 km
2386.77 ym139,600 ym0.55 fm12.98 pm0.82 µm4.1 cm37.76 km
246.77 ym10,889.69 ym43,109,700 ym1.01 pm64.02 nm3.2 mm2.94 km
250.77 ym1,233.65 ym4,883,700 ym114.68 fm7.25 nm362.6 µm333.59 m
262,069,113,700 pl53.82 ym213,100 ym5 fm316.37 pm15.82 µm14.55 m
27405,829,100 pl10.56 ym41,787.43 ym0.98 fm62.05 pm3.1 µm2.85 m
2834,587,700 pl0.9 ym3,561.43 ym83,626,100 ym5.29 pm264.42 nm24.33 cm
292,536,500 pl4,082,025,600 pl261.17 ym6,132,600 ym0.39 pm19.39 nm1.78 cm
3061,516.66 pl99,001,200 pl6.33 ym148,700 ym9.41 fm0.47 nm0.43 mm
3161,516.66 pl99,001,200 pl6.33 ym148,700 ym9.41 fm0.47 nm0.43 mm
32356.91 pl574,400 pl2,273,880,900 pl862.94 ym54,572,100 ym2.73 pm2.51 µm
33356.91 pl574,400 pl2,273,880,900 pl862.94 ym54,572,100 ym2.73 pm2.51 µm
3414.33 pl23,062.27 pl91,298,100 pl34.65 ym2,191,100 ym109.56 fm100.79 nm
351.96 pl3,147.15 pl12,458,800 pl4.73 ym299,000 ym14.95 fm13.75 nm
360.52 pl835.87 pl3,309,000 pl1.26 ym79,414.88 ym3.97 fm3.65 nm
370.02 pl39.27 pl155,400 pl3,650,060,700 pl3,730.65 ym186,532,700 ym171.61 pm
380 pl0.56 pl2,231.63 pl52,401,000 pl53.56 ym2,677,900 ym2.46 pm
390 pl0.56 pl2,231.63 pl52,401,000 pl53.56 ym2,677,900 ym2.46 pm
400 pl0.03 pl133.55 pl3,136,000 pl3.21 ym160,300 ym147.44 fm
410 pl0.01 pl24.13 pl566,500 pl0.58 ym28,949.81 ym26.63 fm
420 pl0 pl0.47 pl11,118.95 pl703,159,600 pl568.22 ym0.52 fm
430 pl0 pl0.31 pl7,393.36 pl467,553,800 pl377.83 ym347,603,600 ym
440 pl0 pl0 pl11.57 pl731,600 pl0.59 ym543,900 ym
450 pl0 pl0 pl11.57 pl731,600 pl0.59 ym543,900 ym
460 pl0 pl0 pl6.94 pl439,100 pl21,957,068,900 pl326,500 ym
470 pl0 pl0 pl0.46 pl29,143.95 pl1,457,197,300 pl21,667.11 ym
480 pl0 pl0 pl0.09 pl5,729.68 pl286,484,000 pl4,259.74 ym
490 pl0 pl0 pl0 pl123.89 pl6,194,300 pl92.1 ym
500 pl0 pl0 pl0 pl6.81 pl340,700 pl5.07 ym
510 pl0 pl0 pl0 pl4.89 pl244,600 pl3.64 ym
520 pl0 pl0 pl0 pl0.21 pl10,479.35 pl9,641,002,700 pl
530 pl0 pl0 pl0 pl0.02 pl1,227.78 pl1,129,559,800 pl
540 pl0 pl0 pl0 pl0 pl57.07 pl52,503,500 pl
550 pl0 pl0 pl0 pl0 pl1.47 pl1,349,300 pl
560 pl0 pl0 pl0 pl0 pl1.47 pl1,349,300 pl
570 pl0 pl0 pl0 pl0 pl0.29 pl266,300 pl
580 pl0 pl0 pl0 pl0 pl0 pl2,983.86 pl
590 pl0 pl0 pl0 pl0 pl0 pl2,401.42 pl
600 pl0 pl0 pl0 pl0 pl0 pl247.31 pl
610 pl0 pl0 pl0 pl0 pl0 pl21.96 pl
620 pl0 pl0 pl0 pl0 pl0 pl0.41 pl
630 pl0 pl0 pl0 pl0 pl0 pl0.12 pl
640 pl0 pl0 pl0 pl0 pl0 pl0.02 pl
650 pl0 pl0 pl0 pl0 pl0 pl0 pl

No comments:

Post a Comment