# Basic probability question concerning random variables and events

I believe it is true that $P(X=t) = \sum\nolimits_{X(s)=t}p(t)$, where X is a discrete random variable and p is the probability measure on the sample space S. This looks very similar to the probability of an event E, i.e., $P(E)= \sum\nolimits_{s\in E}p(s)$. My question is basically what is the connection between random variables and events. Can/should I think of $P(X=t)$ as the probability of an event?

• Exactly, a random variable allows you to describe certain events in your probability space, like $\{X=t\}$ or $\{X \in [a,b]\}$, etc. – angryavian Aug 16 '16 at 18:17
• So random variables are introduced to talk about probabilities of $\textit{certain}$ events? – SihOASHoihd Aug 16 '16 at 19:51
• Yes exactly; not all events can be expressed in terms of a certain random variable. (But usually we only care about the ones involving the random variable anyway.) – angryavian Aug 16 '16 at 20:17
• Oops, I see that my comment is the same as your first comment. Anyways, thanks for your replies, I think I understand now. – SihOASHoihd Aug 16 '16 at 20:41

$$\mathsf P(X=t) = \sum\limits_{\{s: X(s)=t\}}\mathsf P\{s\}$$

Yes, that is fine as long as the sample space contains countable many outcomes.

An event is a set of outcomes from the sample space.   A random variable is a function that maps outcomes to real values.   There is also an inverse function that maps (sets of) real values to sets of outcomes within the sample space.

So the notation $\mathsf P(X=t)$ is shorthand for "the probability measure of the set of outcomes that maps to the random variable $X$ possessing value $t$".   That is:

$$\mathsf P(X=t) ~:=~ \mathsf P\{s\in\Omega: X(s)=t\} \\ = \mathsf P\circ X^{-1}\{t\}$$

$$\mathsf P(u<X\leq v) ~:=~ \mathsf P\{s\in\Omega: X(s)\in (u;v]\}\\ = \mathsf P\circ X^{-1}(u;v]$$

And so forth.