So, I was up early doing some random problems, and I ran onto this one:

Given f(x) = 1/9 (3âˆ’ |x| ) for |x| < 3, what is Var(X)?

I have seen this problem before.Â There are a few easy to avoid pitfalls.

We need to find Var(X) = E(X^{2}) – E(X)^{2}.

First, we notice that this is an even function.Â The expected value of an even function is 0.Â Since f(x) is even, xf(x) is odd.Â The integral of an odd function from -L to L is 0.Â This is a very simple fact which, if missed, will lead you into a mess of integration.

Next, we notice that E(X^{2}) is an even function, because x^{2}f(x) will still be even.Â The integral from -L to L of an even function is simply 2 times the integral from 0 to L of the function.Â This integral is super easy to calculate.

Next, since this problem involves some traps, and some non-trivial calculus facts, I decide to explore the problem further and to enter the facts into my spaced repetition software.Â First, I start with some general questions:

The expected value of an even function is ???

- 0
- Since f(x) is even, xf(x) is odd. The integral of an odd function from -A to A is 0.

When f(x) is even, E(X) is ???

- 0
- Since f(x) is even, xf(x) is odd. The integral of an odd function from -L to L is 0.

When f(x) is even, E(X^{2}) is 2 times ???

- âˆ« from 0 to L x
^{2}f(x) dx
- because when f(x) is even x
^{2}f(x) is also even

The variance of an even function is E(???)

- E(X
^{2})
- because xf(x) is an odd function, hence E(X) = 0
- E(X
^{2}) – 0^{2} = E(X^{2})

Given f(x) = 1/L^{2}(Lâˆ’ |x| ) for |x| < L, what is E(X)?

- 0
- Since f(x) is even, xf(x) is odd. The integral of an odd function from -L to L is 0.

Now, since my goal is to become a whiz, you will see above that I have started to find a general solution to a specific problem.Â Mathematics is all about that.Â So, my next batch of problems are both more general, and more specific.

Given f(x) = 1/L^{2}(Lâˆ’ |x| ) for |x| < L, what is E(X^{2})?

- L
^{2}/ 6
- This is also Var(X), because the variance of an even function is E(X
^{2})

Given f(x) = 1/L^{2}(Lâˆ’ |x| ) for |x| < L, what is Var(X)?

- L
^{2}/ 6
- This is also E(X
^{2}), because the variance of an even function is E(X^{2})

Given f(x) = 1/4(2âˆ’ |x| ) for |x| < 2, what is Var(X)?

- 2/3
- Variance of f(x) = 1/L
^{2}(Lâˆ’ |x| ) for |x| < L = L^{2}/ 6

Given f(x) = 1/9 (3âˆ’ |x| ) for |x| < 3, what is Var(X)?

- 3/2
- Variance of f(x) = 1/L
^{2}(Lâˆ’ |x| ) for |x| < L = L^{2}/ 6

Given f(x) = 1/16 (4âˆ’ |x| ) for |x| < 4, what is Var(X)?

- 8/3
- Variance of f(x) = 1/L
^{2}(Lâˆ’ |x| ) for |x| < L = L^{2}/ 6

I often like to throw in a few numeric examples, so that I learn to recognize my generalization when I run into it.Â So, I have taken a problem and turned it into a dozen memorization items.