I am not that good at expressing things mathematically, so I'll start with the practical problem right away:

I have a set of four objects: O1, O2, O3, O4.

Now I want to assign a variable that scales their probabilities between an equal distribution and some unknown distribution which could look like a 1/log distribution.

Say, level 50 is the extreme case for equal chances. We choose one of the four objects and each has a probability of 0.25, 0.25, 0.25, 0.25.

Level 1 on the other hand is the other extreme case which results in the probabilites of 1.0, 0.0, 0.0, 0.0.

So in terms of probability density functions a level 50 will create a horizontal line and with decreasing level, it will become more and more "L"-shaped.

How can I "create" such a mathematical function with "level" being the only parameter to affect the shape of the PDF?

If that was not really clear, I apologize. Here is a real-life example:

Mr. X has different moods (M). O1 is an apple (his favorite food), O2 is a banana (2nd favorite), O3 a cherry and O4 a melon. Mood = 1 means, he is very strict on his choices and he will choose his favorite fruit in 100/100 times, leaving no option for the others. Mood = 50 means, he is in a mood for perfect experimentation and will eat all fruits with the same probability. The lower his mood level, the more likely he will eat his more favorite fruits. His mood level should decide on the mathematical function behind it (probably scaling or an existing function which could be a 1/log).


1 Answer 1


There are many possibilities here.

I think using an exponential distribution with a tunable average would be a good solution. If you are into theoretical explanations, here is why I think it would be: https://en.wikipedia.org/wiki/Maximum_entropy_probability_distribution#Positive_and_specified_mean:_the_exponential_distribution

Here is how it works in practise. Your function would be $$ f(x) = C e^{-x/\mu} $$

where $C$ is the normalisation, so that the sum over all possible values of x is 1.

Your level is the $\mu$ parameter in the function, which tunes the function from uniform to L-shaped.

Let's look at some examples with 4 choices.

For $\mu = 0.1$, you would get the following probabilities:

[0.99, 4.5e-05, 2.06e-09, 9.35e-14]

which are very concentrated on the first value.

For $\mu = 100$, you would get almost the uniform case:

[0.253, 0.251, 0.248, 0.246]

  • 1
    $\begingroup$ Thank you very much, Andrea! When I saw the function, I couldn't believe I was THAT close (I tried 1/e but could not figure how to properly scale this). Your solution works perfect! I scaled from 0.1 to 5.0 to get the probabilities I was looking for. This also worked for 3 and 2 choices. The normalisation took a while, but I figured it out. So thanks again for your help! $\endgroup$ Commented Oct 10, 2018 at 20:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.