10.07.2015 Views

Plane Geometry - Bruce E. Shapiro

Plane Geometry - Bruce E. Shapiro

Plane Geometry - Bruce E. Shapiro

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

SECTION 44. ESTIMATING π 247Define the notation{x} = x mod 1, the fractional part of x. Then{ n}∑{16 n 16 n−k ∞S p } =8k + p +∑ 16 n−k8k + pk=0k=n+1{ n{∑ 16 n−k , 8k + p }=8k + pk=0}∞∑ 16 n−k+8k + pDefines p (n) =k=n+1{ n∑ 16 n−k , 8k + p }k=0Then the n th hex-digit of π is given by8k + pd n = ⌊16 {4{s 1 (n)}2{s 4 (n)} − {s 5 (n)}−{s 6 (n)}}⌋where ⌊x⌋ denotes the greatest integer less than or equal to x. The followinggives a Mathematica implementation:s[p_, n_]:= Sum[Mod[16^(n-k), 8k+p]/(8k+p),{k,0,n}];r[p_, n_]:= Mod[s[p,n],1];hexit[n_]:= Floor[16.0*Mod[4r[1,n]-2r[4,n]-r[5,n]-r[6,n], 1]];Thenhexit/@Range[0,11]gives the first 12 hex figures to the right hand side of the radix point:{2, 4, 3, 15, 6, 10, 8, 8, 8, 5, 10, 3}which corresponds toπ − 3 ≈ .243F 6A88 85A3 16The correct value of in hex to 16 figures isπ ≈ 3.243F 6A88 85A3 08D3 16To convert the number back to decimal, divide each integer by its correspondingpower of 16.Revised: 18 Nov 2012 « CC BY-NC-ND 3.0.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!