Problem Statement | |||||||||||||
M integers are randomly independently chosen from the interval lowerBound...upperBound, inclusive. Return the probability that the K-th smallest element of the generated set is equal to N. K=1 refers to the smallest element, K=2 refers to the second smallest element, and so on. | |||||||||||||
Definition | |||||||||||||
| |||||||||||||
Notes | |||||||||||||
- | The returned value must have an absolute or relative error less than 1e-9. | ||||||||||||
Constraints | |||||||||||||
- | M will be between 1 and 100, inclusive. | ||||||||||||
- | lowerBound will be between 1 and 1000, inclusive. | ||||||||||||
- | upperBound will be between lowerBound and 1000, inclusive. | ||||||||||||
- | N will be between lowerBound and upperBound, inclusive. | ||||||||||||
- | K will be between 1 and M, inclusive. | ||||||||||||
Examples | |||||||||||||
0) | |||||||||||||
| |||||||||||||
1) | |||||||||||||
| |||||||||||||
2) | |||||||||||||
| |||||||||||||
3) | |||||||||||||
| |||||||||||||
4) | |||||||||||||
|