Originally Posted by

**Geekster732** I hope there is someone who can help me with this out there. My brother and I play this game where you need to roll special die to attack and defend pieces.

I was attempting to create a program which would output the odds of the attacker winning when the initial amount of attack die and defense die were input. Each die has 6 sides.

the attack die have three colored and 3 blank sides. the defense die only have 2 colored sides. (also if the two numbers are the same, the attack fails)

In all I need to find a semation equation where you can input two variables and get an output of a probablity.

The difficult part for me is finding the probablility that a probablility will be greater than a different probability.

Thanks for your help!

Well the number of coloured faces on the attackers and defenders dice are binomial random variables and so we may write the probability of the attacker winning as:

where:

is the probability of successes in trials with probability on a single trial is , and an suffix denote the attacker value and the defenders.

Now there may be some way of writting this more compactly, but we may as well just tabulate it:

Code:

Na=1 Na=2 Na=3 Na=4 Na=5
Nd=1 0.333333 0.583333 0.75 0.854167 0.916667
Nd=2 0.222222 0.444444 0.625 0.756944 0.847222
Nd=3 0.148148 0.333333 0.509259 0.655093 0.766204
Nd=4 0.0987654 0.246914 0.407407 0.555556 0.679398
Nd=5 0.0658436 0.18107 0.320988 0.462963 0.591821

RonL