Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re^3: Odd Ball Challenge

by zby (Vicar)
on Jun 24, 2005 at 12:39 UTC ( [id://469681]=note: print w/replies, xml ) Need Help??


in reply to Re^2: Odd Ball Challenge
in thread Odd Ball Challenge

So take following riddle - "How much is it 2 + 2?". You want a program that would print a program printing solution to this riddle. I say this the solution to this is:
print "print 4;";
But you say that this is not enough, that the solution should somehow compute the "print 4;" output.

Replies are listed 'Best First'.
Re^4: Odd Ball Challenge
by Limbic~Region (Chancellor) on Jun 24, 2005 at 12:48 UTC
    zby,
    No, the riddle would be more like:

    Produce a prime number whose sum when added to itself is the same as the product if multiplied by itself.

    The point is that until you know the answer is 2 + 2 = 4 = 2 * 2, you can't write a program that prints out 4. The challenge is not to figure out the solution and then write a translation of that solution into the program. The challenge is to write a program that given the rules can figure out a solution (since there may be more than one).

    If it is still not clear and you need another example, see Challenge: Setting Sun Puzzle.

    Cheers - L~R

      The question is how much knowlege can I use in the solution. That is you need to define the proces of 'finding the solution'.
        zby,
        You can use only the information outlined by the riddle itself:
        • Given: 12 balls identical in appearance
        • Given: 11 balls are identical in weight, 1 is not
        • Given: A balance scale with 2 sides
        • Given: The use of the balance 3 times
        • Goal: A set of groupings and weighings that when followed will determine which ball is odd and how it is odd.

        I really don't know how else to say it. You are designing a program to solve a problem that is presumably too difficult to solve otherwise. You feed it rules to follow and a desired outcome and it churns away until it has satisified the goal.

        Cheers - L~R

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://469681]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others imbibing at the Monastery: (5)
As of 2024-04-19 06:50 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found