To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.off-topic.geekOpen lugnet.off-topic.geek in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 Off-Topic / Geek / 4187
4186  |  4188
Subject: 
Re: math question (or pattern... whatever...)
Newsgroups: 
lugnet.off-topic.geek
Date: 
Tue, 4 Mar 2003 00:16:43 GMT
Viewed: 
281 times
  
On Mon, Mar 03, 2003 at 11:37:58PM +0000, David Eaton wrote:
I don't quite get why this works-- if you're doing rand($#bag), won't that
always pick r, r, or w for the 1st value? Hence, theoretically, you could
pick "wb", which isn't in your sample set... on the other hand, you're
increasing the chance that you'll pick "rr" since you can't pick b first,
and are more likely to pick r. I'm amazed either that this works out by luck
to 33%, or that there's some underhanded secret-math-logic as to why this is
an equivalent situation.

doh, you're right :)  Also, I was calculating the chance of getting 2
red marbles, in general, not checking the chance given the first one was
red... :)

That's what you get when you do an experiment, and have an expected
solution in your mind...  you get a bug, but it tells you what you
wanted to know, so you accept it.

For the curious, my original program, after fixed by Dave, returns 16%.

:)

--
Dan Boger
dan@peeron.com



Message is in Reply To:
  Re: math question (or pattern... whatever...)
 
(...) I don't quite get why this works-- if you're doing rand($#bag), won't that always pick r, r, or w for the 1st value? Hence, theoretically, you could pick "wb", which isn't in your sample set... on the other hand, you're increasing the chance (...) (22 years ago, 3-Mar-03, to lugnet.off-topic.geek)

61 Messages in This Thread:




















Entire Thread on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact
    

Custom Search

©2005 LUGNET. All rights reserved. - hosted by steinbruch.info GbR