Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Cylinders in Spheres (datagenetics.com)
118 points by stansmith on July 9, 2014 | hide | past | favorite | 58 comments


One of those cases where using integrals rather than geometry is much simpler.

    \pi \int_-3^3 (R^2 - x^2) dx = \pi (6 R^2 - 18)
is the volume of the rotational solid without removing the cylinder. While the volume of the cylinder is given by:

    \pi \int_-3^3 (R^2 - 3^2) dx = \pi 6 (R^2 - 9)
As you can see the difference between the two volumes is 36 \pi.

You can actually show the solution does not depend on \pi without evaluating the integral, and then compute the 'cheat' case, which would not be a cheat once you've made this observation.


Nit: the solution doesn’t depend on “R” (as you note, this is clear from looking at the structure of the two integrals); it does depend on \pi.


typo! And I'm out of the edit window.


Nice, I especially appreciate the "cheat answer" to the Gardner Puzzle at the bottom of the page. I have found that kind of meta-reasoning about questions quite useful, on exams and in games like Trivial Pursuit, for example.


Looking at the other comments, it seems like most people really like the cheat. I admit it's very cute, and you're absolutely right that this sort of thinking can be helpful in artificial situations like exams and games --- I've used it myself.

That artificiality is why I don't really like that approach, though. It's a brand of thinking that generally works only on artificial problems, because the key component ("you wouldn't be asking me this if it didn't have a well-defined answer") doesn't exist on most problems. Proving that it's constant and then using the r -> 0 trick to calculate the constant is much more satisfactory to me.


> that approach is a brand of thinking that generally works only on artificial problems, because the key component ("you wouldn't be asking me this if it didn't have a well-defined answer") doesn't exist on most problems

Perhaps changing the footnote hint "no more information is given" to an integral part of the problem spec, and saying "no more information is required", would make the problem less artificial. There would then be a self-referencial component in the problem definition, self-referentiality being fairly common in nature and engineering.


Of course, the key components of the analytic solution (knowing the volume formula for spherical caps, spheres, and cylinders) also don't exist on most problems.


I once encountered question that had cheat answer. It was about trapezoid and it seemed that it had some data missing.

I was amazed that just assuming that the question had one answer allowed to reduce the problem to trivially calculable one by consistently manipulating the variables that were not given.

I was also pretty proud of myself for finding this solution.


In the early eighties there was a TV show on German network television and I remember them presenting this puzzle, and I figured out the "cheat solution" as a kid.

It was this awesome TV game show that consisted entirely of Martin Gardner-style puzzles and other fiendish physics/biology puzzles, and contestants who were all scientists. Does anyone by any chance remember the name of this German TV show? I would really like to look up more information about it! It deserves to be remembered.


Likely Kopfball (http://de.wikipedia.org/wiki/Kopfball_(Show)), although that is late eighties (and the precursor late seventies)


I found it through some extra searching starting from your link- "Kopf um Kopf" ... Is that the precursor you were thinking of?

Here is a video on youtube that shows the awesomeness of this show (don't need to know German to appreciate it- On the start of the show, putting your finger under the device makes it spin in the opposite direction... why? The audience member with the right answer would get a reward.) https://www.youtube.com/watch?v=1ObdE9n3UF4

Take a quick peek at a few other random spots of the show in the video and marvel at the awesome scientific experiments on live TV: I think that was one of the most bad ass shows ever, especially since it didn't have that pejorative "science shows are only for kids" thing happening.


I'm not sure. Wikipedia claims that he precursor also was called Kopfball, and has some overlap in the times when the series ran.

I just googled the "kopf" that I remembered in combination with "wissenschaft" (science) and "fernsehen" (television), and that popped up, and I thought "that must be it".

I should have been more cautious, though. German TV at the time had quite a few interesting programs about science (in a broad sense) I remember programs where they taught differentiation and integration, live chess (or at least, it seemed like that; if a player takes ten minutes to think about a move, the commenters would explain what the players might be thinking about) by such players as Karpov, Timman, and Anand (http://en.m.wikipedia.org/wiki/Chess_of_the_Grandmasters), Hobbythek (http://de.m.wikipedia.org/wiki/Hobbythek) about DIY, (with subjects such as "we build a hot air balloon", "book binding", and "stereo photography"), and that program about personal computing whose name I don't remember.


Yeah, Hobbythek was awesome, too... I remember at maybe 8 years old trying to rebind one of my own broken books after probably seeing that exact episode you mention...

It's really easy to get into this mode where you think "If it's not new and American it's crap" because the US in recent years has been so prodigious in creating such a large range of media of many different types, and because the US is not shy in "Americanizing" things from other countries and improving on them. However, there are definitely corners of brilliance lying in the past and in other countries that have been forgotten, and will be rediscovered in future years.


The deformed gelatin on the polarizer about half way in was pretty cool.


The cheat is absolutely brilliant reasoning.


Ehh, sort of. It's logically flawed as phrased, in that the first bit is false: "If the problem is being posed, it must have a constant solution" is false; it could just as well be a niftily-simple symbolic solution too.

(I say "as phrased" because as other commenters observe, there are mathematically valid ways to arrive at the result.)

This reminds me of one of my favorite joke proofs from when I was in school. (It's so simple I'm sure it has other originations but AFAIK I independently recreated it.)

"The problem begins with the phrase 'Show that...' or similar. All previous problems that began with that phrase have been provable. Therefore, by induction, the claim I am being asked to prove must be correct. QED."

Unfortunately, this proof line hit a snag about halfway through my graph theory class in which we were assigned a problem out of the book that turned out to ask you to prove a false statement. (Well, a snag above and beyond the fact that that is an invalid inductive proof in general, ahem.) It was a typo and clearly accidental, but it was enough to break my proof forevermore. May you have better luck with it.


My favorite "cheat" was on an exam in an algorithm-analysis class (lots of discrete math, infinite sums, and proofs). We were asked to prove or find a counterexample to some conjecture or other. Looking at the conjecture, and looking at the clock, I decided the only thing I could complete in time was to find a counterexample. Indeed within a few minutes I found one and wrote it down.

I was the last to finish my exam and handed in my booklet; the prof looked it over and noted I was the only one (out of 5) in the class to get that particular question correct. I explained to him my "reasoning". He said, "yes, that is how you're supposed to do it!"


In a linear algebra class, we were asked to prove that a theorem is true if and only if X. (I think X may have been that a matrix had a nonzero determinant.) I had no idea how to do it, but I noticed the theorem was trivially true in the case of a 1x1 zero matrix. Since this matrix has a zero determinant, it spoiled the "only if" part. I wrote it as a counter-example, showing that "if AND only-if" was false, and didn't prove the "if." Full credit!


Its flawed as a "proof", but it might contextually justify the answer. That exact reasoning accounts for pretty much all of my limited success at middle school/high school math competitions. You can usually skip long, difficult steps by simply assuming there is a single constant answer (as the rules of the contests usually make clear must be the case).


I took it to mean that the problem would not be given in this way unless there was an exact solution. In the stated version, there are no degrees of freedom specified, so there can be no degrees of freedom in the solution. In that way, the proof wouldn't work if the problem stated "A six inch high cylindrical hole is drilled through the center of a sphere with radius R. How much volume is left in the sphere?"

In that case, the solution might be dependent on R, and we'd have to go through the long version. Without that mention of R, unless the problem is wrongly stated, it must be constant.

So it's still an invalid inductive proof, but it's a lot stronger than just assuming that because there is a question there is a constant answer.


It's much more impressive if you can show the answer is independent of the variables and then use the limiting case to find the answer. As another poster wrote, all you have to do is write down the integrals for the volumes and notice that in the difference the R^2 terms will cancel.

Unfortunately, in this case the integrals are trivial to evaluate. I think a much more interesting problem would be one where the same approach I described works, except it's not tractable (or at least not easy) to do the integrals in your head.


Agreed. Given that it is a puzzle and not a request for proof. Once you realize that the hole and sphere diameter are related and the situation has one degree of freedom not specified, it is perfectly valid to conclude that the answer must be independent of that and choose a case you can work out in your head.


There is a simpler puzzle that's similar to Gardner's, but as unintuitive.

Take an orange and wrap a string around its diameter. Now extend the string by 1 inch and redistribute it around the orange so that it floats an even distance from it. Do the same with the Earth, i.e. wrap, extend by 1 inch and even out into a circle. The gap betwen the string and the orange/Earth - which one is bigger?


Spoiler below!

The relationship between radius and circumference is linear (C = 2pi * r). When the circumference is increased by 1, the radius increases by 1/2pi. Therefore, the gap has the same size.

Let g be the gap. Then

          C + 1 = 2pi * (r + g)
    2pi * r + 1 = 2pi * (r + g)
    r + 1 / 2pi = r + g
        1 / 2pi = g


It wasn't (initially) clear to me that the cylindrical hole must enter and exit the sphere.

With that knowledge the solution seems pretty intuitive.


How can one drill a 6" long hole through a sphere of more than 6 inches in diameter?

What I mean is if you drill 6 inches into the earth, you haven't passed through the other side...

edit: I think they mean drill a 6 inch hole of maximum width, which of course would just leave a very thin ring of the earth 6 inches tall.


It doesn't say "through the sphere." It says "through the center of the sphere." For example, drill a thin radial hole 6" inches deep through the center of a sphere of radius 5"; you will pass through the center and stop before you reach the far side. The volume remaining then depends on the radius of the drill bit, and the size of the sphere.

It also doesn't even state that the hole must enter the sphere. A large solid sphere that internally contains a six inch hole through its center would qualify too.

This was my objection when I first encountered the problem. Everyone else seemed to understand that the hole must pass through both sides of the sphere, but that's not stated or even implied in the problem.


In the puzzle statement, "A six inch high cylindrical hole is drilled through the center of a sphere," through is the keyword, rather than into.

I made the same initial mistake of misreading through as into.


In that case, the statement from the article "We could have a sphere as large as a planet, bore a hole 6" in length through it..." seems inconsistent. Either the cylinder is not 6" long, or it does not go through the sphere.


The problem can be rephrased to avoid the ambiguity. Something like "A hole is bored through a sphere such that the void in the remaining material has the shape of a cylinder 6 inches tall".

I guess the overall idea is anyway to reveal the elegant mathematical result. Wikipedia does a good job of talking clearly about it:

In geometry, the volume of a band of specified height around a sphere—the part that remains after a hole in the shape of a circular cylinder is drilled through the sphere—does not depend on the sphere's radius.

http://en.wikipedia.org/wiki/Napkin_ring_problem


I thought that at first, but the length of the hole is dependent on the width of the hole. The wider the hole, the shorter, because wider holes remove bigger caps.

With a sufficiently wide hole, you could indeed drill a 6" hole through a spherical Earth, it'd just look more like a thin ring the diameter of the Earth than a sphere.


i still get a confused language impression from that. for me it's the combination of "drill" and "through" (probably was forced to take too much 'wood shop')

i think it would be more clear to phrase it starting along the lines of: position a cylinder concentric and inscribed within a sphere ...


I've always heard it described as a circular napkin ring where the depth of the inner hole is an inch.


Nor that the endcap(s) would not be included in either the 6 inches or the resulting volume. It seems to me that there must be a much better phrasing that brings these points home, although it might require a diagram.


I'm just pleased that I finally found a math puzzle on HN that I was able to solve without looking ahead! (Although I called the radius of the cylinder r/a, where r is the radius of the sphere, which ended up making my math a bit messy...)

Regardless, deserves an upvote just for the cheat answer at the end. I like that kind of reasoning!


I remember reading and solving this the problem as the end of the article (“A six inch high cylindrical hole is drilled through the center of a sphere. How much volume is left in the sphere?”) as a kid. I did it the hard way using the formula's, but the whole point of the puzzle was what this article called the "cheat" answer. It reduces the solution to utter simplicity by application of some elegant logic. It's not something of a cheat -- it's the whole point of the puzzle.

I really was a kid. I was taken in by Gardner's April 1st column that claimed among other things that a proven solution for "Chess" indicated that white would always win and that the opening move was P-KR4 (h4 in modern notation).


It only wouldn't be a cheat if the question were framed as "Surprisingly, the volume of the ring is constant, regardless of the radii of the sphere and circle. What is that constant volume?" Otherwise, you don't really know your answer is correct. Maybe, they wanted the answer in terms of R1 and R2. And if you are able to trick them into confirming it, then you're essentially using social engineering to leverage somebody else's work (the person who discovered the surprising result) in formulating your answer. There's no way that the original discoverer could have used that method. That's what makes it a cheat.

Back in middle school geometry, I came up with my own strategy for proving theorems. "You wouldn't ask me to prove it if it weren't true, therefore it must be true. Q.E.D." It didn't go over well.


That's why in Uni they usually asked: prove this statement right or wrong (or undecidable).


I solved the puzzle in my head before getting to the second paragraph in the article. Here's the reasoning:

1) The area of a circle has a fixed ratio to the area of a square inscribed in that circle.

2) Therefore the volume of a cylinder has a fixed ratio to the volume of a square box of the same height, which sits inside that cylinder.

3) Therefore the biggest cylinder corresponds to the biggest box that can fit inside the sphere.

4) That box is obviously a cube, because what else could it be?

5) If a cube is inscribed in a unit sphere centered at the origin, the corners have coordinates ±1/√3, ±1/√3, ±1/√3.

6) Now you can calculate the volume of the cylinder in your head. Do it!


Step 4 seems a bit glib... :)

It would follow straightforwardly if we knew that the largest rectangle in a circle is a square.

The easiest way I can think of right now to see this is by Lagrange optimization (which we could also apply just as well directly to the 3d problem): the area of a rectangle of width and height <x, y> has a gradient of <y, x>, which can only be normal to the circle (which has normal vector <x, y>) when x = y.

Another way is to think of <x, y> as proportional to <cos(t), sin(t)>; the area is then cos(t) * sin(t), which is proportional to sin(2t), and thus clearly maximized when x = y.


Congrats! But I hope all that is a humblebrag, not a reflection of your standards as a technical interviewer ;-)


Yeah, that was definitely a brag, nothing humble about it :-)

When I was a bit younger, I was in fact the typical asshole interviewer who would ask lambda calculus questions. Now I mostly stay away from interviewing, because I can emphasize much more with the pressure that candidates feel.


It reminds me of two other neat problems -

1. Imagine a band stretched taught around the diameter of the earth (which, for the purposes of this question, is a smooth sphere). Now imagine that the band is raised one metre from the ground at every single point along its length. How much longer is it?

2. Imagine perfectly parallel lines painted on the floor, exactly one foot apart, and a rigid needle of length one foot. If you throw the needle to the floor at random, what is the probability that it crosses one of the lines? (This one has a nice 'cheat' solution just like the OP article).


Maybe I am missing something here, but why is 1 a neat problem? You are increasing the radius by 1 meter so the length of the band is now 2pi(r_e + 1) making the increment 2*pi meters. Is the surprisingly low increment the point of the problem?


Most people when faced with 1 and knowing the huge circumference of the Earth estimate (using Sytem 1 type thinking, http://en.wikipedia.org/wiki/Dual_process_theory#System_1) it would be longer by kilometers.


Yes, exactly; if you don't start out by doing the math, the result can seem unintuitive.


#2 is 3/Pi.

It's a good puzzle and it helps to know the answer :)


Maybe it's just me, but that one could use better wording. Because of the "exactly one foot apart" phrase, I interpreted it to mean that there are only two parallel lines, which obviously makes it a poorly defined problem. I probably would have understood it if the phrase was replaced by "at one foot intervals."


I fell for this too. My initial answer, suspect of course, was thereby zero. :-)


Rather, 2/pi.

The nice answer (referred to above as a "cheat") is to note that the sought probability is the mean number of crossings made by a 1 foot needle with the lines on the floor, where we are implicitly supposing our throw-distribution to be uniform with respect to both translation and rotation. This uniformity, along with "linearity of expectation", is such that the mean number of line-crossings from throwing any shape is simply proportional to the length of the shape (imagine breaking the shape up into many tiny straight lines, all identical except for location and orientation, the number of which is proportional to the length). Note that a circle of 1 foot diameter always makes exactly 2 crossings. Thus, the constant of proportion is 2/pi per foot, and accordingly the sought probability is 2/pi.


#2 is called this: http://en.wikipedia.org/wiki/Buffon%27s_needle. This is also mentioned in Jordan Ellenberg's book How Not to Be Wrong, and has a similar passage with your explanation above. I mention the book as much because it's a great read.


If you read to the bottom of the cylinder article, there's a link to another blog post by the same guy about other Martin Gardner puzzles, and the 'band around the Earth' puzzle is the first one!

http://www.datagenetics.com/blog/may12012/index.html


The author never pays off the answer to the initial question- is it a fat cylinder or a skinny one? We know it has height ~1.15R (where R is sphere's radius), but this is not easy to visualize.


The cylinder is sqrt(2) (~= 1.41) times as wide as it is high. So... a little fat? (I don't know the healthy baseline for cylinders...)


If I did my trigonometry right, the edges of the cylinder would be about at the 35.26° latitudes, which seems pretty fat to me.


To estimate an answer for the first problem: consider two cylinders with zero volume, the one equatorial (r=R) and the other polar (r=0). Both correspond to zero volume. Hence the maximum volume occurs (hand wave) for a height somewhere between 0 and 2R. Not knowing better, the initial estimate for h is to bisect this interval, to give h_est = R (compare 1 with 2/sqrt(3) ~= 1.15).

It would be nice to construct a first order correction term. Any ideas?


Regarding the Napkin Ring part of the problem.

Had the author simplified the formula for "Vanswer" rather than plugging in values for h & c, he would have gotten:

Vanswer = (Pi/6) * h^3

From which is it easy to see that the answer in this particular case is 36 * Pi but it also makes clear that the answer does not depend on R.


...and its Archimedean inverse(his favorite!): a Wilson(tm)* soccer ball enjoys 2/3 the volume and 2/3 the surface content of its minimal cylindrical official Wilson(tm) shipping clear plastic blister pack.

*citation: Tom Hanks in "Castaway"




Consider applying for YC's Summer 2026 batch! Applications are open till May 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: