2/7 if 6 <= x <= 9
f(x) = (20-2x)/7 if 9 <= x <= 10
0 elsewhere
x represents hours an employee works per day. Calculating E[x] wasn't a problem. However, now they ask for expected labor costs. Cost per hour is 21 for the first 8 hours, then 35 for every extra exceeding hour.
I'm at a total loss, no idea if I'm doing it right.
I came up with three integrals incorporating cost functions:
f(x)C(x) = 2/7 * 21 * x for 6 < x < 8
f(x)C(x) = 2/7 * (21 * x + 14 * ( x - 8 )) for 8 < x < 9
f(x)C(x) = 2/7 * (21 * 8 + 35 ) + 35 * ( x - 9 ) * ( 20 - 2x )/7 for 9 < x < 10
I don't think that what I'm doing is correct, but I really don't see any other way.
Let’s define $Y$ as the random variable of cost you want to find: When $X<=8$, $Y=21X$. When $X>8$, $Y=168+35(X-8)$. Therefore, $$E(Y)=\int_6^8 (21x)\frac{2}7 dx + \int_8^9 (168+35(x-8))\frac{2}7 dx + \int_9^{10}(168+35(x-8))\frac{20-2x}7 dx$$