# Thread: CHALLENGE Probability with dice

1. ## CHALLENGE Probability with dice

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.

2. 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.

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:

$
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:

$b(k,N,p)=
\left( {\begin{array}{*{20}c}
N \\
k \\
\end{array}} \right)p^k (1 - p)^{N - k}
$

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

3. Hello, Geekster732!

Sorry, I don't understand the game; the rules aren't clear . . .

I was trying 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. .[1]

Each die has 6 sides.
The attack die has 3 colored and 3 blank sides.
The defense die has 2 colored sides and 4 blank sides. .[2]
(Also if the two numbers are the same, the attack fails.) .[3]

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

[1] Just what are those "inputs"?
. . ."The amount of the attack die" doesn't tell us anything.
. . .Is it an amount of money wagered? . . . or what?

[2]Some face are colored, others are not.
. . .How does this affect the outcome?

[3] The dice have numbers (probably 1 to 6).
. . .What constitutes a win? . . . The higher number?
. . .Which are the colored faces? .And what is their significance?

If "winning the game" is decided after one roll (each), it is a simple problem
. . providing the rules are explained.

If the winner decided after, say, 10 rolls, the problem is more elaborate.

Could you please explain the rules again?

4. Hi there!
I'm not the original poster, but I came to this forum to get this very question answered

Soroban: let me clarify.

The dice don't have numbers. They have 6 sides with (identical) symbols on them, and some blank sides.
The dice that the attacker rolls have 3 'success' sides, the defender's dice have 2 'success' sides.

The basic idea is that the attacker gets to roll a certain number of dice (dependent on their ingame character, etc), and the defender gets to roll a certain number of dice.

Whenever the attacker rolls more 'successes' than the defender, he scores a hit. When he rolls equal or lower numbers of 'sucesses', no hits are scored.

--
The question is: how could one calculate the odds of the attacker scoring at least one hit, given that C is the number of dice the attacker gets to roll and D is the number of dice the defender gets to roll?

My probability has gotten VERY rusty over the years, so I couldn't for the life of me figure out this (probably basic) problem