20-CS-110-001 Introduction to Computer Science Fall 2010

Solution to Hole in Sphere Puzzle

   
        _----_                 <- height of piece showing at top = (r-x/2)
       / |  | \       |\      |
      |  |  |  |   x/2| \r    | <- the hole
      |  |x |  |      |  \    |
       \ |  | /       |___\___|
        -____-          ^ ^
                        | |-- center of sphere
                        |---- sqrt(r^2 - x^2/4)
Volume of hole: π*(r2-x2/4)*x + ...
Volume of sphere: 4*π*r3/3

Volume of piece of sphere: int{t=x/2,r} π*w2dt where w = sqrt(r2-t2)
so it's int{t=x/2,r} π*(r2-t2)dt

whole sphere:
   2*π*(r2t - t3/3) | 0-r = 2*π*(2*r3/3) = (4/3)*π*r3

end pieces:    2*π*(r2t - t3/3) | (x/2)-r = 2*π*((2/3)*r3-r2*x/2+x3/24)
   = π*((4/3)r3-r2*x+x3/12)

hence, hole volume =
   π*(r2*x - x3/4) + π*((4/3)r3 - r2*x + x3/12) =
   ((4/3)*π*r3 - x3/6)

Remaining volume =
   π*((4/3)*r3 - (4/3)*r3 + x3/6) = π*x3/6
   - which is independent of the radius of sphere!

If the radius of the hole is q, then r = sqrt(x2/4-q2).