Given that the three players playing a game of rolling a dice. Player1 rolled a dice got A and player2 rolled a dice got B. The task is to find the probability of player3 to win the match and Player3 wins if he gets more than both of them.
Input: A = 2, B = 3 Output: 1/2 Player3 wins if he gets 4 or 5 or 6 Input: A = 1, B = 2 Output: 2/3 Player3 wins if he gets 3 or 4 or 5 or 6
Approach: The idea is to find the maximum of A and B and then 6-max(A, B) gives us remaining numbers C should get to win the match. So, one can find the answer dividing 6-max(A, B) and 6 with GCD of these two.
- Dice Throw | DP-30
- Probability of getting more heads than tails when N biased coins are tossed
- Maximum number of dots after throwing a dice N times
- Puzzle | Choose the game of Rolling Dice
- Count ways to obtain given sum by repeated throws of a dice
- throw and throws in Java
- Probability of getting at least K heads in N tosses of Coins
- Probability of getting a sum on throwing 2 Dices N times
- Probability of getting two consecutive heads after choosing a random coin among two different types of coins
- Probability of not getting two consecutive heads together in N tosses of coin
- Probability of getting K heads in N coin tosses
- Probability of getting a perfect square when a random number is chosen in a given range
- Probability of getting all possible values on throwing N dices
- Find the first, second and third minimum elements in an array
- Program to find third side of triangle using law of cosines
- Third last digit in 5^N for given N
- Determine the position of the third person on regular N sided polygon
- Minimum and maximum possible length of the third side of a triangle
- Find third number such that sum of all three number becomes prime
- Minimum swaps to make two strings equal by swapping only with third string
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.