Compute the empirical mean and variance of binary (0/1) observations.
Implement solve(x).
Returns. Return a tuple (mean, variance) of floats, where the variance is p^(1−p^). Empty input, non-binary values or a non-1-D input raise ValueError.
Example 1
Input:
solve([1, 0, 1, 1])
Output:
(0.75, 0.1875)
Example 2
Input:
solve([0, 0, 0])
Output:
(0.0, 0.0)
No results yet
Run your code to check it against the examples, or submit to run every test.