http://web2.0calc.com/questions/1-nbsp-suppose-we-have-a-bag-with-8-slips-of-paper-in-it-six-of-these-have-a-1-on-them-and-the-other-two-have-a-3-on-them-what-is-the-ex
The expected value is the average. So if we have 6 slips of paper with 1 and 2 slips with 3, to get the average we add up all the numbers and divide by the total number of slips, which would give us:
average = (1 + 1 + 1 + 1 + 1 + 1 + 3 + 3)/8 = 12/8 = 3/2
But notice that there are 6 lots of 1 and 2 lots of 3, so we could write this as (6*1 + 2*3)/8
The 6 and the 2 are known as "weights".
Notice also that the total number of slips is the same as the sum of the "weights": 6 + 2 = 8.
Whenever you have grouped data (that is, a number of slips with the same value) it tends to be easier to calculate the average by multiplying the "weight" by the number in each group, adding up the results of all the "weights"*numbers and then dividing the whole lot by the sum of all the weights.
Does this make it any clearer?