Given the sum. The task is to find out the probability of occurring that sum on the thrown of the two dice N times.
Probability is defined as the favorable numbers of outcomes upon total numbers of the outcome. Probability always lies between 0 and 1.
Input: sum = 11, times = 1 Output: 2 / 36 favorable outcomes = (5, 6) and (6, 5) i.e 2 Total outcomes = (1, 1), (1, 2), (1, 3)...(6, 6) i.e 36 Probability = (2 / 36) Input: sum = 7, times = 7 Output: 1 / 279936
The probability of occurring sum on throwing 2 dices N times = (favorable/total) ^ N
First of All, Calculates the probability of Occurring that sum on thrown of 2 dice 1 times.
Let say it Probability1.
Now, to calculate the Probability of occurring that sum on thrown of 2 dice N times be:
Probability2 = (Probability1) ^ N. i.e Probability1 raise to power N
Below is the implementation of above approach:
Attention reader! Don’t stop learning now. Get hold of all the important DSA concepts with the DSA Self Paced Course at a student-friendly price and become industry ready.
- Probability of getting all possible values on throwing N dices
- Probability of obtaining Prime Numbers as product of values obtained by throwing N dices
- Maximum number of dots after throwing a dice N times
- Sum of all numbers formed having 4 atmost X times, 5 atmost Y times and 6 atmost Z times
- Number of ways to get a given sum with n number of m-faced dices
- Conditional Probability and Independence - Probability | Class 12 Maths
- Probability of getting at least K heads in N tosses of Coins
- Probability of getting two consecutive heads after choosing a random coin among two different types of coins
- Probability of getting more value in third dice throw
- Probability of getting more heads than tails when N biased coins are tossed
- 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 not getting two consecutive heads together in N tosses of coin
- Times required by Simple interest for the Principal to become Y times itself
- Probability of choosing a random pair with maximum sum in an array
- Probability that a random pair chosen from an array (a[i], a[j]) has the maximum sum
- Generate integer from 1 to 7 with equal probability
- Random number generator in arbitrary probability distribution fashion
- Probability of Knight to remain in the chessboard
- Aptitude | Probability | Question 1
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. 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.