Apolyton Archive  |  Preserved copy of the Apolyton Civilization Site and its forums as they stood in September 2005. Read-only; nothing here can be posted to or replied to.  |  Forum index |  About this archive |  The 1998–2001 UBB forums
Today on Apolyton WARDELL INTERVIEW PROMO A.C.S. HISTORY CHAPTER 4 GET CIV4 /w FREE PLUS! A.C.S. PHOTO GALLERY GET A.O.M. V1.1
Apolyton Civilization Forums
main| civ2| civ3| civ4| smac| ctp2| ron| moo3| galciv| galciv2| alt| about|
ApolytonPLUS | register | search | faq | new posts | pm (-/-) | upload | members
hall of fame new! | civgroups | civgroups news | interviews | the column | radio | chat | directory | news | store | PLUS
Apolyton Civilization Forums : Powered by vBulletin version 2.0.3 Apolyton Civilization Forums > Miscellaneous > Archive > Civ2-Strategy-Archive > Is the combat formula wrong?
Show a Printable Version | Email This Page to Someone! | Receive updates to this thread | Report this to Apolyton news!

bottom of page
  
Author
Thread    < Last Thread     Next Thread > Post New Thread     Post A Reply
SlowThinker is offline SlowThinker
King
homeless, Praha, Czech Republic
Jan 2000
time: 06:15
  Old Post 26-08-2001 21:39 Visit SlowThinker's homepage!
Edit/Delete Message Reply w/Quote
#1 Report this post to a moderator
Is the combat formula wrong? Avatar Enlargement: We've got the solution

IMHO the combat formula
P = SUMn(COMB(n-1,dh-1) * (p^dh) * (1-p)^(n-dh))
mentioned in http://apolyton.net/forums/showthre...2856#theformula
is wrong

quote:
In layman's terms, P is the sum of the probabilities of the all possible outcomes of the attacker winning; For example, the odds of the attacker winning ten straight combats, plus that of winning ten out of eleven, plus that of winning ten out of twelve, and so on, added together to produce a grand total. The maximum number of rounds is the attacker's and defender's total hit points minus one. Basically, until the winner is left with a single hit point after destroying the loser. The defender's chance is (1 - winner's probability).
The problem is that the event "the attacker winning ten straight combats" is also one of events "the attacker winning ten out of eleven".
In other words,
sets

{events; the attacker winning ten straight combats}
{events; the attacker winning ten out of eleven}
{events; the attacker winning ten out of twelve}
...

are not disjunctive and so they must not be added up.

Last edited by SlowThinker on 26-08-2001 at 21:57

SlowThinker is offline SlowThinker
King
homeless, Praha, Czech Republic
Jan 2000
time: 06:15
  Old Post 26-08-2001 21:42 Visit SlowThinker's homepage!
Edit/Delete Message Reply w/Quote
#2 Report this post to a moderator
My proposition of the correct formula: Support Apolyton or Terrorists Win

Any line of dh+ah-1 combats (some combats are superfluous, because the result of the battle is known before the {dh+ah-1}th combat, but this does not matter) is an event.
(You may imagine an event as dh+ah-1 of bits. "1" means the attacker wins, "0" means the defender wins)
Events with at least dh wins of the attacker induce that the attacker wins the battle. Events with less than dh wins of the attacker induce that the attacker loses the battle.

P = SUMn(COMB(dh+ah-1,n) * (p^n) * (1-p)^(dh+ah-1-n))

Where "n" is summed from dh to dh+ah-1.

(n represents number of combat wins of the attacker
dh+ah-1-n represents number of combat wins of the defender
COMB(dh+ah-1,n) represents number of events where the attacker wins n combats)

SlowThinker is offline SlowThinker
King
homeless, Praha, Czech Republic
Jan 2000
time: 06:15
  Old Post 26-08-2001 22:57 Visit SlowThinker's homepage!
Edit/Delete Message Reply w/Quote
#3 Report this post to a moderator
Browse Apolyton AD-FREE

An additional note to the formula:
quote:
Originally posted by Marquis de Sodaq
Note: Modified hit points: An opponent's total hit points are divided by the unit's firepower. Thus an attacker with 2fp halves the defender's total hit points.

I think that these numbers should be rounded up.
In other words, both 9-hitpoints unit and 10-hitpoints unit have 5 modified hitpoints against a 2FP unit.

Marquis de Sodaq is offline Marquis de Sodaq
King
... no, a Marquis.
Jul 2000
time: 23:15
  Old Post 27-08-2001 06:11 Visit Marquis de Sodaq's homepage!
Edit/Delete Message Reply w/Quote
#4 Report this post to a moderator
Support Apolyton, buy Alpha Centauri

I suspect this thread is supposed to get my attention.

The problem is that the event "the attacker winning ten straight combats" is also one of events "the attacker winning ten out of eleven".

Your logic is correct. Winning ten straight can be seen as one of the eleven possible subsets of winning ten of eleven. As for replacing the formula, it is not necessary. The chances of winning the first ten combats (be it out of 10, 12, or any other number) are actually different combinations. Winning the first ten is one outcome, but whether that would have been followed by 1, 2, or 9 losses makes them different. Although they have the same result, they are mathematically exclusive occurences.

Just in case I misunderstood you, I adopted your suggestion into my Excel calculator. The math ends up the with the same results. I believe, unless I have misread something, that you have discovered another way to come up with the same number. Let me know if you think what you have suggested changes the result, in which case I will redo my checks.

Marquis de Sodaq is offline Marquis de Sodaq
King
... no, a Marquis.
Jul 2000
time: 23:15
  Old Post 27-08-2001 06:13 Visit Marquis de Sodaq's homepage!
Edit/Delete Message Reply w/Quote
#5 Report this post to a moderator
Suffering from ads?

quote:
Originally posted by SlowThinker
I think that these numbers should be rounded up.
In other words, both 9-hitpoints unit and 10-hitpoints unit have 5 modified hitpoints against a 2FP unit.

This part I have not yet tested. My calculations allow for the half (e.g. 4.5).

SlowThinker is offline SlowThinker
King
homeless, Praha, Czech Republic
Jan 2000
time: 06:15
  Old Post 28-08-2001 01:20 Visit SlowThinker's homepage!
Edit/Delete Message Reply w/Quote
#6 Report this post to a moderator
Support Apolyton or Terrorists Win

quote:
Originally posted by Marquis de Sodaq
This part I have not yet tested. My calculations allow for the half (e.g. 4.5).
I proceeded from the description of the combat system yesterday.
But I have tested it now. I think I am right. A 9FP 1HP unit is very weak against a 10FP 1HP unit, my results corresponds to a 5FP 1HP unit against a 10FP 1HP unit.

SlowThinker is offline SlowThinker
King
homeless, Praha, Czech Republic
Jan 2000
time: 06:15
  Old Post 28-08-2001 01:25 Visit SlowThinker's homepage!
Edit/Delete Message Reply w/Quote
#7 Report this post to a moderator
Get a bigger avatar today!

quote:
Originally posted by Marquis de Sodaq
IMHO, the combat formula is correct.






Yesterday I thought there is COMB(n,dh) in the original formula (it would correspond to "the odds of the attacker winning ten straight combats, plus that of winning ten out of eleven, plus that of winning ten out of twelve").

Now I have understood that there is "-1" in the COMB expression, because the last combat must be won by the attacker, only first n-1 combats participate in combinations.
"n" represents the number of combats needed to destroy the defender, i.e. the defender is destroyed exactly in the n-th combat.

The outcome: the original combat formula is correct.

Last edited by SlowThinker on 28-08-2001 at 01:37

Marquis de Sodaq is offline Marquis de Sodaq
King
... no, a Marquis.
Jul 2000
time: 23:15
  Old Post 28-08-2001 06:49 Visit Marquis de Sodaq's homepage!
Edit/Delete Message Reply w/Quote
#8 Report this post to a moderator
Support Apolyton, buy Galactic Civilizations

Thanks again for testing what is becoming accepted as rote. The formula is a bit confusing to translate into coherent, language-based thought. That final -1 does indeed account for the necessary final win by the attacker.

Boco is offline Boco
Prince
who was once King for a week.
Jan 2001
time: 00:15
  Old Post 28-08-2001 07:40 Visit Boco's homepage!
Edit/Delete Message Reply w/Quote
#9 Report this post to a moderator
Try BINOMDIST Suffering from ads?

This may already be known, but Excel has a worksheet function that appears to calculate P (overall probability) from p (probability per round) quite accurately in a single cell. In the English version it is:

"=1-BINOMDIST(dH_over_aF-1,aH_over_dF+dH_over_aF-1,Prob_per_Round,TRUE)" ,

where
dH_over_aF = def hit point / att firepower,
aH_over_dF = att hit point / def firepower,
Prob_per_Round = probability of victory per round (p),
TRUE forces the function to return the cumulative binomial distribution function.

Read the Excel help file on this function for more information. Using BINOMDIST also corrects a error in my flawed invocation of the Euclid/Buenos equation (E/B), which used Excel's COMBIN with ~60 rows of n (i.e. calculating P from p took ~180 cells!). The flaw is shown in the following example.

4a, 20hp, variable fp attacking 5a, 20hp, 1fp

Att fp E/B BINOMDIST dH_over_aF
1___7.6%___7.6%____20 (7.6% matches the number posted in the Eggman/Euclid/Buenos thread*)
2__74.3%__74.3%____10
3__70.6%__90.6%_____6.67
4__98.2%__98.2%_____5
5__99.3%__99.3%_____4
6__80.7%__99.8%_____3.33
7__57.4%_100%______2.86
8__67.6%_100%______2.50
9__76.7%_100%______2.22

Looks like I didn't truncate dH_over_aF to an integer properly. In any event, BINOMDIST in a single cell is far more elegant than a 180 cell calculation.

*http://apolyton.net/forums/Archives...4-1-000624.html

Marquis de Sodaq is offline Marquis de Sodaq
King
... no, a Marquis.
Jul 2000
time: 23:15
  Old Post 28-08-2001 18:57 Visit Marquis de Sodaq's homepage!
Edit/Delete Message Reply w/Quote
#10 Report this post to a moderator
Avatar Enlargement: We've got the solution

Thanks, Boco. My Excel work also involved separate probabilities in rows, with a set of SUM cells for different ranges. It also took up 60+ rows. I'll look at that BINOMDIST function, it could save a heap of clutter in the calculation!

  < Last Thread     Next Thread > Post New Thread     Post A Reply
All times are GMT. The time now is 05:15.
Apolyton Time is 00:15.
    top of page
Rate This Thread:
archivepost
Forum Jump:
Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is ON
vB code is ON
Smilies are ON
[IMG] code is ON
 




Contact Us - Apolyton Civilization Site - Support Us!

Building a better Apolyton through better information. Click here and take our poll!
Non-US visitors, click here!

Powered by: vBulletin Version 2.0.3
Copyright ©2000, 2001, Jelsoft Enterprises Limited.

Page generated in 0.0470 seconds (89.36% PHP - 10.64% MySQL) with 31 queries
Page Loading Time:

Support Apolyton: Amazon USA | Amazon UK | Amazon DE | Amazon FR |
Support Apolyton and get FREE PLUS, Buy from Chips&Bits: Galactic Civilizations | Galactic Civilizations: Deluxe Edition | Call to Power 2 | Civilization: The Boardgame | GURPS/ Alpha Centauri | Alpha Centauri | Civilization IV | Civilization III: Complete |


Front Page | Civilization IV | Civilization III | Civilization II | Call to Power II | Alpha Centauri | Master of Orion III
Rise of Nations | Galactic Civilizations | Galactic Civilizations II | Misc
Alt.Civs | Civ I | C:CtP I | About | News | Directory | Apolyton Store | Forums | Chat | Columns | Interviews | Newsletter
Scenario League | CSC | Clash of Civs | Spanish Site | CtP Maps | Cradle of Civ | WesW's Ctp1/2 Site | Civ3 Haven

apolyton.net | apolyton.com | civilization2.net | civilization3.net | civilization4.net | civilizationiv.info | calltopower.net | galciv.net | galciv2.net | moo3.net