# Your experience with combat odds...?

Discussion in 'Civ4 - Strategy & Tips' started by Tobiyogi, Oct 21, 2019.

1. ### TobiyogiPrince

Joined:
Nov 23, 2018
Messages:
467
Gender:
Male
Location:
Berlin, GE
Sure, that specific book wants to teach how to win in lotteries but the underlying law of the large numbers is an empiric theory that you can prove in action over long periods. I was expecting similar odds with Civ 4, to be honest, but as I stated earlier, every single fight portrays a single situation that is a bit different than the previous one, so there is no "memory". In a lottery or roulette, every single situation however has exactly the same framework and so it is repeatable.

2. ### drewisfatPrince

Joined:
Feb 8, 2011
Messages:
424
I believe that this was a thing early in the game, where first strikes were given an estimate that was the "expected value" of all first strikes instead of going through the individual possibilities of all the first strikes. The result was if a lot of first strikes were present extreme values tended to be too extreme. So a battle that showed 99% odds may be more like 98% (and visa versa on the low end). I believe this was fixed though.

I also believe it was suggested by people with more coding and math expertise than myself, that the "RNG" used in this (and other games) has limitations and is streakier than a true RNG. This means if you send in say 5 units each at 75% odds, the odds of losing all 5 battles in a row should be 1/1024, but in practice it will happen more frequently. This jives with my personal experience.

3. ### sampsaGhost

Joined:
Jan 1, 2006
Messages:
1,890
Location:
Finland
It doesn't matter if every situation has exactly the same framework or not. There is no "memory" even if it is, and judging from your comments it's unclear to me if you understand what law of large numbers means.

4. ### TobiyogiPrince

Joined:
Nov 23, 2018
Messages:
467
Gender:
Male
Location:
Berlin, GE
You are always a bit on the "doubting side" judging by some of your answers, don't you? I may not express myself right all time but I see exactly what it means. I even found a last chapter here where the author claims that his long term studies have shown "undeniable agreement between actual lotto results and probability estimation. The agreement between the actual statistics and theoretical estimation proves that the lottery follows The Law of Large Numbers."
Memory doesn't mean for me outer force. It is more like some inherent order that keeps on making a proving repeatable, and only under the same conditions. You cannot compare two lotteries with different amount of numbers.

In Civ 4 spoken, on a long testrun, when I WB create a city with three archers (no promotions, no fortification) and I attack with three AGG axes, no promotions, with combat odds of let's say 60% and if I repeat that endlessly, I should win in average 6 out of 10 fights. Surely not 6 out of the first 10 attacks, but maybe 600 out of 1000. At some point, it has to even out, that means probability in action for me. Because that situation is always the same, the odds are always the same and it is repeatable. How comes that it evens out over several thousand trials, if there is not a kind of "memory"?
What kind of "force" makes it happen? I don't expect someone to count but it is indeed very close to the lottery situation where numbers fall in the exact proportion after years.

Last edited: Oct 21, 2019
5. ### sampsaGhost

Joined:
Jan 1, 2006
Messages:
1,890
Location:
Finland
OK. I probably misunderstood some of your comments or they were too philosophical for my understanding.

Let's take an example from poker, as there are magnificent variance calculators available online. https://www.primedope.com/poker-variance-calculator/ You can freely ignore all the other parameters and only alter the "number of hands to simulate". At 1M hands the difference between "best" and "worst" seems quite significant (in my sim best:55,855, worst:-9,979, difference of 65,834). Add 3 zeros to "number of hands to simulate" and the chart seems to show that it's evening out, just like the law of large numbers predicts. "Best" is now 26,040,266 and "worst" is 23,972,107, difference of 2,068,159. So while as the chart shows, "best" and "worst" are proportionally getting closer to each other, their numerical difference is growing. The law of large numbers only means that they get proportionally closer to each other, nothing more, nothing less.

6. ### AcaMetisPrince

Joined:
May 21, 2018
Messages:
598
Gender:
Male
I believe the force you're looking for is "a reasonably well programmed pRNG", in Civ IV's case.

7. ### sampsaGhost

Joined:
Jan 1, 2006
Messages:
1,890
Location:
Finland
The problem is your assumption "At some point, it has to even out". It doesn't even out. It might theoretically even out at infinity, but we don't care about that. It doesn't matter if the odds are always the same and it is repeatable. There is no "memory". There is no "force". Lottery balls don't fall in the exact proportion after years.

As AcaMetis hints, there is also no perfect RNG. I have no idea how good cIV:s pseudo-RNG is, but I'd assume decent ones are not very hard to code, and by decent I mean near perfect.

I guess this is my last post on this subject.

8. ### AcaMetisPrince

Joined:
May 21, 2018
Messages:
598
Gender:
Male
If memory serves me right a decent pRNG is really easy to program, you just have to be careful that whatever uses those numbers doesn't require an impossible sequence to generate a certain result. A near perfect pRNG is basically an oxymoron, however, since a pRNG that gets stuck rolling the same number many times in a row isn't considered a good pRNG, but a pRNG that can't get stuck like that isn't truly "random" either. That issue you basically have to solve on the end of whatever interprets those numbers, but of course that can be done as well as it can be done poorly.

As far as Civ IV is concerned I've no idea if the game is programmed well or not in that respect. It seems to be, since it can roll extreme results (losing battles at 99% odds) and doesn't seem to consistently get stuck rolling the same result too often (winning 10 battles at 90% odds in a row 100% of the time), but without checking the source code there's no way to say for sure.

Tobiyogi and sampsa like this.
9. ### lymondRise Up! (Phoenix Style!)Hall of Fame Staff

Joined:
Mar 11, 2008
Messages:
20,820

Tobiyogi likes this.

Joined:
Jan 1, 2006
Messages:
1,890
Location:
Finland
FYP

11. ### pigswillfly (one day)

Joined:
Apr 29, 2006
Messages:
8,656
Location:
berkshire, england
Maybe there's an element of observer bias going on. You've had a few games where you've had runs of bad luck so that sticks in your mind. I still remember an early Sgotm where our team produced three great artists in a row (10% chance for each (Glib, 2 scientists, Nat Epic iirc)) which set us back a long way compared to other teams who produced 3 GS in a row.

12. ### AnysenseKing

Joined:
Jan 30, 2015
Messages:
765
From my fairly extensive gaming experience RNG tends produce extreme results too frequently. In regard with Civ it means that fighting at ods below 75% is little more than gambling. This is another argument in favour of siege - you really need those 90+ odds, unless you are savescumming. I had to scrap a HoF game once because out of ~15 fights at 70-90% I won just 2 or 3.

13. ### TobiyogiPrince

Joined:
Nov 23, 2018
Messages:
467
Gender:
Male
Location:
Berlin, GE
I have honestly no idea how RNGs are programmed and if they follow the Law of Large numbers, but if you assume that a lottery is nothing more than a "number generator" either and observations show that over time drawn numbers get closer and closer to each other, I would also assume that any game RNG produces similar results. Of course, no single person can benefit from this and you can get 10 GA in a row while others lose 5 fights with 80% in a row. I will observe that a bit more closely in a next game, if I am really unlucky most of the time.

14. ### TobiyogiPrince

Joined:
Nov 23, 2018
Messages:
467
Gender:
Male
Location:
Berlin, GE
You can have a look at the pie graphs here:
https://lotterycodex.com/private/number-and-combination/

There are much more provings like the Bernoulli trials. When you roll a dice a 1000 times, the cross sum will be nearly at 3,5 (1+2+3+4+5+6 : 6 = 3,5). Maybe 3,49 or 3,51. When you flip a coin often enough, you will produce the same proportion of head/tails.

Last edited: Oct 22, 2019
15. ### sampsaGhost

Joined:
Jan 1, 2006
Messages:
1,890
Location:
Finland
I looked. Are you seriously saying that this is proof that "it evens out"? None of the charts show how many times each ball was picked. If you looked at my poker example, it's exactly the same. They get proportionally closer to each other, but they don't "fall in the exact proportion after years" like you claim. I find a conversation like this with an alleged maths teacher completely ridiculous.

16. ### TobiyogiPrince

Joined:
Nov 23, 2018
Messages:
467
Gender:
Male
Location:
Berlin, GE
I don't want to prove you anything by one book, you can find much more sources that trace back to the history of mathematicians. I don't claim to be a researcher, just trying to understand. Btw, in the spreadsheet above the pies you can see "almost" the same proportion of the shown numbers. And it's only after 3600 draws. The theory claims that in an infinity, proportions will completely even out, you can be even sure of that, but obviously no-one can make such a proving, that's why they call it empiric "theory".
It's up to you what discussion to join, it was me who opened that thread and I don't consider it ridiculous.

Last edited: Oct 22, 2019
17. ### sampsaGhost

Joined:
Jan 1, 2006
Messages:
1,890
Location:
Finland
OK. If you throw a dice 10 times, their average might differ wildly from 3,5. If you throw a dice 1000 times, their average will be closer to 3,5. This doesn't prove that there is a "force" that is evening it out, unless you call law of large numbers a force. Again, I'm not sure if you really understand law of large numbers. It doesn't mean things will even out.
When you flip a coin enough times, you will very likely reach a point where they are even. That doesn't prove anything. Or do you think it does?
Yes they are almost the same proportion in your linked pie chart, but that is irrelevant. You claimed that "numbers fall in the exact proportion after years." which is a completely different thing. After more draws, the pie will get more and more into proportion, I'd assume. But for example the difference between the times the most "popular" ball was drawn compared to the most "unpopular" ball was drawn will increase.

18. ### TobiyogiPrince

Joined:
Nov 23, 2018
Messages:
467
Gender:
Male
Location:
Berlin, GE
Ok, maybe the word "exactly" is too much as 100% exact proportion will never exist. It's simply in the heart of that theory that proportions will become so even that you can almost call it that way. I didn't understand that you are disturbed by that word. How can I claim that? No-one can really tell. It is a theory where you can anticipate something, but you cannot really prove it. For me, it's enough to see that it comes very close to that and that's what I wanted to apply on Civ 4. So I did a testrun.....
There was a Charlemagne city where I have placed more than 100 Longbows (no promo, no hill, no fortification) and I have attacked with 100 knights (no promo, no withdraws seen). The odds were always the same, 70,5% for every single fight. Sometimes, I won 10 fights in a row, sometimes I lost 3 in a row. But the most interesting: out of these 100 fights, I really won 72 over 28 losses what comes extremely close to the odds. It's just a single proving, maybe others are inspired to try that again?
I won't do that again, it's not really life-changing but in the essence, it shows what I wanted to find out by opening this thread.
The game level is EMP in that case so I have not been screwed by a rather high level. I was really a bit surprised by the positive outcome.

19. ### sampsaGhost

Joined:
Jan 1, 2006
Messages:
1,890
Location:
Finland
I am not disturbed by words. I tend to choose my words carefully to say exactly what I mean and I suppose I to too much extent expect the same from others.

Yes. And if you increase the amount of your sample, you will get closer to 70,5% (assuming RNG works as it's supposed to). This we agree on. But if from 1,000,000 fights we win 704,500 (70,45%) we are 500 off the mark. If you draw a chart, it looks like "numbers fall in the exact proportion", but in reality it's not that.

20. ### TobiyogiPrince

Joined:
Nov 23, 2018
Messages:
467
Gender:
Male
Location:
Berlin, GE
There are probably many folks out there who are much more inexact in their expression than an alleged math teacher.
For me, it's part of taking thing not too seriously, when I "round up" things. I feel that I still refer to the same things, even if it's only 98% correct.
Same happened to me in that forum when I created NC games and some people took all those extra challenges 100% seriously. It was not my intention to force someone, rather to create inspiration.
Btw, the odds in my sample were exactly at 70,45%, another case where I rounded up for the easier communication