SPUG: Stick Riddle

Michael R. Wolf MichaelRunningWolf at att.net
Wed Jan 1 18:45:07 CST 2003


Geoffrey & Kristin Grosenbach <glyph at mac.com> writes:

[...]

> In his college course, he came up with the answer of 50%
> probability. I wrote the attached Perl script to simulate this, and
> constently get 38%, assuming the second split is done on the larger
> piece.

Doesn't this assumption violate the "randomly split in pieces" clause
in the problem definition?  Breaking the shorter piece will certainly
not allow a triangle, but that doesn't mean you should rule it out in
the solution.  You could optomize it out in the calculations, but you
can't ignore that possible root of the equation.

> It appears that rand() is consistently random enough to give good
> results, so that's not an issue. Should I tell him he's wrong (and use
> Perl to prove it), or am I making an obvious error?
> 
> Geoff

-- 
Michael R. Wolf
    All mammals learn by playing!
        MichaelRunningWolf at att.net


 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
     POST TO: spug-list at pm.org       PROBLEMS: owner-spug-list at pm.org
      Subscriptions; Email to majordomo at pm.org:  ACTION  LIST  EMAIL
  Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address
 For daily traffic, use spug-list for LIST ;  for weekly, spug-list-digest
     Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org




More information about the spug-list mailing list