Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search

[REBOL] Re: A Rebol Challenge. The Monty Hall Puzzle

From: sunandadh:aol at: 17-Dec-2001 9:39

Hi Joel,
> It seems to me that the problem in the original post was persuasion > and not just computation. That being the case, the text of the > program itself (or its derivation) should be a compelling argument > for the right answer. > > IOW, if I had trouble understanding/accepting an answer, I would > not be very persuaded simply by the output of a highly compact > program that seemed to contain assumptions about the very answer > I was having trouble with.
I completely agree that a highly compressed program isn't often a great way to win an argument. But (just to defend myself for a moment) my attempt embodied all the "rules": I picked a door; Monty picked an empty one of the other two; I swap to his unopened one. No built-in assumptions there. i also agree with an earlier post of yours (about Perl and parlor games). The best test of a programming language isn't how compact a program it can write, but (I would claim) how easy it is to write maintainable programs in it. But even that tests mainly the design skills and long-term vision of the programmer. A good test of all of our (and Perl and Matlab) solutions is how easily can they be modified as various "real world" changes are required. Almost by definition, we can't know what our programs will face over there lifetimes, but here are a few of the sort of things that might beset a Monty simulator: -- Not three doors, but 10 -- Not 10 but 25 million doors (challenging many language implementations to handle this as in-store arrays) -- Monty opens more than one door --there is more than one door with a car behind it -- I get to pick more than one originally, but can only open ONE of mine, OR one of his once Monty has opened the ones on his side -- I get to pick more than one door, and Monty opens N of mine and M of his. -- There are several prizes (a Saab and a Mercedes) including some booby prizes (A tribe and a yugo maybe). Monty will open up to N doors at random; I can't win the prize behind an opened door; but I can tell him to stop at any moment, and then make my choice. -- The program running as a CGI is so overwhelming popular that it is swamping the server: rewrite it to use half the cpu cycles. -- The government will buy 3,000,000 copies but only after the simulation is run not 500 times but 500,000,000 times. (Rebol can handle this number, but for most languages Wins + 1 = Wins for a sufficiently large value of Wins. If you exceed that, you need extra special code). I can see how my solution will naturally extend for some of these; can be bodged into shape for others; and would be scrapped and rewritten for the rest. And that's programming! Sunanda.