I'm wondering how to use Anydice to calculate the following:
Roll 3d6, treating all 1's as 2's, you may reroll each die once, so we do this if the roll is below the average.
So 3d6, can reroll each dice once, and we'll reroll on 2 and 3 because its below average.
I've given it a go, but I'm not sure if I got it right
Best Answer
The first step to make it easier to recognise that our dice are independent of each other meaning we can figure out how one of them works and then add them together.
Firstly, treating all 1s as 2s is actually pretty easy if you know how to define custom dice:
Which is a d6 but with the 1 replaced with a 2. (This is technically a sequence which is why we use
1dD
to roll it later.)We then need to work our how to do a singular reroll for which we can use a custom function. Note that it is not equivalent to taking the higher of two rolls as you keep 4s and 5s even if the second (then unrolled roll) would be higher.
This function takes in a die and converts it to a number, which means it will be iterated for each possible result (make sure not to pass a sequence as that will be converted to the sum). We then check if the 'roll' is 3 or less and if it is we return a new roll (the reroll), otherwise we just return the value roll.
To get the output for 3 such rolls we just call:
Which gives the following distribution:
You can check out my anydice program for this here (includes some outputs for singular rolls as a sanity check).