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:

$\displaystyle

p_a = \sum\limits_{i = 1}^{N_a } {\sum\limits_{j = i}^{N_d } b(i,N_a } ,0.5)b(j,N_d ,1/3)

$

where:

$\displaystyle b(k,N,p)=

\left( {\begin{array}{*{20}c}

N \\

k \\

\end{array}} \right)p^k (1 - p)^{N - k}

$

is the probability of $\displaystyle k$ successes in $\displaystyle N$ trials with probability on a single trial is $\displaystyle p$, and an $\displaystyle a$ suffix denote the attacker value and $\displaystyle d$ 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