The hidden power of agg+cha (or, why Boudica is actually the best leader in the game)

6K Man

Bureaucrat
Joined
Jul 17, 2007
Messages
2,402
Location
in a Gadda Da Vida
I can't tell you how many Artists I've gotten from my GP farm city, from just 1 Artist GPP per turn from the National Epic. Meanwhile I'm running 5 Caste Scientists for 15 GPP, plus the 6 more Scientist GPP from Great Library in many cases.

It's fortunate that I like Golden Ages.
 

Anysense

Emperor
Joined
Jan 30, 2015
Messages
1,419
It seems to be working as intended, although I still have difficulty comprehending it. Long streaks are supposed to be rare and they are rare. If you run the same script many times you will see that certain outcomes occur with expected probability. But if you just make 100 warriors in world builder and attack another 100 warriors or if you make RNG toss a coin one hundred times, you will almost certainly see some very long streaks, whose occurance at such short distance is supposed to have probability <1%:dunno:
 

Pangaea

Rock N Roller
Joined
Sep 17, 2010
Messages
6,390
Any wizard around who can tell what the odds for that happening really are?
0.2%. Not high. But in times of dark moods in the game, I tend to look at 98% winning odds as 2% winning odds. Same with revolt chances. Although that's more like 1% equals 99.8%.
 

SittinDown

King
Joined
Jun 29, 2016
Messages
849
Location
(UTC-5)
Any wizard around who can tell what the odds for that happening really are?

Quick little program... pretty dramatic results actually.

I ran 1 million iterations trying to find out streaky results.

With 90/10 odds: 5 losing streaks of 5+, longest loss streak was 5.
With 85/15 odds: ~60 losing streaks of 5+, longest loss streak was 7.
With 70/30 odds: ~1,600 losing streaks of 5+, longest loss streak was 10!
With 60/40 odds: ~6,000 losing streaks of 5+, longest loss streak was 15!

At 60% odds, 3.4% of ALL your fights will be in some 5+ bad losing streak, or 1 in 33 fights, and probably will happen most games.
At 70% odds, 0.9% of ALL your fights will be in some 5+ bad losing streak, or 1 in 100 fights, or maybe expect that in 1/2 to 1/4 of your games?
At 85% odds, 0.03% of ALL your fights will be in some 5+ bad losing streak, or 1 in 3,333 fights, or maybe 1 in every 100 games.

At 90% odds, 1 in 22,000 of ALL fights will be in some 5+ bad losing streak, or it probably happened in a real game to someone a handful of times.
At 95% odds, 1 in 250,000 of ALL fights will be in some 5+ bad losing streak, and has possibly happened for real once or twice.
At 97% odds, it's basically impossible. 1 in 250,000,000 fights were in a bad losing streak. Lottery odds.
At 98% odds, it's extremely improbable to have such bad luck, and didn't happen in my test in 10 million attempts.

Spoiler Here is the code I used :

Code:
function calcOdds() {

   let max = .3;
   let streakCount = 0;
   let streak = 0;
   let streakMax = 0;
   let streakSum = 0;

   for(var j = 0; j < 1000000; j++) {
       let rnd = Math.random();

       if(rnd <= max) {
           streak++;
           if(streakMax < streak) {
               streakMax = streak;
           }
       }
       else {
           if(streak >= 5) {
               streakSum += streak;
               streakCount++;
               console.log("Streak of " + streak + " : " + streakCount);
           }
           streak = 0;
       }
   }

   console.log("Max Streak of: " + streakMax + " Streak Sum: " + streakSum);
}

calcOdds();
}
 
Last edited:

Anysense

Emperor
Joined
Jan 30, 2015
Messages
1,419
This is very similar to the code I used, except in different langauge. At 60% odds I got 6099 such streaks and 3.4459%. Remarkably close. And at 50% odds I got 9.3% in 5+ loss streaks. Add winning streaks to it and it becomes ~18.6%, that is nearly 1/5 fights are part of 5+ long win or loss streaks! This seems to be a very good angle to look at streaks: while they are few they comprise quite a few fights.
 

Donald Duck1

Chieftain
Joined
Mar 9, 2019
Messages
72
With 90/10 odds: 5 losing streaks of 5+, longest loss streak was 5.
With 85/15 odds: ~60 losing streaks of 5+, longest loss streak was 7.
With 70/30 odds: ~1,600 losing streaks of 5+, longest loss streak was 10!
With 60/40 odds: ~6,000 losing streaks of 5+, longest loss streak was 15!

With a true random number generators the corresponding expected number of 5+ losing streaks are:
0.1^5 = 10 / 1,000,000
0.15^5 = 76 / 1,000,000 (0.15^7 = 1.7 per million)
0.3^5 = 2,430 / 1,000,000 (0.3^10 = 5.9 per million)
0.4^5 = 10,240 / 1,000,000 (0.4^15 = 1.1 per million)

So it seems the pseudo random generator you used (probably the same as civ4?) is having sligthly shorter win/loss streaks than a true random generator.
 

SittinDown

King
Joined
Jun 29, 2016
Messages
849
Location
(UTC-5)
Anysense used the random generator that was the same as Civ 4.
Mine was using whatever the native random generator is with NodeJs v14 - which might actually be the same thing, because I think node is written in C++, but I'm not sure.
 

Major Tom

Immortal
Joined
Jun 1, 2005
Messages
712
Location
Oslo
Interesting analysis. But should we trust the winning probability? Gut feeling says that when an injured attacker attack there is something skewed.
Also there is a serial correlation.
One flaw specific to LCGs is that, if used to choose points in an n-dimensional space, the points will lie on, at most, nn!⋅m hyperplanes (Marsaglia's theorem, developed by George Marsaglia).[7] This is due to serial correlation between successive values of the sequence Xn."
 

Snowbird

Prince
Joined
Feb 2, 2017
Messages
419
Isn't the quote below the actual result of serial correlation?
So it seems the pseudo random generator you used (probably the same as civ4?) is having sligthly shorter win/loss streaks than a true random generator.
 

Snowbird

Prince
Joined
Feb 2, 2017
Messages
419
Not a 5/5, but 5+, which is exactly the same thing. Just one in theory and another in practice.

Anything 5 and longer is at the probability of (chance) at a degree of five. Exact five means it is five instances and six must be dif - so it (chance) at degree five multiplied by (1-chance).

Unless I am mistaken in probabilities. Would not be the first time.

p.s. Might be that gross multiplication calculates one 7 loss streak as a 3 5+ ones, hmmm. I am not sure how to avoid it...
 

pigswill

fly (one day)
Joined
Apr 29, 2006
Messages
8,894
Location
berkshire, england
It appears that test results so far indicate that losing streaks are relatively rare (which doesn't mean they never happen) but psychologically they're much more memorable than winning streaks. Its also possible that players are more likely to ascribe good outcomes to skill and bad outcomes to bad luck.
 

Donald Duck1

Chieftain
Joined
Mar 9, 2019
Messages
72
Hm yes I described the probability of a single 5+ streak, which indeed isn't what we're looking for...
Turns out this is harder to compute than I thought. I used to be good at this stuff, 30 years ago...
 

6K Man

Bureaucrat
Joined
Jul 17, 2007
Messages
2,402
Location
in a Gadda Da Vida
How do first strikes fit into all this? My understanding is that free rounds of combat (that one side can't lose) break the odds generator. Can't find the relevant thread, tho.
 

Snowbird

Prince
Joined
Feb 2, 2017
Messages
419
It appears that test results so far indicate that losing streaks are relatively rare (which doesn't mean they never happen) but psychologically they're much more memorable
I think it is more of a thing that expectations of random looks are flawed

a classroom experiment originally performed by Revesz [14]. The class is divided into two groups. In the first group, each student is instructed to toss a coin 200 times and record the resulting sequence of heads and tails. Each student in the second group is merely to write down a sequence of heads and tails that the student believes is a reasonable simulation of 200 tosses of a fair coin. Given the combined results of the two groups, Revesz claims that the students can be classified back into their original groups with a surprising degree of accuracy by means of a very simple criterion: In students' simulated patterns, the longest run of consecutive heads or consecutive tails is almost invariably too short relative to that which tends to arise from actual coin tossing.
Full article at http://www.csun.edu/~hcmth031/tlroh.pdf
 

Kaiman

Chieftain
Joined
Apr 26, 2020
Messages
58
Location
Texas
Being part of a fair number of dice-heavy board game events, both in person and online, and running a few myself, I've observed that for whatever reason people are far more tolerant of and understanding of normal random variation in physical dice than they are in computerized rolls. Once someone has it in their mind that a computer is producing an ludicrously improbable number of streaks, it's nearly impossible to dissuade them.

The class is divided into two groups. In the first group, each student is instructed to toss a coin 200 times and record the resulting sequence of heads and tails. Each student in the second group is merely to write down a sequence of heads and tails that the student believes is a reasonable simulation of 200 tosses of a fair coin. Given the combined results of the two groups, Revesz claims that the students can be classified back into their original groups with a surprising degree of accuracy by means of a very simple criterion: In students' simulated patterns, the longest run of consecutive heads or consecutive tails is almost invariably too short relative to that which tends to arise from actual coin tossing.

I taught high school stats for a year and did this exact experiment in the AP class. My guessing criteria was simple: if there is at least one string of 6 straight heads or 6 straight tails, it was done with a real coin. If not, it was done by a student just writing down 200 letters. Had 16 students, 8 in each group, and it resulted in getting 7/8 right in each case.
 
Top Bottom