147k views
4 votes
Formulate an Algorithm to roll a standard pair of dice until a "12" shows. Each die has side numbered 1 to 6

Formulate an Algorithm to roll a standard pair of dice until a "12" shows-example-1
User Won
by
8.3k points

1 Answer

7 votes
Each of the dice has numbers 1 to 6 on the sides. There are 6 times 6 ways in which the numbers in the dice can be paired (e.g. 1-1, 1-2, 2-3, 4-4, 5-1, etc). Now, to get a number 1 from 1 die and 2 from the other, the dice must be rolled at least 36 times. 
User DeanMWake
by
8.4k points

No related questions found

Welcome to QAmmunity.org, where you can ask questions and receive answers from other members of our community.