# Better skill checks for RPGs - Conditional probability given 2 independent parameters

I am trying to find a better way (theoretically, not practically speaking) to do a skill check for a Skill Trial in RPGs.

In several RPGs, a skill check consists of a Playing Character (PC) trying to overcome a Skill Trial (ST), which difficulty level is chosen by the Game Master (GM). To succeed, he must roll the dice and obtain a score above or below a target, depending on the ST's difficulty level and on the PC's skill level for the skill checked.

In the d20 system, the GM choose a Difficulty Class for the ST, and the PC has a Skill Modifier (bonus, or malus if it's negative) depending on the skill checked. So the PC must roll above $$DC + SM$$ with a d20. Both DC and SM can take values between plus and minus infinity, but the average DC is considered to be 10 and the average SM is 0.

In the BRP system, the PC have a Skill Chance depending on the skill checked, and the GM have to choose a sort of Difficulty Multiplier for the ST, so the PC must roll below $$SC \times DM$$ with a d100. The Skill Chance is between 0 and 100 and the Difficulty Multiplier is either 2, 1 or 1/2 for increasing difficulty, 1 being average.

In both cases, the skill check is a Bernoulli test which parameter could be written $$Pr(S|P_i C_j)$$, where (given the skill checked):

• $$S$$ is the event "the Dice Roll is successful"
• $$C_i$$ is the event "the character is the ith one"
• $$T_j$$ is the event "the trial is the jth one"

Moreover, the SM and SC seem related to $$Pr(S|C_i)$$, the average success rate of the PC for the skill checked, while the DC and DM seem related to $$Pr(S|T_j)$$, the average success rate of any PC for that particular skill trial.

However, the scales are completely different and hard to compare, and they also seem arbitrary, like the operations used to combine them to obtain $$Pr(S|C_i T_j)$$ ($$max(0,min(1,1-\frac{DC+SM-1}{20}))$$ for d20, $$max(0,min(1,\frac{SC \times DM}{100}))$$ for BRP).

It would not be surprising if they were almost completely arbitrary, since they are chosen to improve the gameplay, not to be "accurate". But I wonder if we could choose scales and operations that would be accurate.

So the question is:
Given $$Pr(S|C_i)$$ and $$Pr(S|T_j)$$ (and maybe $$Pr(S)$$), and knowing that $$C_i$$ and $$T_j$$ are independent, can we calculate, or at least estimate, $$Pr(S|C_i T_j)$$?

More precisely, if we assert that:

• $$Pr(S|C_i T_j)$$ is the probability of a Bernoulli test (so $$Pr(S|C_i T_j) = E(S|C_i T_j)$$)
• $$Pr(S|C_i) = \sum_j Pr(S|C_i T_j)Pr(T_j)$$ is the known average success rate of character $$C_i$$ for the skill checked, with $$T_j \in \Bbb{T}$$ the set of events corresponding to all trials for the skill checked and a finite partition of the sample space
• $$Pr(S|T_j) = \sum_i Pr(S|C_i T_j)Pr(C_i)$$ is the known average success rate for trial $$T_j$$ for the skill checked, with $$C_i \in \Bbb{C}$$ the set of events corresponding to all characters and a finite partition of the sample space
• $$Pr(S) = \sum_i Pr(S|C_i)Pr(C_i) = \sum_j Pr(S|T_j)Pr(T_j)$$ is the known average success rate of any character for any trial for the skill checked
• $$Pr(C_i)$$ and $$Pr(T_j)$$ are unknown
• $$C_i$$ and $$T_j$$ are unconditionally independent (NB: but conditionally dependent given S)
• the sample space is the set of events corresponding to all possible skill checks for the skill checked, for any character and any trial

I'm searching for a function $$f: [0,1]^3 \to [0,1]$$ such that: $$Pr(S|C_i T_j) \approx f(Pr(S|C_i),Pr(S|T_j),Pr(S))$$

I think it should also have the following properties (ignoring $$Pr(S)$$):

1. $$f(c,t)=f(t,c)$$, because there are no reason to treat characters and trials differently
2. $$\forall{t,c_1,c_2}\in [0,1], c_1 \leq c_2 \Rightarrow f(c_1,t) \leq f(c_2,t)$$, because if a character have a better skill level than another, he should have a higher success rate for any trial
3. $$f(c,t)=1-f(1-c,1-t)$$, because there is no reason for failure to behave differently than success
4. $$f(c,0)=0$$, because for impossible trials, the character's skill level becomes irrelevant

therefore:

• $$f(c,1)=1$$
• $$f(c,0.5)=c$$
• $$f(c,1-c)=0.5$$
• $$f(0.5,0.5)=0.5$$
• $$f(0,1)$$ and $$f(1,0)$$ are undefined

Here is what it should look like

I am open to any suggestion.

My first try was $$f(c,t,s) = \frac{ct}{s}$$, but unfortunately, $$Pr(S|C_i T_j) = \frac{ Pr(S|C_i) Pr(S|T_j) }{ Pr(S) }$$ holds (using Bayes' theorem) if and only if $$C_i$$ and $$T_j$$ are conditionnaly independent given $$S$$, which is not necessarily the case (hence the "NB" above). Moreover, it gives results outside of the range $$[0,1]$$: $$f(80\%,80\%,50\%) = 128\%$$

Some of my attempts to find a function with the right properties can be found here, even if the question itself is obsolete because the fifth property it defines is not necessary for what I want.

My current try consists of computing a good a priori probability for $$Pr(S|C_i T_j)$$. I used combinatorics, and started from a finite sample space (finite number of characters and trials) with a finite resolution for $$Pr(S|C_i T_j)$$ (which means it can only take a finite number of values). I applied the Principle of Indifference by stating that all sample spaces (of a given size) have equal probability to have the right $$Pr(S|C_i T_j)$$ given $$Pr(S|C_i)$$ and $$Pr(S|T_j)$$ (and $$Pr(S)$$), and computed the average $$Pr(S|C_i T_j)$$ for all those sample spaces.

I found an apparently working formula, which have the right properties. Computing its limit would allow me to achieve my goal, but... it's not that easy.

You can find the formula here.

In short, it's : $$Pr(S|C_i T_j) \approx (\frac{ (Pr(S|C_i)^{-1}-1)(Pr(S|T_j)^{-1}-1) }{ Pr(S)^{-1}-1 }+1)^{-1}$$
Or, in terms of odds: $$Od(S|C_i T_j) \approx \frac{ Od(S|C_i) Od(S|T_j) }{ Od(S) }$$ with: $$Od(S|E) = (Pr(S|E)^{-1}-1)^{-1}$$