Compute the posterior probability of hypothesis H1 from its prior probability and the likelihood of the observed evidence under H1 and under H0.
Implement solve(prior, likelihood_h1, likelihood_h0).
Returns. Return a float in [0,1]. The prior of H0 is 1−prior. The prior and both likelihoods must lie in [0,1], and if the total evidence P(e) is zero the posterior does not exist; both cases raise ValueError.
Example 1
Input:
solve(0.5, 0.8, 0.2)
Output:
0.8
Example 2
Input:
solve(0.01, 0.9, 0.05)
Output:
0.153846
No results yet
Run your code to check it against the examples, or submit to run every test.