Is pi awesome? Didn't I make that clear in my last two posts about Pi? (determining pi with a spring and fractional representation of pi)
Well, I can't stop thinking about pi. It must be some sort of pi-illness. There were a couple of issues with my previous calculation of the best fractional representation of pi. First, is pi. In that program, python was only using the first 16 digits of pi. Is that good enough? No. Nothing is ever good enough when it comes to pi. The other problem was that my division was also only being carried out to 16 digits. So, how do you super-size these digits? I know there is more than one way, but I am going to do this my way.
Hello python Decimal module. I originally try to do this by putting everything in a list, but stuff just got plain messy. Why be messy when there is an easier way. Basically, the decimal module lets you tell python how many digits to use in the calculations.
Ok, with my new program I find the same fractional representations as before. This makes sense. My best value was 355/113. This didn't match the 7th digit of pi. I had plenty of room left, so I was no where near the limit of the normal python way of representing numbers.
Super size time. What if I just let the sucker keep going. I am not sure if this is correct or not, but the next fraction I find that is better than 355/113 isn't until I get to 52163/16604. This is just barely better than 355/113. Let me write out a few digits of both.
Pretty close. It is odd that there is such a huge void between these two numbers. A pi-void if you will. Maybe there is a pi monster that lives in that void and ate all the good fractional representations of pi.
If you keep moving up looking for better values of pi, you find a lot. Here are some:
- 52163/16604
- 52518/16717
- 52873/16830
- 53228/16943
- 53583/17056
- 53938/17169
The best fraction I found was 312689 / 99532.
Weird. Here is another weird thing that Tom (of Swans on Tea) pointed out. The square root of g (the local gravitational field) is pretty close to pi (in units of N/kg).
What about e (Euler's number)
First, e gets the shaft. e is just as cool as pi, but no one cares. Personally, I think it is because of the name. You can't say 'e' and expect people to know you are talking about THE e.
So, since e is also irrational what would be the best fractional representation for it? Really, all I have to do is change the value of pi in my program to e and run it again.
And the best fractional representation of e is 566827 / 208524 that I found (I ran it up to numerator + denominator = 100,000).
One last note
Why am I doing this (other than being obsessed with pi - WHICH I AM NOT)? Couldn't I just do a literature search and find out what someone has done before? Well, why would someone build their own canoe? Surely, you could buy a better one that wouldn't take so long. Having the best canoe is not the point. It is the process that is important. The same can be said for running. Why run anywhere when you could just drive? This is what humans do. I want to be human.