I am interested in the following problem.
I want to decorate the faces of $n$ six-sided dice with integers, such that (as closely as possible, for some reasonable definition of "close") they satisfy various constraints on their joint distributions. All else being equal, I would prefer these integers being small.
e.g. I would like three dice $A,B,C$ such that
$$\mathbf{P}(A>0) =1/2,$$ $$ \ \mathbf{P}(A+B>0) = 2/3,$$ $$ \mathbf{P}(A+B+C>0)=5/6,$$ $$\mathbf{P}(A=0) =0,$$
or as close as possible to that.
How might one code this in Mathematica?
Edit: I am asking for a general method that works for any $n$ and reasonable set of restrictions on the joint distribution, and suggest that the answerer apply the general method in the simple example I gave, where it is easy to compute an answer directly by hand.
Tuples
or nestedFor
and generate some or all the possible dice and then write a function that takes one set of the dice and tests whether that set is acceptable or not. If you useTuples
then you can useSelect
to extract the acceptable sets. Does this give you an idea how you might start? Start with a really easy example to test this first and then work closer to your actual problem. $\endgroup$DistributionA=EmpiricalDistribution[{-1,-1,-1,1,1,1}]
. You can do the same for the B and C dice. Then you can use TransformedDistribution:DistributionAPlusB=TransformedDistribution[a+b,{a\[Distributed]DistributionA,b\[Distributed]DistributionB}]
. You can test probabilities like this:Probability[x > 0, x \[Distributed] DistributionAPlusB]
$\endgroup$