Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: How confident are you that you could have done this?

Author: Robert Hyatt

Date: 09:52:17 02/10/06

Go up one level in this thread


On February 10, 2006 at 12:44:07, George Tsavdaris wrote:

>On February 10, 2006 at 12:09:16, Robert Hyatt wrote:
>
>>>Question 4: An inverted cone is filled with water.  You are given 2 floating
>>>point numbers: the radius and height of the cone.  Find the radius of the sphere
>>>which if dropped into the cone would have caused the maxiumum amount of water to
>>>spill over the top.  The answer has to be accurate to 3 significant digits.
>>>Maybe I could have figured out how to do this, in a week's time.
>>
>>That one sounds easiest.  Restated:
>>
>>Find the sphere that will fit into the cone, where the surface of the sphere
>>just contacts the top "surface" of the cone.  That's the largest sphere you can
>>put in there, which will displace the most water.
>
> Yes that's the largest sphere you can put inside, but how this assures that
>another shpere that only a part of it that goes inside the cone, doesn't spills
>more water.....? You have to investigate this too....
> Of course this is an easy math problem and the above solution seems the easiest
>too along with an addition to look for spheres not 100% inside the cone. I think
>this should take 2 more cases to investigate.....


No, what this would take is good testing.  At so-called "boundary conditions".
My test cases would have included a cone with an enormous base, and a tiny
height, as well as the opposite.  And by starting at the base with the center,
it would have quickly been obvious that the idea was wrong, with the wide/short
cone, because every circle tried would have seen steadily decreasing
displacement, giving a hint that the center should be somewhere outside the
cone...  That would be a trivial change to alter the starting point for the
circles, assuming testing showed the flaw.

I can't say for certain but this might have come up 10 minutes into the coding
even, when thinking about it.  My "gut reaction" above was just that, but when
writing the code, and thinking about it at the same time, it might well "jump
out at you" that the initial condition I gave might not be right for all types
of cones.

I suspect one could come up with a mathematical formula to predict when the
center of the circle has to lie inside the cone, based on the base and height of
the thing...

But this isn't helping chess, so I'm not wasting any time writing the code. :)


>
> This problem would probably take 5-10 minutes to solve it by maths(paper and
>pencil only) but i don't know how long to program it.....Perhaps a day for a
>beginner like me. Of course there is always the possibility to add the paper
>solution as comments inside /* */ :-) But whenever i did such "tricks" i always
>become the bad boy and being misunderstood not to mention the zero grades....:-(
>
>
>>You can reduce this to two
>>dimensions, a triangle with base B and height H.  Fit a circle into that
>>triangle such that the base is a tangent to the circle,
>
>
>>and the radius of the
>>circle doesn't pass through the cone.
>
>I don't really understand what did you want to say with this....?
>
>
>>
>>I'd probably go about that like this:
>>
>>Center of the circle has to lie along the center of the cone that stretches from
>>the vertex to the middle of the base. so my goal is to find a circle whose
>>center is along that line, with radius R, such that R touches the base, and
>>touches the side, both at 90 degrees.  The algorithmic solution would probably
>>be to slide the center upward from the base, testing the radius for reaching the
>>side of the cone as the radius increases to push the center of the circle away
>>from the base.
>>
>>
>>>
>>>
> Providing that a complete beginner like me would solve the 1st problem in 15-40
>minutes, so 5-10 for the contestants, they would have 1:50 to solve a Chess
>problem not easily programmable to cover all possible cases in less than 1:30
>hours, a zombie question of 2 pages, and a math question that needs some
>investigation before you program it....Insane!
> I guess even Ken Thompson couldn't do it in less than 2 hours.....



This page took 0.01 seconds to execute

Last modified: Thu, 15 Apr 21 08:11:13 -0700

Current Computer Chess Club Forums at Talkchess. This site by Sean Mintz.