# Expected Values of an Indicator Variable

I want to calculate the expected value of an indicator variable. The problem is of the form: $$\mathbb{E}\left(\mathbf{1}[f(x_{a})>f(x_{b})]\right)$$ where $f(\cdot)$ is some function. I have no idea to proceed. Any help is greatly appreciated. Thanks!

• Hint: An indicator function = 1 if its argument is true, and = 0 if its argument if false. So what is the expected value of an indicator function? Commented Nov 19, 2015 at 16:27
• +1 @MarkL.Stone Yes, thinking about what the indicator function is doing is the key here. [It might help initially to think of an indicator over a discrete variable.] Commented Nov 20, 2015 at 0:16

$$\mathbb{E}\left(\mathbf{1}[f(x_{a})>f(x_{b})]\right)=\int\mathbf{1}[f(x_{a})>f(x_{b})]d\mathbb{P}=Pr(f(x_{a})>f(x_{b}))$$
I think I can answer my question after giving it some thought. It should be:$$\mathbb{E}\mathbf{1}[(f(x_{a})>f(x_{b})]=[1\mathbf{Pr}(f(x_{a})>f(x_{b})+0\mathbf{Pr}(f(x_{a})\leq f(x_{b})]=\mathbf{Pr}(f(x_{a})>f(x_{b})]$$