# Can non-random variables be expressed as random variables with probability 1?

Suppose that $$a = 5$$. In this case, $$a$$ is not random since it is always equal to $$5$$. Can $$a$$ instead be interpreted as a random variable $$X$$ such that $$$$p(X=x) = \begin{cases} 1 &\text{if} \quad x = 5 \\ 0 &\text{otherwise} \end{cases}$$$$ If so, would $$a$$ be interpreted as a discrete random variable, as indicated by the probability mass function above, or as a continuous random variable?

• Looks like Dirac's delta distribution probabilitycourse.com/chapter4/4_3_2_delta_function.php
– Many
Commented Jun 10, 2021 at 12:26
• Sometimes this is called a "constant random variable." stats.stackexchange.com/search?q=%22constant+random+variable%22
– Sycorax
Commented Jun 10, 2021 at 15:31
• Label all faces of die "5:" because that does not change the random nature of the outcome of rolling it, perforce it defines a random variable. That variable just happens to have a constant value. Yes, we could declare that such variables are special and agree to not call them "random"--but then the statements of many theorems about random variables would have to be cluttered with exceptions and special cases.
– whuber
Commented Jun 10, 2021 at 20:09

Given a probability space $$(\Omega, \mathscr F, P)$$, a random variable is a Borel function $$X : \Omega\to\mathbb R$$. That's all there is to it.
For $$a\in\mathbb R$$ let $$X_a : \Omega\to\mathbb R$$ be defined by $$X_a(\omega) = a$$ for all $$\omega\in\Omega$$. Consider a Borel set $$B \subseteq \mathbb R$$. Then $$X_a^{-1}(B) = \{\omega\in \Omega : X_a(\omega) \in B\} = \begin{cases}\Omega & a \in B \\ \emptyset & a \notin B\end{cases}.$$ No matter how coarse the $$\sigma$$-algebra $$\mathscr F$$ is, it will always be the case that $$\{\emptyset, \Omega\}\subseteq \mathscr F$$ so this means that $$X_a$$ is Borel.
The distribution for $$X_a$$ is $$P\circ X_a^{-1}$$ and $$(P\circ X_a^{-1})(B) = \mathbf 1_{a\in B}$$ i.e. any set containing $$a$$ has a measure of $$1$$ and any set not containing $$a$$ has a measure of zero. Effectively this is a point mass of $$1$$ on $$a$$, and the corresponding pmf is just $$P(X=x) = \mathbf 1_{x = a}$$.