Friday, March 20, 2009

More Stats




Happee Spring! Wat kynde ov flowahs r doz in da cowntdown box? Zno drops?

Tyme foah dais week's poozle. TcT, Ize am sorree dat Ize can't zeem tah wrap mye mind aroond da solooshun tah Millie da Millipede's sox problem, maybee u cayne teyell us da anzer?

Za u wryte ten letters, and wryte owd ten envelopes. Denn u playz da letters in da envelopes at random. Ow many letters awn avridge wud end upe in da ryet envelopes?

12 comments:

Tobee 'n DeeDee said...

What are we going to count down now? Days until summer?

BuBe said...

yes, let's count down to summer solstice 2009 june 21, but let's not rush it as then the days start to get shorter again :(

am thinking those are Lee's snowdrops from an earlier posting, and am thinking Lee was the first to post first sign of spring. and the last!

speaking of stats, how is smobriety going, and how is your jogging progressing? Mostly, how do you maintain such good discipline?!! I just finished a bowl of icecream - a rare occassion for me, and it was good, but not that good, and it made me think I really really need to focus on moving my body. am such a slug!

Tobee 'n DeeDee said...

Smobriety is going good, the stats for that is:
---
1y 2m 1w 22:43 smoke-free, 8,658 cigs not smoked, $3,030.30 saved, 4w 2d 1:30 life saved

Of course, i don't really have that much money saved, although I wish I did!

Jogging has gone back to wogging. I started jogging outside this week, and am finding it a a lot harder than doing it on a treadmill. I think it is the hills. So right now I am alternating jogging 2/10 of a mile and walking 2/10 of a mile.

My discipline comes from wanting to be healthy. My dad had type II diabetes, and I don't want to follow in his footsteps. I try to eat healthy too, but once in a while I have some chocolate. That is my vice!

BuBe said...

you go, Girl!

Tinyc Tim said...

The answer to the envelope / letter puzzle is 1.

What if you had just 2 envelopes, 2 letters?

E1 L1 E2 L2 2 correct
E1 L2 E2 L1 0 correct

So, out of the 2 "stuffings," there are 2 correctly addressed letters. This makes an average of 2/2 = 1 correctly addressed letters.

Try 3 envelopes, 3 letters.

E1 L1 E2 L2 E3 L3 3 correct
E1 L1 E2 L3 E3 L2 1 correct
E1 L2 E2 L1 E3 L3 1 correct
E1 L2 E2 L3 E3 L1 0 correct
E1 L3 E2 L1 E3 L2 0 correct
E1 L3 E2 L2 E3 L1 1 correct

So, out of the 6 "stuffings," there are 6 correctly addressed letters. This makes an average of 6/6 = 1 correctly addressed letters.

If you carefully do the 4 envelope / 4 letter case, you find 24 correctly addressed letters out of 24 "stuffings."

I wrote envlet.tc to simulate the 10 envelope / 10 letter case. I did about 5 runs each of which stuffed 15000 sets of 10 envelopes and 10 letters. Output at envlet.out. The results showed values very close to 1 for each run.

Very interesting problem DeeDee. The letter from Joe Shmoe to Tobee now joins the ranks of the 23 other images on our translator page.

As for Millie the Millipede, the answer is you need at least 2999 socks to guarantee she'll have 2 "pair." In general, for a creature with F feet, you need 3*F-1 socks to be guaranteed 2 "pair." For huminds, 3*2-1=6-1=5. For kitehs, 3*4-1=11. For spidees, 3*8-1=24-1=23. Minnie would need 3*1000-1=2999.

This formula makes sense if you think about it. The worst possible case for spidee would go something like this:

BBBBBBBB (8)
WWWWWWW (7)
BBBBBBB (7)

That's 8 + 7 + 7 = 22

The next sock (either a W or a B) would make the 2nd pair.

I'm still working on trying to figure out what the average number of socks you end up pulling to get 2 "pair." For huminds, the answer is 4.5. Here's why:

Here are all the 4 sock combinations that fail to give you the needed 2 pair:

WBBB
WWWB
BBBW
BWBB
WBWW
BWWW
WWBW
BBWB

There are 2^4 = 16 different 4 sock combinations. So the probability you fail to get your 2 pair by pulling 4 socks is 8/16 = 1/2. So the probability you do get 2 pair by pulling 4 socks is 1 - 1/2 = 1/2. Clearly you'll get your 2nd pair by pulling just one more sock.

Expected value (average) =

4*1/2 + 5*(1-1/2)*(1) = 9/2 = 4.5

If you're still with me, yes, the Spring flowers are the Snow Drops I photographed early on when they first emerged.

Great idea to count down to the Summer Solstice. Stay tuned.

Congrat's DeeDee on your wogging and smobriety. BuBe's right. Your reasons for doing these things are good ones.

 

Tobee 'n DeeDee said...

Tanx for the sox update. You are hereby ofishilee named the Sox Mastah.

You nailed this one too, of course. One letter is correct. The other numbers are interesting also.

BuBe said...

i take absolutely no credit for this, but when I read the envelope problem for the first time, without any calculating via BuBe method or any other method, my very first thought was "One" but second guessed myself and figured I was wrong, so never answered.

i almost understand the milli-socks explanation, too, and will reread at some point. thanks for all that, TcT! I agree you are the sox mastah, and pretty good at stuffing envelopes stats, too. :)

Tinyc Tim said...

You know what they say. It's often a good idea to go with your first answer to a problem. Once again, your natural insight into complex things shines thru.

Tinyc Tim said...

Tanc u DeeDee foah mye nu title ov Sox Mastah. Ize luk fourward tah da day whin Ize hav alzo earned da title ov Onvellope / Lettah Mastah. Tah dat end, Ize hav upgraded mye envlet.tc prograym tah fix a bug, korrektlee spel certain wurds and tah ad a nu feature dat tells u ow offden u gotz da machaz.

Translation by http://primepuzzle.com/blog/jspeek.html using a 1507 word dictionary.

envlet.tc - 3/22/9 - tct

seed (e.g. 315) 4221

number of simulations (e.g. 1, 100, 200, 2000, 15000 etc.) 30000

on average, 0.9961 onvellopes wur korrektlee stuffid.

total matches: 29884

0 matches: 11131 0*11131=0
1 matches: 10983 1*10983=10983
2 matches: 5463 2*5463=10926
3 matches: 1837 3*1837=5511
4 matches: 481 4*481=1924
5 matches: 90 5*90=450
6 matches: 15 6*15=90
7 matches: 0 7*0=0
8 matches: 0 8*0=0
9 matches: 0 9*0=0
10 matches: 0 10*0=0

tc>

Tobee 'n DeeDee said...

Can you explain the output for the envlet program a yittle more? What is a seed? And what do all of the numbers mean after the matches?

Tinyc Tim said...

envlet.html

envlet.tc - 3/22/9 - tct

A "seed" is a number which is "fed" to a random number generator to start it off. Its purpose is to "prime" the "pump." Different seeds cause the generator to generate different sequences of random numbers. This in turn causes programs that use random numbers to produce different results each time they are run.

seed (e.g. 315) 4221

number of simulations (e.g. 1, 100, 200, 2000, 15000 etc.) 30000

on average, 0.9961 onvellopes wur korrektlee stuffid.

total matches: 29884

The "matches" numbers below are telling you how many times 0 envelopes got stuffed correctly, how many times 1 envelope got stuffed correctly, etc. The products are simply telling you the total number of letters that got correctly stuffed for each case (0, 1, 2 etc.) You can see the 0 thru 2 matches cases are way more common than any of the others.

0 matches: 11131 0*11131=0
1 matches: 10983 1*10983=10983
2 matches: 5463 2*5463=10926
3 matches: 1837 3*1837=5511
4 matches: 481 4*481=1924
5 matches: 90 5*90=450
6 matches: 15 6*15=90
7 matches: 0 7*0=0
8 matches: 0 8*0=0
9 matches: 0 9*0=0
10 matches: 0 10*0=0

tc>
 

Tinyc Tim said...

I realize this may be beating a dead horse, but your question has motivated me to change the program again in several ways. Besides making it slightly more efficient, I've changed the way it reports its output. You may see the new output format and my explanation by visiting envlet.html