Help for a troll definition

Help for a troll definition

Return to topic list

Thu Oct 23 03:29:05 2014   by   Tiziano Contorno
Hi all,

I can't find a way to do this:

Roll Nd6, evaluate probability to get at least C identical dice showing a value greater than R.

Example:

N = 4
C = 3
R = 5

Roll 4d6, calculate probability to get at least 3 identical dice showing a value greater than 5.

Good combinations for this example are:

6666
6661
6662
6663
6664
6665

Hope this is clear, thank you!



Thank you!
 
Thu Oct 23 08:18:14 2014   by   Torben
You can do it by first filtering such that only dice greater than or equal to the target number T are retained and then count identical dice.  This is done by first counting Ts, then counting T+1s up to 6s and then taking the maximum of these.  In Troll, this is done like this:

x := 4d6;
T := 5;
y := T <= x;
max (foreach i in T..6 do count i=y)


This will give you the probabilities of getting different numbers of identical dice that meet the threshold.

I hope this helps.
 
Sat Oct 25 19:41:42 2014   by   Tiziano Contorno
Thank you Torben, I completely missed that 1..N notation. Works wonders.
 
Sun Oct 26 12:05:53 2014   by   Torben
I just noticed that the definition can be made shorter: You don't need to filter the dice that are less than T, since you only count those that are at least T in the foreach loop.  So you can remove third line and replace y by x in the last line.
 

Return to topic list



New message:
Topic:
Posted by:

Type the values of the dice shown below:

Return to topic list