• 2007 AAR League

    I added some units, but then it doesn’t do anything when I press Start, and then I tried again and it froze Firefox. Also why are there 2 start buttons? I pressed the 1st one.


  • Hey,

    I have been following this conversation very loosely so sorry if you have already covered this.

    Earlier you had mentioned that if you wanted to create a calculator you would need to make a system that “rolled” the dice for each scenario several times. As I am sure we can all agree the more times we roll for the scenario the more accurate the results (for example 100 times versus 1,000 times).

    I fail to see the point in going through all the trouble for that because we know that if a lone infantry unit attacks he has a 1/6 of a change of making a hit. The more times we roll the more our control results will resemble that so having a scenario roll x number of times would just reinforce that our answer would be 1/6 of a chance right?


  • I’ve been lossly folowing this conversatin too. but they are trying to build a calculator that only does it based on probabiblity. that way you get a “true odds” calculator.


  • I am an engineer with an adequate understanding of statistics to solve this problem.  As a matter of fact, I am solving discrete problems of this kind in another thread in AAR forum.  I am using Microsoft Excel to do the work, but there is much work on my part to make it happen.  The longer I play around with it, the more short cuts I discover.

    First, there are two things being discussed here.  The OP wants to know the odds.  This is a different thing from a dice simulator.  A dice simulator can be used with some work to compute the odds, but would have to be used with much care to do so.  Computing the odds though, can be done in a direct calculation if you understand the tricks.

    There are two steps.  The hard step is developing the permutations tree that must be completed to establish the possible outcomes that must be computed.  After this step, the probabilities must then be computed.  For naval battles with subs, this becomes even more difficult.  Also, loaded transports is a problem.  But lets skip all that and stick with the basics.  (Note:  The good thing about these problems though is that naval battles involve many fewer units, and this helps keep the permutations down.)

    If two units attack two defenders, there are eight outcomes that must be considered.  This comes from the calculation that two defenders may get one of three outcomes (0 hits, 1 hit & 2 hits) and the attackers as well have three outcomes.  This produces 3 x 3 = 9, except we must subtract 1 because no attacker hits and no defender hits is a non event.  This is how I get eight permutations.  Representing the permutations visually we can see …

    X  A  B
    C  D  E
    F  G  H

    Where X is a non-event.

    “A” might be one attacker gets hit by a defender, “B” is both attacker get hit by defenders without hitting the defenders at all.  “C” would be the defender misses, “D” the defenders get one hit on the attackers, and “E” is where both defenders hit the attackers while the attackers get one hit on the defenders.  The last line, “F, G, H” represent no hits, one hit and two hits on the attackers while the attackers deliver two hits themselves.  But if you think that is fun, you need to recognize that in cases A, C & D, the atacker gets to decide if he would like to proceed.  In the end, you can arrive at F, by passing through C; you can arrive at G by passing through A, C or D (or some combinations of these); and you can arrive at other states, B, E and H by passing though others as above.

    To develop the whole odds calculator for this simple battle, you have to study the original 3 x 3, and 2 - 2 x 3s and one more 2 x 2, eliminating the non events.

    Now that we have the permutations, we can do the probabilities.  This is where Pascal’s triangle comes into play, and where I will end my version of the explanation until I have more time.

    Note:  I made this post to give another explanation of the ideas involved in case some found the earlier discussions confusing.  There were earlier discussions that were very accurate and I want to point out that I am not correcting these earlier posts.  I am only trying to explain the ideas using a new approach in hopes that some will better connect with my approach to the ideas.  This is a wonderful game and I am using it to teach my son math while he enjoys the lessons.  I am even painting the game pieces to keep him all the more interested.  After all, not everyone enjoys math as much as I.  -  Merry Christmas

  • 2007 AAR League

    I don’t understand that all, but thank you anyway. I am willing to make my PHP code for frood.net/aacalc/ available to anyone who wants to try to build a statistical engine for it like this.

    Now, I think where it gets really tricky is with subs especially. There you have different numbers of hits against different types of units. Can you accommodate that?


  • @Ender:

    I don’t understand that all, but thank you anyway. I am willing to make my PHP code for frood.net/aacalc/ available to anyone who wants to try to build a statistical engine for it like this.

    Now, I think where it gets really tricky is with subs especially. There you have different numbers of hits against different types of units. Can you accommodate that?

    Yes, let me see that code.  Can’t promise I’ll do anything with it, alas.  But I do like to read code, and maybe something will come of it.  (omg code pervert!)

    I think you’re talking about not the fact that subs have opening fire, but the fact that subs are restricted to hits against naval units.  But either way, opening fire, or subs being restricted to hits against naval (i.e. not air) units, the code CAN be put into the odds calculator program.  Not saying it’s easy, but it isn’t really that awful.

    Initially, the user inputs a variable number of attackers and a variable number of defenders, like “2 sub 1 transports 1 destroyer 1 battleship 4 fighter 1 bomber attack 1 sub 5 transports 1 battleship 1 carrier 2 fighter”.

    The tricky part here is that if the odds calculator is ideally programmed, the user should be able to have total control over casualty removal, so in THEORY if the attacker got four hits, the program could be programmed to destroy the defending battleship (take two hits on the battleship), the defending sub, and a defending transport.  Programming THAT in could be pretty heinous, particularly if the user has if-then scenarios in mind.  (ew, I shudder to think)

    BUT . . . I digress.  To make a long story short, assume the PROGRAM (not the user) will make casualty order decisions.  So it’s simple.  Attacking subs fire in opening step.  (They fire regardless of whether or not enemy has destroyers, only casualty removal changes).  Defender is forced to take casualties from eligible casualties (each unit type would have to be typed as “land”, “naval”, or “air” (also useful for making calculations for capturing territory (land only), checking to see what subs can hit (naval only), and checking to see what AA guns can hit (air only) among other things).

    So when the attacking subs fire, the program chooses casualties, then defending subs fire, then battle and odds calculation proceeds as usuall.  So long as the program doesn’t have to change its order of casualty removal, it’s pretty straightforward to program (even if it does take a while)

  • 2007 AAR League

    e-mail me (rempel at  gmail) if you want the code. I’m thinking I might be done with it.

    I had a scheme whereby I would support unit-by-unit OOL but it was tied into my new (I thought improved) text-parsing input system and people just complained, so that kind of killed it for me. That’s the direction I wanted to go in, but the users didn’t like it, so not much point developing it further. I do it for fun, so if it’s not fun, why bother?


  • Hello,

    I decided to make an odd’s calculator to determine on a 100% scale who[attacker, defender] has what odds.  I found this post and dug through the info a bit.  Interesting stuff.  I think most people are taking different routes to attempt the same effect.

    I have some idea on how I want to go about doing this but I’m not sure if it is giving the true odds.  I racked my brains last night to come up with some form of an algebra formula to determine the odds.  I started simple and worked my way up to AA vs Fighters, this is what I’ve come up with.

    Dice:

    Odds on rolling a 1 or less:
    16.6%
    Odds on rolling a 2 or less:
    33.3%
    Odds on rolling a 3 or less:
    50%
    Odds on rolling a 4 or less:
    66.6%
    Odds on rolling a 5 or less:
    83.3%

    So we have the first variable for the formula which would obviously correspond to the attacking unit or defending unit.  So here are the other variables that I’ve thought of.

    Attacker:
    How many attacking units[Atk]
    the reason for this number is so you can determine now many hits you can take before a loss
    Odds on rolls [Atk]
    Determines the odds of a hit all around for different units
    How many first strike attacking units [Atk]
    If I’m thinking correctly, the odd’s of this unit’s hit would come right off the top of the corresponding unit.
    How many defending units [Def]
    This would determine how many hits the defender could take before a loss
    Odds on rolls [Def]
    this would determine the odds on each unit types odds of hitting
    How many first strike defending units[Def]
    If I’m thinking correctly, the odd’s of this unit’s hit would come right off the top of the corresponding unit.

    So for an easy example, to test out the theory we could use this setup:

    Attacker:

    2 Soldiers
    1 tank
    3 Planes

    Defender:
    1 AA
    1 Soldier
    3 Tanks
    1 Plane

    Beginning the battle the AA would have a shot at taking the planes out of the equation.  So I think we need to look at that area first.

    1 plane has a 50% chance of scoring a hit.  Fighters attack on a 3.  We have 3 attacking planes, which have the combined chance of 50%.  So adding planes does not effect the chance, this is why I think this.

    Knock the decimal over two spots and you get .05, add that three times and you get 1.5, divide that by the number of units and you get 50%.  The reason for returning to 50% is that by adding more planes, your adding the chance of a hit plus the chance of a miss.  So 1 plane’s odds is the same as 3 planes odds @ 50%.  So it’s safe to say that 1/2 your planes will hit by the odds.

    The AA unit defends by attacking each fighter separately, in effect we’ll only be looking at one because one odd is the same as 3 right?  The AA unit defends on a 1 [16.6%] chance.  This is where I could be wrong, but I think that you would take the AA’s odds off the fighters odds.  So with an AA defending, your planes have the combined chance of 33.4%.  The reason for this is because that AA would take the fighter out of the equation, by subtracting the AA’s chance off of the fighters chance we would get the true chance of that fighter, thus all of the fighters chances because the AA effects them all.

    Now if there where a bomber then you would do this separate from the fighters.  Bombers attack on a 4 [66.6%], having the AA unit defending [16.6%] then the bomber would have the odds of [50%].  You would calculate this separate because the bomber attacks on a different number.

    So now we come to this conclusion:

    Attacker:

    2 Soldiers (attack on 1 [16.6%])
    1 tank (attack on 3 [50%])
    3 Planes (attack on 3 [50%]) coupled with the AA’s odds gives us a 33.3%

    Defender:
    1 AA (attack on a 1[16.6%]) Effecting Air units only and it is already calculated
    1 Soldier (Defends on a 2 [33.3%])
    3 Tanks (Defends on a 3 [50%])
    1 Plane (Defends on a 4 [66.6%])

    This is where I’m kind of stuck, I think what we would do now that we’ve figured out all the ending chances is turn those percentages into numbers by moving the decimal over two spaces or dividing the percent number by 10. So we would add all attacking numbers first.

    Attacking units:
    Soldiers: 16.6% / 10= .166 x 2 Soldiers = .332
    Tanks: 50% / 10= .5 x 1 tank = .5
    Fighters: 50% - 16.6% = 33.3% / 10 = .333 x 3 Fighters =  .999
    Total Attack Value (TAV)= 1.831

    Defending Units:
    AA’s = Already Formulated inside the Attacker’s Planes
    Soldiers: 33.3% / 10= .333 x 1 soldier = .333
    Tanks: 50% / 10 = .5 x 3 tanks = 1.5
    Fighters: 66.6% / 10 = .666 x 1 fighter= .666

    Total Def Value(TDV)= 2.499

    Now add the two total values to get the dividing number for the percentage chance of victory. So this is our final formula:

    [TAV/(TAV+TDV)]*10= attackers chance of success.

    1.831/4.33= .422*10= 42.2%

    This gives the attacker a 42.2% chance of a victory and the defender a 57.8% chance of victory.

    I think this is right, but I thought I would add this in so someone could dig through and tell me if my logic for the formula is correct.

    You have to remember that this is a beginning phase only calculation, you would need to redo the calculation for every complete turn.  So the defender would roll for each plane, then attacker would roll for all units left, then defender would roll for his units.  Then at the “attack or retreat phase” you would recalculate the odds to determine the new odds of success with the remaining units attacking and defending.

    Now I’m cranking my brain to figure out the first strike bombarding stuff for battleships.  Because it would only be used one time, this could be somewhat difficult to get a true chance of success.  It might be easier for you not to even add the bombard into the equation, so that you can use it as a “bonus” or undefined variable.

    Subs are easier, they’re basically the same as the AA units in that formula.  The only difference is if there is an enemy destroyer present, then you would calculate them as a normal unit, not a first strike unit.

    Battleships add to the total defense value due to having the ability of taking 2 hits.  This adds a dimension to the equation that I have yet to dig into.  The number of units is a variable that you could call defense that both attackers and defenders have.  I need to work that into the equation somewhere and perhaps cross calculate with the possible attack values.

    I think when this is all said and done, the calculator would give you a percent chance of success and the number of turns it would take to win.  You would have to recalculate every full turn like I said earlyer and that would change your chances every full turn. That would give you a way of determining whether or not to retreat units that can retreat.

    So for example, if your defending and your chance of success drops after the first round to 30%, then it would probably be a good idea to retreat your plane(s) and sub(s).  Or if your a horrible gambler like myself, continue with your low odds lol.

    I would appreciate any feedback on this negative or positive, I’m curious as hell whether or not this is correct.  Yeah, curiosity killed the cat, it’s probably going to kill me too lol.


  • I think there is something wrong with your numbers concerning Fighters and bomber vs. an AA.

    An AA has a chance of 1/6 to hit a air unit. Therefore any air unit has a chance of 5/6 to be alive when combat starts. This would lead to a chance of geting a hit by a fighter of 5/63/6 or 5/61/2=5/12. This leads us to a chance of 0.41667 or roughly 42 %


  • hrm, so I guess I would have to readjust the values and run it through the formula, and that would be…

    Attacking units:
    Soldiers: 16.6% / 10= .166 x 2 Soldiers = .332
    Tanks: 50% / 10= .5 x 1 tank = .5
    Fighters: 50% * 83.3% = 41.6% / 10 = .416 x 3 Fighters =  1.248
    Total Attack Value (TAV)= 4.16

    Defending Units:
    AA’s = Already Formulated inside the Attacker’s Planes
    Soldiers: 33.3% / 10= .333 x 1 soldier = .333
    Tanks: 50% / 10 = .5 x 3 tanks = 1.5
    Fighters: 66.6% / 10 = .666 x 1 fighter= .666
    Total Defense Value (TDV)= 2.499

    4.16/6.659= .624*10= 62.4%

    So then the attacker would have a 62.4% chance and the defender would have a 37.6% chance?  I guess that sounds about right then.  Hrm, I was so sure I had it but that does look like it would be correct.  Thanks for the heads up ;)

Suggested Topics

Axis & Allies Boardgaming Custom Painted Miniatures

26

Online

17.1k

Users

39.3k

Topics

1.7m

Posts