Question: The Python code below is made to find the expectation of three values: 45, 72, 38. Choose the best statement to enable the code to
The Python code below is made to find the expectation of three values: 45, 72, 38. Choose the best statement to enable the code to function as required. p = [0.5, 0.35, 0.15] X = [45, 72, 38] result = 0.0 for i in range(len(X)): _____ print("E(X) =", result) Option A result /= p[i] / X[i] Option B result += p[i] * X[i] Option C result -= p[i] * X[i] Option D result *= p[i] / X[i]
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
