Simulating the Batter

"In all these simulations," continued Roscoe, "you need to devise a sort of random number generator."

"Well," I said, "what devices did you have at your disposal?"

"Not much," responded Roscoe. "All we had were three identical dice of the usual variety, with one to six spots on each. Still, I figured it would be easy to simulate probabilities with them, because that was really what we needed to do. We decided that the simplest thing to do was roll the three dice simultaneously, add up the number of spots, and use that total to determine success or failure."

"Probabilities? I'm not sure I understand," I said.

"Sure, probabilities! That's how the fantasy baseball concept works. For example, assume you have a hitter at the plate with a batting average of .250. At the lowest level of sophistication (forget, for a minute, about walks) we need a way of randomly deciding if he gets a hit for this at-bat, so we need to create a random event that has a probability of occurring 250 times out of 1,000." I had never known Roscoe to be that interested in probability and statistics, but I was about to be impressed.

"Now in reality, it's more complicated. In our game, for example, we ignored the quality of the pitcher, and complicated situations like sacrifice flies and so on."

"Well, assuming you have made these simplifications, how do you actually simulate a batter's appearance at the plate?" I asked.

"We have only two things to think about," Roscoe replied. "Plate appearances and official at-bats. When a player gets a walk, it counts as a plate appearance, but not as an official at-bat. So basically, you need two numbers: the percentage of plate appearances that yield official at-bats for that player, and then his batting average. Suppose, for example, that a player walks in one out of every 10 plate appearances.[3] What you would do is then first determine if the player walks by asking for a successful trial of an event with probability 0.1. With the three dice, you'd need to know what combined number on a given throw has that probability. So imagine that you roll the dice, and you get that totalthen, bingo! The batter walks to first base, and you're done.

[3] We note here that statistics such as official at-bats and walks (from which plate appearances can be calculated) are the kinds of numbers that appear on the baseball cards mentioned in the salvage inventory.

"On the other hand, if you don't roll that total, then the player does not walk; instead, he has an official at-bat. Now you take his batting average, say .250, and you roll for that probability. If you're successful, he makes a hit; if not, he is out. Then, of course, you can roll for what kind of hit (single, double, triple, home run) by using those statistics per at-bat. And so on. I used batting average as the generic example, but basically you can refine the simulation to your heart's content, depending on how many of the 'corner cases' you want to include.[4] It will always, however, come down to simulating an event with a certain probability. And, because sometimes we will need probabilities for things other than batting average, we need to be able to cover the entire range from zero (total failure) to 1 (certain success.)"

[4] Another example of a "corner case" would be the probability, in the case of an out, that the batter hits into a double play if there is a man on first base. People actually construct these kinds of fantasy simulations for a living; as baseball mavens record almost every kind of statistic imaginable, this is a natural result. It should also be noted that our scheme for simulating the batter's plate appearance is certainly not unique; there are many ways to achieve the same result. For example, you could recompute the batting average based on plate appearances, and then compute walks, singles, doubles, triples, and home runs from renormalized statistics. There are many, many alternative formulations of which we have picked just one as an example. However, regardless of the formulation, one of the big challenges before the widespread availability of computers was figuring out how to conduct the probability simulation using simple, low-cost devices available to most people.

"Fair enough. I get the gist of it. So what's the problem?" I replied in turn.

"The problem," said Roscoe, "is this: Can we figure out how to simulate probabilities using a device as simple as three dice, and still have enough granularity to make the simulation reasonable? For example, if we can only simulate .250, .500, and .750, we don't have enough values to do a good simulation."

"Well, if you throw all three dice simultaneously, you get totals that range from 3 to 18; that's 16 different outcomes, so that's a start," I responded.

"Indeed," said Roscoe, "that is exactly how we proceeded."

The Software Development Edge(c) Essays on Managing Successful Projects
The Software Development Edge(c) Essays on Managing Successful Projects
Year: 2006
Pages: 269 © 2008-2017.
If you may any questions please contact us: