Especially want one that can be used with just Pacific Edition 1940 2nd edition please:)
True odds calculator
-
I made a calculator in a non-internet based Java application that runs the simulation 1 mil, 4 mil, or 16 million times divided by the number of units in the battle, depending on the settings. So, for instance, if you run a battle with 10 units on each side on high accuracy, it will run 800000 times in about 5 seconds, and come within 1/10th of a percent every time. And Java is even considered slow compared to other languages like c++.
Your problem, Frood, is just that its going to run allot slower on an internet based program, unless there is some alternate language or method that works better. I guess it ends up being a trade-off between accuracy/time and convenience.
Does your sim handle submarines and abort conditions and such? I think those things really slow it down too.
Not that it matters, do you REALLY need to know to an accuracy of 1% or less?
-
Does your sim handle submarines and abort conditions and such? I think those things really slow it down too.
Not that it matters, do you REALLY need to know to an accuracy of 1% or less?
Yes, it does, to the best of my understanding of the rules, and I think I have everything down right. The only real problem it has that I know of is that the IPC lost details assume that units always die in the same order, so it just gives the results in numbers of units remaining, but in the case of AA guns and subs, this is not always the case. I didnt think of that, though, until later and I dont feel like changing it now. Not that its really a big deal, since it doesnt affect the actual chances.
As far as the accuracy thing, well, I didnt really think it was necessary either, but apparently some people want it REALLY accurate. :-)
-
I’d like to build a Java version of AACalc, but sadly I do not speak Java :(
A Java app would have much greater portability, obviously. What yours lacks is some of the flexibility and detailed output that AACalc generates. I’d be interested in collaborating on a java-based tool.
True Odds calculation would be even better, if we could do that. Maybe me, you and Mot could all contribute - Mot seems to understand the math involved in true odds calculation.
-
Im not really that interested in this anymore, but I could give you the source if you want and you can do whatever you want with it-I warn you though, it wasn’t exactly designed for anyone else to read.
BTW you know there are more options and results in separate windows right?
-
No I hadn’t noticed. (runs to check) Hey that’s cool! Except the bar graphs do this transparent thing that shows whatevers behind the window there, it’s very distracting.
I wouldn’t mind playing with the source, be a good way to learn Java maybe. PM me for my e-mail addy.
-
I’d like to build a Java version of AACalc, but sadly I do not speak Java :(
A Java app would have much greater portability, obviously. What yours lacks is some of the flexibility and detailed output that AACalc generates. I’d be interested in collaborating on a java-based tool.
True Odds calculation would be even better, if we could do that. Maybe me, you and Mot could all contribute - Mot seems to understand the math involved in true odds calculation.
I’ve done some Java and I am slightly tempted…once we are in the fall and things get more sane…hmmm…
-
http://en.wikipedia.org/wiki/Pascal’s_triangle
oo pascal u secksy fiend, you cut down calculation time so much . . . leaves time for other things.
Maybe if we get nekkid pix of Jen then I can be um, inspired, to write a true odds calculator.
-
I would like to see a true odds calculator. The problem is that my math is rusty and I’m not sure how to handle complex probability calculations such as would be required for Axis & Allies.
Anybody good with probability computations? I just need help with the math.
I have already figured out that a true odds calculator should use memoization otherwise large complex battle computations will take as long as a dice simulator. (Memoization is basically caching results of previous calls to a function for future use, it’s perfect for these math related operations).
Honestly, I dunno wat a “memoization” is.
I will say tho that large complex battle computations take a lot LONGER than a dice simulator.
Me am Dice Simulator. Me say “You hit twice.”
Me am Large Complex Battle Computer. Me say “You hit 20%. You miss 30%. Ur enemy hits 15%. 35% of time scenario repeats.”
Here’s wat u do (simple)
First you get Microsoft Excel and someone that knows how to plug in formulas and stuff and use concatenation etc. Then you put the first 100 or so lines of Pascal’s triangle into a big array of arrays. (So the first array element of the array of arrays will be “1”, the next will be “1, 1”, the next will be “1, 2, 1”)
You need to do this because it cuts down on calculation time a lot.
Then you write the bit that gets the user input.
Then you split the user input into types. Like, let’s say that the user input is “3 infantry 1 tank attacking 2 infantry”. You split that into “3 attacking infantry”, “1 attacking tank”, and “2 defending infantry”.
Then you use Pascal’s triangle to generate a list of possible outcomes for each of those types. Like let’s say you attack with 3 infantry. You have a (1/6) ^ 3 to hit 3 times, a 2 * ((1/6)^2*(5/6)) to hit 2 times, a 2 * ((1/6)*(5/6)^2) to hit 1 time, and a (5/6) ^ 3 to hit 0 times. You can see the Pascal’s triangle element; “1, 2, 2, 1” here. (You can use combination mathematics, but just making a fat Pascal’s triangle array is a lot more efficient on calculation time).
Okay, so once you have a list of possible outcomes for each of those types, you multiply the attackers list together (and give the appropriate output), and then you multiply the defenders list together (and give the appropriate output).
Now, there’s a certain probability that nobody will get a hit. If you want to rerun the battle if nobody gets a hit on the first round, or report the result, whatever. But realize that you can’t ask the program to “resolve” an unresolvable battle. If you don’t write in something to account for the probability that nobody gets a hit, you could stick your program into an infinite loop.
Easiest way to do it is to make each probability outcome fraction (use fractions, not percentages for in-program calculation) have a common denominator. Then you whack out the probability of all missing, and add up the remaining numerators to get a single denominator.
I’d do it myself, but I need nekid Jen pix for inspiration . . .
-
I’d like to build a Java version of AACalc, but sadly I do not speak Java :(
A Java app would have much greater portability, obviously. What yours lacks is some of the flexibility and detailed output that AACalc generates. I’d be interested in collaborating on a java-based tool.
True Odds calculation would be even better, if we could do that. Maybe me, you and Mot could all contribute - Mot seems to understand the math involved in true odds calculation.
Hey Frood, I’ll be on vaca next week. While sitting on the beach I might have a chance to skecth out in Java psuedo-code the implementation I was describing before. I’ll let you know how I make out, if I get far enough to be useful then we can collaborate.
Mot
-
With all due respect NPB, I think the problems you raise can be dealt with.
1. Battle rounds with no hits can be ignored, because it is as if they never happened. The exception is that if it is the first round, it may allow an opportunity for the defender to submerge subs.
2. Ultimately there are only a relatively small number of possible outcomes. There are a great many paths leading to those outcomes, but they can be collapsed into each other using certain programming tricks that I have an inkling of and that I think Mot knows how to pull off.
Even if it only works for smaller battles, it would still be worthwhile I think. The added benefit would be that it would be downloadable but still provide the same kind of output as AACalc (at least that’s my hope)
-
With all due respect NPB, I think the problems you raise can be dealt with.
So u got teh nekid Jen pix? Anyways, I never said the problems were insurmountable, not by any means. It’ll just take a bit of time and effort (looks around vaguely while zaphod beeblebroxing towards door . . .)
1. Battle rounds with no hits can be ignored, because it is as if they never happened. The exception is that if it is the first round, it may allow an opportunity for the defender to submerge subs.
They shouldn’t be ignored. First, no hits is a possible outcome that should be representable when requesting outcomes after (x) rounds of combat. Second, it is EASIER to calculate the no-hit probabilities as well as the hit probabilities with the Pascal triangle. It is so much easier, that I think it probable that instead of eliminating the no hit probability (as I originally outlined), it may be better to put in an error catch routine and use Pascal triangle multiplication on the whole thing.
2. Ultimately there are only a relatively small number of possible outcomes. There are a great many paths leading to those outcomes, but they can be collapsed into each other using certain programming tricks that I have an inkling of and that I think Mot knows how to pull off.
OoOOoOOooOO what are these programming tricks? Are they language specific, or just general programming guru stuff? I program a bit myself . . .
Even if it only works for smaller battles, it would still be worthwhile I think. The added benefit would be that it would be downloadable but still provide the same kind of output as AACalc (at least that’s my hope)
-
Hi guys. I’m back from vacation but I’m still ctaching up with work and emails and all that.
I’ll definitely takes a look at your links and ideas, newpaintbrush, as anything to help optimize the odds calculation is a good thing.
I’ll post again once I’ve got my head above water.
Later!
Mot -
I would like to see a true odds calculator. The problem is that my math is rusty and I’m not sure how to handle complex probability calculations such as would be required for Axis & Allies.
Anybody good with probability computations? I just need help with the math.
I have already figured out that a true odds calculator should use memoization otherwise large complex battle computations will take as long as a dice simulator. (Memoization is basically caching results of previous calls to a function for future use, it’s perfect for these math related operations).
Honestly, I dunno wat a “memoization” is.
I will say tho that large complex battle computations take a lot LONGER than a dice simulator.
Me am Dice Simulator. Me say “You hit twice.”
Me am Large Complex Battle Computer. Me say “You hit 20%. You miss 30%. Ur enemy hits 15%. 35% of time scenario repeats.”
Here’s wat u do (simple)
First you get Microsoft Excel and someone that knows how to plug in formulas and stuff and use concatenation etc. Then you put the first 100 or so lines of Pascal’s triangle into a big array of arrays. (So the first array element of the array of arrays will be “1”, the next will be “1, 1”, the next will be “1, 2, 1”)
You need to do this because it cuts down on calculation time a lot.
Then you write the bit that gets the user input.
Then you split the user input into types. Like, let’s say that the user input is “3 infantry 1 tank attacking 2 infantry”. You split that into “3 attacking infantry”, “1 attacking tank”, and “2 defending infantry”.
Then you use Pascal’s triangle to generate a list of possible outcomes for each of those types. Like let’s say you attack with 3 infantry. You have a (1/6) ^ 3 to hit 3 times, a 2 * ((1/6)^2*(5/6)) to hit 2 times, a 2 * ((1/6)*(5/6)^2) to hit 1 time, and a (5/6) ^ 3 to hit 0 times. You can see the Pascal’s triangle element; “1, 2, 2, 1” here. (You can use combination mathematics, but just making a fat Pascal’s triangle array is a lot more efficient on calculation time).
Okay, so once you have a list of possible outcomes for each of those types, you multiply the attackers list together (and give the appropriate output), and then you multiply the defenders list together (and give the appropriate output).
Now, there’s a certain probability that nobody will get a hit. If you want to rerun the battle if nobody gets a hit on the first round, or report the result, whatever. But realize that you can’t ask the program to “resolve” an unresolvable battle. If you don’t write in something to account for the probability that nobody gets a hit, you could stick your program into an infinite loop.
Easiest way to do it is to make each probability outcome fraction (use fractions, not percentages for in-program calculation) have a common denominator. Then you whack out the probability of all missing, and add up the remaining numerators to get a single denominator.
I’d do it myself, but I need nekid Jen pix for inspiration . . .
Got it. That is a handy shortcut.
-
Propellerhead Alert!!! :lol:
-
I have written and posted a Java A&A Odds Calculator…a naval battle simulator is also available. Feel free to use it…Firefox is really recommended as Microsoft has really messed with Java support in Internet Explorer 7.
-
OK. Now it’s working both with IE and Firefox. Apologies for any issues.
Please respond to info_AT_cascadiatechnology.com with any issues or feedback you have!
Thanks.
-
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 HWhere 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