profit1 = 10;
profit2= 20;
profit3 = 40;
prob1= 0.2;
prob2 = 0.8;
prob3 = 0.3;
expec = profit1*prob1 + profit2*prob2 + profit3*prob3;
disp(" thousand dollars", expec, "The expectd profit is")