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.
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 use1 - BINOM.DIST(g-1, n, p, TRUE)to do the computationSo 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}$$