We have 4 bags with 47 candies each, 4 bags with 131 candies each and 2 bags with 173 candies each. In order to calculate the expected value of x, we can divide the total number of candies by the total number of bags:

So the expected value of x is 105.8.