First of all, thanks for taking the time to look at this. My goal is to be able to generate lotteries, where I can determine the first, second and third moments of their distributions, for a behavioural economics experiment. In other words, I'd like to be able to determine their expected values, variances and skewness. \begin{align*} &\mathrm{Expected\ Value\ :} &&=\frac{\sum_{i}x_i}{n}\\ &\mathrm{Variance:} &&=\frac{\sum_{i}(x_i-\mathrm{Mean})^2}{n}\\ &\mathrm{Skewness:} &&=\sum_{i}\left( \frac{x_i-\mathrm{Mean}}{\sqrt{\mathrm{Variance}}}\right) ^3 \end{align*} The lotteries will have three outcomes that are equally probable, so I believe this amounts to solving for $\{a,b,c\}$ in the following nonlinear system of equations, where $m, v$ and $s$ are just constants. \begin{align} \frac{a+b+c}{3}= m\\ \frac{ (a-m)^2+(b-m)^2+(c-m)^2 }{n}= v\\ \frac{ (a-m)^3+(b-m)^3+(c-m)^3 }{\left( \sqrt{v}\right) ^3} = s \end{align} My questions is, how would you find for what values of $m,v$ and $s$ there are non-negative real solutions? I know that I can just input non-negative values for $a, b$ and $c$, but the issue with this is that, for my experiment, I would like to find triples of lotteries that satisfy one of the two following conditions. For three lotteries, say $\{1,2,3\}$, I would like either:
A. $\mathrm{Exp_1}=\mathrm{Exp_2}>\mathrm{Exp_3}$ and $\mathrm{Var_2}=\mathrm{Var_3}<\mathrm{Var_1}$ and $\mathrm{Skew_3}=\mathrm{Skew_1}<\mathrm{Skew_2}$
or
B. $\mathrm{Exp_1}=\mathrm{Exp_2}<\mathrm{Exp_3}$ and $\mathrm{Var_2}=\mathrm{Var_3}>\mathrm{Var_1}$ and $\mathrm{Skew_3}=\mathrm{Skew_1}>\mathrm{Skew_2}$
So, my question to you is, is this possible? And if so, how could I achieve it?
Many thanks and
best wishes,
Jeremy
The following Python code helps to find $a,b,c$ as a function of $m,v,s$ by transforming the set of equations
eqs1that define mean, variance and skewness into an equivalent set of equationseqs2that is easy to solve. In this case, it is enough to look at the last equation (which is printed by the code).In the example I chose $m=v=s=1$ and the code produces the output $$ a^3 - 3a^2 + \frac32a + \frac16 $$ which, by wolfram alpha, has the three solutions $-0.093199, 0.76963, 2.3236$. By symmetry, the unique solution (up to swapping the values of $a,b,c$) is given by: \begin{align*} a &= -0.093199\\ b &=0.76963 \\ c &= 2.3236 \end{align*} Which means that you cannot realize $m=v=s=1$ if you want $a,b,c >0$.
Read chapter 3.1 of Cox Little O'Shea if you want to know why this works. Note that they refer to
eqs2as a Gröbner basis for the Ideal generated byeqs1.