According to what-if.xkcd/85 if you had a bag of golf balls that was 150 miles in diameter you would be statistically likely to hit-a-hole in one at every golf course in the world. I was just curious as to what, "statistically likely" means. I remember from my statistics class back in my college days that statistically significant means greater than 1%, which isn't very significant.
So first things first, how many golf courses are in the world? Google says there are 32,000 ish golf courses in the world over half of which are in the US (17,000). In Randall's scenario you evenly spread your golf balls across the middle latitudes, the US is not in the middle lattitudes which means it is statistically impossible to score a hole in over half the courses in the world. We're going to have evenly spread our balls out across everything but the arctic and antarctic circles.
Wikipedia says that each golf course is roughly 125 acres and has 18 holes (some have 9, most have 18, and others have 27 or even 36). 125 acres is roughly .2 miles2. The about golf website says all golf holes are 4.25 in. in diameter or 2.125 in. in radius, or 14.2 in2. That gives us a total size of 255.6 in2 per golf course of hole in which to land a single golf ball. If I were to randomly drop a single golf ball onto a 125 acre golf course about 1 in 3.14 million times it would land in a hole. Minus the arctic and antarctic circles the Earth has roughly 177,100,000 miles2. If I were to randomly drop a golf ball on the Earth (minus the arctic and antarctic circles), about 1 in 2,780,000,000,000,000 times it would result in a hole in one.
Each golf ball has a volume of 2.48 in3 and our sphere of golf balls has a volume of roughly 4.5 x 1020 in3.
However as Randall pointed out, golf balls pack inefficiently and we can only use 65% of that space for golf balls. So we have a total of 1.8 x 1020 golf balls for a total of 6.65 x 1011 golf balls per mile2 or better put 166 golf balls per in2. I definitely should've started with the number of golf balls calculations because that would've saved me a lot of time, but here we are. Since everything but the poles are covered in 23 feet of golf balls, it is statistically impossible for you to not get a hole in one at every golf course unless all the golf balls are rocketed off your space ship at the same time and form a bridge over the golf hole. I mean we could add the poles and we'd still be covered in 21 feet of golf balls.
Baggles
Wednesday, June 25, 2014
Wednesday, August 21, 2013
Molecules in a teaspoon? Teaspoons in the ocean?
So back in college, I had a physics professor ask the class "Is there more molecules of water in a teaspoon, or more teaspoons of water in the oceans?" I initially thought there were more molecules of water in a teaspoon, but I didn't know for certain. Today, I did the calculations. Let’s start with the teaspoon.
1 Teaspoon of water is ~5cm3
The molecular weight of water is 2*(1.00794) + 15.9994 == 18.01528 g/mole
Water is pretty convenient in that it weighs 1 gram per cm3
5 g/18.01528 g/mol == .278 moles/teaspoon
6.022e23 * .278 == 1.67e23 molecules of water per teaspoon
Next, the world's oceans.
Surface area of Earth is ~500000000km2
Roughly 70% of the earth is covered in water.
The earth's average ocean depth is 4 km
1 km3 is 1e15 cm3
500000000*.7*4*1e15 == 1.4e24 cm3 of water in the ocean
Divide that number by the size of a teaspoon, and you get
1.4e24/5 == 2.8e23 teaspoons of water in the ocean
And we have our conclusion that there are in fact more teaspoons of water in the oceans, than there are molecules of water in a teaspoon. Long story short, I was wrong.
1 Teaspoon of water is ~5cm3
The molecular weight of water is 2*(1.00794) + 15.9994 == 18.01528 g/mole
Water is pretty convenient in that it weighs 1 gram per cm3
Wednesday, June 26, 2013
Me, a shovel, and Everest
So I have asked XKCD many times to answer my what if questions... but it's not happening, so I've decided to do the research myself, and find the answers myself. The first question on my mind is...
How long would it take to flatten Mount Everest to sea level using a shovel?
-Jason Thompson
The first problem with answering this question is deciding the volume of Mount Everest. Let's assume Mount Everest is more or less, cone like, and the base of the mountain is about 5 miles across. And from a base camp altitude of roughly 17,598 ft to a peak of roughly 29,029 ft, that gives us a height difference of about 11,431 ft. So calculating the volume is fairly straight forward, 1/3 * π * r2 * h, so we can say the volume from the base camp to peak is roughly 2.09*1012 ft3 of rock and dirt, and other mountain stuff. Since we're going to making it level with the sea we now have plenty of hole digging to do. The volume of the ground beneath Everest is roughly 9.633*1012 ft3. That leaves a total of 11.723*1012 ft3 of earth that needs to be moved.
When I was in high school I watched the movie Holes, and was so intrigued with the idea of digging a 5 ft deep hole, I went out, and spent 4 hours over a 2 day period digging a 6 ft deep hole, that was about 5 ft wide. Assuming Mount Everest is a mountain containing nothing but ideal digging dirt, and I have a conveyer belt that takes the dirt I put on it away to some faraway place, and there are no rocks larger than 1/2 a square foot, at a digging rate of 2 hours per day, 300 days a year (I need my holidays, and I'd take a break on Sundays), I've calculated the time it would take me to move Mount Everest at a quick 250.8 million years. According to this website, Mount Everest is only about 60 million years old. So it would take me 4 times its current age in order to completely remove it from its current home in Nepal.
But 2 hours a day is something I did for fun because I was intrigued. Let's say instead we sentence a single criminal to moving Mount Everest who works at the same rate per hour as me, but works longer days. We force this guy to work every day of the week, 12 hours a day, he get's 8 hours of sleep at night and can do whatever he wants (within his prison that provides him all the necessities of life) with the rest of his 4 hours a day. In these optimized conditions he would be able to work at a much quicker pace of moving all of Mount Everest and the ground below it down to sea level within 34.33 million years.
But using a single criminal is inefficient, what if we used all of the criminals today? There are approximately 9.2 million prisoners in the world. Let's get all of them to work, and we'll only use a couple of conveyer belts that take the dirt far away instead of 1 per person. That means realistically, only 5% of the prisoner population will be digging, and that's being generous, the rest are moving dirt. We'll replace people as necessary, but we'll keep the 9.2 million number for as long as they're working on Mount Everest. In this case, we can move Mount Everest in a much more reasonable 74.64 years, or 27243 days.
But using shovels are inefficient, what if we gave everyone who's digging a Caterpillar? With my shovel I move earth at a measly 471 ft3 per 4 hours. The Caterpillar I'm planning on giving to all those digging prisoners can move earth at a whopping 360 yd3 per hour. These Caterpillars are much larger than people with shovels, and we'll reduce the number of diggers down to only 1% of the prisoner population, everyone else is doing earth moving, not digging. At this rate we'll be done in as little 4.522 years, or 1650 days.
But using Caterpillars are inefficient, it is hypothesized that the Gulf of Mexico was actually created by a comet/asteroid some 66 million years ago, and that was what really ended the dinosaurs, and extinction events similar to that happen every 26 million years or so. So apparently we're due for another one of those any day now, and that would be able to remove Mount Everest for us fairly easily probably in a matter of minutes. Another problem comes in to play when we realize we would have to position either the Earth or the comet/asteroid so that Mount Everest would be decimated. But that's a topic for another discussion.
How long would it take to flatten Mount Everest to sea level using a shovel?
-Jason Thompson
The first problem with answering this question is deciding the volume of Mount Everest. Let's assume Mount Everest is more or less, cone like, and the base of the mountain is about 5 miles across. And from a base camp altitude of roughly 17,598 ft to a peak of roughly 29,029 ft, that gives us a height difference of about 11,431 ft. So calculating the volume is fairly straight forward, 1/3 * π * r2 * h, so we can say the volume from the base camp to peak is roughly 2.09*1012 ft3 of rock and dirt, and other mountain stuff. Since we're going to making it level with the sea we now have plenty of hole digging to do. The volume of the ground beneath Everest is roughly 9.633*1012 ft3. That leaves a total of 11.723*1012 ft3 of earth that needs to be moved.
When I was in high school I watched the movie Holes, and was so intrigued with the idea of digging a 5 ft deep hole, I went out, and spent 4 hours over a 2 day period digging a 6 ft deep hole, that was about 5 ft wide. Assuming Mount Everest is a mountain containing nothing but ideal digging dirt, and I have a conveyer belt that takes the dirt I put on it away to some faraway place, and there are no rocks larger than 1/2 a square foot, at a digging rate of 2 hours per day, 300 days a year (I need my holidays, and I'd take a break on Sundays), I've calculated the time it would take me to move Mount Everest at a quick 250.8 million years. According to this website, Mount Everest is only about 60 million years old. So it would take me 4 times its current age in order to completely remove it from its current home in Nepal.
But 2 hours a day is something I did for fun because I was intrigued. Let's say instead we sentence a single criminal to moving Mount Everest who works at the same rate per hour as me, but works longer days. We force this guy to work every day of the week, 12 hours a day, he get's 8 hours of sleep at night and can do whatever he wants (within his prison that provides him all the necessities of life) with the rest of his 4 hours a day. In these optimized conditions he would be able to work at a much quicker pace of moving all of Mount Everest and the ground below it down to sea level within 34.33 million years.
But using a single criminal is inefficient, what if we used all of the criminals today? There are approximately 9.2 million prisoners in the world. Let's get all of them to work, and we'll only use a couple of conveyer belts that take the dirt far away instead of 1 per person. That means realistically, only 5% of the prisoner population will be digging, and that's being generous, the rest are moving dirt. We'll replace people as necessary, but we'll keep the 9.2 million number for as long as they're working on Mount Everest. In this case, we can move Mount Everest in a much more reasonable 74.64 years, or 27243 days.
But using shovels are inefficient, what if we gave everyone who's digging a Caterpillar? With my shovel I move earth at a measly 471 ft3 per 4 hours. The Caterpillar I'm planning on giving to all those digging prisoners can move earth at a whopping 360 yd3 per hour. These Caterpillars are much larger than people with shovels, and we'll reduce the number of diggers down to only 1% of the prisoner population, everyone else is doing earth moving, not digging. At this rate we'll be done in as little 4.522 years, or 1650 days.
But using Caterpillars are inefficient, it is hypothesized that the Gulf of Mexico was actually created by a comet/asteroid some 66 million years ago, and that was what really ended the dinosaurs, and extinction events similar to that happen every 26 million years or so. So apparently we're due for another one of those any day now, and that would be able to remove Mount Everest for us fairly easily probably in a matter of minutes. Another problem comes in to play when we realize we would have to position either the Earth or the comet/asteroid so that Mount Everest would be decimated. But that's a topic for another discussion.
Wednesday, May 22, 2013
File compare
Today's problem must be solved in C++ without any special libraries (namely boost). There's an unknown number of files of the format:
File1_1.txt // the files all start with File, followed by some number < 9999
followed by _1.txt
There's 5 lines of comments about this file.
These comments can contain any characters
such as `~!@#$%^&*()_+-=[]{};':",./<>? and not be disrupted
156 1.569e-1
200 0.5e+09
215 569
289 159E+009
350 150
For each of these files, there's a file with the exact same name in a folder in the parent directory of the current working directory. That file with the same name looks exactly the same, except for when we get to the numbers. Specifically the second number is different, i.e. :
156 1.568e-1
200 0.5e+09
215 569
289 159E+009
350 159
Within two same name files we will need to calculate the difference of the second number and find the largest difference in this file. Because 150 - 159 gives us abs(-9) == 9, 9 is the biggest difference for this particular file. We will not need to compare different lines.
The goal is to find the largest difference (absolute value of the difference) among all the files.
File1_1.txt // the files all start with File, followed by some number < 9999
followed by _1.txt
There's 5 lines of comments about this file.
These comments can contain any characters
such as `~!@#$%^&*()_+-=[]{};':",./<>? and not be disrupted
156 1.569e-1
200 0.5e+09
215 569
289 159E+009
350 150
For each of these files, there's a file with the exact same name in a folder in the parent directory of the current working directory. That file with the same name looks exactly the same, except for when we get to the numbers. Specifically the second number is different, i.e. :
156 1.568e-1
200 0.5e+09
215 569
289 159E+009
350 159
Within two same name files we will need to calculate the difference of the second number and find the largest difference in this file. Because 150 - 159 gives us abs(-9) == 9, 9 is the biggest difference for this particular file. We will not need to compare different lines.
The goal is to find the largest difference (absolute value of the difference) among all the files.
Friday, May 17, 2013
Contains Palindrome
The problem is, given any size string (has to fit in the String class) check to see if it contains a palindrome. We'll define a palindrome as longer than 2 characters. If the string contains a palindrome, print out true, otherwise print out false. I.E. abby -> false, abba -> true, repelevilasaliveleper -> true
Thursday, May 16, 2013
Next Palindrome
Given any number up to 1000000 digits long (far too large for any int double long float or any other number format common to programming languages) find the next lowest palindrome. So for example, if the number is 5, the next lowest is 6, given 9 the next lowest is 11, given 12 the next lowest is 22, given 123123 the next lowest is 123321, and the final example given 9877899835481354687 the next lowest would be 9877899836389987789. If the current number is a palindrome, find the next lowest after the current number.
Wednesday, May 15, 2013
Line Spacing?
So Irealized in my comments to my previous post, the line spacing of my code was not maintained. Does anyone know how to maintain it for comments? I supposed the same problem will occurr for the actual posts too.
Subscribe to:
Comments (Atom)