Π day
|
03-14-2022, 09:35 PM
(This post was last modified: 03-15-2022 12:01 AM by robve.)
Post: #12
|
|||
|
|||
RE: Π day
(03-14-2022 01:55 PM)EdS2 Wrote: There's an unusual one by Valentin... 3 years ago, which seems appropriate. Here is the unusual pi computation in Haskell, which self-applies \( f\,(h,p)=(p\lceil\frac{h}{p}\rceil,p-1) \) iteratively \( n-1 \) times starting with \( (1,n) \) to return \( \frac{n^2}{h} \) as an approximation of \( \pi \): unusual_pi n = let (h,p) = head (drop (n-2) (iterate (\(h,p) -> (p*ceiling (fromIntegral h/fromIntegral p), p-1)) (1,n))) in (fromIntegral (n*n))/(fromIntegral h) unusual_pi 100000 3.141526183050601 The reason why this works is explained here: "Beginning with any positive integer \( n \), round up to the nearest multiple of \( n–1 \), then up to the nearest multiple of \( n–2 \), and so on, up to the nearest multiple of 1. Let \( f(n) \) denote the result. For example, \( f(10) = 34 \). Interestingly, the ratio \( n^2/f(n) \) approaches \( \pi \) (i.e., 3.14159...) as \( n \) increases." (03-14-2022 01:55 PM)EdS2 Wrote: It feels worthwhile also to showcase one of Gerson's [but see downthread!] pandigital approximations ("good to 17 digits"): Yes, very interesting and impressive work by Gerson. - Rob "I count on old friends to remain rational" |
|||
« Next Oldest | Next Newest »
|
Messages In This Thread |
RE: Π day - Dave Britten - 03-14-2022, 11:44 AM
RE: Π day - Gerson W. Barbosa - 03-14-2022, 12:25 PM
RE: Π day - Dave Britten - 03-14-2022, 06:15 PM
RE: Π day - Gerson W. Barbosa - 03-14-2022, 11:53 AM
RE: Π day - Gerson W. Barbosa - 03-14-2022, 06:06 PM
RE: Π day - robve - 03-14-2022 09:35 PM
RE: Π day - Gerson W. Barbosa - 03-14-2022, 10:30 PM
RE: Π day - Gerson W. Barbosa - 03-14-2022, 08:29 PM
RE: π day - Thomas Klemm - 03-14-2022, 09:17 PM
RE: Π day - Eddie W. Shore - 03-15-2022, 01:09 AM
RE: π day - Thomas Klemm - 03-15-2022, 07:55 PM
RE: Π day - Thomas Klemm - 03-17-2022, 03:40 AM
RE: Π day - Thomas Klemm - 03-17-2022, 03:54 AM
RE: Π day - Gerson W. Barbosa - 03-17-2022, 11:39 AM
RE: Π day - Thomas Klemm - 03-17-2022, 12:29 PM
RE: Π day - Gerson W. Barbosa - 03-17-2022, 02:10 PM
RE: Π day - Ángel Martin - 03-18-2022, 09:07 AM
RE: Π day - Frido Bohn - 03-19-2022, 09:45 AM
RE: Π day - Ángel Martin - 03-19-2022, 11:17 AM
RE: Π day - Frido Bohn - 03-19-2022, 01:01 PM
RE: Π day - Frido Bohn - 03-19-2022, 03:13 PM
RE: Π day - Steve Simpkin - 03-18-2022, 04:31 AM
RE: Π day - MeindertKuipers - 03-18-2022, 10:48 AM
RE: Π day - Ángel Martin - 03-18-2022, 11:04 AM
RE: Π day - Ángel Martin - 03-19-2022, 11:18 AM
RE: Π day - Ángel Martin - 03-20-2022, 07:39 AM
RE: Π day - Frido Bohn - 03-20-2022, 07:28 PM
RE: π day - Thomas Klemm - 03-21-2022, 07:24 AM
RE: Π day - Frido Bohn - 03-21-2022, 04:03 PM
RE: Π day - Albert Chan - 03-21-2022, 10:45 PM
RE: Π day - Gerson W. Barbosa - 03-24-2022, 01:36 AM
RE: Π day - Albert Chan - 03-26-2022, 03:59 PM
RE: Π day - Gerson W. Barbosa - 03-26-2022, 05:37 PM
RE: Π day - Thomas Klemm - 03-21-2022, 05:27 PM
RE: π day - Thomas Klemm - 03-21-2022, 05:54 PM
RE: π day - Thomas Klemm - 03-21-2022, 06:33 PM
RE: Π day - Albert Chan - 03-26-2022, 11:24 PM
RE: Π day - Albert Chan - 03-27-2022, 01:44 PM
RE: Π day - Albert Chan - 03-27-2022, 04:00 PM
|
User(s) browsing this thread: 1 Guest(s)