## 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:
 Digits Value Error 1 3 4.5070342% 2 3.1 1.3239353% 3 3.14 0.0506958% 4 3.142 -0.0129662% 5 3.1416 -0.0002338% 6 3.14159 0.0000845% 7 3.141593 -0.0000110% 8 3.1415927 -0.0000015% 9 3.14159265 0.0000001% 10 3.141592654 0.0000000%

Absolute error in calculating the circumference of a circle with the given radius:
 Digits Meter Mile Earth Astronomical Unit Light Year Galaxy Observable Universe 1 28.32 cm 0.46 km 1,804.17 km 42,363,900 km 17,908.56 AU 14,159.27 ly 3,993.87 Mpc 2 8.32 cm 133.87 m 529.97 km 12,444,300 km 5,260.62 AU 4,159.27 ly 1,173.19 Mpc 3 3.19 mm 5.13 m 20.29 km 476,500 km 201.44 AU 159.27 ly 44.92 Mpc 4 0.81 mm 1.31 m 5.19 km 121,900 km 51.52 AU 40.73 ly 11.49 Mpc 5 14.69 µm 2.36 cm 93.61 m 2,198.01 km 0.93 AU 0.73 ly 675,900 ly 6 5.31 µm 0.85 cm 33.81 m 793.94 km 50,208,700 km 16,781.23 AU 244,100 ly 7 0.69 µm 1.11 mm 4.41 m 103.64 km 6,554,400 km 2,190.69 AU 31,869.74 ly 8 92.82 nm 149.38 µm 0.59 m 13.89 km 878,100 km 293.5 AU 4,269.74 ly 9 7.18 nm 11.55 µm 4.57 cm 1.07 km 67,922.68 km 22.7 AU 330.26 ly 10 0.82 nm 1.32 µm 0.52 cm 122.73 m 7,761.55 km 2.59 AU 37.74 ly 11 20.41 pm 32.85 nm 130.05 µm 3.05 m 193.12 km 9,656,100 km 0.94 ly 12 0.41 pm 0.67 nm 2.63 µm 6.19 cm 3.91 km 195,600 km 1,202.95 AU 13 0.41 pm 0.67 nm 2.63 µm 6.19 cm 3.91 km 195,600 km 1,202.95 AU 14 13.52 fm 21.76 pm 86.16 nm 2.02 mm 127.94 m 6,396.77 km 39.34 AU 15 6.48 fm 10.42 pm 41.26 nm 0.97 mm 61.28 m 3,063.76 km 18.84 AU 16 0.48 fm 0.77 pm 3.04 nm 71.35 µm 4.51 m 225.6 km 1.39 AU 17 76,925,300 ym 123.8 fm 0.49 nm 11.51 µm 0.73 m 36.39 km 33,476,700 km 18 3,074,700 ym 4.95 fm 19.59 pm 0.46 µm 2.91 cm 1.45 km 1,338,100 km 19 925,300 ym 1.49 fm 5.9 pm 138.42 nm 0.88 cm 0.44 km 402,700 km 20 74,713.23 ym 120,239,000 ym 0.48 pm 11.18 nm 0.71 mm 35.34 m 32,514.03 km 21 5,286.77 ym 8,508,200 ym 33.68 fm 0.79 nm 50.02 µm 2.5 m 2,300.72 km 22 713.23 ym 1,147,800 ym 4.54 fm 106.7 pm 6.75 µm 33.74 cm 310.39 km 23 86.77 ym 139,600 ym 0.55 fm 12.98 pm 0.82 µm 4.1 cm 37.76 km 24 6.77 ym 10,889.69 ym 43,109,700 ym 1.01 pm 64.02 nm 3.2 mm 2.94 km 25 0.77 ym 1,233.65 ym 4,883,700 ym 114.68 fm 7.25 nm 362.6 µm 333.59 m 26 2,069,113,700 pl 53.82 ym 213,100 ym 5 fm 316.37 pm 15.82 µm 14.55 m 27 405,829,100 pl 10.56 ym 41,787.43 ym 0.98 fm 62.05 pm 3.1 µm 2.85 m 28 34,587,700 pl 0.9 ym 3,561.43 ym 83,626,100 ym 5.29 pm 264.42 nm 24.33 cm 29 2,536,500 pl 4,082,025,600 pl 261.17 ym 6,132,600 ym 0.39 pm 19.39 nm 1.78 cm 30 61,516.66 pl 99,001,200 pl 6.33 ym 148,700 ym 9.41 fm 0.47 nm 0.43 mm 31 61,516.66 pl 99,001,200 pl 6.33 ym 148,700 ym 9.41 fm 0.47 nm 0.43 mm 32 356.91 pl 574,400 pl 2,273,880,900 pl 862.94 ym 54,572,100 ym 2.73 pm 2.51 µm 33 356.91 pl 574,400 pl 2,273,880,900 pl 862.94 ym 54,572,100 ym 2.73 pm 2.51 µm 34 14.33 pl 23,062.27 pl 91,298,100 pl 34.65 ym 2,191,100 ym 109.56 fm 100.79 nm 35 1.96 pl 3,147.15 pl 12,458,800 pl 4.73 ym 299,000 ym 14.95 fm 13.75 nm 36 0.52 pl 835.87 pl 3,309,000 pl 1.26 ym 79,414.88 ym 3.97 fm 3.65 nm 37 0.02 pl 39.27 pl 155,400 pl 3,650,060,700 pl 3,730.65 ym 186,532,700 ym 171.61 pm 38 0 pl 0.56 pl 2,231.63 pl 52,401,000 pl 53.56 ym 2,677,900 ym 2.46 pm 39 0 pl 0.56 pl 2,231.63 pl 52,401,000 pl 53.56 ym 2,677,900 ym 2.46 pm 40 0 pl 0.03 pl 133.55 pl 3,136,000 pl 3.21 ym 160,300 ym 147.44 fm 41 0 pl 0.01 pl 24.13 pl 566,500 pl 0.58 ym 28,949.81 ym 26.63 fm 42 0 pl 0 pl 0.47 pl 11,118.95 pl 703,159,600 pl 568.22 ym 0.52 fm 43 0 pl 0 pl 0.31 pl 7,393.36 pl 467,553,800 pl 377.83 ym 347,603,600 ym 44 0 pl 0 pl 0 pl 11.57 pl 731,600 pl 0.59 ym 543,900 ym 45 0 pl 0 pl 0 pl 11.57 pl 731,600 pl 0.59 ym 543,900 ym 46 0 pl 0 pl 0 pl 6.94 pl 439,100 pl 21,957,068,900 pl 326,500 ym 47 0 pl 0 pl 0 pl 0.46 pl 29,143.95 pl 1,457,197,300 pl 21,667.11 ym 48 0 pl 0 pl 0 pl 0.09 pl 5,729.68 pl 286,484,000 pl 4,259.74 ym 49 0 pl 0 pl 0 pl 0 pl 123.89 pl 6,194,300 pl 92.1 ym 50 0 pl 0 pl 0 pl 0 pl 6.81 pl 340,700 pl 5.07 ym 51 0 pl 0 pl 0 pl 0 pl 4.89 pl 244,600 pl 3.64 ym 52 0 pl 0 pl 0 pl 0 pl 0.21 pl 10,479.35 pl 9,641,002,700 pl 53 0 pl 0 pl 0 pl 0 pl 0.02 pl 1,227.78 pl 1,129,559,800 pl 54 0 pl 0 pl 0 pl 0 pl 0 pl 57.07 pl 52,503,500 pl 55 0 pl 0 pl 0 pl 0 pl 0 pl 1.47 pl 1,349,300 pl 56 0 pl 0 pl 0 pl 0 pl 0 pl 1.47 pl 1,349,300 pl 57 0 pl 0 pl 0 pl 0 pl 0 pl 0.29 pl 266,300 pl 58 0 pl 0 pl 0 pl 0 pl 0 pl 0 pl 2,983.86 pl 59 0 pl 0 pl 0 pl 0 pl 0 pl 0 pl 2,401.42 pl 60 0 pl 0 pl 0 pl 0 pl 0 pl 0 pl 247.31 pl 61 0 pl 0 pl 0 pl 0 pl 0 pl 0 pl 21.96 pl 62 0 pl 0 pl 0 pl 0 pl 0 pl 0 pl 0.41 pl 63 0 pl 0 pl 0 pl 0 pl 0 pl 0 pl 0.12 pl 64 0 pl 0 pl 0 pl 0 pl 0 pl 0 pl 0.02 pl 65 0 pl 0 pl 0 pl 0 pl 0 pl 0 pl 0 pl