Let X be the length of a randomly chosen scarf. To find the expected value of X, we should first recall how to calculate the expected value.
When X can take only a discrete set of values, the expected value of X is calculated as follows
this formula means that we should multiply each possible value for x with the probability of having that value, and then adding all values together.
So, for example, one term of this sum in this case would be
to calculate the term of the probability, we simply count how many scarfs we have of that length and divide it by the total amount of scarfs. So, we have 3 scarfs of length 108 and a total amount of 20 scarfs, so we have
so, the first term would be
We can fill the following table using the principles explained above
x # of scarfs P(X=x) x*P(X=x)
108 3 0.15 16.2
155