06 December 2008

Metal Fatigue

Metal is an incredibly handy substance, amazingly strong and relatively light. That's why it is used for so many things. Metal has a weakness though; it gets tired.

Try this simple experiment: First, take a small piece of metal and try to break it. A straightened paperclip will do nicely - literally try to pull it apart, use pliers to get a good grip if needed, and pull without bending or twisting. This ought to be difficult, and odds are you probably can't break the metal this way barehanded. For the second part of this experiment, bend the metal; work it back and forth several times bending and re-straightening it in the same place. Now pull again, and the metal should part fairly easily. If not, bend it some more and try again, OR just keep bending it until it breaks. Why does the metal, originally quite strong, now break easily?

The answer is metal fatigue (which I previously hinted at here). Metal is malleable and easily bent, and when subjected to stress it develops tiny cracks, The more times the metal is stressed, the longer these cracks become (growing in an essentially random manner). Eventually these cracks reach some critical length and the metal breaks.
Exactly how long a piece of metal can be stressed before it breaks is difficult to predict, but there is a nice mathematical results (Birnbaum and Saunders, 1969) that derives the theoretical probability distribution that describes how long a metal part under repeated stress will last. Furthermore, this is an application of the Central Limit Theorem, and will give a useful approximation to the large sample behavior of survival time in many similar circumstances, and not just for metal parts (exceptions are a topic for another day). So here is the formula that describes the Cumulative Distribution Function (CDF) of the Birnbaum-Saunders distribution for fatigue life:

(It is at this point I realize there may be some difficulty in expressing a formula within the format of a blog without some special software tools. Please forgive the crude scribbles done in Paint.)formula scribbled Birnbaum-Saunders CDF distributionwhere Xi is the magnitude of the stresses or shocks, Xi > 0, which have mean m and variance V, t (where t>0) is the number of shocks, W is the critical length of a crack that will break the part when the sum of the shocks Xi is greater than W, and the Greek-looking-thingee is the Normal CDF function. I might do as well to present this is Excel-formula-like notation:

Let Z = m*sqrt(t)/sqrt(V) - W/sqrt(V*t)
F(t) = NORMDIST(Z,0,1,1)

which is very close to something you can plug into an Excel spreadsheet and use**. Lets try this one more time in English: The formula F(t) gives the probability that the part will break on or before some number of shocks (t), or that the sum of t shocks (the Xi's, defined by m and V) will be greater than W. For a less scatterbrained definition of the Birnbaum-Saunders distribution, see this excellent source.
**I will provide a spreadsheet to demonstrate this, but that will get put off to another post so I can get to the point (yes, there is a point to this).

The mathematical theory doesn't care anything about metal, it is describing the probability that the sum of a series of random numbers X will be greater than some number W. This is a Central Limit Theorem result, which means that we can use almost any sort of random numbers, like those generated using dice or cards, as long as we know the mean and variance. Further, if we a playing a point scoring game with some fixed number of points that are needed to win, then we know W. Therefore, we have a mathematical tool that can describe the probability distribution of a Point Objective Game.

Dramatic pause and a deep breath. I have done a fair amount of work to get to this point, and it is going to pay off, because I now have a tool to help analyze a whole class of games. One of these games is Classic Battletech - which I do not deny is a very complex sort of Point Objective Game - but it can be done. I have a number of other topics to cover along the way too, and this is just the beginning.

[Part Two]


Unknown said...

An interesting study. I like the idea.

But I don't think you need to go this far when analysing a game in general - whereas this method seems to be designed to model the effect of an unknown distribution of cracks causing failure, you already know the distribution of the randomness in a game (almost always uniform distributions are used...), so you should be able to compute the probabilites and scores directly shouldn't you?

Also, if you think that is cool, you should also check out the extreme value distribution. In a game where the aim is to have the highest score after N turns (or whatever) this may be more helpful - its conceptually identical to the central limit theorem (adding a bunch of distributions gives you a normal distribution), but for the largest (or smallest) values. That is, without knowing any of the underlying distributions, you can characterise the largest expected value with a particular distribution. Check out the wikipedia page on it, and have a look at:




Dan Eastwood said...

Hello Frith, Thanks for the really good comments.
The application that started all this for me is the game (Classic) Battletech. Here the players generally select the units they want to play from among thousands of choices. Working out these distributions is possible, but (long story short) is also really really hard to do. Using the Birnbaum-Saunders distribution as an accurate and flexible approximation is therefore a very attractive alternative. I have more to say on this, but perhaps I should put it into a new blog post instead. Thanks for prodding me in this direction.

The extreme value distribution is a really fascinating topic in itself, and I worked with it a great deal as part of my thesis. Off the top of my head, I cannot think of any games that operate as an EV distribution. However, the "High Score" list on most video/computer games is most certainly governed by a EV distribution.

After thinking for a bit, I do know a game governed by EV. It's perhaps a bit silly or trivial, but worth a post for its own sake. Now that's TWO posts you have inspired. Thank you again, and please come back! :-)