Math.round (Math.random (0,1)) + 2, to obtain a value 2 or 3. Test this randomizer a few times by clicking on the white buttons.
Test the random head or coin
This random function throws 500,000 times one coin and shows how often it was head or coin (it takes a few seconds).
Test the random for the three coins
Three coins, each generating a value 2 or 3, will result in a 6, 7, 8 or 9.
This random function throws 500,000 times three coins and shows how often the value 6, 7, 8 or 9 was cast (it takes a few more seconds).