GolfHos

General => The Cantina => Topic started by: Uisce Beatha on February 11, 2008, 07:25:21 AM



Title: [sm_scratch]
Post by: Uisce Beatha on February 11, 2008, 07:25:21 AM
My wife and I were discussing the odds of pulling four blue and one green M&Ms out of the bag twice in a row.  Blah, blah, blah... so on and so forth.  Then she brings, "I don't like blue ones."

[sm_banghead]


Title: Re: [sm_scratch]
Post by: stroh on February 11, 2008, 08:09:00 AM
LOL.  That's good stuff.

Peanut?



Title: Re: [sm_scratch]
Post by: Uisce Beatha on February 11, 2008, 08:16:11 AM

Peanut?


Absolutely.  The plain ones suck.   ;)


Title: Re: [sm_scratch]
Post by: spacey on February 11, 2008, 08:20:26 AM
Van Halen surrenders.


Title: Re: [sm_scratch]
Post by: stroh on February 11, 2008, 08:25:19 AM
Where does she stand on the green ones?  [sm_naughty]


Title: Re: [sm_scratch]
Post by: Aske on February 11, 2008, 08:28:35 AM
goddamit, now im going to get to work and try to figure out those odds



what size is the bag?
what amount of the bag is eaten before you start this 'trial' ?


Title: Re: [sm_scratch]
Post by: gleek on February 11, 2008, 08:31:07 AM
goddamit, now im going to get to work and try to figure out those odds


If the bag contains only 4 blue ones and 1 green one, I'd say the odds are 1 : 1.


Title: Re: [sm_scratch]
Post by: Aske on February 11, 2008, 08:32:42 AM
goddamit, now im going to get to work and try to figure out those odds


If the bag contains only 4 blue ones and 1 green one, I'd say the odds are 1 : 1.

if the bag contains 5 total and the 'odds' to be calculated are pulling  4b:1g    2x in a row   I think the odds are 0  [sm_disgust] [sm_devil] 

see O.P. more closely.  [sm_devil]


Title: Re: [sm_scratch]
Post by: Clive on February 11, 2008, 08:34:30 AM
Did she pull them out of the bag before or after the fumble was recovered by a player from Team A, who then voluntarily ran into his own end zone and was tackled?


Title: Re: [sm_scratch]
Post by: Uisce Beatha on February 11, 2008, 08:36:33 AM
goddamit, now im going to get to work and try to figure out those odds



what size is the bag?
what amount of the bag is eaten before you start this 'trial' ?

Hell if I know.  Not the great big one but not the normal "candy bar" size either. 

Bag was 1/3 gone.

We didn't start the trial.  It just sorta happened to us.  Like rain or sour milk.


Title: Re: [sm_scratch]
Post by: gleek on February 11, 2008, 08:37:22 AM
goddamit, now im going to get to work and try to figure out those odds


If the bag contains only 4 blue ones and 1 green one, I'd say the odds are 1 : 1.

if the bag contains 5 total and the 'odds' to be calculated are pulling  4b:1g    2x in a row   I think the odds are 0

Not if you put the M&Ms back in the bag.


Title: Re: [sm_scratch]
Post by: Aske on February 11, 2008, 08:38:02 AM
goddamit, now im going to get to work and try to figure out those odds


If the bag contains only 4 blue ones and 1 green one, I'd say the odds are 1 : 1.

if the bag contains 5 total and the 'odds' to be calculated are pulling  4b:1g    2x in a row   I think the odds are 0

Not if you put the M&Ms back in the bag.

 [sm_shock]  i like it.


Title: Re: [sm_scratch]
Post by: Uisce Beatha on February 11, 2008, 08:39:35 AM
Nobody ever puts them back in the bag.   :hungry:


Title: Re: [sm_scratch]
Post by: gleek on February 11, 2008, 08:43:52 AM
goddamit, now im going to get to work and try to figure out those odds


If the bag contains only 4 blue ones and 1 green one, I'd say the odds are 1 : 1.

if the bag contains 5 total and the 'odds' to be calculated are pulling  4b:1g    2x in a row   I think the odds are 0

Not if you put the M&Ms back in the bag.

 [sm_shock]  i like it.


Even if the 5 pieces weren't the only ones left, you'd still have to put them back into to calculate the odds of doing it twice in a row. Otherwise, the 1 green could have been the last one that was left in the bag, in which case your probability of doing it a 2nd time is zero.


Title: Re: [sm_scratch]
Post by: Aske on February 11, 2008, 08:47:26 AM
see, i dont see it that way, i was just going with the time evolution (time being pieces left in bag at event sample) of the probability of snagging 4:1

(and yes, i was going to write a program to do this)
 [sm_devil]


Title: Re: [sm_scratch]
Post by: Uisce Beatha on February 11, 2008, 08:54:25 AM
see, i dont see it that way, i was just going with the time evolution (time being pieces left in bag at event sample) of the probability of snagging 4:1

(and yes, i was going to write a program to do this)
 [sm_devil]

Once you get this sorted let me know.  My wife will think I'm wicked smart when I tell her I figured it out myself.   [sm_devil]

Well, probably not.  She'll say, "why were you wasting time on that when the basement needs framed?"   :sad3:


Title: Re: [sm_scratch]
Post by: stroh on February 11, 2008, 08:54:29 AM
LOL This thread rocks.


Title: Re: [sm_scratch]
Post by: gleek on February 11, 2008, 09:21:51 AM
see, i dont see it that way, i was just going with the time evolution (time being pieces left in bag at event sample) of the probability of snagging 4:1

(and yes, i was going to write a program to do this)
 [sm_devil]

What kind of assumptions did you intend to make about the population size and color distribution? If it's not a matter of pulling 5 pieces from the same population on two seperate occasions (i.e. putting what you pulled out back into the population), at minimum, you'd have to assume that there are at least 8 blue ones in the bag (as well as 8 green ones, if assuming even distribution). Then it's a matter of assuming how many non-blue/green pieces are in the bag as well.

According to this web page (http://www.answerbag.com/q_view/131240), there are 6 colors in a standard bag.

So, I think a reasonable method would be this:

Calculate the probability of pulling 4b1g (stroh will like this terminology ;D) from a population of:

8 blue
8 green
32 other

And then multiply that by the probability of pulling 4b1g from a poulation of:
4 blue
7 green
32 other



Title: Re: [sm_scratch]
Post by: Aske on February 11, 2008, 09:34:33 AM
I was going by creating a bag with 1.2k pieces, 6 colors each, with a target* random seed of 200 each (but with the seeding to allow variance {hence randomness} around the 200pc ideal stating point per color.  Then run statistics on emptying the bag, probably 1000 times.  Then shape the statistics down to the normal bag size which is (undetermined yet) but probably 300 pieces? There would be no putbacks



Title: Re: [sm_scratch]
Post by: Aske on February 11, 2008, 09:36:45 AM
see, i dont see it that way, i was just going with the time evolution (time being pieces left in bag at event sample) of the probability of snagging 4:1

(and yes, i was going to write a program to do this)
 [sm_devil]

Once you get this sorted let me know.  My wife will think I'm wicked smart when I tell her I figured it out myself.   [sm_devil]

Well, probably not.  She'll say, "why were you wasting time on that when the basement needs framed?"   :sad3:

hell no I'm not letting you take the credit


Title: Re: [sm_scratch]
Post by: Aske on February 11, 2008, 09:44:04 AM

Peanut?


Absolutely.  The plain ones suck.   ;)

btw,  peanut m+m's  suck.   worst peanuts ever.
 [sm_disgust]


Title: Re: [sm_scratch]
Post by: stroh on February 11, 2008, 09:47:57 AM
*fiddlesticks* this.  I've had it with you guys' bull*feces* voo doo economics smoke and mirrors astrophysics.

The equation/answer is painfully simple.  The odds are 50/50.  Either an event occurs, or it does not.

Kind of like Whiskers' take on rule infractions.

Toss a quarter 50 times, 50th time, blah blah.

Now go get Daddy a beer.   ;D


Title: Re: [sm_scratch]
Post by: stroh on February 11, 2008, 09:49:26 AM

Peanut?


Absolutely.  The plain ones suck.   ;)

btw,  peanut m+m's  suck.   worst peanuts ever.
 [sm_disgust]

Kinda like that joke about going to the old folks home, and the sees a bowl of peanuts.......


Title: Re: [sm_scratch]
Post by: Uisce Beatha on February 11, 2008, 09:50:39 AM
see, i dont see it that way, i was just going with the time evolution (time being pieces left in bag at event sample) of the probability of snagging 4:1

(and yes, i was going to write a program to do this)
 [sm_devil]

Once you get this sorted let me know.  My wife will think I'm wicked smart when I tell her I figured it out myself.   [sm_devil]

Well, probably not.  She'll say, "why were you wasting time on that when the basement needs framed?"   :sad3:

hell no I'm not letting you take the credit


Some wingman you are.  ::)


Title: Re: [sm_scratch]
Post by: Uisce Beatha on February 11, 2008, 09:52:30 AM

Peanut?


Absolutely.  The plain ones suck.   ;)

btw,  peanut m+m's  suck.   worst peanuts ever.
 [sm_disgust]

Coffee, beer and spices.  Other than those who gives a *feces*.  Good enough I say. 


Title: Re: [sm_scratch]
Post by: Aske on February 11, 2008, 09:55:38 AM
*fiddlesticks* this.  I've had it with you guys' bull*feces* voo doo economics smoke and mirrors astrophysics.

The equation/answer is painfully simple.  The odds are 50/50.  Either an event occurs, or it does not.

Kind of like Whiskers' take on rule infractions.

Toss a quarter 50 times, 50th time, blah blah.

Now go get Daddy a beer.   ;D



ok.
the 'event' : stroh has  $3M in cash in his wallet.  odds  50:50
if he does, he can keep it.
if he doesn't, he gives $3M to me.
 [sm_devil]


Title: Re: [sm_scratch]
Post by: Aske on February 11, 2008, 09:56:12 AM
see, i dont see it that way, i was just going with the time evolution (time being pieces left in bag at event sample) of the probability of snagging 4:1

(and yes, i was going to write a program to do this)
 [sm_devil]

Once you get this sorted let me know.  My wife will think I'm wicked smart when I tell her I figured it out myself.   [sm_devil]

Well, probably not.  She'll say, "why were you wasting time on that when the basement needs framed?"   :sad3:

hell no I'm not letting you take the credit


Some wingman you are.  ::)

ok,  fine, you can take the credit, but it will cost you.

ps,  I doubt i'll get to this until mid/late week  [sm_shock] [sm_devil]


Title: Re: [sm_scratch]
Post by: gleek on February 11, 2008, 10:02:54 AM
see, i dont see it that way, i was just going with the time evolution (time being pieces left in bag at event sample) of the probability of snagging 4:1

(and yes, i was going to write a program to do this)
 [sm_devil]

Once you get this sorted let me know.  My wife will think I'm wicked smart when I tell her I figured it out myself.   [sm_devil]

Well, probably not.  She'll say, "why were you wasting time on that when the basement needs framed?"   :sad3:

hell no I'm not letting you take the credit


Some wingman you are.  ::)

ok,  fine, you can take the credit, but it will cost you.

ps,  I doubt i'll get to this until mid/late week  [sm_shock] [sm_devil]

Why? Are you going to run this simulation on a 8088?


Title: Re: [sm_scratch]
Post by: stroh on February 11, 2008, 10:07:53 AM
LOL   [sm_laughing]


And Tom Cruise Surrenders.


Title: Re: [sm_scratch]
Post by: Aske on February 11, 2008, 10:08:08 AM
see, i dont see it that way, i was just going with the time evolution (time being pieces left in bag at event sample) of the probability of snagging 4:1

(and yes, i was going to write a program to do this)
 [sm_devil]

Once you get this sorted let me know.  My wife will think I'm wicked smart when I tell her I figured it out myself.   [sm_devil]

Well, probably not.  She'll say, "why were you wasting time on that when the basement needs framed?"   :sad3:

hell no I'm not letting you take the credit


Some wingman you are.  ::)

ok,  fine, you can take the credit, but it will cost you.

ps,  I doubt i'll get to this until mid/late week  [sm_shock] [sm_devil]

Why? Are you going to run this simulation on a 8088?

lol.  i just doubt i'll have time to write the code until thursday


Title: Re: [sm_scratch]
Post by: Clive on February 11, 2008, 10:48:47 AM
Golfhos: sucking the fun out of everyday events since, I don't know, September-ish 2006.


Title: Re: [sm_scratch]
Post by: twoiron on February 11, 2008, 12:48:18 PM
Women, can't live 'em..... pass the beer nuts..


Title: Re: [sm_scratch]
Post by: Aske on February 11, 2008, 02:01:46 PM
so I had a brief lull in work and sat down working on a program.  i'll post some stats in a minute.  I have no idea how good they are yet (didn't use a great random # generator, etc)  [sm_shock] [sm_shock]

just as an interesting effect from a debugging ;) run.....

if you run 100,000 300-pc bags, with the 1st 10 fixed (in order),  it only seems to happen additionally {beyond the fixed 1st 10 chain) in 12 bags on average (based on 5 runs) using the 6th-10th m+ms as seeds.  that's 12/100,000 with the 5pc seed to start the chain!  (in a 300 m+m bag!!!) , and not at all past that seeding.


this seems like it should be a staggeringly unlikely event in a small size bag  with a truly random distribution of pieces.
(as random intuition would seem to dictate)




Title: Re: [sm_scratch]
Post by: Aske on February 11, 2008, 02:12:17 PM
so, main experiment:

initial conditions:
individual bag samples of 300 pieces each (theoretically averaging 50pcs/color) over many many bags with random distributions allowed

2,500,000 bags sampled in total

4b,1g,4b,1g  in that order... 
almost never happens-   6 instances counted out of the  2.5 M bags  (next step, write a flag to see if it ever happens more than 1x/bag.. too lazy this time around)    that is 0.00024%  or of course about 1/416,667 bags
 
blue avg/bag observed : 50.005
green avg/bag observed : 50.002



if you increase the bag size to 1000pcs it seems to happen a bit more frequently
(more detailed stats tomorrow, this is considerably slower to run)





interesting average probabilities of just getting a 4b1g  chain anywhere in a bag of 300 pieces: 0.0382988



 :glasses:


Title: Re: [sm_scratch]
Post by: Aske on February 11, 2008, 02:25:41 PM
with 500,000 1200-pc bags:
(3 run average)

green/bag:  200.0012
blue/bag:  199.9879


4b1g4b1g  chains: 4   (1/125,000 bags)
4x the pieces/bag, and only 3.33 times more likely the occurrence ?  i think i need a better random # generator, or more runs.
meh.


4b1g  chains:  0.153566   (4.04 times the # in the 300pc bag)



Title: Re: [sm_scratch]
Post by: Clive on February 11, 2008, 02:31:05 PM
Thanks for that.

Now Blader can die.


Title: Re: [sm_scratch]
Post by: Aske on February 11, 2008, 02:36:48 PM
LOL.

cranking out 1 last big run for the day out of curiosity while I write a paper draft ...

2.5M bags of 1800 pieces each.
 [sm_shock]


Title: Re: [sm_scratch]
Post by: Uisce Beatha on February 11, 2008, 02:58:24 PM

Now Blader can die.

I'll pray for his immortal soul.


Title: Re: [sm_scratch]
Post by: Aske on February 11, 2008, 03:13:11 PM
2.5M bags of 1800 pcs each.
(1 run only)


greens: 300.0040
blues:  300.0108


4b1g4b1g  chains/bag: .0000276   (or 1 per ever 36230  bags)
4b1g  chains/bag: 0.230666  (almost 1 per 4 bags ! )






Title: Re: [sm_scratch]
Post by: Uisce Beatha on February 11, 2008, 03:41:10 PM
Unpossible.  We haven't consumed remotely close to 36230 bags.


Title: Re: [sm_scratch]
Post by: Aske on February 11, 2008, 03:45:20 PM
decreasing the bag size to 50 pieces with 10,000,000 bags generates results of  1 occurrence per 1.25M bags of the 4b1g4b1g  chain.  :o


Title: Re: [sm_scratch]
Post by: Aske on February 11, 2008, 03:46:36 PM
Unpossible.  We haven't consumed remotely close to 36230 bags.

Is it possible the color distribution in the bag is weighted towards  b+g ?
Is it possible my random # generator being used sucks ?
Is it possible you're very lucky?
 :)



Title: Re: [sm_scratch]
Post by: Uisce Beatha on February 11, 2008, 03:50:10 PM
(http://www.foureyesjokeshop.com/ProductImages/Lucky_Leprechaun_Costume.jpg)


Title: Re: [sm_scratch]
Post by: Aske on February 11, 2008, 03:50:49 PM
Unpossible.  We haven't consumed remotely close to 36230 bags.

further, it doesn't mean you need to eat 36320 to get 1 occurrence.  it means if you want to get say 100 occurences , on average, over time,  you'd need to eat 100* 36230  bags  (+/-  some variance)


Title: Re: [sm_scratch]
Post by: tdcoly on February 11, 2008, 03:51:21 PM
Unpossible.  We haven't consumed remotely close to 36230 bags.

Is it possible the color distribution in the bag is weighted towards  b+g ?
Is it possible my random # generator being used sucks ?
Is it possible you're very lucky?
 :)



Looks like somebody has way too much time on his hands. ;D


Title: Re: [sm_scratch]
Post by: Uisce Beatha on February 11, 2008, 03:52:05 PM
Unpossible.  We haven't consumed remotely close to 36230 bags.

further, it doesn't mean you need to eat 36320 to get 1 occurrence.  it means if you want to get say 100 occurences , on average, over time,  you'd need to eat 100* 36230  bags  (+/-  some variance)


I understand.  I was going FTW.   ;)


Title: Re: [sm_scratch]
Post by: Aske on February 11, 2008, 03:52:28 PM
Unpossible.  We haven't consumed remotely close to 36230 bags.

further, it doesn't mean you need to eat 36320 to get 1 occurrence.  it means if you want to get say 100 occurences , on average, over time,  you'd need to eat 100* 36230  bags  (+/-  some variance)


I understand.  I was going FTW.   ;)


 [sm_shock] :'( :-X :-[


Title: Re: [sm_scratch]
Post by: Aske on February 11, 2008, 03:54:16 PM
oh dear god, i just re-read the problem carefully and realized i was OVER-constraining it.

i was doing it in strict chain order  B-B-B-B-G-B-B-B-B-G

you meant:  sampel of 5 in any order , with 4 blue and 1 green,   repeat.  didn't you.
 [sm_shock] :sad3:



grrrrrrrrrrrr


Title: Re: [sm_scratch]
Post by: Aske on February 11, 2008, 03:55:24 PM
oh dear god, i just re-read the problem carefully and realized i was OVER-constraining it.

i was doing it in strict chain order  B-B-B-B-G-B-B-B-B-G

you meant:  sampel of 5 in any order , with 4 blue and 1 green,   repeat.  didn't you.
 [sm_shock] :sad3:



grrrrrrrrrrrr





if so,  i'll fix it tomorrow.  the odds will go WAY up.


Title: Re: [sm_scratch]
Post by: Uisce Beatha on February 11, 2008, 03:55:40 PM
oh dear god, i just re-read the problem carefully and realized i was OVER-constraining it.

i was doing it in strict chain order  B-B-B-B-G-B-B-B-B-G

you meant:  sampel of 5 in any order , with 4 blue and 1 green,   repeat.  didn't you.
 [sm_shock] :sad3:



grrrrrrrrrrrr


Yes.  Please redo the problem and have it on my desk by morning.   [sm_devil]

:fear:


Title: Re: [sm_scratch]
Post by: stroh on February 11, 2008, 04:32:16 PM
LOL

So Aske, you didn't tell it that's is ok to draw:

GBBBB
BGBBB
BBGBB
BBBGB

?


Title: Re: [sm_scratch]
Post by: Aske on February 11, 2008, 04:38:18 PM
LOL

So Aske, you didn't tell it that's is ok to draw:

GBBBB
BGBBB
BBGBB
BBBGB

?


LOL,  no,  i read WAY too much into  UB's  initial post (too literal)

no matter, revising my program will be simple overnight (the broader problem is actually far easier to code!)  ... AND...  we now have the answer to the far harder problem .
 [sm_devil]


Title: Re: [sm_scratch]
Post by: stroh on February 11, 2008, 04:56:55 PM
Let's also not gloss over, and grant a free pass on several other pressing issues.

I think seldom does the question get asked enough, that is 5 M&M's an acceptable serving?  Was this a grab, or a pour?  It does matter.

And I'm not sure I like your usage of pluralizing M&Ms in your query.  The candy it self is an M&M.  Collectively, more than one piece are M&M's.

Unless of course they could mean the possessive of the candy belonging to Messrs Mars and Murrie.

i.e. four blue and one green Mars and Murries' is sis is candy.

I sincerely doubt the latter.


Title: Re: [sm_scratch]
Post by: Uisce Beatha on February 11, 2008, 05:40:32 PM
Clowns to the north of me.  Jokers too. 


Title: Re: [sm_scratch]
Post by: dystopia on February 11, 2008, 06:10:24 PM

And I'm not sure I like your usage of pluralizing M&Ms in your query.  The candy it self is an M&M.  Collectively, more than one piece are M&M's.


I vote for M&Ms over M&M's.  But then again, I could easily be convinced otherwise. I'm kind of like the Rolfe of Grammar Nazis.

(http://bp1.blogger.com/_FW86_jO7k_A/RqQI9YFq7XI/AAAAAAAAKCo/ruYd73NArDM/s400/32.gif)
Rolfe: Not another move! Or I’ll shoot!
Captain: You’re only a boy. You don’t really belong to them.
Rolfe: Stay where you are.
Captain: Come away with us. Before it’s too late.
Rolfe: Not another step. I’ll kill you.
Captain: You give that to me, Rolfe.
Rolfe: Do you hear me? I’ll kill you.
Captain: Rolfe! You will never be one of them.
(http://bp3.blogger.com/_FW86_jO7k_A/RqQI94Fq7YI/AAAAAAAAKCw/BVxafEZCtwQ/s400/33.gif)


Title: Re: [sm_scratch]
Post by: Spanky on February 11, 2008, 06:40:13 PM
Where in the world can you get a PhD all fired up about calculating the odds of pulling out a certain colored M&M from a bag that he created a program to calculate it, then realize he didn't give the program the right variable that he will fix it the next day?

Bet your looking at that diploma feeling real proud right about now.

Why don't you calculate the odds of people understanding what is going to happen to their 2008 tax return with this prebate check.


Title: Re: [sm_scratch]
Post by: Clive on February 11, 2008, 06:42:23 PM
(http://adweek.blogs.com/photos/uncategorized/mm_1.jpg)

So long, farewell, auf wiedersehen, good night,
I hate to go and leave this nerdy thread.
So long, farewell, auf wiedersehen, adieu,
Four blue, a green, no yellow, brown or red.


Title: Re: [sm_scratch]
Post by: stroh on February 11, 2008, 06:43:26 PM
Where in the world can you get a PhD all fired up about calculating the odds of pulling out a certain colored M&M from a bag that he created a program to calculate it, then realize he didn't give the program the right variable that he will fix it the next day?


GolfHos kicks ass!



Title: Re: [sm_scratch]
Post by: Aske on February 11, 2008, 06:43:46 PM

Bet your looking at that diploma feeling real proud right about now.


 :sad3:   i never said i was that great at reading statistics problems.  :sad3: :'(


Title: Re: [sm_scratch]
Post by: Spanky on February 11, 2008, 06:48:27 PM

Bet your looking at that diploma feeling real proud right about now.


 :sad3:   i never said i was that great at reading statistics problems.  :sad3: :'(
Just razzin ya a little. I've been doing a little drinkin and feeling a little froggy.

(http://www.norcalblogs.com/bullfight/archives/kermit-thumb.jpg)


Title: Re: [sm_scratch]
Post by: Salamander on February 11, 2008, 07:27:32 PM
holy crap.


Title: Re: [sm_scratch]
Post by: E-A-G-L-E! on February 11, 2008, 07:45:30 PM
Unpossible.  We haven't consumed remotely close to 36230 bags.

Is it possible the color distribution in the bag is weighted towards  b+g ?
Is it possible my random # generator being used sucks ?
Is it possible you're very lucky?
 :)



Looks like somebody has way too much time on his hands. ;D


Well he did say

Quote
so I had a brief lull in work ...


Title: Re: [sm_scratch]
Post by: spacey on February 11, 2008, 08:49:13 PM
holy crap.
Indeed.