Statistical model for a 1-30 random number generator
A 1-30 random number generator can be modeled as a discrete random variable \(X\) that takes values \(1,2,\dots,30\). Assume (i) each integer is equally likely and (ii) repeated uses produce independent draws. Under these assumptions, \(X\) follows a discrete uniform distribution on \(\{1,\dots,30\}\).
Probability mass function (pmf)
\[ P(X=k)=\frac{1}{30}, \quad k=1,2,\dots,30. \]
Every outcome has the same probability, so events are evaluated by counting outcomes.
Common event probabilities (counting outcomes)
For any event \(A\subseteq\{1,\dots,30\}\), \[ P(X\in A)=\frac{|A|}{30}. \]
| Event | Counting | Probability |
|---|---|---|
| \(P(X\le 10)\) | \(|\{1,2,\dots,10\}|=10\) | \(\dfrac{10}{30}=\dfrac{1}{3}\) |
| \(P(X\text{ is even})\) | There are 15 even integers from 1 to 30 | \(\dfrac{15}{30}=\dfrac{1}{2}\) |
| \(P(12 \le X \le 18)\) | \(|\{12,13,14,15,16,17,18\}|=7\) | \(\dfrac{7}{30}\) |
| \(P(X\in\{7,13,29\})\) | \(|\{7,13,29\}|=3\) | \(\dfrac{3}{30}=\dfrac{1}{10}\) |
| \(P(X>25)\) | \(|\{26,27,28,29,30\}|=5\) | \(\dfrac{5}{30}=\dfrac{1}{6}\) |
Mean (expected value) and variance
For a discrete uniform distribution on consecutive integers \(\{1,2,\dots,n\}\), \[ E[X]=\frac{n+1}{2}, \qquad \mathrm{Var}(X)=\frac{n^2-1}{12}. \] With \(n=30\):
\[ E[X]=\frac{30+1}{2}=\frac{31}{2}=15.5. \]
\[ \mathrm{Var}(X)=\frac{30^2-1}{12}=\frac{900-1}{12}=\frac{899}{12}\approx 74.9167. \]
\[ \sigma_X=\sqrt{\mathrm{Var}(X)}=\sqrt{\frac{899}{12}}\approx 8.655. \]
Interpretation: The long-run average output of a 1-30 random number generator is \(15.5\), centered halfway between 1 and 30. The spread is summarized by \(\sigma_X\approx 8.655\).
Visualization: discrete uniform pmf on \(\{1,\dots,30\}\)
Practical statistical notes
- A 1-30 random number generator supports simple randomization tasks (random selection, randomized assignment, simulation) when outcomes are approximately uniform and independent.
- If outcomes are not equally likely (for example, some numbers appear more often), the model is no longer discrete uniform; estimated probabilities can be obtained by relative frequency from a large sample of generated values.
- For repeated draws, independence implies that knowing one output gives no information about the next; this property underlies many simulation-based methods in statistics.