Sorry if I don't have the right terminology for asking this question in a good way ...

I'm curios if there is an established distribution function for the following case:

I have 20 different options, indexed from 1 to 20, that I will repeatedly sample random picks from. The draws are done once and then all of the 20 different options are immediately reset and drawable again in the next round.

Let's imagine that I have pictures of 20 different types of fruit laid out on a table and from time to time I will pick one of the pictures, make a note of it and place the picture back on the table.

I want some fruits to be more likely to be picked than some of the other fruits. I will arrange my fruits so that by default the fruits at the middle of the table will be more probable than fruits at either side of the table. This probability distribution needs to be controlled by a parameter though. So that I step by step can increase the probability for the fruits on one side of the table to be picked at the expense of the fruits located in the middle or the opposite side of the table.

I've played around with some interactive graphs of the beta distribution for continues values. And I like how I'm able to control the probability function with the a & b parameters (see examples bellow).

What I want to know is this ... is there a common way to handle the distribution among a known set of 20 indexed, discrete values so that the probabilities among them (low, mid and high indexes) are varied similar to how the values of the beta distribution functions graph moves when the a & b parameters are manipulated.

Ideally the return value from the function would be a probability between 0 and 1, given a parameter indicating one of the discrete values (1...20) and a parameter controlling where the weight of the distribution should lie among the 20 different values.

Ideally the sum of the 20 discrete distributions would always add up to 1 if added together.

Example of a Beta distribution Conceptual sketch of a distribution for discrete values.

  • 1
    $\begingroup$ What you have seems to be a multinomial distribution with 20 parameters (19 effective ...) and maybe you can make some sub-family by parametrizing a curve in that space, but you need to tell us more about what you want, ultimate goal, number of observations, ... context $\endgroup$ Commented Jan 28, 2021 at 13:35
  • 1
    $\begingroup$ It's hard to ask good questions when you don't know what to ask :) I've tried to rework the question and added some sample images. Thanks for the feedback! $\endgroup$ Commented Jan 28, 2021 at 20:09
  • $\begingroup$ Is your question about how to convert the Beta family into a family of discrete distributions? If not, we need more criteria to assess what you might be trying to achieve. $\endgroup$
    – whuber
    Commented Jan 28, 2021 at 20:10
  • $\begingroup$ @whuber That might be a start ... I know that I have a list of discrete values. I need a way to get a probability between 0 and 1 for each of them. And given that I index all of the items I want to vary the probability among the items similar to how the beta distribution varies its values for low and high x:es, given the a & b parameters. Don't know if you saw, but I reworked my question just minutes ago. Maybe that can explain what I'm after. Thanks for your feedback! $\endgroup$ Commented Jan 28, 2021 at 20:20
  • $\begingroup$ Read How to ask a Statistics Question $\endgroup$ Commented Jan 29, 2021 at 2:08

1 Answer 1


One approach is to discretize a continuous family.

Although one's instinct might be to pick off the values of the probability density function at even intervals, that is complicated by the need to convert those densities into probabilities, which requires adding them up for a normalization factor. A better way is to carve the support of the distribution into equal intervals (to correspond to your data points) and compute the total probability in each interval.

Abstractly, this recipe says that when $\{F_\theta\mid \theta\in\Theta\}$ is a family of distributions (represented by their cumulative distribution functions) parameterized by $\theta\in\Theta$ supported on an interval $[l,u],$ you can discretize it into a family of distributions supported on any sequence of $d\ge 1$ values via

$$p_\theta(x) = F_\theta\left(l + (u-l)\frac{x}{d}\right) - F_\theta\left(l + (u-l)\frac{x-1}{d}\right)$$

for $x=1,2,\ldots, d.$

Provided $d$ exceeds the dimension of $\Theta,$ usually all these discrete distributions are distinct. Their shapes clearly echo the shapes of their parent density functions.

I will illustrate with the Beta family, where $[a,b]=[0,1]$ and $\theta=(a,b)$ contains positive parameters. This figure shows the distributions for $16$ values of $\theta.$


These are bar charts of probability mass functions, not histograms of probability densities! The heights of the bars indicate the probabilities associated with the $x$ values beneath them. Thus, the sum of the $d=20$ heights in each chart is exactly $1,$ as required of any probability mass function. (To help you see that, a horizontal dotted line appears at a height of $1/d$ in each chart: this must be the average of the heights of the bars.)

The R code that created the figure shows how easy it is to implement this approach. After creating a data frame for the values of $x$ and some choices of parameters $(a,b),$ a single line computes the discrete probabilities. No other calculations are needed.

d <- 20
X <- expand.grid(x = seq_len(d),
                 a = c(1/2, 1, 3, 6),
                 b = c(3/4, 1, 2, 6))
X$Probability <- with(X, pbeta(x/d, a, b) - pbeta((x-1)/d, a, b))

The plotting is done with a ggplot2 command, as in

ggplot(X, aes(x, Probability)) + geom_col() + facet_grid(a ~ b)

(I have omitted the decorative commands such as the colors and title.)

The question refers to sampling from this discrete distribution. This is as easy (or difficult) as sampling from its parent. If you have a procedure that generates random values $Y$ according to $F_\theta$ (for any specified $\theta$), then the random variable

$$X = \lceil \frac{d(Y-l)}{u-l} \rceil$$

almost surely has values in the set $\{1,2,\ldots, d\}$ and has $p_\theta$ for its distribution.

  • $\begingroup$ Thanks Whuber! This sounds exactly like something that I was looking for. Now I just need to understand it :) Will look in to it ... $\endgroup$ Commented Jan 28, 2021 at 21:31

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.