SAC '22 Code Challenge 3 Junior P3 - Normal Probabilities
View as PDFAfter discovering the normalized probabilities, Kevin Yang was awarded the Nobel Prize for mathematics.
With this discovery, Kevin can solve even more combinatorics problems.
One of the combinatorics problems entails a list of events that each have a normalized probability
of occurring.
Since these are normalized probabilities, there are types of probability:
Acorresponds to a 100% probability of occurring.Bcorresponds to an 80% probability of occurring.Ccorresponds to a 60% probability of occurring.Dcorresponds to a 40% probability of occurring.Ecorresponds to a 20% probability of occurring.
Kevin wants to know how likely it is that all these events occur (assuming each event is independent) up to an error of
.
Constraints
ABCDE
Input Specification
The first line will contain , the number of independent events.
The next lines will contain
, one of the normalized probabilities (
A, B, C, D, or E).
Output Specification
Output the probability of all events occurring up to an error of
.
Sample Input 1
3
A
B
B
Sample Output 1
0.640000
Sample Input 2
4
B
C
D
E
Sample Output 2
0.038400
Comments