TITLE: Constructing a probability function from its moments.
QUESTION [7 upvotes]: My intuition tells me that if we have a random variable that follows a Probability Mass Function (PMF) and that can take $n$ different values, then if we have the $n^{th}$ first moments we can reconstruct the original PMF. Is it true? How can we perform such thing? For example, what is the PMF which can take only 5 different values and which $5^{th}$ first moments are [1, 0.5, 0.4, 0.3, 0.2]?
Similarly could we define the infinite set of Probability Density Functions (PDF) which correspond to a list of $n$ first moments? How can we do such thing? For example what is the infinite set of PDF which $5^{th}$ first moments are [1, 0.5, 0.4, 0.3, 0.2]?

REPLY [7 votes]: When you know evey moment of a bounded random variable you know its law:
a random variable is caracterized by its Fourier transform
$
E\exp iu X
$.
In the case of a bounded $X$, you have
$$
E\exp iu X = E\sum_{n=0}^\infty \frac{(iu X)^n}{n!}
=\sum_{n=0}^\infty EX^n\frac{(iu )^n}{n!}
$$
You can swap $E$ and $\sum$ thanks to the Fubini theorem, because $X$ is bounded.
In your case, you look for $p_1,\ldots,p_5$, the 5 probabilities, and you know the values $y_i$ of the random variable.
Then you need to solve the system
$$
\sum p_i y_i^k = m_k
$$
The determinant is the Vandermonde determinant, it is $\neq 0$ because $y_i$ are different, so the system has a unique solution.