Under the assumption that
- The probability of getting a girl or a boy is equal (50%)
- A male can only put his thang on his partner female (no multiple wives)
Neither of them will get significantly more boys than the other (in a long period of time)
A Priori Proof :
Barbarian King
In regex: (G*)B
...
G
G B
Z B
B
The tree goes from left to right.
Z = initial state; G = girl; B = boy;
The probability of getting 1 boy and 0 girls is 1/2.
The probability of getting 1 boy and 1 girl is 1/4.
The probability of getting 1 boy and 2 girls is 1/8.
The probability of getting 1 boy and N girls is 1/2^(N+1).
To solve the average difference of boys and girls under the Barbarian King's rule, we would need the following :
$$\lim_{N\to \infty} \frac{\sum_0^N((\mbox{BoyCount}-\mbox{GirlCount})*\mbox{probability}))}{N}$$
$$\lim_{N\to \infty} \frac{\sum_0^N(\frac{1-N}{2^{N+1}}))}{N} = 0$$
Check this wolfram solution to this equation. (Sorry Barbarian King)
This means that in the long run (approaching $\infty$), there is no ($0$) significant difference between the number of boys and girls under the Barbarian King's rule.
Councillor
In regex: (B*)G
G
Z G
B G
B
...
The tree goes from left to right.
Z = initial state; G = girl; B = boy;
The probability of getting 0 boys and 1 girl is 1/2.
The probability of getting 1 boy and 1 girl is 1/4.
The probability of getting 2 boys and 1 girl is 1/8.
The probability of getting N boys and 1 girl is 1/2^(N+1).
To solve the average difference of boys and girls under the Councillor's rule, we would need the following :
$$\lim_{N\to \infty} \frac{\sum_0^N((\mbox{BoyCount}-\mbox{GirlCount})*\mbox{probability}))}{N}$$
$$\lim_{N\to \infty} \frac{\sum_0^N(\frac{N-1}{2^{N+1}}))}{N} = 0$$
Check this wolfram solution to this equation. (Sorry Councillor)
This means that in the long run (approaching $\infty$), there is no ($0$) significant difference between the number of boys and girls under the Councillor's rule.
A Posteriori Proof :
Open your JavaScript console (F12->Console or Ctrl+Shift+J) and copy and paste the below code.
function makeBabies(couples,simulations){
var kingAdvantage=0;
var councillorAdvantage=0;
var kingBabies={boys:0,girls:0};
var councillorBabies={boys:0,girls:0};
for(var j=0;j<simulations;j++){
for(var i=0;i<couples;i++){
//Barbarian King
while(Math.random()<0.5){
kingBabies.girls++;
}
kingBabies.boys++;
//Councillor
while(Math.random()<0.5){
councillorBabies.boys++;
}
councillorBabies.girls++;
}
kingAdvantage += (kingBabies.boys-kingBabies.girls);
councillorAdvantage += (councillorBabies.boys-councillorBabies.girls);
//reset simulation
kingBabies={boys:0,girls:0};
councillorBabies={boys:0,girls:0};
}
//average
kingAdvantage /= simulations;
councillorAdvantage /= simulations;
console.log("Barbarian King advantage : "+kingAdvantage);
console.log("Councillor advantage : "+councillorAdvantage);
}
Type makeBabies(<couples>,<simulations>)
and replace <couples>
with the number of couples that you want in your simulation, and <simulations>
with the number of times you want to run the same test.
Results :
makeBabies(100,10000) = 0.0488, -0.0228
makeBabies(1000,10000) = 0.3019, -0.1117
makeBabies(10000,10000) = -2.47, -0.4471
10000 simulations each time, with increasing number of couples (100, 1000, 10000).
As you can see, the average advantage of boys over girls in both methods is very insignificant. (Most of the time < 1)
You can try out the code and run more simulations if you want.