Monday, July 14, 2008

On a totally separate note

This post goes out to any statisticians out there. I don't care what people say, I think you guys are interesting, exciting to talk to, and good at making decisions when faced with ambiguity.

BRK did his Bingo today (the "today" that I wrote this, not the "today" as you sit here reading). I didn't participate, but was lurking. I'll give him credit for coming up with a fun, random event, which is especially important as the whole WoW community is off speculating about new talents in WotLK.

Aside: I love when people see new talents that may or may not be what's released in the xpac. They see a new 51 point talent and drool ZOMG this is so OP. Yeah, if everybody else stayed at their 41 point talents, then sure, that such and such talent would dominate. But we're all getting 51 point talents. Go back to sleep.

Bored in my cubicle, I decided to play with the bingo thing, and so I made a little Excel spreadsheet that will randomly generate a Bingo sheet according to his rules.

Basic rules: generate 25 pairs of X,Y where X=(White,Green,Blue,Purple) and Y=(Head,Shoulders,Necklace,Cape,Chest,Bracers,Hands,Waist,Leggings,Boots,Ring,Trinket,1H,2H), and no duplicate pairs of X,Y are allowed in your 25 pairs.

So easy peasy job to make a spreadsheet to pick a random number from 1-4 to choose a color, and another number from 1-14 to pick a slot. Easy enough to copy and paste this formula 25 times in a Bingo-like grid.

The tricky part was the "no duplicate pairs". Seeing as how I started this little exercise at 10:00am and, although I wasn't planning to submit an entry, I still wanted to adhere to BRK's 11:00am deadline, just for the sake of seeing if I could do it.

So I quickly ruled out any VB scripting or using Excel's Solver tool, which would be perfect for this, but not quite enough time. (lol, after the fact, I did use Solver, and all it did was optimize by making a full set of Purple gear, followed by a near full set of Blue gear. True, its a legit bingo card, but not very fun).

I settled for some tricky hidden cells that allow me to easily conditionally format any dupliate entries. Supposedly Excel 2007 has this built in since its so common (the dupe part, not the condy formatting, that's been there forever). But not '03, which is what I was on.

Ok, cool. Hit F9 and a new bingo card generates. Any duplicate entries highlight red. Hit F9 a few times, watch as it regenerates and watch a different 2, or 3, or 4 cells turn red each time.

Hit F9 a few more times. Always at least two identical entries.

That's when I got to thinking statistics. I wonder what the odds are that you'll get 25 unique pairs?

My days of Discrete Math in college are long gone, and with all the brain cells I've killed since then, so is my ability to figure this stuff out.

Suffice it to say, the chances are low, because I spent the next 30 minutes clicking F9. Yes, yes, my job has its boring moments where I can kinda zone out, hence this blog, and hence 40 minutes of F9'ing.

I wasn't rapid firing too much, because there's no "back button" in this little calculator, so if you get a solution, and accidentally hit F9 again, poof, gone like Kaiser Sose.

I finally did get a solution, no duplicates, about 5 minutes after BRK started his little thingie.

Then I tried to figure it out to see if I was lucky to have actually gotten a solution, unlucky in that a problem with a very common solution just randomly took me a large number of tries, or if I'm just so bored with work that I'd rather be killing ogres for the painfully slow Kuranei reputation grind, which I basically refuse to do.

To start off, there's 4*14=56 possible (Color,Slot) pairs

So, if you want to create a bingo board with no dupes, pretend that those 56 items are actually marbles in a sac. If no dupes are allowed, then you have 56*55*54*......*31 = YYYYYYY possible no-dupe boards.

But how many boards could you create if you wanted to allow dupes? 56*56*56*56*.....*56 = 56^25 = A HUGE NUMBER

So, if I could do this here math, i'd then divide (YYYYYYY) / (A HUGE NUMBER) = (30 MINUTES OF PRESSING F9)

There you have it.

If you're reading this and it says stuff like YYYYYYY and A HUGE NUMBER, then that means I left work without solving the problem, and then just posted it without trying to figure this out on my own time. But I gotta go pick up the kid, and my timesheet is due, and I'm trying to figure out where to bill 30 minutes of pressing F9.

1 comment:

Loronar said...

Statistics was never something I'm good at. =/ I've never had to take it in college either so far, so I'm hoping I won't need it when I work...