Solution Let the balls in the bag be denoted by w1, w2, r Then the sample space is
S = {w1 w1, w1 w2, w2 w2, w2 w1, w1 r, w2 r, r w1, r w2, r r}
Now, for
ω ∈ S
X (ω) = number of red balls
Therefore
X({w1 w1}) = X({w1 w2}) = X({w2 w2}) = X({w2 w1}) = 0
X({w1 r}) = X({w2 r}) = X({r w1}) = X({r w2}) = 1 and X({r r}) = 2
Thus, X is a random variable which can take values 0,  1 or 2 13 6