# Method to build a polyhedral die with given probabilities

Let's define a die as a polyhedron that, if rolled over a perfect horizontal plane, ends up being in a physically stable unambiguous state labelled $$n$$. The die has $$N$$ states. Each state $$n$$ has a probability $$p_n$$ to happen.

The most common dice are the 5 platonic solids: tetrahedron, cube, ... where $$p_n=1/N$$. However, also others non platonic solids can guarantee uniform probabilities, such as the well known "coin" or, for the sake of the example, a long die with a regular polygon as a base shape (a "long" $$N$$-regular prism).

Previous solids symmetries allow to avoid to take in account 2 fundamental variables involved in the rigid body dynamics:

1. center of mass
2. moment of inertia

The algorithm that allows to generate any discrete probability density function (PDF) with a calculator using the common pseudo-random command rand is well known. If the realisation of rand falls between $$\sum_{n=0}^k p_n$$ and $$\sum_{n=0}^{k+1} p_n$$ the resulting state is $$k+1$$ ($$p_0=0$$ and $$p_{N+1}=1$$). That method basically divides the segment from $$0$$ to $$1$$ that represent the probability domain in $$N$$ sub segments each one assigned to every one of the $$N$$ target output states with pre-defined probability $$p_n$$.

Analogously, basing on the previous algorithm, it is possible to consider a cylinder with the base divided in $$N$$ angular sectors each one with angle of $$\alpha_n=360 \cdot p_n$$. Obviously $$\sum_{n=1}^{N} \alpha_n=360$$ since $$\sum_{n=1}^{N} p_n=1$$. Rolling that not-polyhedral die and considering in which angular sector falls the tangent point between the solid and the horizontal landing plane it is possible to define an output state. The output states generated in this way have a realisation PDF that follows the probabilities $$p_n$$.

However this method does not generate a die as defined before since its states are continuous, the discrete states must be deducted using the angular segments positions and the solid is not a polyhedron.

After all this dissertation the main question is: Does exist a method to design a polyhedral die where its realisations follow a given generic set of probabilities $$[p_n]_{n\in [1,...,N]}$$?

A solution suggested by @Ján Lalinský is to consider a set of probabilities that can be expressed in the form $$p_n=k_n/K$$ where $$K$$ and $$k_n$$ are integers and $$\sum_{n=1}^{N} k_n= K$$. A long die (prism) with a regular base with $$K$$ edges can be considered. The $$K$$ faces of the prism can be grouped in $$N$$ groups with size $$k_n$$ and marked with $$n$$. Every roll of this die will respect the assumptions.
However a solution based on a polyhedron with exactly $$N$$ faces will be preferable.