You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

161 lines
8.4 KiB
TeX

\chapter{Dice}
\section{Basics of Dice}
\subsection{Distribution of Successes}
\begin{multicols}{2}
For further analysis it will be useful to have a distribution function for margins of success.
To obtain such a distribution we start by observing that each roll can be divided into four groups: critical successes, successes, failures and critical failures, as shown in \cref{equ:dice_groups}. Further, this tuple has a multinomial distribution
\begin{align}
\left(C_s, S, F, C_f\right) \sim \text{MN}\left(d, 4, p\right)\label{equ:dice_groups} \\
p = \left[1/12,\frac{12-\stat{dt}-1}{12},\frac{\stat{dt}-1}{12},\frac{1}{12}\right]
\end{align}
We can easily map a tuple to a success margin:
\begin{equation}
M = 2C_s + S - F - 2C_f
\end{equation}
Therefore, our distribution for $M$ is a sum over all tuples that produce the correct $m$
\begin{equation}
Pr(M = m) = \sum_{C_s,S,F,C_f; M = m} \text{MN}\left(d, 4, p\right)
\end{equation}
Instead of trying all combinations of variables and summing the correct ones, we can use a system of Diophantine equations to reduce the search space.
We start with two equations
\begin{align}
2c_s + s - f - 2c_f & = m \\
c_s + s + f + c_f & = d
\end{align}
which resolve into a two-dimensional system
\begin{align}
c_s & = m - d + 2f + 3c_f \\
s & = -m + 2d - 3f - 4c_f
\end{align}
Next, we use inequalities $c_s\geq0, s\geq0$ to constrain the space for $c_f$, based on $f$. An example plot in \cref{fig:candidates} graphically shows the area defined by these equations and inequalities for one combination of $d$ and $m$.
\begin{align}
\frac{m-d+2f}{-3} \leq c_f \leq \frac{-m+2d-3f}{4}
\end{align}
Because the lower bound is not necessarily greater than 0, we will also use $c_f\geq0$.
We can now also constrain $f$ by observing that the lower bound for $c_f$ can cross $c_f=0$ before $f=d$.
\begin{equation}
0 \leq f \leq \frac{2d-m}{3}
\end{equation}
Putting the sum together, and adding floors and ceilings to limit the sum to integers, we get:
\begin{align}
Pr(M=m) & = \sum_{f=0}^{\left\lfloor \frac{2d-m}{3} \right\rfloor}\sum_{c_f=\max(0,\left\lceil\frac{m-d+2f}{-3}\right\rceil)}^{\left\lfloor\frac{-m+2d-3f}{4}\right\rfloor} \\
& \quad\; \frac{d!}{c_s!s!f!c_f!}
\frac{n_s^s n_f^f}{12^{d}} \\
n_f & = \stat{dt}-1 \\
n_s & = 12-n_s
\end{align}
While this equation is not very illuminating, it does allow us to efficiently compute the distribution and thus answer various questions regarding the results of dice rolls.
\end{multicols}
\begin{figure}[htb]
\centering
\includegraphics{images/dice_candidates_example.pdf}
\caption{Example of candidate combinations of $f$ and $c_f$ with upper and lower bounds for $c_f$ shown. In this plot, $d=12$ and $m=8$.\label{fig:candidates}}
\end{figure}
\subsection{Probability of Success}
\begin{multicols}{2}
The first question to ask is: ``What is the probability of success, given a fixed \stat{DT}?''
We will use the binomial distribution $\text{B}(20,7/20)$ for the size of the dice pool, to compute the expectation. This is a fairly arbitrary choice that assumes 7 is the average pool size.
\Cref{tab:cos} shows the probability of success for a given \stat{DT} as well as number of successes in a number of attempts.
\end{multicols}
\begin{table}[htb]
\centering
\begin{tabular}{r | r r c l}
\stat{DT} & $p$ & \multicolumn{3}{c}{Succeeds} \\
1 & 98\% & 51 & in & 52 \\
2 & 95\% & 20 & in & 21 \\
3 & 90\% & 8 & in & 9 \\
4 & 82\% & 4 & in & 5 \\
5 & 70\% & 2 & in & 3 \\
6 & 56\% & 1 & in & 2 \\
7 & 42\% & 2 & in & 5 \\
8 & 28\% & 1 & in & 4 \\
9 & 17\% & 1 & in & 6 \\
10 & 9\% & 1 & in & 12 \\
11 & 4\% & 1 & in & 26 \\
\end{tabular}
\caption{Expected chance of success.\label{tab:cos}}
\end{table}
% \begin{figure}[htb]
% \centering
% \begin{tabular}{r c c c c c c c c c c c}
% \stat{DT} & 1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 & 9 & 10 & 11 \\ \hline
% $p$ & 98\% & 95\% & 90\% & 82\% & 70\% & 56\% & 42\% & 28\% & 17\% & 9\% & 4\% \\
% Succeeds & 51 in 52 & 20 in 21 & 8 in 9 & 4 in 5 & 2 in 3 & 1 in 2 & 2 in 5 & 1 in 4 & 1 in 6 & 1 in 12 & 1 in 26
% \end{tabular}
% \caption{Expected chance of success.\label{tab:cos2}}
% \end{figure}
\subsection{Expected Margin of Success}
\begin{multicols}{2}
We also want to know what the expected margin of success is, given that the player succeeded in the roll, $\text{E}\left[M | M \geq 0\right]$. \Cref{tab:exp_mos} shows the expectations.
Of note are the expected numbers of successes for \stat{DT} 11. The requirement for critical successes there causes a large variance in results.
\end{multicols}
\begin{figure}[htb]
\centering
\begin{tabular}{r | c c c c c c c c}
& \multicolumn{8}{c}{Difficulty Threshold} \\
d & 0 & 1 & 2 & 3 & 4 & 5 & 6 & 7 \\ \cline{2-9}
1 & 1 & 1 & 1 & 1 & 1 & 1 & 0 & 0 \\
2 & 2 & 2 & 1 & 1 & 1 & 1 & 0 & 0 \\
3 & 3 & 3 & 2 & 2 & 1 & 1 & 1 & 1 \\
4 & 4 & 3 & 3 & 2 & 2 & 1 & 1 & 0 \\
5 & 5 & 4 & 3 & 3 & 2 & 1 & 1 & 1 \\
6 & 6 & 5 & 4 & 3 & 2 & 2 & 1 & 1 \\
7 & 7 & 6 & 5 & 4 & 3 & 2 & 1 & 1 \\
8 & 8 & 7 & 5 & 4 & 3 & 2 & 1 & 1 \\
9 & 9 & 8 & 6 & 5 & 3 & 2 & 1 & 1 \\
10 & 10 & 8 & 7 & 5 & 4 & 2 & 1 & 1 \\
\end{tabular}
\caption{Expected number of successes.\label{tab:exp_mos}}
\end{figure}
\section{Combat Pool Steady State}
\begin{multicols}{2}
The combat pool starts with the proficiency stat, i.e., \stat{STR} or \stat{DEX}. However, after rolling, the change in pool size is determined by \stat{CON}. After a number of turns, the expected size of the pool should converge on a number $E[d]$.
We start by assuming that $E[d]$ is a number such that
\begin{equation}
E[d_{n+1}] = E[d_{n}] \label{equ:dice_ss_a1}
\end{equation}
where $n$ is the turn after which the steady state is achieved.
To compute $E[d_n]$ for any $n$ we can use
\begin{equation}
E[d_n] = E[d_{n-1}] - p_f \cdot E[d_{n-1}] + \stat{con} \label{equ:dice_ss_a2}
\end{equation}
where $p_f = \stat{dt}/12$ is the probability of failure.
Using assumptions in \cref{equ:dice_ss_a1,equ:dice_ss_a2} we write the following equations:
\begin{align}
E[d] & = E[d] - p_f \cdot E[d] + \stat{con} \\
p_f\cdot E[d] & = \stat{con} \\
E[d] & = \frac{\stat{con}}{p_f}
\end{align}
As $p_f$ approaches 1, the steady state becomes just \stat{CON}, meaning the dice pool is entirely discarded and refreshed by \stat{con} on every turn. On the other hand, as $p_f$ approaches 0, the expected dice pool size increases. Specifically at 0, it shoots off toward infinity, as the dice pool loses no dice and \stat{con} dice get added toward it on every turn.
\end{multicols}