- This topic has 43 replies, 13 voices, and was last updated 5 years ago by
Phil Dutré.
-
AuthorPosts
-
10/11/2018 at 13:28 #103569
Andrew Rolph
ParticipantAll
Following a catastrophic trouncing in my weekly wargame (and I mean beyond embarrassing – embarrassing defeat is my normal result at the club. I aspire to a hard fought losing draw) I decided to heap all the blame on statistics.
I enjoy a bit of light maths. I don’t have to do it, y’know, I’m in control. Anyway I worked some things out (which happened to prove that I never stood a chance in the game) and in so doing worked out a sort of ‘combat power’ for the stands involved in the wargame. In turn, in deriving that power (from an Excel simulation of anticipated combat results on a stand by stand basis) I noted that the results of x number of stands fighting x or 2x or 3x enemy stands looked very like how I recall the results of Lanchester’s formula looked. If that were the case then I could generalise results across a number of other situations in the game, which would be handy. So I needed to verify that my hunch of the results mirroring Lanchester was right.
I remember the principle of the formula (casualties inflicted in ratio to the square of the fighting power) but I have come up with three implementations when using real numbers and I am not sure which, if any, is correct.
Imagine two forces of ten units in combat with each other. The units on one side each have an abstracted ‘combat power’ of three. Those on the other have a combat power of two. So the better quality troops are (statistically) going to win and, given the square effect, by some margin. Which, then, if any, of the following is the correct way to calculate that margin
a. Multiply the combat power by the number of units and then square that number for each side.
((10*3)*(10*3))-((10*2)*(10*2))= 900-400=500
then the square root of 500 (22.36) is divided by 3(combat power) to return 7.45 as the number of units remaining in the better side once the lesser side is reduced to zero
b. Squaring the combat power for each side then multiplying by the number of units
(3*3*10)-(2*2*10)=90-40=50
then the 50 difference is divided by the combat power squared – 50/(3*3)= 5.56 units remaining when the lesser side is reduced to zero
c. Square the number of units on each side and then multiply by the combat power
(10*10*3)-(10*10*2)=100
then the difference is divided by the combat power and the square root taken to determine the number of surviving stands – 100/3=33.33, the SQRT of which is 5.77
Any assistance out there would be much appreciated. I am not a frequent poster or reader of topics on here but I have a personal bet with myself about at least three regular posters who know enough about this to be able to answer.
thanks in advance.
Andrew
PS I think I am tending towards b being the right one (or closest to being right)
11/11/2018 at 09:21 #103600MartinR
ParticipantI’ve got a copy of Lanchester book somewhere, which I will try to look at later, but intuitively I think a is right.
Lanchester application to real warfare has been extensively debunked, particularly in relation to air combat, as it takes no account of target density, but many Wargames rules do demonstrate the brutal logic of the square law as each individual combat determination is taken in isolation (a shoots at b).
Depressingly for real life commanders, higher force ratios generally only produce decreasing marginal gains in the likelyhood of success, the precise opposite of Lanchester. But Lanchester is key to winning at (many) wargames.
"Mistakes in the initial deployment cannot be rectified" - Helmuth von Moltke
11/11/2018 at 17:55 #103617John D Salt
ParticipantI have a personal bet with myself about at least three regular posters who know enough about this to be able to answer.
I’m going to be quite upset if I’m not one of those three.
Assuming we’re talking about the Lanchester (or Osipov, or Chase, or Fiske) square law, the fighting power of a force is proportional to its firepower multiplied by the square of its numbers. So of your alternatives, c is the best. However you can’t use Lanchester’s laws for any simple calculation to find the expected number of survivors of a battle. Consider the simple case of two equally numerous sides with equal firepower. The fighting power of each side is obviously equal, so Lanchester predicts an even chance of each sde winning. What it does *not* predict is that both sides will be completely annihilated, which is obviously not the case.
If you want to estimate the number of survivors, you need something a little more sophisticated than just a couple of differential equations. Since my normal reaction to any question is to write a Python program to deal with it, I attach the simplest Lanchester-like battle simulation program I can write (I already have loads of more sophisticated ones lying around).
This is a stochastic treatment of the Lanchester battle. Each side has some number of elements, characterised by firepower, here expressed as a kill probability (so in the range 0.0..1.0). In accordance with the Lanchester assumptions, all elements are statistically identical — but it is fun to play with variants where different elements have different firepower or protection characteristics. One might also express firepower as a combination of kill probability per shot and rate of fire; and one might also include suppression or other effects rather than just killing. But we stick with the crudeness of Lanchester for now. Firepower is distributed equally over the enemy force, so for each shot we pick a target at random. This does not matter where all the elements are the same, but in more sophisticated efforts it can be fun to try different target selection policies, such as shooting at the most recent enemy to have shot — which gives an idea of the survival value of staying suppressed. When a target is hit, it is removed from the target array. A very simple variation is to leave dead targets (perhaps with some probability) in the target array so that they can be “re-killed”; this has the effect of wasting enemy shots and so diluting enemy firepower. This produces interesting effects — but, for now, we stick with the crudeness of Lanchester.
It is of course possible to devise an implementation of this kind of game that uses fixed-length turns in which all the elements on each side get to shoot. I have chosen not to because that introduces the possibility of a draw if the last surviving elements on each side kill each other in the same turn. In this implementation, we simply pick an element at random to take the next shot until one side has been wiped out. The shooter might be chosen from either side, but, obviously, there is more chance of the next shooter being from the larger side in proportion to that side’s size advantage. Choosing the next element to shoot each “turn” makes this a little bit like a discrete-event simulation, but without the calendar or simulation clock.
For the case mentioned, 10 elements one each side and firepower in the ratio 2:3 (which I have chosen to interpret as P(kill) of 0.2 and 0.3) the program gives the following results from a run of a thousand battles. People who wish to add more code to calculate confidence intervals on the results are welcome to do so.
Red force score is 20.0 Blue 30.0 After a total of 1000 battles: Red won 214 and had 88.3 per cent casualties Blue won 786 and had 48.0 per cent casualties
Now, the code. As usual I reckon this should be simple enough for non-Pythonistas to follow what’s going on, but if there are any questions, I’ll try to answer them.
All the best,
John.
######################################################################## # # Program to run simple Lanchester square law battles # # Written by John D Salt 11 Nov 2018 # # This program may be shared and redistributed freely # ######################################################################## from random import random, choice class element: def __init__(self, FP, force, enemy): ''' Force elements have a firepower score, and know their own and enemy forces ''' FP = min(FP, 1.0) # Firepower ratings 0..1 self.firepower = FP self.force = force self.enemy = enemy self.force.append(self) def shoot(self): ''' Remove element from enemy force if shot is successful ''' if random() <= self.firepower: self.enemy.remove(choice(self.enemy)) def battle(blueNum, blueFP, redNum, redFP): ''' Fight one battle with the specified lineup ''' Blue = [] Red = [] for count in range(blueNum): element(blueFP, Blue, Red) for count in range(redNum): element(redFP, Red, Blue) finished = False while not finished: # Pick a random element to shoot until one side is annihilated shooter = choice(Blue+Red) shooter.shoot() if len(Red) == 0 or len(Blue) == 0: finished = True print "Blue started with", blueNum, "elements and finished with", print len(Blue) print "Red started with ", redNum, "elements and finished with", print len(Red) return (len(Blue), len(Red)) def campaign(blueNum, blueFP, redNum, redFP, battles = 100): ''' Conduct a number of battles with the same lineup ''' redwins = 0 bluewins = 0 redsurvivors = 0 bluesurvivors = 0 for count in range(battles): b, r = battle(blueNum, blueFP, redNum, redFP) bluesurvivors += b redsurvivors += r if b == 0: redwins += 1 if r == 0: bluewins += 1 if bluesurvivors == 0: bluecas = 100.0 else: bluecas = 100.0 - (100.0 * (float(bluesurvivors/float(blueNum*battles)))) if redsurvivors == 0: redcas = 100.0 else: redcas = 100.0 - (100.0 * (float(redsurvivors/float(redNum*battles)))) print "Red force score is", redNum **2.0 * redFP, "Blue", blueNum ** 2.0 * blueFP print "After a total of", battles, "battles:" print "Red won ", redwins, "and had", round(redcas, 1), "per cent casualties" print "Blue won", bluewins, "and had", round(bluecas, 1), "per cent casualties"
12/11/2018 at 13:33 #103649Andrew Rolph
ParticipantI’ve got a copy of Lanchester book somewhere, which I will try to look at later, but intuitively I think a is right. Lanchester application to real warfare has been extensively debunked…But Lanchester is key to winning at (many) wargames.
Thanks Martin – one of my three! As it’s a wargame I am looking at, the actual validity of the theory is of less interest than its correct application.
I have a personal bet with myself about at least three regular posters who know enough about this to be able to answer.
I’m going to be quite upset if I’m not one of those three.
Yup there’s my second one! Welcome Dr John and his ever present prodigious python! Which may have been an actual song title by the other, less wargame friendly, Dr John.
Assuming we’re talking about the Lanchester (or Osipov, or Chase, or Fiske) square law, the fighting power of a force is proportional to its firepower multiplied by the square of its numbers. So of your alternatives, c is the best. However you can’t use Lanchester’s laws for any simple calculation to find the expected number of survivors of a battle.
…Since my normal reaction to any question is to write a Python program to deal with it, I attach the simplest Lanchester-like battle simulation program I can write…
I must admit to a lack of knowledge of your serpentine Plus One. I can see what it’s doing and can see its potential flexibility (and, indeed, think it would probably be ideal for all sorts of questions I’ve posed to myself over the years) but I am not quite sure what it is or where I can get it. It looks suspiciously like proper grown up computer programming rather than a piece of software and, in that arena, once they moved off BASIC I floundered.
Interesting to note three different interpretations of which answer is ‘correct’ – my own suspicion it might be ‘b’; Martin’s leaning towards ‘a’ and John’s view that ‘c’ is best.
Actually with these specific numbers it’s not too difficult to simply do the experiment to see what answer comes up.
So
taking a combat power of 3 as a probability of a kill on an enemy stand of 0.3 and, similarly, 2 as 0.2
ignoring the potential for hits on any already dead units
ignoring any potential hits on units already hit during the round
basically ignoring anything other than the number of units and the kills they will inflict (as straightforward a Lanchester application as is possible) then the two groups inflict casualties as follows (with rounding)
Start 10 10
Round 1 8 7
Round 2 6.6. 4.6
Round 3 5.7 2.6
Round 4 5.2 0.9
Round 5 5.0 -.6
So the less effective force hits zero when the more effective force has between 5 and 5.2 stands left (and towards the upper end of that range). This equates to none of the methods of calculating the result above, all of which overestimate how many units survive.
Ah well I’ll continue to mess around with some figures and see what happens…and wait to see if the mystery third person joins in (I didn’t count John’s Python as one of my three). Thanks to Martin and John for their views.
Cheers
Andrew
12/11/2018 at 15:00 #103656Darkest Star Games
ParticipantNeeeeerds!
But in all seriousness, some questions: do you find that knowing the odds and the most probable outcome of the combats reduces the joy of playing? Do you feel that maybe some variable should be inserted (say troop vigor, the vagaries of luck, wide resistance, whatever) to better reflect those things that can allow the weaker forces to somehow triumph?
"I saw this in a cartoon once, but I'm pretty sure I can do it..."
12/11/2018 at 16:01 #103666Sane Max
ParticipantDuplicate post
12/11/2018 at 16:02 #103667Sane Max
ParticipantLanchester’s square Law is beyond my ken. But what I know of Lanchester’s Linear Law which relates to ANCIENT warfare – – and I quote Wikipedia for this, but it matches what I thought I was told – (one soldier could only ever fight exactly one other soldier at a time. If each soldier kills, and is killed by, exactly one other, then the number of soldiers remaining at the end of the battle is simply the difference between the larger army and the smaller, assuming identical weapons.) would suggest it’s worth precisely one pinch of weasel dung to anyone interested either in wargaming OR reality.
I am sure the maths is fun – I mean, I am rubbish at Maths and regard it with distaste, but diff’rent strokes for diffr’ent folks – but what is the point of doing the maths at all if the law is that fundamentally worthless? You may as well see if you can finally work out how many angels can dance on the head of a pin, or try to complete the fascinating work of that Turtle from ‘The Mouse and his Child’
Pat
12/11/2018 at 16:14 #103671Not Connard Sage
ParticipantLanchester’s square Law is beyond my ken. But what I know of Lanchester’s Linear Law which relates to ANCIENT warfare – and I quote Wikipedia for this, but it matches what I thought I was told – (one soldier could only ever fight exactly one other soldier at a time. If each soldier kills, and is killed by, exactly one other, then the number of soldiers remaining at the end of the battle is simply the difference between the larger army and the smaller, assuming identical weapons.) would suggest it’s worth precisely one pinch of weasel dung to anyone interested either in wargaming OR reality. Pat
So the key to victory for the budding Alexander is the formula A = E+1. Where A is your army, and E is the opposing army. Genius, I’m never going to lose another game.
🙂
Obvious contrarian and passive aggressive old prat, who is taken far too seriously by some and not seriously enough by others.
12/11/2018 at 16:47 #103682Andrew Rolph
ParticipantLanchester’s square Law is beyond my ken. But what I know of Lanchester’s Linear Law which relates to ANCIENT warfare – – and I quote Wikipedia for this, but it matches what I thought I was told – (one soldier could only ever fight exactly one other soldier at a time. If each soldier kills, and is killed by, exactly one other, then the number of soldiers remaining at the end of the battle is simply the difference between the larger army and the smaller, assuming identical weapons.) would suggest it’s worth precisely one pinch of weasel dung to anyone interested either in wargaming OR reality. I am sure the maths is fun – I mean, I am rubbish at Maths and regard it with distaste, but diff’rent strokes for diffr’ent folks – but what is the point of doing the maths at all if the law is that fundamentally worthless? You may as well see if you can finally work out how many angels can dance on the head of a pin, or try to complete the fascinating work of that Turtle from ‘The Mouse and his Child’ Pat
Lanchester’s Square Law was, as I recall, put together during WWI, to help determine likely casualties in the attack, having determined that it wasn’t a linear relationship. Ten units attacking nine didn’t result in one survivor and nine casualties each. Instead a better predictor resulted from multiplying each side by itself and taking the square root of the difference between them. So ten versus nine became 100 vs 81. The difference was 19, the square root of which is 4.36. Where the enemy fought to the last man the attacker could expect to have four or five units survive. I believe you can then work this backwards to determine the survivors of the attack where the enemy don’t fight to the last man (which is obviously the more useful application). As I remember it was supposed to be quite a reasonable predictor.
As has been pointed out, its value has since been (at least) questioned but, as I said in my original post, it appeared to be valid for a calculation I was doing concerning a wargame (which is a bit different from real life) and, if so, was potentially a useful tool for me to extrapolate to situations other than the one I was analysing. Hence my interest in working out how it should be applied (in order to check its validity before extrapolating)
Cheers
Andrew
12/11/2018 at 17:29 #103690Andrew Rolph
ParticipantNeeeeerds!
I suspect the Venn diagram of Nerds and Wargamers has a significant overlap.
But in all seriousness, some questions: do you find that knowing the odds and the most probable outcome of the combats reduces the joy of playing?
Personally, where there are dice involved (particularly D6s) I find myself mentally calculating probabilities on autopilot. It helps me to assess possible approaches by clarifying the odds of different options. This is not something done for every die roll or every battle or every situation but I do it quite a lot just to help make a judgement call.
Do you feel that maybe some variable should be inserted (say troop vigor, the vagaries of luck, wide resistance, whatever) to better reflect those things that can allow the weaker forces to somehow triumph?
That’s the point of formulating a ‘combat power’ for a given unit – it takes into account better morale, better weapons, better cover. So if a game has units which kill on 4+ on 1D6 and each have a saving roll of 4+ against those kills then both sides have a combat ability which is the same. However if Side A are Veterans (+1 to save roll, + 1 to hit roll), Dug in (+1 to save roll)and armed with MG42s (+1 to hit roll) then they effectively have rolls of 2+ to hit and save. Side B are Green (- minus to hit and to save) then their abilities are 5+ to hit and to save. As a result Side A will hit 5 times out of 6 and Side B will save a third of them – a net kill rate of .56 – whilst Side B will inflict hits 2 times out of 6 which Side A will save 5 times in 6 – a net kill rate of 0.06. The combat power of Side A is therefore nearly ten times as great.
Now you’ll know all the modifiers in advance of any game and therefore know how tough Side B’s job would be attacking Side A. However the value to me in thinking in these terms is whether that particular assault can ever (other than by being very lucky) win and if so what sorts of numbers are needed to do it. Looking at the modifiers alone you might conclude that you’ll need at least twice as many troops to conduct the assault. You might have those numbers and conclude that the attack is worthwhile. However if you do a deeper analysis (such as Lanchester or similar) you may well find out that the required superiority (with average dice rolls) is three or four times as many troops – which you may not have or which might make you think that it wasn’t worth it (in this example I believe it’s 3.1 times as many).
Bear in mind that none of this determines anything – you can still roll lots of ones (or sixes…so I’m told).
In this particular instance I noted, in a series of scenarios, that regardless of what additional volumes of troops I put into a certain situation, they lost. I would attack at 3:2, 2:1,3:1,4:1 and, although they might last longer, they didn’t actually break through. That made me wonder what numbers were needed – hence the analysis. The analysis serves as a guideline for determining an approach. It’s just more information to feed into the decisions in the game – and that decision making is the enjoyable bit of the game for me. Formulate a theory and then test it, particularly when the approach I am using, which is simply intuitive, is routinely failing.
Having said all this it is worth noting that
- I lose at least as frequently as I win
- I am not really interested in who wins any of the games I play
Oh and finally, analysing probabilities and expected losses is very useful for designing games or writing rules.
Cheers
Andrew
12/11/2018 at 18:23 #103696Phil Dutré
ParticipantI wrote an extensive blogpost about Lanchester’s rule some years ago: http://snv-ttm.blogspot.com/2011/07/the-lanchester-model-for-combat_4930.html
Anyway, the original math is pretty simple. The assumption is that a side inflicts casualties proportional to its own strength, and this rate doesn’t vary over time. When writing this down as a differential equation, it results in the difference of the strengths squared being a constant.
Whether those basic assumption is valid in a real attrition combat has been a question of much debate, but I thought the consensus was that it isn’t a very good model.
Phil Sabin’s book ‘Simulating War’ has an explanation about why Lanchester’s model doesn’t work well to model real battles, but it works to model wargames 😉
12/11/2018 at 19:37 #103708Andrew Rolph
Participant…Lanchester’s model doesn’t work well to model real battles, but it works to model wargames 😉
Welcome Phil…and with that I win my bet with myself! ☺
I’ll have a look at your post but your last line, echoing Martin, regarding its applicability to wargaming is the relevant bit
Cheers
Andrew
12/11/2018 at 20:23 #103712Phil Dutré
ParticipantWelcome Phil…and with that I win my bet with myself!
I feel flattered 😉
If you look at my blogpost, the math to explain the square law assumes that:
– all soldiers/unit/… on a side are involved in combat
– all soldiers have a certain probability of hitting the enemy, irrespective of the strength of the enemy
– the rate at which casualties are inflicted doesn’t change over time.
The square law is the result of applying these assumptions to infinitesmall time intervals, i.e. writing it down as a differential equation. If you consider finite time intervals, you end up with discrete differential expressions, which are much more difficult to solve analytically.
12/11/2018 at 22:17 #103719John D Salt
ParticipantThe square law is described in Fred Lanchester’s own words like this: “In other words, the fighting strengths of the two forces are equal when the square of the numerical strength multiplied by the fighting value of the individual units are equal.”
Andrew has, by hand, re-created the inevitable consequences of Lanchester’s square law from first principles.
A similarly simple manual game, but stochastic rather than deterministic, was proposed by me in “Surprise and the Tank Fight”, Nugget 238, Oct 2010, p. 22, available at
http://www.wargamedevelopments.org/Nugget2010-1/Nug238.pdf
password “nexus”I don’t know where the idea of Lanchester writing this stuff for practical application to WW1 battles came from, nor the idea that it proved a good predictor of anything; I suspect rumour control must have modified the real story a number of times to come up with those. The wikipedia article on Lanchester’s theorem is unfortunately a bit crap, but an excellent presentation on the history of both the Lanchester laws and attempts to validate them, by an old wargaming pal of mine, was presented at ISMOR last year:
“Validating Lanchester Models: the first 60 years”, Paul R Syms, ISMOR 2017:
http://www.ismor.com/34ismor_archive/presentations/18_tuesday/34ismor_syms.pdf
Flonking around on Chris Lawrence’s excellent “Mystics and Statistics” blog leads to lots of good meaty stuff on the history of Lanchester’s equations, such as this:
One can also do Lanchestery calculations in a spreadsheet, and calculate for as many elements or as fine-grained a loss rate as you like. Everyone has spreadsheet software, it’s about as widely distributed as E. Coli, and if anyone is unusual enough not to have it, a perfectly useable spreadsheet program is included in the LibreOffice suite, downloadable for free from https://www.libreoffice.org/
Create a spreadsheet with seven columns.
The first column is the turn number, so write 0 in the first cell, and a formula to add 1 in each subsequent line.
The second and third columns are the strengths of the respective opposing sides, red and blue (or whatever you want to call them). Put the starting strengths in the first row. We will come back to the subsequent rows later.
The fourth and fifth columns are the firepower, or casualty-inflicting power if it is done by other means, of each side. This is a number that says (for the square law) how many casualties each unit will inflict per unit time. Keep it small if you want to see nice, smooth curves when you come to plot the results.
Fill in the firepower of each side in the top row, and keep the same number in all subsequent rows — firepower never changes.
The sixth and seventh columns are where all the hard maths is accomplished. With all appropriate apologies to people who hate maths (which is to say, none at all), we are going to have to do a multiplication sum, or, rather, get the spreadhseet to do one for us. These columns show the casualties inflicted on the other side in the current round of combat. Red casualties are found by multiplying the current strength of Blue by the Blue firepower number; Blue casualties are found by multiplying the current Red strength by the Red firepower number. It should not tax the wit of even a spreadsheet newbie to write the necessary formula, if you can remember which columns you put these numbers in. Copy the formula into all subsequent rows.
Now we come back to the second and third columns, the strengths of each force. For rows after the first, this will be the previous turn’s strength, less the casualties inflicted in the previous turn. It is a good idea to make the formula be the maximum of this or 0 (so something like “=MAX(B2-F2,0)” for Blue if you gave used the column ordering I suggest) so that a side with negative remaining stength cannot impart magical healing to its opponents.If you’ve done that, you now have a spreadsheet that will let you approximately solve any Lanchester square law fight you choose to set up. Having the turn, Blue strength and Red strength in the first three columns makes it fairly painless to draw a chart plotting the relative strength of both sides over time, and see what proportion of the winner’s strength remains when the loser is reduced to zero.
It would be a shame not to cover the linear law too, so copy the sheet and modify just the casualty calculation. As well as multiplying the other side’s strength and firepower together, you also multiply by friendly strength.
The thing to notice is that Lanchester’s equations are expressed in essentially continuous terms. Fractional casualties are dealt with, despite the meaninglessness of such a thing in real life. If you set up an equal Lanchester battle, it will never actually end, because the vanishingly tiny sides will continue to inflict vanishingly tiny proportional casualties on each other forever.
Because of its continuousness, a determinstic Lanchester model is not a good way to predict either the probability of a side winning or the expected number of survivors. Hence my strong preference for stochastic Lanchester — roll dice rather than performing sums, and probabilistically knock out whole casualties or none instead of substracting fractions.
My Python program, set up for the 10 v 10 fight with firepower 0.3 and 0.2, gives the following results for a million runs:
>>> campaign(10, 0.3, 10, 0.2, battles=1000000) Red force score is 20.0 Blue 30.0 After a total of 1000000 battles: Red won 212574 and had 89.0 per cent casualties Blue won 787426 and had 49.0 per cent casualties >>>
Anyone who can write functioning programs in an evil and rude programming language like BASIC can certainly write simple scripts in Python.
Downloads, documentation, tutorials and all you can eat about Python all free from python.org at:
All the best,
John.
12/11/2018 at 22:42 #103720Cerdic
ParticipantI don’t understand any of this. But I’m disappointed in this thread. I saw the word Lanchester and was hoping for some of this…
13/11/2018 at 12:36 #103752Andrew Rolph
ParticipantI don’t know where the idea of Lanchester writing this stuff for practical application to WW1 battles came from, nor the idea that it proved a good predictor of anything…
I may be misremembering – it was thirty plus years ago that I came across it…
One can also do Lanchestery calculations in a spreadsheet, and calculate for as many elements or as fine-grained a loss rate as you like.
…which is where we came in, my own Lanchestery Excel calculations.
Because of its continuousness, a determinstic Lanchester model is not a good way to predict either the probability of a side winning or the expected number of survivors. Hence my strong preference for stochastic Lanchester — roll dice rather than performing sums, and probabilistically knock out whole casualties or none instead of substracting fractions.
My Python program, set up for the 10 v 10 fight with firepower 0.3 and 0.2, gives the following results for a million runs:
…surely too small a sample …
Anyone who can write functioning programs in an evil and rude programming language like BASIC can certainly write simple scripts in Python. Downloads, documentation, tutorials and all you can eat about Python all free from python.org at: https://www.python.org/ All the best, John.
In the olden days I was warned at University that, in ten years, no-one would be able to function in life without an ability to programme a computer. BASIC was what of my tutors knew so that’s what he taught us (I wasn’t doing any sort of degree relating to Computer Science). Thanks for the link to Python – I’ll investigate.
Thanks to Phil for the blog and to all who contributed.
Cheers
Andrew
13/11/2018 at 13:45 #103756Phil Dutré
ParticipantJust a little addendum to simulating Lanchester’s law using a spreadsheet or another piece of software:
Lanchester originally formulated his law as a continuous equation (the rate of change of the strengths of both sides varies continuously over time). If you simulate it using any number of discrete time steps, you approximate by discretizing the time parameter. In essence, you are constructing a piecewise lineaur approximation to a smoothly varying curve. As anyone who has ever taken a course on numerical approximations knows, this can lead to severe errors compared to the “exact” solution. Runge-Kutta methods anyone? 🙂
But if you take your time-steps in small enough increments (the number of casualties each turn is small to the total number of strenghts), the approximations might work out ok.
To illustrate:
The simplest form of the square law is that the difference of squares strengths is a constant. In other words (using timesteps t and t+1), R(t) being Red’s strength and B(t) being Blue’s strength:
R(t+1)*R(t+1) – B(t+1)*B(t+1) = R(t)*R(t) – B(t)*B(t)
Now, according to Lanchester’s assumption, the above equation holds if R(t+1) = R(t) – c.B(t) (the rate of casualties inflicted is proportional to the enemy’s strength), and B(t+1) = B(t) – c.R(t).
If you insert this in the original equation:
R(t).R(t) – 2.c.R(t).B(t) + c.c.B(t).B(t) – B(t).B(t) + 2.c.R(t).B(t) -c.c.R(t).R(t) = R(t)*R(t) – B(t)*B(t)
which simplifies to:
c.c(B(t).B(t) – R(t).R(t)) = 0
which obviously is not true, and is the discretization error. But if c chosen to be small (in other words, choose a small time step), this quantity can be made small enough and be ignored.
13/11/2018 at 14:00 #103757Phil Dutré
ParticipantI don’t know where the idea of Lanchester writing this stuff for practical application to WW1 battles came from
The original idea was to model dogfights in the air (I have this from 2nd sources, not the original). Any number of planes are in the air, and every single plane has a given % chance of shooting down an enemy plane in a given time interval. This % chance does not change depending on your own total of planes, or the enemy number of planes, and hence the effectiveness of each “shot” is constant over the entire battle. Each pilot also operates alone, and is oblivious of the surorunding circumstances (no routs, no morale effects, etc.)
Thus, the total strength on my side at time t+1 equals my strength at time t minus the number of casualties, which is proportional (some constant c) to the enemy’s strength, or R(t+1) = R(t) – c.B(t). Written in differential form: dR/dt = – cB, and also dB/dt = – cR. Eliminating dt gives: c.R.dR = c.B.DB, which integrated gives: R*R – B*B = constant.
13/11/2018 at 17:20 #103760John D Salt
ParticipantLanchester originally formulated his law as a continuous equation (the rate of change of the strengths of both sides varies continuously over time). If you simulate it using any number of discrete time steps, you approximate by discretizing the time parameter.
Alternatively, a sensible person, or discrete-event simulationist, will use discrete casualty steps, and adjust the time intervals to suit. It makes a good deal more sense to treat casualties as integer variables than it does to treat time that way.
For my own amusement, I have just written Python and spreadsheet versions of an “exact” deterministic Lanchester battle, and it involves a small but annoying calculation of the time to the next casualty at each processing step, each step involving the occurrence of a casualty on one or both sides. While the original form of Lanchester’s equations was indeed a continuous function, I think most people would agree that making casualties fractional is a poorer approximation to reality than dealing with discrete casualties. Just like Zeno’s paradox with a false beard and stuck-on nose, having “atomic” casualties also solves the problem of the infinitely-protracted battle for exactly similar forces (same strength, same firepower) in the continuous case.
Given the uselessness of the continuous version of the laws for estimating the probability of victory for each side, or the likely number of survivors, I remain mildly baffled by their continuing popularity. Niall McKay (head of maths at the University of York, https://www.york.ac.uk/maths/staff/niall-mackay/ ) has an enviable number of recent publications on them. He is, of course, a mathematician (“a machine for turning coffee into theorems”), rather than an operational analyst.
All the best,
John.
13/11/2018 at 17:28 #103761John D Salt
ParticipantIn the olden days I was warned at University that, in ten years, no-one would be able to function in life without an ability to programme a computer.
Mr. Picky says “program” (unless you attended university before 1967).
I am still wondering whether the folks who gave you that warning were right.
One might contend, given the continued relative scarcity of programming talent (though still not sufficient scarcity to warrant wages as high as, say, a train driver) they were clearly wrong.
On the other hand, a frighteningly high proportion of the people running the country, who I’m quite sure can’t program, do seem to me to be rightly described as “unable to function in life”.
I think I would have to rate it as a less daft prediction than the reputed forecast from 1963 that “COBOL’s English-like syntax is so natural that the job of programmer will disappear within ten years, as managers become capable of writing their own programs”.
All the best,
John.
14/11/2018 at 09:16 #103788Phil Dutré
ParticipantIt makes a good deal more sense to treat casualties as integer variables than it does to treat time that way.
Absolutely. It’s just that if you run the numbers that way, you might not observe the square law exactly, since you will indeed make an approximation error. I guess (I didn’t do this), if you compute the number of casualties stochastically in each time step, and limit everything to integers, and make an average over a bazillion runs, the square law will show up in the end.
14/11/2018 at 09:23 #103789Phil Dutré
ParticipantI am still wondering whether the folks who gave you that warning were right.
“Computational thinking” is the new word – not programming.
It makes sense – since so much of our world is run by algorithms these days, we can expect that most people should at least have a basic understanding of what an “algorithm” is, or how you can use a computer to solve a given problem. Not everyone should be able to program as it was understood back in the 70s or 80s, but at least people should be aware what software can and cannot do – just as people should know what electricity can and cannot do, or what a combustion engine can and cannot do, or what surgery can and cannot do.
But we’re getting off-topic here 😉
BTW, I am computer science professor, so my view might be biased 🙂
14/11/2018 at 10:48 #103792Andrew Rolph
ParticipantIn the olden days I was warned at University that, in ten years, no-one would be able to function in life without an ability to programme a computer.
Mr. Picky says “program” (unless you attended university before 1967). …
All the best, John.
I hovered over the ‘double m’ for a moment or two but having considered that I’d been taught ‘programming’, have previously ‘programmed’ and no doubt will be ‘programming’ in the future, I decided it was better than a ‘single m’. Additionally Mr Pickier-Still (he may be a relation) pointed out the Cambridge British English dictionary definition which maintains that ‘program’ as a verb is American usage and that British usage remains ‘programme’ – even for the specific use in ‘making computers do stuff’.
So though I might accept ‘program’ as a neologism within British English (adopted from American English) for the specific noun usage wrt computing, asking it to become all verby, and to then create a host of irregularity within any past or continuous usage, is a step too far. I’ll maintain my own archaisms.
And if you disagree I’ll be forced to cut you to the quick and address you with an over familiar ‘thou’ (trying to get this one back into English…not a lot of luck so far).
And anyway, Phil says we’re both wrong. Definitely way off topic now.
Cheers
Andrew
14/11/2018 at 11:43 #103794grizzlymc
ParticipantA programme of instruction need not use the American spelling.
14/11/2018 at 12:23 #103795Guy Farrish
ParticipantAs another off topic (sort of) aside – how come you lot can chunter on about ‘program’ v ‘programme’ for hours and I get the Joyce Grenfell rebuke of ‘Are we still discussing gaming?’ from Mike within 6 minutes when I mention the redundant nature of ‘going forward’?
And yes it has been niggling.
Off to ragesulk.
14/11/2018 at 13:38 #103799deephorse
ParticipantAs another off topic (sort of) aside – how come you lot can chunter on about ‘program’ v ‘programme’ for hours and I get the Joyce Grenfell rebuke of ‘Are we still discussing gaming?’ from Mike within 6 minutes when I mention the redundant nature of ‘going forward’? George. Don’t do that. And yes it has been niggling. Off to ragesulk.
Mike’s house, Mike’s rules.
Oh dear ………
Play is what makes life bearable - Michael Rosen
14/11/2018 at 13:39 #103800Whirlwind
ParticipantGiven the uselessness of the continuous version of the laws for estimating the probability of victory for each side, or the likely number of survivors, I remain mildly baffled by their continuing popularity.
Why are they more popular than, say, the Dupuy ones? Is it because the maths is more elegant?
15/11/2018 at 12:24 #103861Sane Max
ParticipantGiven the uselessness of the continuous version of the laws for estimating the probability of victory for each side, or the likely number of survivors, I remain mildly baffled by their continuing popularity.
Why are they more popular than, say, the Dupuy ones? Is it because the maths is more elegant?
I guess in the OP’s context, yes. It is after all more ‘fun with sums’ than anything else to do with soldiers.
But I have to say, if I wrote ‘Pat’s Milk Law’ which began ‘Cows are mainly spherical, hollow and can be assumed to be completely filled with Milk. to calculate the quantity of milk from a given herd of cows use the formula ‘k * 4/3 πr3′ where k =length of herd from nose to tail’ and then started a discussion of it on ‘The Dairy Farmer Website’ I would be expecting someone to point and sneer.
15/11/2018 at 13:36 #103862MartinR
ParticipantI think its enduring popularity is partly down to it being simple enough to vaguely remember, yet sufficently complicated to get a bit wrong. It also is a very good model of how many wargames rule work (mainly the Featherstone style A shoots at B type thing).
Dupuy is a bit more maddeningly hard to convert into something useful on the tabletop. The main message from them is that you can never be too strong, although there is clearly law of diminishing returns at play in terms of force ratios and outcomes and ever accelerating losses for the stronger side.
At least Clausewitz helpfully added to ‘you can never be too strong’, with the observation that actually, 2:1 is good enough for the vast majority of early nineteenth century battles to guarantee victory. Never mind troop quality, brilliant generals or whatever. Just shove lots and lots of men in there. Job done.
"Mistakes in the initial deployment cannot be rectified" - Helmuth von Moltke
15/11/2018 at 13:39 #103863MartinR
ParticipantI don’t understand any of this. But I’m disappointed in this thread. I saw the word Lanchester and was hoping for some of this…
Call that a Lanchester? This is a Lanchester:
"Mistakes in the initial deployment cannot be rectified" - Helmuth von Moltke
15/11/2018 at 15:24 #103866Andrew Rolph
Participant…But I have to say, if I wrote ‘Pat’s Milk Law’ which began ‘Cows are mainly spherical, hollow and can be assumed to be completely filled with Milk. to calculate the quantity of milk from a given herd of cows use the formula ‘k * 4/3 πr3′ where k =length of herd from nose to tail’ and then started a discussion of it on ‘The Dairy Farmer Website’ I would be expecting someone to point and sneer.
But it wouldn’t be on “The Dairy Farmer Website”, it would be on “The Dairy Farming Game Website” where your model might be a very good predictor of yields within a certain set of rules for playing with model cows and therefore be worthy of investigation, contemplation or refinement – regardless of how unrealistic it was in modelling the real world of dairy comestibles.
If I had posted my original query on some fictional “Get the best out of your Armed Forces Modern Battles Website” asking how to correctly interpret the formula (presumably because I was planning to invade somewhere and would like to increase my chances of victory) then quite rightly someone might point out the futility of my endeavour.
But I’m not. It’s a game. It’s not real.
Cheers
Andrew
15/11/2018 at 20:29 #103877Cerdic
ParticipantMartinR – very nice an’ all but yours looks a lot less comfortable…
16/11/2018 at 08:28 #103903Sane Max
ParticipantIf I had posted my original query on some fictional “Get the best out of your Armed Forces Modern Battles Website” asking how to correctly interpret the formula (presumably because I was planning to invade somewhere and would like to increase my chances of victory) then quite rightly someone might point out the futility of my endeavour.
But I’m not. It’s a game. It’s not real.
Cheers
Andrew
sorry that doesnt wash. The basic assumptions in the formula are so ridiculous it is ‘Not Even Wrong’ as they used to say. Try saying ‘It’s a game, it doesn’t matter’ and then get out dice that cannot roll true, tape-measures with random calibrations and an opponent who randomly picks up figures and eats them.
16/11/2018 at 10:09 #103906Andrew Rolph
Participant…The basic assumptions in the formula are so ridiculous it is ‘Not Even Wrong’ as they used to say. Try saying ‘It’s a game, it doesn’t matter’ and then get out dice that cannot roll true, tape-measures with random calibrations and an opponent who randomly picks up figures and eats them.
It’s a model. It either works or it doesn’t. ‘Works’ means that it can take a set of inputs, perform actions on those inputs and deliver some outputs, which in turn are closely correlated with what actually happens in practice
For real life, it doesn’t work (apparently) – quite possibly because the assumptions made in building it were poor.
For aspects of many wargames, it works – it is a reasonable predictor of casualties, force required etc. The assumptions which form its basis are irrelevant.
In a similar fashion all wargames rules are models. They are judged by their players to either work or not. Their designers make some assumptions which they feed into their rules. Most of the time players do not know what any of these assumptions are. However the rules are judged on whether they work, in the players’ eyes. It may be that Mr X has designed his tactical WWII tank combat game with armour values based upon a random selection of cheese rind thicknesses in the Netherlands. The players will never know, but regardless of that lack they can still find the game valuable – because it works.
The ‘game corollary’ of assumptions and Lanchester’s Law is not wonky dice and random behaviour but more likely the very last game you played and thought worked. You probably didn’t know all the assumptions built into the rules. Some of them could easily have been rubbish. Who cares? It was a good game, which reflected your understanding of what could have been the reality of the military situation which it was representing.
Lanchester’s Law’s assumptions may be all kind of wrong, but the model built from them works. It might be an entirely lucky fluke or, possibly, game designers have designed games with the Law in mind or, possibly, the assumptions which cripple the Law’s real life performance are, in fact, valid within a given wargame or, possibly, a mixture of all this.
Cheers
Andrew
16/11/2018 at 10:40 #103907grizzlymc
ParticipantThere are two reasons that I think govern the failure of Lanchester’s square law.
One is that, in many environments, the smaller force can inflict disproportionate damage in a turn. Possibly because of frontage issues, or what the airforce call a “Target rich environment”.
But there is another, much harder to simulate reason, and wargames are famous for ignoring it.
A good illustration is McIntyres lunch rule. A given group of people can assemble in reception to go out to lunch together in a period proportionate to the exponent of their number. One person, says, I’m off for lunch, back at 2ish and flees inside 10 seconds. Two take about a minute and a half. Ten, never make it.
In bar brawls, it is surprisingly easy to take out the first of two people who are having at you, because they can’t coordinate. When you have done so, the second often remembers a pressing engagement.
16/11/2018 at 10:42 #103908grizzlymc
ParticipantI don’t understand any of this. But I’m disappointed in this thread. I saw the word Lanchester and was hoping for some of this…
Call that a Lanchester? This is a Lanchester:
The gentleman’s SMG
16/11/2018 at 10:49 #103910Whirlwind
ParticipantLanchester’s Law’s assumptions may be all kind of wrong, but the model built from them works. It might be an entirely lucky fluke or, possibly, game designers have designed games with the Law in mind or, possibly, the assumptions which cripple the Law’s real life performance are, in fact, valid within a given wargame or, possibly, a mixture of all this.
I think the last one is probably the one especially for games that, at heart, are derivative from the 1960s wargames. So for me it is quite instructive that Lanchester’s Law works better for wargames than they do for actual wars.
16/11/2018 at 11:16 #103911Guy Farrish
ParticipantFor me, it suggests the wargames that fit Lanchester’s Square Law aren’t very good models of reality either.
16/11/2018 at 11:27 #103912grizzlymc
ParticipantWe all knew that.
16/11/2018 at 12:21 #103919Guy Farrish
ParticipantExcellent news.
-
AuthorPosts
- You must be logged in to reply to this topic.