Does this seems like a reasonable definition of a uniform distribution? Does this seem like a reasonable definition of a uniform distribution?
Let
\begin{align}
&S \text{ be a sample space}; \tag{1} \\
&X:S\rightarrow \mathbb{R} \; \text{ be a random variable on } S. \tag{2} \\
\end{align}
Then
\begin{align}
& X(S) \text{ is distributed uniformly } \\
\Leftrightarrow &\text{ every realisation of } X \text{ has pre-image of equal size}, \tag{3.1}\\
\Leftrightarrow &\forall \; x_1,x_2 \in X(S): \; |X^{-1}(\{x_1\})|=|X^{-1}(\{x_2\})|. \tag{3.2}
\end{align}
 A: Let me answer the implicit question: what is a uniform distribution?
Because $X$ is a random variable, $S$ really is the underlying set in a probability space $(S,\mathfrak F, \mathbb P).$

We say $X$ has a continuous uniform distribution when there exists a subset $A\subset \mathbb R$ such that, for every interval $(a,b]\subset \mathbb{R},$ $$\mathbb{P}(X\in (a,b]) \ \propto\  \lambda((a,b]\cap A)$$ where $\lambda$ is Lebesgue measure.
$X$ has a discrete uniform distribution when there exists $A\subset \mathbb{R}$ such that for every interval $(a,b],$ $$\mathbb{P}(X\in (a,b])\ \propto\ |(a,b] \cap A|$$ where $|\cdot |$ is the cardinality of a set.

The implicit normalizing constants (denominators) in these equations are $\lambda(A)$ in the first case and $|A|$ in the second, both of which (therefore) must be finite and nonzero.  In particular,

*

*in the continuous case, $X$ has a probability density function equal to $$f_X(x) = \frac{1}{\lambda(A)} \mathcal{I}_A(x)$$ (where $\mathcal{I}_A$ is the indicator function of $A$);


*in the discrete case we may write $|A|=n$ (a nonzero natural number) and see that for any number $x\in \mathbb R,$ $\Pr(X=x) = 1/n$ when $x\in A$ and otherwise $\Pr(X=x)=0.$ This defines the probability mass function of $X.$
