# How to generate random points with weight distribution and specific criteria? [duplicate]

Consider some function $$f(E_{1},E_{2})$$, say $$\tag 1 f(E_{1},E_{2}) = \exp[-E_{1}^{3}+E_{2}^{2}]$$ I want to generate random $$n$$ points $$E_{1}$$, $$E_{2}$$ using this function as weights, with an extra condition for the domain of definition of $$E_{1},E_{2}$$: $$\tag 2 E_{1}\ge m_{1},\quad E_{2}\ge m_{2}, \quad E_{3} \equiv m-E_{1}-E_{2} \ge m_{3}$$ $$\tag 3 -1 <\frac{\sqrt{E_{3}^{2}-m_{3}^{2}}-\sqrt{E_{1}^{2}-m_{1}^{2}}-\sqrt{E_{2}^{2}-m_{2}^{2}}}{2\sqrt{E_{1}^{2}-m_{1}^{2}}\sqrt{E_{2}^{2}-m_{2}^{2}}} < 1,$$ where $$m,m_{1-3}$$ are real positive constants which are known, $$m>m_{1}+m_{2}+m_{3}$$.

I expect that this may be done using RandomVariate command. However, I face two complications: first, I don't know syntax allowing to use f as the distribution function in RandomVariate, second, I don't know how to implement the domain of definition $$(2),(3)$$ in RandomVariate.

The example of parameters is m = 10, m1 =2, m2 = 0.5, m3 = 0.1.

P.S. The second problem may be avoided if just setting f to be zero outside of the range $$(1),(2)$$. Then, probably, my question may be rephrased on how to create symbolic distribution using Eqs. $$(1)-(3)$$.
• What is $E_3$? Are $m, m_1, m_2, m_3$ some known numerical constants? Dec 1, 2021 at 20:30
• @Domen : thanks, the question contained typos and had to be expanded by providing more information. I have fixed them, $E_{3} \equiv m - E_{1}-E_{2}$. $m,m_{1-3}$ are real positive constants that are known. Dec 1, 2021 at 20:33
• Can you provide concrete values for $m,m_1,m_2,m_3$? Dec 2, 2021 at 4:20