Canonize and probability functions + tests with the dice