We live in a simulation.
10s 256 MB
For each day, the probability a machine fails is . Given a binary string of days of data, where is a failure on that day, estimate the probability of of these machines failing on the same day.
Define a program that takes in an string representing d days of data from one machine, and outputs the optimal unbiased estimation for p', where "optimal" means the estimator has the minimum variance among all valid unbiased estimators.
Answers within of the expected answer will be accepted. In other words, do not worry about floating point truncations or rounding offsets.
Notes
- Assume machine failures are independent across machines
- The estimator should be a function of the observed data only (no simulation/randomization)
Constraints
-
d dconsists of only'1'or'0'
Examples
Example 1
Input:
1001101110Output:
~0.02380952Example 2
Input:
010111011010011111001111101110Output:
~0.108795419Accepted 3/5
Acceptance 60%
Loading editor...
Input
1001101110Expected Output
0.023809523809523808Custom Test Cases:
Input Expected Output