Hello,
It is not so complicated once you get it...
For using the calculator, the formulae

and

and

should do.
If the 20 dices were replaced by 20 people, you can distinguish between them so it becomes a permutation. In this case, you choose 20 (maybe same)elements out of 3 ones (The order of choice is not arbitrary).
Each person can choose from 3 alternatives, so

.
If 10 people have only 2 alternatives, the total would be

.
Bye.