-->

Tuesday 27 August 2013

Not The Mean Value Theorem

The following question was mentioned in the comments on Hacker News the other day.
If the side of a cube comes from a uniform distribution between 1 and 5 inches, what's the expected volume of the cube ?
The answer is to get the integral of x^3 at 5 minus the integral at one divided by 5-1. The integral is (x^4)/4 so we get 1/4(625/4-1/4) = 39.

But what if we are dealing with a cuboid and the sides are independent random variable. Well its E(length) * E(breadth) * E(width) or 3*3*3. But I wasn't sure if I was correct so I went to one of the newer tools in my mathematical toolbox - that's right I went triple integral.

It's the same as the integral above except we need to remember to divide by 64 because we are working against three axes.


Finally we divide by 64 to get 27. Basically each integral evaluates to 12 (area under the curve) and is divided by four to get the mean.

Yay maths works!

Arrow Key Nav