I have a general question about expected values:
For a discrete random variable, $E[X] = \sum_{i=1}^{\infty} x_{i}p_{i}$ and $E[X] = \int_{-\infty}^{\infty} xp(x) \ dx$ for a continuous random variable $X$.
But what is the motivation for these definitions? Is it essentially defined because of the following: Suppose I perform an experiment a large number of times and record the results. I then take the average of the results. I want to find what this average approaches as the number of trials increases. Thus by trial and error I find that the definition of $E(X)$ works. This is assuming I am taking a frequentist view of probability. What does this all have to do with computing the area under some function?