Upon making the April Fools Version of the site, I found this throwback website of animated gifs, which has a section called "Africa People." Way to stay classy.
I ran the 5k, and you can see the results here. It was really fun, and I'm looking forward to it next year. Tomorrow, I'm doing the Go St. Louis Half Marathon. I've never done one before, so that should be interesting.
So I've been teaching myself come C#. I was sitting in math class and pi was mentioned, and it got me wondering if there were better fractions to estimate pi.
So I wrote a program to figure it out. I wanted to know what fraction (integer/integer) closely estimates pi. As you increase (have more available) the integers in the fraction, we will be able to more closely estimate pi. At first, I just checked if any of the first 10 (meaning 1,2,3,...,7,8,9,10) were good matches. A match is defined to be a number n such that floor(pi*n)= a number, x, where x has d zeros immediately after the decimal point (e.g. n=36, pi*36 = x = 113.09, so d=1. We could then do 113.09/36, and obtain a rough estimate of pi =113/36~3.138.
The fraction estimating pi is x/n
I then did this for d=1,2,...,8, and for n=10,100,1000,..., 100000000
Decimal places (# of zeros after decimal) | 1 |
2 | 3 | 4 | 5 | 6 | 7 | 8 | |
Numbers checked (n) | |||||||||
10 | 0 | 0 | 0 | 0 | 0 | 0 | |||
100 | 10 | 0 | 0 | 0 | 0 | 0 | |||
1,000 | 89 | 8 | |||||||
10,000 | 883 | 88 | |||||||
100,000 | 8998 | 900 | 89 | 9 | 1 | ||||
1,000,000 | 89990 | 8998 | 897 | 89 | 10 | ||||
10,000,000 | 899976 | 89995 | 8990 | 897 | 91 | 8 | |||
100,000,000 | Don't | Care | 89989 | 8999 | 898 | 92 | 7 | 1 |
For example, the highlighted square would show that there were 8 numbers in the 1-1000 range that, when you multiply any one of those numbers by pi, you get a number with exactly two zeros after the decimal. Similarly, there were 89 numbers in the 1-1000 range that, when you multiply those numbers by pi, you get a number with exactly one zero after the decimal. The fact that it is exact indicates that the columns are exclusive
Results
In the 1-100,000 range, there was only one number, n = "66,317", that satisfied d = 5 (aka pi*n equals a number with 5 zeros after the decimal). For this n, we get an estimation of pi is 208341/66317 = 3.141592653467436, which is better than the whole 22/7 crapstimation that most people use.
That's a pretty good estimation, but I figured I could do better. . The farthest I took it was the n=100,000,000 mark. At this point, the program significantly slows my computer, and takes a long time to compute. I skipped calculating the d=1 and 2 cases for this n, because it honestly isn't important. There are so many numbers satisfying this that it really slows the whole program down.
The interesting find was there was one number in the 100,000,000 range that was the best, and satisfied d=8. N = 78256779 gives an estimate of pi =
Onward!
This was mostly just for me to practice my C# abilities, however, there is further work that could be done. I could run it for larger n (with n=1,000,000,000, there were no numbers that satisfied d=9). If I tried the next power of 10 higher, I get an error, for the maximum allowed value of an integer allowed in the program is 2,147,483,647<10,000,000,000 .
However, the more interesting area would be that I have only covered half of the possible options. I chose to only look at fractions that were slightly over pi. I could also search for fractions ending in .9, .99, .999,. etc. Maybe there is a better estimator in the 100,000,000 range doing that.
A Saturday seems as good of a day as any to get an update in.
Synonyms and Antonyms
A thought popped into my head the other day: how many synonyms would I have to go through in order to get to an antonym. Is this even possible? I think it would be, due to the fact that synonyms are not perfect representations of their targets. I am looking to write code to do this, but am having an issue finding a good enough database of synonyms and antonyms.
I asked a linguist and he gave me Princton's WordNet, but that has two problems that I've encountered. One, it doesn't have antonyms for all words. Two, all of it's synonyms are grouped; it just groups lots of words together into a synonym "bundle", and there is no way to escape that bundle in search of an antonym (which I guess makes sense, but it's still annoying.
Milk Jug Problem
So I drink a lot of milk from half gallons, but never know how much (cup-wise) I am drinking (I know there are 8 cups, but the handle sort of screws up the continuity of guessing solely by height). I was trying to think of a way to measure this mathematically, and have yet to find exact dimensions good enough. I was thinking of calling the milk company. One easy way would be to either (1) pour one cup of milk, and see where the milk line in the gallon now lays. Repeat. or (2) Place it in some sort of measuring device until it displaces a cups worth of liquid. However, I don't have any measuring devices, so neither of these will work. The closest I've gotten is that the milk jug is roughly 3.75" x 3.75" x 9.5", but that was from a ChaCha answer and is pretty sketch. I also learned there is some controversy in the milk jug industry, brought on by the introduction of the square milk jug.
Last Week of Class
Next week is the last week of class. I'm so excited.
Psych Experiment
I'm doing a psychology experiment based on priming and seeing if different intelligence-level videos have different affects on people's scores on a test they take after watching the video. I'll report back with results
Music
I'm always looking for new music. Recently, a friend told me about Ray LaMontagne. I don't know how I haven't ever heard of him, he's right up my alley. The weird thing was, the first time she showed me "Trouble," I was able to sing along for the first few lines, though I couldn't recognize where I had heard it from. Go figure.