Risk Statistics
December 7, 1999
Risk
Statistics
by Ross Philip Davis
Below is a table showing the probabilities of different
outcomes in Risk. The probabilities were calculated using a Matlab
function which is listed below the table. For each die roll combination,
one million trials were excecuted to ensure smooth statistics.
| |
3 vs 2
|
2 vs 2
|
1 vs 2
|
3 vs 1
|
2 vs 1
|
1 vs 1
|
|
Attacker loses one
|
0%
|
0%
|
74.52%
|
33.97%
|
42.16%
|
58.38%
|
|
Defender loses one
|
0%
|
0%
|
25.48%
|
66.03%
|
57.84%
|
41.62%
|
|
Attacker loses two
|
29.20%
|
44.80%
|
0%
|
0%
|
0%
|
0%
|
|
Defender loses two
|
37.17%
|
22.77%
|
0%
|
0%
|
0%
|
0%
|
Both lose
one
|
33.63%
|
32.43%
|
0%
|
0%
|
0%
|
0%
|
MATLAB function:
function prob = RiskRoll(trials, attack, defend)
% Computes the probabilities for rolls in Risk.
% trials represents the number of times the function
% will excecute the rolls and calculate outcome.
Thus
% the more trials, the better the statistic. attack
% is the number of attack dice being rolled, and defend
% is the number of defense die being rolled.
% prob is a 5 row vector that contains the probabilities
% of the follwing occurring...
% [Lose one each
% Attacker loses one
% Defender loses one
% Attacker loses two
% Defender loses two]
% First initialize variables...
OneEach = 0;
ALoseOne = 0;
DLoseOne = 0;
ALoseTwo = 0;
DLoseTwo = 0;
% loop through the trials, summing the different results...
for i = 1:trials
% to keep a count of pieces lost each trial...
ALoses = 0;
DLoses = 0;
% computes uniformly distributed random numbers for the
% attack and defense rolls...
ADie = floor(6*rand(attack,1)+1);
DDie = floor(6*rand(defend,1)+1);
% sorts the vectors from greatest to least...
ADie = -sort(-ADie);
DDie = -sort(-DDie);
% the following two if statements find the maximum value(s)
% of the rolls...
if (attack >= 2)
AMax1 = ADie(1);
AMax2 = ADie(2);
else
AMax1 = ADie(1);
AMax2 = 0;
end
if (defend >= 2)
DMax1 = DDie(1);
DMax2 = DDie(2);
else
DMax1 = DDie(1);
DMax2 = 0;
end
% computes the number lost for each side during the current
% trial...
if ((attack >= 2) & (defend >= 2))
if (DMax1 >= AMax1)
ALoses = 1 + ALoses;
else
DLoses = 1 + DLoses;
end
if (DMax2 >= AMax2)
ALoses = 1 + ALoses;
else
DLoses = 1 + DLoses;
end
else
if (DMax1 >= AMax1)
ALoses = 1 + ALoses;
else
DLoses = 1 + DLoses;
end
end
% the following if statement finds the appropriate variable
to
% increment based on the troops lost...
if (ALoses == 1) & (DLoses == 0)
ALoseOne = 1 + ALoseOne;
elseif (ALoses == 1) & (DLoses == 1)
OneEach = 1 + OneEach;
elseif (ALoses == 0) & (DLoses == 1)
DLoseOne = 1 + DLoseOne;
elseif (ALoses == 2)
ALoseTwo = 1 + ALoseTwo;
else
DLoseTwo = 1 + DLoseTwo;
end
end
% takes the average...
OneEach = OneEach/trials;
ALoseOne = ALoseOne/trials;
DLoseOne = DLoseOne/trials;
ALoseTwo = ALoseTwo/trials;
DLoseTwo = DLoseTwo/trials;
prob = [OneEach;ALoseOne;DLoseOne;ALoseTwo;DLoseTwo;];
|