Consider the function :
$f(L) = \sum\limits_{x:L} g(x)$ where L is a list of integers where each element is randomly chosen between $1$ and $20$
$g(x) = 0$ if $x < 10$
$g(x) = 1 $ if $10 <=x <=19$
$g(x) = 2$ if $x =20$
What is the expected value of $f(L)$ for a list of size $5$ ?
As per my understanding I did it like :
$E(f(L)) = \sum\limits_{x:L} E(g(x)))$
$E(g(x)) = 1 * 10/20 + 2 * 1/20$
So it will just be 5 times the above value.
I am not sure if I am solving it correct?