Stack Exchange network consists of 183 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
If we define a random variable to be a probability measure $P$ on the Borel sets, then the probability $X$ in $S$ is exactly $P(S)$, if I am not mistaken.