Explanation:
first, the simple practical approach :
the PDF is simply a constant, a flat line. so, all values in the interval have the same probability (1/3).
therefore the expected value is simply the middle of the interval :
(5 + 8)/2 = 13/2 = 6.5 or 6 ½
now for the formal approach :
as the expected values of a set of discreet numbers is the sum of the products of each of these numbers with their probabilities, the expected value of a continuous interval of numbers ( [a, b] ) is simply the integral over the products of the numbers and their probabilities.
EX = integral[a, b] of x×f(x)×dx
f(x) = 1/3
a = 5
b = 8
so, we have
EX = integral[5, 8] of x/3 × dx =
= [5, 8] of x²/6
as the integral of x is x²/2.
x²/6 between 5 and 8 is
64/6 - 25/6 = 39/6 = 13/2 = 6.5
EX = 6.5 or 6 ½
we got the same result practically and theoretically.
these are the best results ever !