All problems
Wald Identity Value
Problem
Wald's identity states that for a random number N of independent summands with mean mean_x, the expected sum is:
E[S_N] = E[N] * E[X] = mean_n * mean_x.
Return the product.
Hint
Average the random number of summands separately from the summand size.
Test cases
case 1
in: [10,2]
expected: 20
case 2
in: [3.5,4]
expected: 14
case 3
in: [0,5]
expected: 0
Starter codePython
def wald_identity_value(mean_n, mean_x):
# Your code here
pass3 test cases · run your code against them in the editor