Monday, August 15, 2016

Computer Baseball

Last week I wrote about Statis Pro Baseball - a game I played growing up. Drawing cards numbered from 11 to 88 determined how a player did in a particular at-bat. A computerized version of this can be used making use of the same randomness as drawing from the deck of shuffled cards.

Let's take one random baseball player. How about Babe Ruth? I was recently in his boyhood home / museum in Baltimore. It is really cool. Anyway, let's take his 1927 season.

 That year, Ruth in 540 at-bats had 95 singles, 29 doubles, 8 triples, and 60 home runs. The percent of each of these types of hits out of 540 at-bats is as follows:

Singles:         17.6%
Doubles:         5.4%
Triples:            1.5%
Home Runs:   11.1%

Now, we could use a random number generator, available on many calculators or on-line and simulate any number of at-bats. Adding together the above percentages and change them to numbers from zero to a thousand, we get the following:

Singles from 0 to 176
Doubles from 177 to 230
Triples from 231 to 245
Home Runs 246 to 356
Everything 357 and above will be an out

Running the random generator for twenty numbers and giving the results:

791 - Out
365 - Out
258 - Home Run
320 - Home Run
494 - Out
75   - Single
929 - Out
842 - Out
461 - Out
536 - Out
210 - Double
388 - Out
836 - Out
914 - Out
214 - Double
812 - Out
509 - Out
978 - Out
955 - Out

20 At bats, 1 Single, 2 Doubles, 0 Triples, 2 Home Runs

Actually, a little sub-par for the Babe. I'll spare you all the numbers, but I did it two more times just for fun, and here are the results.

20 At bats, 0 Singles, 3 Doubles, 0 Triples, 4 Home Runs

20 At bats, 3 Singles, 3 Doubles, 0 Triples, 2 Home Runs

I think this is a pretty good Algebra I application covering ratios and to get them thinking about the law of large numbers