Problem
Starting from n=2 dice:
- Roll
ndice, with each number 1 to 6 equally likely on each die. - Check if their sum equals the most probable sum for
ndice, that is3.5*n.- If they're equal, terminate.
- Otherwise, print
n, and repeat from the start withn+2dice
Your code doesn't have to do this procedure exactly, but should give random output probabilistically equivalent to it, based on our definition of randomness.
Your program should output all of the numbers on their own line; for example, if the program got up to 8 dice and rolled the most probable number with 8 dice, the output would be:
2
4
6
Example Run
On 2 dice, 7 is the most probable sum. Let's say the numbers rolled were 2 and 3. Then, you would print 2.
On 4 dice, 14 is the most probable sum. Let's say the numbers rolled were 3, 4, 2, and 5. Then, the sum is 14, so the program would terminate here.
The final output in this case is "2".
Rules
- code-golf so shortest solution in bytes wins
- Standard Loopholes Apply
- The meta definition of randomness applies
- You may use functions as well as programs
27 Answers 27
Python 2, 70 bytes
from random import*
n=2
while eval("+randrange(6)-2.5"*n):print n;n+=2
The trick is to compute the sum by evaling a string the looks like
'+randrange(6)-2.5+randrange(6)-2.5'
with n copies of the expression concatenated. The randrange(6) outputs a random number from [0,1,2,3,4,5], which is shifted down by 2.5 to have average of 0. When the sum if 0, the while condition fails and the loop terminates.
An alternative using map was 4 bytes longer:
from random import*
n=2
while sum(map(randrange,[6]*n))-2.5*n:print n;n+=2
I've found a bunch of equal-length expressions for a die shifted to mean zero, but none shorter
randrange(6)-2.5
randint(0,5)-2.5
randrange(6)*2-5
uniform(-3,3)//1
-
11\$\begingroup\$ I like this one! Mainly because it is the only one that I understand. \$\endgroup\$zoecarver– zoecarver2017年06月13日 03:30:15 +00:00Commented Jun 13, 2017 at 3:30
MATL, 13 bytes
`@E6y&Yrs@7*-
Explanation
` % Do...while top of the stack is truthy
@E % Push 2*k, where k is the iteration index starting at 1
6 % Push 6
y % Duplicate 2*k onto the top of the stack
&Yr % Array of 2*k integers distributed uniformly in {1, 2, ..., 6}
s % Sum
@7* % Push 7*k
- % Subtract
% End (implicit). If the top of the stack is non-zero, the loop
% proceeds with the next iteration. Else the loop is exited.
% Display stack (implicit)
Jelly, (削除) 19 (削除ここまで) 14 bytes
-5 bytes with help from Leaky Nun (moving from count up to recursion)
‘‘6ṗX_3.L6S?Ṅß
A full program printing the results separated by newlines (an extra space and newline are also printed, and the program errors at the end).
Try it online! - any time 6 dice are surpassed TIO kills this due to memory usage, but it works in principle - it also takes ~40s to do so.
A more friendly 15 byte version that does not take so long or require so much memory is available here .
How?
Recursively rolls 2 more dice until the sum of the faces each reduced by 3.5 is zero, printing the number of dice as it goes, when the zero is reached it attempts to use a space character causing a type error.
‘‘6ṗX_3.L6S?Ṅß - Main link: no arguments (implicit left=zero)
‘ - increment (initial zero or the previous result)
‘ - increment (= # of dice to roll, n)
6 - literal 6
ṗ - Cartesian power - all possible rolls of n 6-sided dice with faces 1-6
X - pick one of them
3. - literal 3.5
_ - subtract 3.5 from each of the roll results
? - if:
S - sum the adjusted roll results (will be 0 for most common)
L - ...then: length (number of dice that were rolled)
6 - ...else: literal ' ' (causes error when incremented in next step)
Ṅ - print that plus a newline
ß - call this link with the same arity (as a monad with the result)
-
\$\begingroup\$ Wow, that is very few bytes. Well done! I am holding off on accepting it until a few more people answer. \$\endgroup\$zoecarver– zoecarver2017年06月13日 03:10:10 +00:00Commented Jun 13, 2017 at 3:10
-
\$\begingroup\$ Yeah it is normal to wait quite a while before accepting, even if ever doing so. Many people give it a week or two. \$\endgroup\$Jonathan Allan– Jonathan Allan2017年06月13日 03:11:05 +00:00Commented Jun 13, 2017 at 3:11
-
\$\begingroup\$ also, you are supposed to output all of the iterations - not just the last one. \$\endgroup\$zoecarver– zoecarver2017年06月13日 03:14:09 +00:00Commented Jun 13, 2017 at 3:14
-
\$\begingroup\$ Oh, I answered an old edit - that completely changes it, I cant use this method in many many ways. \$\endgroup\$Jonathan Allan– Jonathan Allan2017年06月13日 03:21:04 +00:00Commented Jun 13, 2017 at 3:21
-
\$\begingroup\$ Oh wait just the
ns, OK maybe it's salvageable. I thought you meant the sums :) \$\endgroup\$Jonathan Allan– Jonathan Allan2017年06月13日 03:22:28 +00:00Commented Jun 13, 2017 at 3:22
TI-BASIC, 28 bytes
2→N
While mean(randInt(1,6,N)-3.5
Disp N
N+2→N
End
Explanation
randInt(1,6,N)generates a list of N random numbers from 1 to 6mean(randInt(1,6,N)-3.5gets the average of the rolls shifted down by 3.5Whilecontinues until the average expression equals zero (the most probable sum)
R, 49 bytes
n=2
while(sum(sample(6,n,T)-3.5)){print(n)
n=n+2}
sample(6,n,T) generates n (pseudo)random samples from the range 1:6 with replacement. Subtracting 3.5 from each element yields a result whose sum is 0 (falsey) if and only if it's the most common value.
Skips the odd dice rolls.
-
\$\begingroup\$ This seems to output 80 every time for me, possible bug? \$\endgroup\$zoecarver– zoecarver2017年06月13日 03:13:01 +00:00Commented Jun 13, 2017 at 3:13
-
\$\begingroup\$ @pudility you can add spaces at the end to try it again; it's caching the inputs/code snippet each time \$\endgroup\$Giuseppe– Giuseppe2017年06月13日 03:14:04 +00:00Commented Jun 13, 2017 at 3:14
-
3\$\begingroup\$ @Giuseppe You can disable the cache in TIO under Settings. \$\endgroup\$xnor– xnor2017年06月13日 03:20:23 +00:00Commented Jun 13, 2017 at 3:20
-
\$\begingroup\$ after I disabled the cache like @xnor said, It worked very well. Thanks for the answer! \$\endgroup\$zoecarver– zoecarver2017年06月13日 03:28:48 +00:00Commented Jun 13, 2017 at 3:28
-
\$\begingroup\$ @xnor who knew! Good to know in the future. \$\endgroup\$Giuseppe– Giuseppe2017年06月13日 03:49:15 +00:00Commented Jun 13, 2017 at 3:49
Java 8, (削除) 123 (削除ここまで) (削除) 149 (削除ここまで) (削除) 113 (削除ここまで) 108 bytes
()->{for(int n=0,s=1,i;s!=n*7;){for(i=s=++n*2;i-->0;s+=Math.random()*6);if(s!=n*7)System.out.println(n*2);}}
Or 107 bytes if we use an Object null as unused parameter instead.
+26 bytes for a bug-fix, correctly pointed out by @Jules in the comments.
-41 bytes thanks to @OliverGrégoire's great thinking!
Explanation:
()->{ // Method without parameter nor return-type
for(int n=0, // Amount of dice
s=1, // Sum
i; // Index
s!=n*7;){ // Loop (1) as long as the sum doesn't equal `n`*7,
// because we roll the dice per two, and 3.5*2=7
for(i=s=++n*2; // Reset both the index and sum to `n`*2,
// so we can use random 0-5, instead of 1-6
// and we won't have to use `+1` at `Math.random()*6`
i-->0; // Inner loop (2) over the amount of dice
s+=Math.random()*6 // And increase the sum with their random results
); // End of inner loop (2)
if(s!=n*7) // If the sum doesn't equal `n`*7
System.out.println(n*2); // Print the amount of dice for this iteration
} // End of loop (1)
} // End of method
-
1\$\begingroup\$ I think there is an error in the function. If
requals3.5*nthe program should terminate directly. But, if I understand the function correctly, it would printnone last time before terminating. \$\endgroup\$raznagul– raznagul2017年06月13日 14:48:11 +00:00Commented Jun 13, 2017 at 14:48 -
\$\begingroup\$ @raznagul Actually, it wasn't printing an additional time. It was however bugged. What it did before: random 1-12 (bug 1: should have been 2-12); check if this equals 7: if it is: we're done without printing; if it is not: roll 2 dice again (bug 2, should have been 4 dice instead of 2 again); then print 2, and raise
nby 2. So it did contain two bugs (1-12 instead of 2-12; and rolling dice like 2 -> 2 -> 4 -> 6 -> ..., instead of 2 -> 4 -> 6 -> ...). It was printing correctly however, because it wouldn't have gone toSystem.out.println(n),n+=2ifrwas indeed equal to3.5*n. \$\endgroup\$Kevin Cruijssen– Kevin Cruijssen2017年06月13日 17:07:39 +00:00Commented Jun 13, 2017 at 17:07 -
2\$\begingroup\$ "Roll two dice at once, by picking a random number from 2-12" -- this is not probabilistically equivalent to rolling two dice and adding the numbers as required in the question, therefore is not a correct solution. \$\endgroup\$Jules– Jules2017年06月13日 18:41:55 +00:00Commented Jun 13, 2017 at 18:41
-
1\$\begingroup\$ Shorter by a few bytes (113), but probably still golfable:
()->{for(int n=2,s=0,e=7,i;s!=e;n+=2,e+=7){for(i=n,s=n;i-->0;)s+=Math.random()*6;if(s!=e)System.out.println(n);}}. Also, correct in regards to Jules' comment and my explanation.nis dices,sis sum,eis expected,iis index. Finally, the sum starts withnto avoid a+1,ntimes, ands!=eis repeated because I just don't know how to avoid that case. \$\endgroup\$Olivier Grégoire– Olivier Grégoire2017年06月14日 09:27:26 +00:00Commented Jun 14, 2017 at 9:27 -
1\$\begingroup\$ I golfed it a bit again ;)
()->{for(int i=0,s=1,j;s!=i*7;){for(j=s=++i*2;j-->0;)s+=Math.random()*6;if(s!=i*7)System.out.println(i*2);}}\$\endgroup\$Olivier Grégoire– Olivier Grégoire2017年06月14日 17:50:30 +00:00Commented Jun 14, 2017 at 17:50
05AB1E, (削除) 22 (削除ここまで) 20 bytes
-2 Bytes thanks to Emigna
[YF6L.RO}7Y*;ïQ#Y=ÌV
Explanation
[YF6L.RO}7Y*;ïQ#Y=ÌV
[ # Infinite loop start
YF } # Y times... (Y defaults to 2)
6L.R # Push a random number between 1 and 6 (why does this have to be so looooong ._.)
O # Sum
7Y*;ï # Push 3.5 * Y as an int
Q # Is it equal to 3.5 * Y?
# # If so: Quit
Y # Push Y
= # Print without popping
ÌV # Set Y to Y + 2
-
1\$\begingroup\$ If you move
Oafter.Ryou can remove)ands. \$\endgroup\$Emigna– Emigna2017年06月13日 11:17:49 +00:00Commented Jun 13, 2017 at 11:17
R, (削除) 48 (削除ここまで) (削除) 44 (削除ここまで) 42 bytes
A 5-byte improvement on Giuseppe's answer.
while(sum(sample(6,F<-F+2,1)-3.5))print(F)
This (ab)uses the fact that F is a variable by default assigned to FALSE which coerces to 0 and can then be incremented, saving us the need to initialize a counter variable.
-
1\$\begingroup\$ of course, you can save two bytes by calling
sample(6)instead ofsample(1:6)but crossed out 44 is still 44.... codegolf.stackexchange.com/a/82343/67312 \$\endgroup\$Giuseppe– Giuseppe2017年06月13日 13:07:21 +00:00Commented Jun 13, 2017 at 13:07 -
\$\begingroup\$ @Giuseppe Of course, thanks! I've edited the answer now. \$\endgroup\$rturnbull– rturnbull2017年06月14日 08:28:41 +00:00Commented Jun 14, 2017 at 8:28
PHP, 75 bytes
for($d=2;(++$i*7/2-$r+=rand(1,6))||$i<$d;)$i%$d?:$d+=1+print"$d
".$r=$i="";
-
1\$\begingroup\$
5^2/++$i*$d+=rand()%6is a slightly shorter condition for the loop. Also I think the current loop incorrectly exits if the very first "dice" rolled is a "1" (it generates a 0 for the initial$d). \$\endgroup\$user59178– user591782017年06月13日 13:45:57 +00:00Commented Jun 13, 2017 at 13:45 -
\$\begingroup\$ @user59178 Nice Idea but it could be make a division by zero error so I must modified it. You are right my solution before stops in this case which is wrong. \$\endgroup\$Jörg Hülsermann– Jörg Hülsermann2017年06月13日 14:25:41 +00:00Commented Jun 13, 2017 at 14:25
-
\$\begingroup\$ Your 45-byte answer is invalid because the resulting distribution is not the same as in the question, see here. Your 42-byte answer is, I think, also using the wrong distribution; it seems to assume for example that for two dice, it is equally likely to have 2 and 7 as the sum. \$\endgroup\$user34409– user344092017年06月13日 18:37:30 +00:00Commented Jun 13, 2017 at 18:37
-
\$\begingroup\$ @Pakk Yes the 45 Byte answer is invalid. I think your thinking is false what happens at the 42 Byte Version. Look at am expanded version Try it online! \$\endgroup\$Jörg Hülsermann– Jörg Hülsermann2017年06月13日 19:43:39 +00:00Commented Jun 13, 2017 at 19:43
-
\$\begingroup\$ @JörgHülsermann That expanded version confirms what I say. In a proper implementation, the value of $r/$i should become closer to 3.5 for bigger values of $i, but I don't see that happening at all. I got an average of 1.16 for 9984 dice, that is statistically extremely unlikely. \$\endgroup\$user34409– user344092017年06月13日 19:55:57 +00:00Commented Jun 13, 2017 at 19:55
Mathematica, 47 bytes
For[n=1,Tr@RandomInteger[5,2n++]!=5n,Print[2n]]
-5 bytes from LLlAMnYP
05AB1E, 17 bytes
[N·ÌD6Lã.R7;-O_#,
Explanation
[ # loop over N in 0...
N·Ì # push N*2+2
D # duplicate
6L # push range [1 ... 6]
ã # cartesian product (combinations of N*2+2 elements in range)
.R # pick one at random
7;- # subtract 3.5 from each dice roll
O_# # if sum == 0 exit loop
, # otherwise print the copy of N*2+2
Batch, 109 bytes
@set/an=%1+2,s=n*5/2
@for /l %%i in (1,1,%n%)do @call set/as-=%%random%%%%%%6
@if %s% neq 0 echo %n%&%0 %n%
Rather annoyingly, random is a magic environment variable, so it only gets replaced with a random value during environment expansion, which normally happens before the for loop starts. call makes it happen each time through the loop, but then you need to double the % signs to prevent the expansion from happening before the loop. The fun starts because we want to modulo the result by 6, which requires a real % sign, which now has to be doubled twice. The result is six consecutive %s.
JavaScript (ES2015), (削除) 75 (削除ここまで) 78 bytes
f=(n=2)=>[...Array(n)].reduce(a=>a+Math.random()*6|0,n)==3.5*n?'':n+`
`+f(n+2)
Outputs a string of results separated by newlines
Edit: saved a byte thanks to Shaggy, added 4 bytes to start function at 2
Explanation
f=n=>
[...Array(n)] // Array of size n
.reduce( // Combine each item
a=>a+Math.random()*6|0, // Add a random roll between 0 and 5 for each item
n) // Start at n to correct rolls to between 1 and 6
==3.5*n // Compare total to most probable roll total
? '' // If true, end
: n+'\n'+f(n+2) // Otherwise, output n and continue
f=(n=2)=>[...Array(n)].reduce(a=>a+Math.random()*6|0,n)==3.5*n?'':n+`
`+f(n+2)
let roll = _ => document.getElementById('rolls').innerHTML = f();
document.getElementById('roll-button').onclick = roll;
roll();
<button id="roll-button">Roll</button>
<pre id="rolls"></pre>
-
2\$\begingroup\$ Save a bytes by using a literal newline enclosed in backticks, instead of
'\n'. \$\endgroup\$Shaggy– Shaggy2017年06月13日 09:23:25 +00:00Commented Jun 13, 2017 at 9:23 -
\$\begingroup\$ This does not start with
n=2, instead you have to specify the starting number of dice when the function is called. \$\endgroup\$MT0– MT02017年06月13日 12:17:47 +00:00Commented Jun 13, 2017 at 12:17
php - 89 Characters
$r=0;$n=2;while($r!=$n*3.5){$r=$i=0;while($i<$n){$r+=rand(1,6);$i++;}print $n."
";$n+=2;}
-
\$\begingroup\$ you need not the first
$r=0;useechoinstead ofprint$n."can be write as"$nand for loops instead of while allows do to something in the after loop or before to save some bytes \$\endgroup\$Jörg Hülsermann– Jörg Hülsermann2017年06月13日 17:33:44 +00:00Commented Jun 13, 2017 at 17:33
C (gcc), (削除) 84 (削除ここまで) (削除) 80 (削除ここまで) (削除) 79 (削除ここまで) (削除) 77 (削除ここまで) (削除) 75 (削除ここまで) (削除) 80 (削除ここまで) (削除) 78 (削除ここまで) 76 bytes
i;f(s,j){for(;s;s?printf("%d\n",i):0)for(j=i+=2,s=i*7/2;j--;)s-=1+rand()%6;}
Haskell (削除) 133 (削除ここまで) 132 bytes
import System.Random;import Control.Monad
s k=do n<-replicateM k$randomRIO(1,6);if sum n==7*div k 2 then pure()else do print k;s(k+2)
Credit to @Laikoni for the suggestions in the comments below.
-
\$\begingroup\$ 1.) Imports should be counted in the byte count. 2.)
return()can be shortened topure()andputStrLn$showcan be shortened toprint. \$\endgroup\$Laikoni– Laikoni2017年06月13日 17:48:26 +00:00Commented Jun 13, 2017 at 17:48 -
\$\begingroup\$ I will fix it right away. Thanks \$\endgroup\$Davide Spataro– Davide Spataro2017年06月13日 18:53:31 +00:00Commented Jun 13, 2017 at 18:53
-
\$\begingroup\$ Some further small things:
div k 2 thencan bediv k 2thenanddo print k;s(k+2)isprint k>>s(k+2). \$\endgroup\$Laikoni– Laikoni2017年06月13日 20:24:28 +00:00Commented Jun 13, 2017 at 20:24
Octave 55 bytes
n=2;
while mean(randi(6,n,1))-3.5!=0
n
n=n+2;
end
Inspired by Andrewarchi's answer. If someone has any pointers to even shorten it, they are welcome.
-
\$\begingroup\$ Wow, TI-BASIC and Octave have surprisingly similar syntaxes \$\endgroup\$thaliaarchi– thaliaarchi2017年06月15日 01:29:05 +00:00Commented Jun 15, 2017 at 1:29
-
\$\begingroup\$ @andrewarchi Octave (the online version is what I use) is just the basics of the basics when it comes to programming. \$\endgroup\$Michthan– Michthan2017年06月15日 11:11:53 +00:00Commented Jun 15, 2017 at 11:11
-
\$\begingroup\$ Welcome to PPCG! \$\endgroup\$Martin Ender– Martin Ender2017年06月14日 12:49:23 +00:00Commented Jun 14, 2017 at 12:49
-
\$\begingroup\$ Thanks! Just finished the Pyth tutorial and figured I might give it a try, although this is probably still improvable. Any suggestions are appreciated. \$\endgroup\$qwertz– qwertz2017年06月14日 13:11:48 +00:00Commented Jun 14, 2017 at 13:11
QBIC, 40 bytes
{[1,r|g=g+_r1,6|]~g=r*3.5|_X\g=0?r┘r=r+2
Thispretty much literally does what the challenge asks for; seems the shortest way to get the distribution right.
Explanation
{ DO infinitely
[1,r| FOR a=1, a<=r (at start, r == 2), a++
g=g+ Add to g (0 at start)
_r1,6| a random number between 1 and 6 incl.
] NEXT
~g=r*3.5 IF the result of all dice rolls equals the expected value
|_X THEN quit
\g=0 ELSE, reset the dice total
?r┘ PRINT the number of dice used
r=r+2 and add 2 dice.
END IF and LOOP are courtiously provided by QBIC at EOF.
Rexx (Regina), 78 bytes
x=2
do forever
t=0
do x
t=t+random(6)
end
if(t=x*3.5)then
exit
say x
x=x+2
end
JavaScript (ES6) - 69 Characters
r=n=>n?r(n-1)+(Math.random()*6|0)-2.5:0;f=(n=2)=>r(n)?n+`
`+f(n+2):""
console.log(f())
Explanation:
r=n=> # Roll n dice
n? # If there is a dice left to roll
r(n-1) # Roll n-1 dice
+(Math.random()*6|0) # Add a random number from 0 .. 5
-2.5 # Subtract 2.5 so sum of average is 0
:0 # Else total is 0
and:
f=(n=2)=> # Start with n = 2
r(n) # Roll n dice
?n+"\n"+f(n+2) # If non-zero then concatenate n, newline and
# result for n+2 dice
:"" # If zero (average) terminate.
Calc2 0.7, (削除) 119 (削除ここまで) (削除) 118 (削除ここまで) 111 bytes
using"runtime";for(n=2,d=0;d!=3.5*n;Console.WriteLine(n),n+=2)for(i=d=0;i++<n;)d+=Math.Int(Random().Next(1,7));
ungolfed:
using "runtime";
var d = 0;
var r = Random();
for(var n = 2; d != 3.5 * n; Console.WriteLine(n), n += 2)
{
d = 0;
for(var i = 0; i < n; i++)
d += Math.Int(r.Next(1,7));
}
I could do without the Math.Int() but unfortunately in 0.7 the Random().Next() functions have a bug where they all return doubles instead of ints. It has been fixed but only after this question was posted. I'm not gonna win anything, but hey, nice proof of concept.
Edit:
- removed unnecessary space between using and "runtime" (-1 byte)
Edit2:
removed var r and create a new Random where it's needed (-4 byte)
changed i=0,d=0 to i=d=0 (-2 byte)
incremented i after check (-1 byte)
Ruby, 52 bytes
s=x=2;(s=0;p x.times{s+=rand(6)-2.5};x+=2)while s!=0
Explanation
s=x=2; # sum=2, x=2
( )while s!=0 # while sum != 0:
s=0; # reset the sum
p # print
x.times{ }; # repeat x times:
s+= # Add to sum:
rand(6) # random int in 0..5
-2.5 # subtract average
# (implicitly return x for printing)
x+=2 # Increment x by 2
-
\$\begingroup\$ @Pakk note the
s=0at the front of the loop and the use ofx.times. This means the sum is reset every time and thenxdice are rolled, which should be the correct distribution. I'll write up an explanation of my code. \$\endgroup\$Value Ink– Value Ink2017年06月13日 19:23:59 +00:00Commented Jun 13, 2017 at 19:23 -
\$\begingroup\$ You are correct, I was too fast with my conclusion. \$\endgroup\$user34409– user344092017年06月13日 19:51:29 +00:00Commented Jun 13, 2017 at 19:51
Javascript, 87 chars
for(n=2;eval('+'.repeat(n).replace(/./g,x=>x+(Math.random()*6|0)))!=2.5*n;n+=2)alert(n)
Test with console.log instead of alert:
for(n=2;eval('+'.repeat(n).replace(/./g,x=>x+(Math.random()*6|0)))!=2.5*n;n+=2)console.log(n)
console.log('Done')
lua, 102 bytes
function r(n,t) for d=1,n do t=t+math.random(1,6)end return t==n*3.5 or print(n)or r(n+2,0)end r(2,0)
Or the more readable version
function r(n,t) --recursive function does its magic, t is given to safe usage bytes(no local)
for d=1,n do --roll n dice and count them up to the total (t)
t =t+math.random(1,6)
end
return t==n*3.5 or --check if t==n*3.5. If it is then it ends
print(n) or --t != n*3.5 thus print n. print returns nil
r(n+2,0) --both the check and the return value from print are false thus r gets executed.
end
r(2,0) --start the process
A more cheaty version for 96 bytes
function r(n,t,m)t=t+m(1,6)+m(1,6)return t==n*3.5 or print(n)or r(n+2,t,m)end r(2,0,math.random)
This pretty much works the same as the first but reuses the rolls from earlier calls. Because of this I can remove the for loop. Both are tested in lua 5.2
2, 4, 6, 8, ...an roll that many dice each time until I hit the most probable number for that iteration? \$\endgroup\$