Wednesday, November 16, 2011

Gambler's fallacy

I was listening to ESPN First Take on Monday (podcast [mp3]) and the hosts were debating whether the Falcons should have punted or not on fourth and short in overtime against the Saints. In wrapping up the debate, Jay Crawford said (around minute 32 of the podcast):
"One thing on your [Jon Ritchie's] numbers deal, because I'm a math guy too. They [the Falcons] have gone for it twice earlier, similar situation, you said that there is a 66.1% probability [sic] of picking it up ... Here's why you don't go for it: they've tried it twice, they've made it twice [earlier in the game], it's probability. Because if you're sitting at a blackjack table and you're playing odds, you're playing three times, and the law of your averages tells you, it's simple math if you try it three times you're going to make it twice and miss it once, and that's exactly how it played out."

Jay then apologizes to Skip Bayless, I guess for being too "mathy". He should be sorry not for using math, but for using math poorly.

Saturday, November 12, 2011

OT: sisu

This is an excerpt from "The Finnish Settlement in the Eagle River Area", a memoir written by my grandmother, Elsa Ahola Bloom, who passed away in the fall of '99. Most of the memoir is published in Eagle River, Wisconsin: Its History & People, but this story, perhaps the most personal part of the brief history, was not included in the revised version.

Early every afternoon it was the duty of us younger children to start out looking for the cows and bring them home. We would travel the old road and follow the cow's tracks to whichever field they chose for their pasture for the day. We always loved these long walks and spent many happy hours bringing the cows home. Wild raspberries grew in patches along the road, and strawberries grew wild in the old fields, and we would pick them during the berry season.

When I was six years old they started to build a road to connect Rhinelander to the nearest city to the south, and Eagle River. This road, now State Highway 17, roughly followed the old wagon trail, and when completed, went right past our house and on to Eagle River. The county line, separating Oneida and Vilas County, was about a mile to the south of your home, and that portion of the road to the south was completed about a year before the road past our house was ready. Our cows would still take the old path through the woods but now they would end up on the completed portion of the road and cut off that to the old fields, or they would continue straight through to Camp Six [an abandoned logging camp] to pasture there.

One beautiful afternoon, in late summer, when the raspberries were ripe, I had an experience that I believe helped to mold the pattern of my life. My brother who was two years older than I, and I were walking along the completed portion of the road on our way to get the cows which this time seemed to be going straight along the road to Camp Six. We walked slowly along, pausing now and then to throw rocks at the chipmunks that sat on stumps alongside the road eating raspberries.

We had just rounded a turn in the road when about a quarter of a mile ahead of us we saw a large black bear cross the road. Black bear were scarce in those days, and I had never seen one before and had no idea what it was. My brother, who had seen one once when he stayed one summer at our uncle's farm in Michigan, recognized it for what it was. I was a little afraid to go on, but he assured me it would be gone into the woods long before we got to where it crossed. We continued on our way. As we walked along, I recall my brother telling me about how our uncle and some other men had shot and killed a bear in Michigan. We saw no further sign of the bear and took it for granted he was gone. We got to within a short distance of where we figured he had crossed when about a hundred feet away we saw him on the side of the road where he had stopped to eat some of the wild raspberries that grew alongside the road. He evidently saw or scented us at the same time for he came out of the ditch and out into the road. He got to the center of the road and stood up on his hind legs facing us. We stopped dead in our tracks.

"What can we do?" I whispered to my brother. He told me we must not turn and run because the bear might take after us. After several frantic seconds of speculation, my brother said he believed if we acted like we weren't afraid we could probably scare him off.

"When I say 'go' we will both start yelling at the top of our voices," he said, "and run right at him." I will never forget my terror as I waited for that word "go."

As my brother gave the signal, we started straight for that bear as fast as we could run, our hands waving in the air, and both of us yelling as loud as we could. After a moment of hesitation that bear turned, gave one great leap and went crashing off into the woods. We continued on our way, laughing shakily and agreeing that we had done the only thing we could do. In all the years following we never did see a bear again.

The grass of many years has grown over the grave of my brother, and I never did know what effect our adventure had on him. For me, though, whenever the clouds seem too dark, and the burdens of life too hard to bear, or when I face a seemingly unsurmountable problem, my thoughts travel back through the years and I see once more those two barefooted, terror-stricken children running as fast as they could straight toward what to them was the greatest danger, and I know that I can face whatever comes and win.

Elsa's oldest son and a stroke survivor: "Never give up"

Sunday, November 6, 2011

Symbolic links rock

I've used symbolic links (symlink or soft link) in the past, but recently I've started to realize their potential in two ways.

First, I keep almost all of my files in version control repositories, but I often want to use those files in a project that is not hosted in the repository. With centralized version control I was often copying files between my repo and source trees until I realized I can make a symbolic link between the file in my checked-out repository and where that file belongs in my source tree. Now I can work directly in my source tree and not have to remember to make copies to my repository; I just go to the repository to commit/update, and the symlinks automatically propagate the file data.

Second, when testing an improvement to a program I run an unmodified and modified program using the same input data. Sometimes I have to vary the input data, for example to cover a bunch of test cases or to do random input testing. Managing the input data sets can become tedious. One way to make my life easier is to generate the input data in a single location and make symlinks to the input data for each of my programs. Then a script easily can create input data, run the test programs, archive the input data and results, and repeat.