<p>One way you could sort of accomplish this for <em>any</em> distribution is to pre-compute a large number of samples (through any method, pulled either at random or evenly spaced) and then put them in a table indexed by your choice of analog randomizer. For example, put 100 samples in a 10x10 grid, and then have players roll two 10-sided dice and look up the corresponding value.</p>
<hr />
<p>I suggest you stop reading now :)  but here's a silly alternate answer which gets you <em>arbitrarily close to the exact distribution</em> for a fixed level of precision and maximum value. Pick your precision - say, integers - so then pre-compute the values of the CDF at each integer up to your maximum. For Pareto, the first few values look like:</p>
<p>10: 0</p>
<p>11: 0.173553719</p>
<p>12: 0.3055555556</p>
<p>13: 0.4082840237</p>
<p>Give this table to the players. Then to pull from the distribution, repeatedly roll a d10 to generate digits of a real number, and stop when you can tell which thresholds it's between. So for example if the first roll is a 2 then you can stop immediately with result 11, because <em>every</em> real beginning with 0.2 is between the 11 and 12 thresholds. But if the first roll is a 3 then you have to roll again - after say 3-0-0 you would have the result 11, but 3-1 or 3-0-6 would be a 12 and for 3-0-5 you'd have to keep rolling. In this way you will achieve exactly a probability of 0.173553719 of drawing a 10, etc.</p>

CC BY-SA 4.0
2020-08-15T03:07:42.937Z
One possible variant of this: precompute 100 samples by generating samples from the [Pareto inverse transform sampling function](https://en.wikipedia.org/wiki/Pareto_distribution#Random_sample_generation) by choosing U = 1/n for n ranging from 0 to 99. Then each roll results in the corresponding sample.
murgatroid99
CC BY-SA 4.0
2020-08-15T03:44:44.187Z
That's what I meant by "evenly spaced" samples; thanks for elaborating since this was obviously not clear enough from my answer :)
Benjamin Cosman
CC BY-SA 4.0
2020-08-15T04:22:52.567Z
Now I'm rereading my comment, though, and I wrote it wrong. It should be U=n/100, not 1/n.
murgatroid99
CC BY-SA 4.0
2020-08-14T22:57:07.053Z
2020-08-15T14:56:14.880Z
2020-08-15T14:56:14.880Z
Benjamin Cosman
<p>I need to generate numbers from a Pareto distribution (<a href="https://en.wikipedia.org/wiki/Pareto_distribution" rel="nofollow noreferrer">https://en.wikipedia.org/wiki/Pareto_distribution</a>) for a game I'm making. Ideally with xm=10, and alpha = 2, but approximately is good enough. Is there anyway I can do this? I want to do it an &quot;analogue&quot; way (like with dice, cards, etc.) Thank you.</p>

CC BY-SA 4.0
2020-08-14T23:48:54.207Z
What would be your ideal level of precision? i.e. if I came up with a 'perfect' answer that gave you real-valued random samples with infinite digits after the decimal, how many of those digits would you actually use?
Benjamin Cosman
CC BY-SA 4.0
2020-08-15T00:12:45.773Z
@BenjaminCosman Integer is good enough.
Eriek
<game-design><probability>
How to generate numbers from a Pareto distribution?
Eriek
# How to generate numbers from a Pareto distribution?

(Asked by: username_0 on 2020-08-14)

I need to generate numbers from a Pareto distribution (<https://en.wikipedia.org/wiki/Pareto_distribution>) for a game I'm making. Ideally with xm=10, and alpha = 2, but approximately is good enough. Is there anyway I can do this? I want to do it an "analogue" way (like with dice, cards, etc.) Thank you.

**Tags:** game-design, probability

> **Comments:**
> **username_1**: What would be your ideal level of precision? i.e. if I came up with a 'perfect' answer that gave you real-valued random samples with infinite digits after the decimal, how many of those digits would you actually use?  
> **username_0**: @username_1 Integer is good enough.  

---

## 1 answers

### Answer by username_1 on 2020-08-14. Score: 0

One way you could sort of accomplish this for *any* distribution is to pre-compute a large number of samples (through any method, pulled either at random or evenly spaced) and then put them in a table indexed by your choice of analog randomizer. For example, put 100 samples in a 10x10 grid, and then have players roll two 10-sided dice and look up the corresponding value.

---

I suggest you stop reading now :) but here's a silly alternate answer which gets you *arbitrarily close to the exact distribution* for a fixed level of precision and maximum value. Pick your precision - say, integers - so then pre-compute the values of the CDF at each integer up to your maximum. For Pareto, the first few values look like:

10: 0

11: 0.173553719

12: 0.3055555556

13: 0.4082840237

Give this table to the players. Then to pull from the distribution, repeatedly roll a d10 to generate digits of a real number, and stop when you can tell which thresholds it's between. So for example if the first roll is a 2 then you can stop immediately with result 11, because *every* real beginning with 0.2 is between the 11 and 12 thresholds. But if the first roll is a 3 then you have to roll again - after say 3-0-0 you would have the result 11, but 3-1 or 3-0-6 would be a 12 and for 3-0-5 you'd have to keep rolling. In this way you will achieve exactly a probability of 0.173553719 of drawing a 10, etc.

> **Comments:**
> **username_2**: One possible variant of this: precompute 100 samples by generating samples from the [Pareto inverse transform sampling function](https://en.wikipedia.org/wiki/Pareto_distribution#Random_sample_generation) by choosing U = 1/n for n ranging from 0 to 99. Then each roll results in the corresponding sample.  
> **username_1**: That's what I meant by "evenly spaced" samples; thanks for elaborating since this was obviously not clear enough from my answer :)  
> **username_2**: Now I'm rereading my comment, though, and I wrote it wrong. It should be U=n/100, not 1/n.  

---

