Problem Statement | |||||||||||||
Some people think five is a lucky number. They roll several dice, and if they get five on strictly more than one fifth of the dice, they believe it will be a lucky day.
Given an int dice, the number of dice rolled, and an int sides, the number of sides on each die, return the probability of the day being lucky. For a die with N sides, the probability of rolling a five is 1/N. | |||||||||||||
Definition | |||||||||||||
| |||||||||||||
Notes | |||||||||||||
- | Your return value must have an absolute or relative error less than 1e-9. | ||||||||||||
Constraints | |||||||||||||
- | dice will be between 1 and 20, inclusive. | ||||||||||||
- | sides will be between 5 and 10, inclusive. | ||||||||||||
Examples | |||||||||||||
0) | |||||||||||||
| |||||||||||||
1) | |||||||||||||
| |||||||||||||
2) | |||||||||||||
| |||||||||||||
3) | |||||||||||||
|