Needing some Math help!

I'm working out part of a system for a game I'm working on, and I need to know if I need to tweak some things, so I'm checking to see if it all adds up (no pun intended).

defender has a base of 1, 3, 5, 7, or 11 for the target successes that the attacker has to roll; if the attacker achieves the # of successes required the attacker wins the roll, otherwise the defender wins. the attacker rolls 1, 2, 3, 4, or 5 10-sided dice based on his/her increasing skill, however only 8-10 count as a success, and each 9-10 granting an additional die to add to the pool. That means, there is a 3/10 chance of at least one success, and 1/5 chance to add another die, to increase the chance for the attacker to hit the defender's number.

I feel like this should be really easy, but I can't figure out how to get started... What is the chance (expressed as a ratio please...) for the attacker to win the roll against a defender with a target of 1? a target of 3, 5, 7, 11?

  • $\begingroup$ The actual mechanic isn't at all clear here, could you be more specific? $\endgroup$ – Travis Willse May 14 '15 at 7:13
  • $\begingroup$ Do you mean that according to his skill, the attacker will roll 1, or 2 or .. or 5 dice? And for each outcome that is 9 or 10, he will roll another die? Then, does this apply to the additionnal dice (I mean, if he gets 9 or 10 on the 6th die, he will throw yet another die). Anyway, you have to know the "base" number of dice (between 1 to 5) to compute the probability to win. With only one die for example, the attacker can't win with more than 1 success, obviously. $\endgroup$ – Jean-Claude Arbaut May 14 '15 at 7:38
  • $\begingroup$ @travis fixed the question so it explains it better. $\endgroup$ – Jacob Hooper May 14 '15 at 18:51
  • $\begingroup$ @Jca yes, attacker uses 1,2,3,4,or 5 dice depending on skill. $\endgroup$ – Jacob Hooper May 14 '15 at 18:51
  • $\begingroup$ @JacobHooper I think I understand the setup now, and I nominated the question for re-opening. Cheers! $\endgroup$ – Travis Willse May 15 '15 at 3:11

Let the skill (i.e. the numbers to be rolled) be $n$.

We have the event $X_n$ that's the number of successes with skill $n$.

Now $P(X_n\geq 1)$ is pretty easy to calculate, it's as simple as $$P(X_n\geq 1) = 1-P(X_n=0)=1-(\frac{5}{8})^n$$ As you see it's quite difficult to express it as a ratio unless an $n$ is given.

$P(X_n\geq a)$ for $a> 1$ is much more complicated. Let's begin with $P(X_1\geq a)$. For that you need to roll $n-1$ times $9$ or $10$, and then $8$, $9$ or $10$. So $$P(X_1\geq a)=(\frac{2}{10})^{a-1}\times \frac{3}{10}$$

Now the fun/most hard part is left... $$P(X_n\geq a)$$ I'll think about it a bit more, but post it here so people can use it for further discussion and work upon it.


For a single die this is pretty straightforward. To get $N$ successes you have only two options: 1. $N-1$ consecutive 9-10's followed by an 8. 2. $N$ consecutive 9-10's followed by a 1-7, of which I'll think as $N-1$ consecutive 9-10's followed by a sequence of 9-10 and 1-7.

So this leads to: $P(n=N) = (\frac{2}{10})^{N-1}(0.1+0.2\times 0.7)$, and $P(n=0)=0.7$ of course.

For a larger set of dice you should only sum such single die distributions, each of the original dice can be analyzed independently of the others.

If you are only interested in this for practical reasons then I wrote a script which gives me pretty good estimates.

  • $\begingroup$ Thanks. I'm pretty sure this is on track. does this formula allow for cumulative extra die as well - 9s and 10s that roll other 9s and 10s? every 9 or 10 grants an extra die, which is why this is confusing me. if you have a script that I could use, that would be amazing! $\endgroup$ – Jacob Hooper May 14 '15 at 19:33
  • $\begingroup$ I'm away from my computer now, but I'll paste the code here later (it's written in matlab but can be easily converted to whatever language you use) as well as the results for 2-5 dice. $\endgroup$ – Shahar Even-Dar Mandel May 15 '15 at 7:24
  • $\begingroup$ math.stackexchange.com/questions/548525/… $\endgroup$ – Shahar Even-Dar Mandel May 15 '15 at 16:01
  • $\begingroup$ Well, I'm back. Given the fact that we now have a closed form for the probability of a single die it doesn't really make sense to use the simulation I did before since we can sum over the distributions and obtain exact results (especially since we don't really have to go beyond P(n=11). So I started by defining a vector p (actually $p_1$) by the expression above, and then ran a simple loop to calculate $p_k(n=N)=\sum p_{k-1}(n=m)p_1(n=N-m)$. This can be easily done in Excel (no need for scripting/programming). $\endgroup$ – Shahar Even-Dar Mandel May 18 '15 at 8:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.