[math-fun] more pi methods
(Thought funsters might enjoy eavesdropping.) Jason, I'm still occupied by your pi question. I believe we've already rejected montecarloing or integrating Buffon's needle. How about integrating the area under sqrt(1-x^2)? Besides the numerous numerical methods, one can expand via the binomial thm and termwise integrate. Expanding at x=0 gives the slow series i 1/2 inf (- 1) ( ) ==== i %pi \ --- = > ------------, 4 / 2 i + 1 ==== i = 0 but expanding at x=1 gives one bit/term: i 1/2 inf (- 1) ( ) ==== i %pi \ --- = > ------------------. 4 / i - 3/2 ==== (2 i + 3) 2 i = 0 Better yet, only integrate from sqrt(3)/2 to 1: inf ==== i + 3/2 \ (2 - sqrt(3)) 1/2 3 sqrt(3) %pi = 12 > -------------------- ( ) + --------- / i i 2 === (2 i + 3) (- 4) i = 0 gives > 1 decimal digit/term (ratio = .06699). Expansion at points other than 0 and 1 produces a powerseries whose coefficients are themselves sums. But these obey a three term recurrence, so the double sum reduces to a 4x4 matrix product. Strangely, integrate(expansion at 1/sqrt(2),x,0,1) produces a divergent series. How about inf ==== 2 \ 1 %pi > -- = ---- ? / 2 6 ==== n n = 1 (I have an Euleroid derivation of this in the form of an annotated Macsyma notebook, starting with the atan x series.) Here's a neat one: the average value of gcd([k sqrt(2)],[k sqrt(3)])^-2 should approach pi^2/15, for large intervals of k. ([]:=floor) Too bad you don't like logs. I have *really* magic ways to get pi/ln 2 and (pi/ln 2)^2, the latter using a random bit stream. Heck, pi is basically log(-1). Ah, how about (d5) t(n) := if n = 0 then .2d1 else (t(n - 1), 2 %% ---------------------------------) %% (--, sqrt(%% + 1) + sqrt(1 - %%)) n 2 (c6) t(24) (d6) 3.14159265358979d0 or (d7) s(n) := if n = 0 then .4d1 else (s(n - 1), 2 %% --------------------) 2 %% 1 + sqrt(1 + ------) n + 1 4 (c8) s(25) (d8) 3.14159265358979d0 ? --rwg POINT SOURCE PROSECUTION
On Tue, 6 Feb 2007, R. William Gosper wrote:
(Thought funsters might enjoy eavesdropping.) Jason, I'm still occupied by your pi question. I believe we've already rejected montecarloing or integrating Buffon's needle. How about integrating the area under sqrt(1-x^2)? Besides the numerous numerical methods, one can expand via the
(math-funsters: the problem he refers to is finding the most intuitive and least complicated way to approximate pi. It's the continuation of a discussion we had here months ago; I think I even posted my best solution then, but I assume Bill has been avoiding going back to peek at the answer.) Integrating sqrt(1-x^2) is my second-best (or arguably, best) solution. To avoid calculus, though, we can just pick a sufficiently large r and then: 4 r --- \sigma sqrt(r*r-x*x) r*r x=0
I said you could expand (integral of) sqrt(1-x^2) anywhere with a 4x4 matrix product. As CNWH sez, there are three kinds of mathematicians ... / 2 [ 2 asin(x) x sqrt(1 - x ) I sqrt(1 - x ) dx = ------- + -------------- ] 2 2 / [ a (2 j - 1) (x - a) 2 ] [ ------------------- 1 sqrt(1 - a ) (x - a) ] inf [ 2 ] /===\ [ (1 - a ) (j + 2) ] | | [ ] = UR( | | [ 2 ]) | | [ (j - 2) j (x - a) ] j = 0 [ ------------------------ 0 0 ] [ 2 ] [ (1 - a ) (j + 1) (j + 2) ] [ ] [ 0 0 1 ] where UR means upper right. This *does* induce a four term recurrence, 2 2 2 F := ((j - 4) (j - 2) F y - F y ((j - 6 j + 8) y - 2 a j + 7 a j - 5 a) j j - 3 j - 2 2 2 - (j - 1) F ((2 a j - 5 a) y + (1 - a ) j))/((a - 1) (j - 1) j), j - 1 2 2 2 a y F = 0, F = sqrt(1 - a ) y, F = sqrt(1 - a ) y - --------------, 0 1 2 2 2 sqrt(1 - a ) where y:=x-a and F_j is the expansion to j terms. Now we can choose endpoints x, say, 0 and sin(pi/6) with a the midpoint (1/4) to kill the even powers, getting 2 %pi 1 ---------- + ------- = 3 sqrt(15) sqrt(5) [ 2 ] oo [ 2 (19 j - 4) 4 j - 1 ] /===\ [ --------------------- ---------- 1 ] | | [ 225 (j + 1) (2 j + 3) 30 (j + 1) ] UR( | | [ ]) | | [ 2 (j - 1) j (4 j + 1) 2 (j - 1) j ] j = 0 [ ------------------------------- -------------------- 0 ] [ 225 (j + 1) (2 j + 1) (2 j + 3) 15 (j + 1) (2 j + 1) ] [ ] [ 0 0 1 ] with term ratio approaching 1/25. Again, use a four-term recurrence. Derivation: write [A[j+1],B[j+1],C[J+1]] = [A[j],B[j],C[J]].M[j] for three consecutive j, then eliminate from the nine equations the eight As and Bs. The term ratio for x_0 = sin pi/12, a = x_0/2 would be much smaller, but the matrix would be full of sqrt(2 and 3). --rwg Port au Prince porcupine rat
participants (2)
-
Jason Holt -
R. William Gosper