Difference between revisions of "Talk:E"
From Organic Design wiki
m |
(Interesting feature of phi relationship to pi/e) |
||
Line 15: | Line 15: | ||
:Yes, thats what I got in R. Someone on [http://en.wikipedia.org/wiki/Talk:Golden_ratio#Relationship_to_.CF.80_and_e 'pedia] mentioned that the relationship was coincidence --[[User:Sven|Sven]] 14:41, 22 Aug 2006 (NZST) | :Yes, thats what I got in R. Someone on [http://en.wikipedia.org/wiki/Talk:Golden_ratio#Relationship_to_.CF.80_and_e 'pedia] mentioned that the relationship was coincidence --[[User:Sven|Sven]] 14:41, 22 Aug 2006 (NZST) | ||
+ | |||
+ | ok, now this is interesting. pi on 32-bit computers is an approximation (22 decimal places in [[Category:R|R]]). [[E]] is a tailor series expansion, so I tried seeing which iteration of [[E]] was closest to [[Wikipedia:Golden ratio|Phi]], and I found it was the 7<sup>th</sup> order tailor series expansion (8.84 X 10<sup>7</sup>; | ||
+ | |||
+ | <table> | ||
+ | options(digits=22) | ||
+ | phi <- (1+sqrt(5))/2 | ||
+ | phi | ||
+ | |||
+ | phi2 <- (7 * pi)/(5 * exp(1)) | ||
+ | phi2 | ||
+ | |||
+ | phiCalc <- c() | ||
+ | |||
+ | x <- 1 | ||
+ | e <- top <- bottom <- 1 | ||
+ | for(i in 1:20) { | ||
+ | top <- top*x | ||
+ | bottom <- bottom*i | ||
+ | e <- e + top/bottom | ||
+ | phiCalc[i] <- (7 * pi)/(5 * e) | ||
+ | } | ||
+ | |||
+ | |||
+ | print(phi-phi2) | ||
+ | print(pi) | ||
+ | print(exp(1)) | ||
+ | print(phiCalc - phi) | ||
+ | |||
+ | print(phi-phi2) | ||
+ | [1] 1.569904260434463e-05 | ||
+ | > print(pi) | ||
+ | [1] 3.141592653589793 | ||
+ | > print(exp(1)) | ||
+ | [1] 2.718281828459045 | ||
+ | > print(phiCalc - phi) | ||
+ | [1] 5.8108086876296028e-01 1.4125789726038929e-01 3.1302154384746705e-02 | ||
+ | [4] 5.9277521826752722e-03 9.4627444975325936e-04 1.1899787172575671e-04 | ||
+ | [7] 8.8451503788000707e-07 -1.3878442173043126e-05 -1.5518754122645362e-05 | ||
+ | [10] -1.5682785134529809e-05 -1.5697697043126624e-05 -1.5698939702435410e-05 | ||
+ | [13] -1.5699035291527608e-05 -1.5699042119621254e-05 -1.5699042574590649e-05 | ||
+ | [16] -1.5699042603234403e-05 -1.5699042604566671e-05 -1.5699042604566671e-05 | ||
+ | [19] -1.5699042604566671e-05 -1.5699042604566671e-05 | ||
+ | </table> | ||
---- | ---- |
Revision as of 23:34, 22 August 2006
Interesting, the closure of the math tag is missing the / in the docie e^x = \sum_{n = 0}^{\infty} {x^n \over n!} = 1 + x + {x^2 \over 2!} + {x^3 \over 3!} + {x^4 \over 4!} + \cdots
- Sven 09:48, 16 Nov 2005 (NZDT)
Is the relationship (7/5) * (pi/e) exact, or is it an approximation? --Sven 10:19, 22 Aug 2006 (NZST)
- I had always thought it was exact, but....
- gives...
- Yes, thats what I got in R. Someone on 'pedia mentioned that the relationship was coincidence --Sven 14:41, 22 Aug 2006 (NZST)
ok, now this is interesting. pi on 32-bit computers is an approximation (22 decimal places in). E is a tailor series expansion, so I tried seeing which iteration of E was closest to Phi, and I found it was the 7th order tailor series expansion (8.84 X 107;
options(digits=22) phi <- (1+sqrt(5))/2 phi phi2 <- (7 * pi)/(5 * exp(1)) phi2 phiCalc <- c() x <- 1 e <- top <- bottom <- 1 for(i in 1:20) { top <- top*x bottom <- bottom*i e <- e + top/bottom phiCalc[i] <- (7 * pi)/(5 * e) } print(phi-phi2) print(pi) print(exp(1)) print(phiCalc - phi) print(phi-phi2) [1] 1.569904260434463e-05 > print(pi) [1] 3.141592653589793 > print(exp(1)) [1] 2.718281828459045 > print(phiCalc - phi) [1] 5.8108086876296028e-01 1.4125789726038929e-01 3.1302154384746705e-02 [4] 5.9277521826752722e-03 9.4627444975325936e-04 1.1899787172575671e-04 [7] 8.8451503788000707e-07 -1.3878442173043126e-05 -1.5518754122645362e-05 [10] -1.5682785134529809e-05 -1.5697697043126624e-05 -1.5698939702435410e-05 [13] -1.5699035291527608e-05 -1.5699042119621254e-05 -1.5699042574590649e-05 [16] -1.5699042603234403e-05 -1.5699042604566671e-05 -1.5699042604566671e-05 [19] -1.5699042604566671e-05 -1.5699042604566671e-05