Dice probability, Exemple, having at least three 5 or more, on seven dice throw.

54 Views Asked by At

I'm having trouble calculating probability on dice rolls, here's the setup :

(All dices are fair 6 faces classic dice)

It's a D&D Roleplaying kind of game, the rules say this :

For each action, you have a stat, and a skill assigned. To fight someone on melee, that could be strenght as a stat, and brawling as a skill.

If you have 5 points on strenght, that mean you can throw 5 dices. Then, let's say you have 4 points on brawl skill, that mean you must land a 4 or higher on a dice to validate it.

Then, the Game Master will set a goal. If he set it a 3, you must have at least 3 dice that show a 4 or higher to achieve your action.

Get it ?

Exemple :

Me : "I have 5 in strenght and 4 in brawl, I'll punch this guy in the face"

GM : "Ok, but he's skilled at combat, so the goal is at 3"

Then, according to the rules, I can throw 5 dices, and need to have at least 3 showing 4 or more to succesfully punch the said guy.

Here's where I landed thus far :

If I want at least a 4, with five dice, I can apply this formula :

The chance of failing are (3/6)^5

So the chance of succes are 1 - ((3/6)^5), or 0,96875

According to the game rules, this mean I have a goal set to 1.

But if I have a goal set to 3 ?

Is the formula (1 - ((3/6)^5))^3 ? wich shall give 0,9091491699

Or I am missing something ?

I am working on an easy excel, so the GM can more easily calculate the chances of success before setting the goal of every action player might do.

2

There are 2 best solutions below

2
On BEST ANSWER

When you want to count the number of successes of independent trials where the probability of success is all the same, reach for a Binomial random variable. Your step $(3/6)^5$ as the chance of failure is not quite right. Each roll succeeds or fails with a probability of 1/2. So $(3/6)^5$ is the probability of one particular sequence of 5 rolls, such as $SSFFS$ or $FSFSF$. The question is: in how many of these possible sequences do we exceed the goal set by the GM?

Let $X$ be the random variable for the number of trials out of 5 that succeed (roll a 4 or higher). Then $X \sim \text{Bin}(5, 1/2)$.

The probability that 3 or more of the 5 trials succeed is then $$P(X \geq 3) = 1 - P(X \leq 2) = P(X = 0) + P(X=1) + P(X = 2)$$

In R you can call 1 - pbinom(2, 5, 0.5) and find that this probability is actually 0.5. In Excel I think you can use 1 - BINOM.DIST(g-1, n, p, TRUE) to do the computation

So in general, you can model these types of probabilities as follows: $$p = \frac{6 - skill + 1}{6} \text{, probability of success on a single roll}$$ $$g = \text{goal set by the GM}$$ $$n = \text{the stat, the number of rolls you get}$$ $$X \sim \text{Bin}(n, p)$$ $$P(X = k) = \binom{n}{k}p^k (1-p)^{n-k}, \text{the PMF for Binomial dist.}$$ $$P(X \geq g) = 1 - P(X < g) = 1 - \sum_{k=0}^{g-1} \binom{n}{k}p^k (1-p)^{n-k}$$

4
On

Let's suppose you have $d$ fair six-sided dice, with a target of at least $t$ showing on at least $n$ of the dice.

The probability of this is $$\sum\limits_{j=n}^d {d \choose j}\frac{(6-t+1)^j(t-1)^{d-j}}{6^d}$$

In Excel, you can find ${d \choose j}$ as =COMBIN(d,j)

So in your example of $d=5,t=4,n=3$ you have $10\times \frac{3^3 3^2}{6^5}+5\times \frac{3^4 3^1}{6^5}+1\times \frac{3^5 3^0}{6^5}$ which simplifies to $\frac12=0.5$, as you might expect since a die has probability of $\frac12$ of being $4$ or more, and you want at least half of an odd number of dice to achieve this.