The Majestic Sea Creature
    • Edit
    • Delete
    • Tags
    • Autopost

    Logic can be dangerous!

    My ravioli's read:

    Boil 6-8 minutes or until tender

    If I were to treat this as short-circuit logic, like many programming languages would, it means:

    • if the raviolis are already tender before 6 minutes, you might overcook them
    • you can choose to stop cooking after 6 minutes, whether they are tender are not
    • you must stop boiling after 8 minutes, whether they are tender are not
    • you never reach the 'until tender' condition

    Of course, a human reads something to the effect of "Boil until tender. This takes approximately 6-8 minutes"

    But how do you model that logically? Doesn't it just mean 'Boil until tender' ?

    Maybe the reality is that the ravioli company is just giving me two possible solutions.

    The first one: Boil for 6-8 minutes is the simple one. If you have a watch with a minute hand, you're good to go. Just make sure at least 6 minutes pass, and avoid cooking for more than 8 minutes. It'd be hard to screw this one up.

    The second one, Boil until tender, is far more complicated. It requires you to have an objective condition called 'tenderness' that you can poll for, and the ability to detect it at any given moment.

    If you're writing software, this means you need to handle concurrency, because you'll need to spin off a thread to get the water boiling, and then poll the ravioli continuously for tenderness, stopping the boiling process once tenderness has been reached.

    Since it's unlikely that you'll be able to find the 'exact moment of tenderness', you'll need to define some sort of acceptable margin of error. You'll need to test this by trial and error. I suggest starting with steps of 30 minutes, and once you scrape up the burned raviolis, scale it down to maybe a check every few seconds.

    Of course, this is silly. But on the same token, it goes to show you how much of a divide there is between human intuition and logical analysis. I don't envy the programmers who are going to build the magic robots that cook my food for me in 2030 by downloading and parsing my grandmothers recipe for chicken soup.

    This is also just a very convoluted way of expressing why I enjoy cooking. It brings out the human side of me, because computers would probably suck at it.

    • 23 June 2007
    • Views
    • 0 Comments
    • Permalink
  • majestic @seacreature

    Hello, my name is Gregory Brown. I am the founder of Mendicant University, a free online school for software developers.

    I am passionate about community service, education, and the free software movement. If you're interested in getting to know me a bit better, feel free to send me an email: gregory.t.brown@gmail.com

    Archive

    2011 (53)
    August (7)
    July (9)
    June (11)
    May (11)
    April (2)
    March (8)
    February (4)
    January (1)
    2010 (33)
    December (2)
    November (1)
    October (3)
    September (13)
    July (3)
    June (10)
    April (1)
    2009 (1)
    May (1)
    2008 (62)
    October (2)
    September (1)
    August (3)
    July (2)
    June (3)
    May (3)
    April (14)
    March (11)
    February (11)
    January (12)
    2007 (61)
    December (4)
    November (2)
    October (5)
    September (4)
    August (2)
    July (10)
    June (15)
    May (19)