4. Experimental Probability

Easy

A theoretical probability is exact; an experimental one is estimated from what actually happened:

P^(A)=times A occurrednumber of trials\hat P(A) = \frac{\text{times } A \text{ occurred}}{\text{number of trials}}

observations is a list of recorded outcomes and event is a set. Return the fraction of observations that fall inside the event.

solve([1, 2, 2, 6, 3], {2, 4, 6})  ->  0.6

Sign in to write and run your own code.

Implement solve(...)