Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask

Re: Holiday parcel puzzle

by Not_a_Number (Prior)
on Dec 22, 2011 at 20:12 UTC ( #944838=note: print w/replies, xml ) Need Help??

in reply to Holiday parcel puzzle

Update: Added spoiler tags

Update 2: Looking now at the OP's much more verbose code, I wonder if mine is not too concise, especially if the aim is to convince someone who doubts the actual odds.

Anyway, it was enough to convince me! :)

Replies are listed 'Best First'.
Re^2: Holiday parcel puzzle
by cavac (Deacon) on Dec 22, 2011 at 20:17 UTC

    Nice one. Actually, way nicer than mine.

    BREW /very/strong/coffee HTTP/1.1
    418 I'm a teapot

      So do I win the 1000XP?


        I i could give them to you, i probably would.

        But i'm just a humble Pilgrim, working in the Department Of Bugsniffing. My hope is, that, one day, i'll be promoted to Friar. If i'm very lucky, i might even get my own desk.

        BREW /very/strong/coffee HTTP/1.1
        418 I'm a teapot
Re^2: Holiday parcel puzzle
by JavaFan (Canon) on Dec 22, 2011 at 22:33 UTC
    The problem with your "concise" solution is that it's unclear whether your program matches the problem description. If you don't care about the latter, here's an even more concise one:
    use 5.010; say "Please wait while I run a simulation ...."; sleep 5; say "Elves have wrapped a billion parcels, calling FedEx ...."; sleep 10; say "Not switching wins 33.3% of the time"; say "Switching wins 66.7% of the time";

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://944838]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (5)
As of 2018-04-21 01:13 GMT
Find Nodes?
    Voting Booth?