<s>[INST] Determining if a die is fair or not by rolling six times and observing only the sum Suppose you have two bags and each has 6 dice. In one bag all the die are fair. In the other each die has a bias - die “1” has a probability of returning 1 of $\frac{1}{6} +\epsilon$ and $\frac{1}{6} -\frac{\epsilon}{5}$ for any of the other numbers. Die 2 has a probability of returning 2 of $\frac{1}{6} +\epsilon$ and $\frac{1}{6} - \frac{\epsilon}{5}$ for any of the other numbers and so on. Someone chooses a bag at random and one of the die out of that bag at random. They roll the same die six times and give you the sum. What is the probability that the die came from the biased bag. You can denote the number of ways to get sum S from r rolls as $N^{S}_{r}$.
This is what I got so far:
From Bayes,
P(bag|sum) = P(sum|bag)P(bag) / P(sum) $\propto$ P(sum|bag)
For the fair bag P(sum|bag is fair) = $\frac{N^{S}_{r}}{6^{6}}$
For the unfair bag P(sum|bag is not fair) = $\frac{1}{6}$ P(sum|die biased to return 1) + $\frac{1}{6}$ P(sum|die biased to return 2) + ... +  $\frac{1}{6}$ P(sum|die biased to return 6)
Thanks!
 [/INST] So let's look at $P(\mathrm{sum}=S \mid \mathrm{die\ biased\ toward\ } k)$.
Each roll of the biased die is equivalent to a process where we first choose between case $A$ with probability $\frac{6}{5} \epsilon$ and case $B$ with probability $1 - \frac{6}{5} \epsilon$. In case $A$, the result of the process is $k$. In case $B$, we'll roll a fair die and use that as the result. The net probability works out to the stated $\frac{1}{6} + \epsilon$ for result $k$ and $\frac{1}{6} - \frac{1}{5} \epsilon$ for any result other than $k$. (I came up with the probabilities for $A$ and $B$ by requiring $P(B) \frac{1}{6}$ must be the probability the result is a particular number other than $k$.)
Pretending the biased die value instead comes from this process, let $M$ be the number of times case $B$ happens, so case $A$ happens $6-M$ times. The probability that case $B$ happens $m$ times is
$$ P(M=m) = {6 \choose m} \left(\frac{6}{5} \epsilon\right)^{6-m} \left(1 - \frac{6}{5} \epsilon\right)^m $$
If case $B$ happens $m$ times, then we have $6-m$ results of exactly $k$, and $m$ results equally likely to be any number from $1$ to $6$. If all $6$ add up to $S$, then the case $B$ values must add up to $S - (6-m)k$. The number of ways this could happen is $N_m^{S-(6-m)k}$. ($N_r^s$ is zero for any impossible combinations of $r$ and $s$, or if $r$ or $s$ is negative. But $N_0^0 = 1$.) So
$$ P(\mathrm{sum} = S \mid (\mathrm{die\ biased\ toward\ } k) \land (M=m)) = 
\frac{N_m^{S-(6-m)k}}{6^m} $$
$$ \begin{align*}
 P((M=m) \land (\mathrm{sum} = S) \mid \mathrm{die\ biased\ toward\ } k) &= {6 \choose m} \left(\frac{6}{5} \epsilon\right)^{6-m} \left(1 - \frac{6}{5} \epsilon\right)^m \frac{N_m^{S-(6-m)k}}{6^m} \\
&= {6 \choose m} \left( \frac{6}{5} \epsilon \right)^{6-m} \left(\frac{1}{6} - \frac{\epsilon}{5} \right)^m N_m^{S-(6-m)k}
\end{align*} $$
Combine all possible values of $m$ to get:
$$ P(\mathrm{sum} = S \mid \mathrm{die\ biased\ toward\ } k) = \sum_{m=0}^6 {6 \choose m} \left( \frac{6}{5} \epsilon \right)^{6-m} \left(\frac{1}{6} - \frac{\epsilon}{5} \right)^m N_m^{S-(6-m)k} $$
Then as you already described, you can combine all possible values of $k$ to get:
$$ P(\mathrm{sum = S} \mid \mathrm{unfair\ bag}) =
\frac{1}{6} \sum_{k=1}^6 \sum_{m=0}^6 {6 \choose m} \left( \frac{6}{5} \epsilon \right)^{6-m} \left(\frac{1}{6} - \frac{\epsilon}{5} \right)^m N_m^{S-(6-m)k} $$
</s>