\(5\) equal numbers result in a trick. However, how likely this is depends on what you count as a try: a single roll of \(5\) dice or a complete turn in which you keep matching dice and re-roll them up to \(2\) times. Here we use \(5\) fair dice with the numbers \(1\) to \(6\) and independent results. Every trick counts as a success; the probability you are looking for is not limited to a specific number of points like \(6\) .
According to the game instructions , you can decide again before each additional roll which dice are left lying. Our only goal is some kind of trick, not the best overall score in a game. A single roll has \(6^5=7776\) equally likely results when differentiating the dice. Of these \(6\) show the same number on all dice. So the chance is \(\frac{6}{7776}=\frac{1}{1296}\) . As soon as a trick is reached, you end the move; In total, a maximum of \(3\) throws are allowed.
$$p_1=\frac{6}{6^5}=\frac{1}{1296}\approx0{,}07716\%.$$
The most trivial strategy is also the best: if you want to maximize the chance, you keep the largest group of identical numbers. The target number can also change: From \((2,2,3,4,5)\) you first keep the two \(2\) . If the next roll delivers \((6,6,6)\) , you keep this group and re-roll the two \(2\) . The last chance increases from \(\frac{1}{216}\) to \(\frac{1}{36}\) . And last but not least, let's assume: A gimmick ends the episode immediately; further litters are omitted.
The easiest way to do the calculation is to start with the last throw. If \(4\) of the same dice are already available, only the remaining dice have to pass: the chance is \(\frac{1}{6}\) . If \(3\) are the same dice, the other two must show the number held. Because their outcomes are independent, multiply the chances and get \(\frac{1}{6}\cdot\frac{1}{6}=\frac{1}{36}\) . On the other hand, if you hold on to different numbers at the same time, there can be no problem with the last throw. So it's not just the number that matters, but also what you keep.
With \(2\) remaining rolls, each missing die gets another chance. If \(4\) dice are the same, one hit with the remaining dice is sufficient. The counter calculation is shorter here: He misses the target number in both attempts with probability \(\frac{5}{6}\cdot\frac{5}{6}=\frac{25}{36}\) . The chance of success is therefore \(1-\frac{25}{36}=\frac{11}{36}\) . For smaller groups, you count all possible consequences of the throws and allow the target to be changed. The following chances arise with the best choice of stop:
| Largest group | Results in the \(1.\) litter | Chance with \(2\) remaining rolls |
|---|---|---|
| \(1\) | \(720\) | \(\frac{221}{17496}\) |
| \(2\) | \(5400\) | \(\frac{113}{3888}\) |
| \(3\) | \(1500\) | \(\frac{121}{1296}\) |
| \(4\) | \(150\) | \(\frac{11}{36}\) |
| \(5\) | \(6\) | \(1\) |
The lines do not occur with the same frequency. For example, a largest group of \(2\) dice is created in \(5400\) of the \(7776\) possible first throws. These include a single pair and \(2\) pairs; If there is a tie, you choose one of them. We multiply each chance on the right by the number in the middle and divide the sum by \(7776\) . This returns \(p_3\) ; for \(p_2\) you only use a remainder throw. The following values apply before the first throw with optimal stopping choice: \(p_2\) for a maximum of \(2\) and \(p_3\) for a maximum of \(3\) throws:
$$p_2=\frac{221}{17496}\approx1{,}26315\%.$$
$$p_3=\frac{347897}{7558272}\approx4{,}60286425\%.$$
Whether keeping the largest group is really best can be fully tested. The following PHP script considers every possible selection, including mixed numbers or no dice held at all. It starts at the end of the turn, then calculates the best decisions for \(1\) and \(2\) remaining rolls and finally averages over the first roll. The same patterns are reused to keep the bill small. All comparisons are made with integers; only the percentage display is rounded:
<?php
declare(strict_types=1);
if (PHP_INT_SIZE < 8) {
throw new RuntimeException('64-Bit-PHP erforderlich.');
}
function combinations(array $limits): array
{
$result = [[]];
foreach ($limits as $limit) {
$next = [];
foreach ($result as $prefix) {
for ($i = 0; $i <= $limit; $i++) {
$next[] = [...$prefix, $i];
}
}
$result = $next;
}
return $result;
}
function outcomes(int $number): array
{
static $cache = [];
if (isset($cache[$number])) {
return $cache[$number];
}
$result = [];
foreach (combinations(array_fill(0, $number, value: 5)) as $dice) {
$counts = array_fill(0, count: 6, value: 0);
foreach ($dice as $face) {
$counts[$face]++;
}
$key = implode(',', $counts);
$result[$key] = ($result[$key] ?? 0) + 1;
}
return $cache[$number] = $result;
}
function pattern(array $counts): string
{
rsort($counts);
return implode(',', $counts);
}
$states = [];
$values = [];
foreach (outcomes(5) as $key => $count) {
$counts = array_map('intval', explode(',', $key));
rsort($counts);
$states[pattern($counts)] = $counts;
$values[pattern($counts)] = (int) ($counts[0] === 5);
}
// Gemeinsamer Nenner: 6^(5 * verbleibende Würfe).
for ($remaining = 1; $remaining <= 2; $remaining++) {
$next = [];
foreach ($states as $key => $counts) {
$best = 0;
foreach (combinations($counts) as $held) {
$number = 5 - array_sum($held);
$total = 0;
foreach (outcomes($number) as $rolled => $count) {
$after = array_map('intval', explode(',', $rolled));
foreach ($held as $face => $amount) {
$after[$face] += $amount;
}
$total += $count * $values[pattern($after)];
}
$best = max($best, $total * (6 ** (5 - $number)));
}
$next[$key] = $best;
}
$values = $next;
}
$numerator = 0;
$denominator = 6 ** 15;
foreach (outcomes(5) as $key => $count) {
$numerator += $count * $values[pattern(array_map('intval', explode(',', $key)))];
}
[$a, $b] = [$numerator, $denominator];
while ($b !== 0) {
[$a, $b] = [$b, $a % $b];
}
echo intdiv($numerator, $a), '/', intdiv($denominator, $a), PHP_EOL;
printf("%.10f%%\n", (100 * $numerator) / $denominator);
Around \(4{,}60\%\) means: Even with the best choice, a problem remains rare. If you reroll everything every time, the chance over a maximum of \(3\) attempts is only about \(0{,}23130\%\) . If you keep matching dice, but stick to the target number chosen after the \(1.\) roll, you will achieve around \(4{,}52941\%\) . Switching to the larger group therefore brings a small additional advantage. Regardless of whether it's mathematical strategy or pure gut feeling: Kniffel is a timeless, entertaining and, above all, entertaining board game.