Let's suppose I want to determine the weighted average from a set of numbers.
I have x-data and y-data. The x-data corresponds to energies, 1 through 400 eV, in increments of 1 eV. At each energy, I get a certain number of defects produced which is my y-data.
So at 1 eV, I have 0 defects But at 10 eV, I might have 1 defect At 20 eV, I might have 1.2 defects (these are already averages) etc.
Is there a way to get a weighted average?
If I take say 400 eV, and see there are 10 defects, then the average energy to create a defect is 40 eV. How can I get a weighted average based on all the energies?
$$P(X)=\sum_{i=1}^{10} P(X|i)P(i)$$ $$=.5*.1+1*.1+1*.1+1*.1$$ (by your given values for $i=7,8,9,10$) $$=0.35$$