All problems
Linearity of Expectation Sum
Problem
Expectation is linear: E[X1 + ... + Xn] = sum_i E[Xi] regardless of dependence.
Given the list of means, return the mean of the sum.
Hint
No independence assumption is needed.
Test cases
case 1
in: [[1,2,3]]
expected: 6
case 2
in: [[0,0]]
expected: 0
case 3
in: [[-1,1]]
expected: 0
Starter codePython
def linearity_of_expectation_sum(means):
# Your code here
pass3 test cases · run your code against them in the editor