## Three points, $P_1$, $P_2$ and $P_3$, are randomly selected within a unit square. Consider the three rectangles with sides parallel to the sides of the unit square and a diagonal that is one of the three line segments $\overline{P_1P_2}$, $\overline{P_1P_3}$ or $\overline{P_2P_3}$ (see picture below).

We are interested in the rectangle with the second biggest area. In the example above that happens to be the green rectangle defined with the diagonal $\overline{P_2P_3}$.

Find the expected value of the area of the second biggest of the three rectangles. Give your answer rounded to 10 digits after the decimal point.

### This is a probability problem that requires an understanding of expectation and integrals. Consider one diagonal of the rectangle, which we denote as line segment `a`. We can let `a` vary from 0 to √2 (the maximum length of a diagonal in the unit square). Also consider the other two sides of the rectangle which are perpendicular to `a`, those are the other two diagonals whose lengths we denote as x and y (with x ≤ y).

Firstly, note that for a fixed `a`, a rectangle is determined by choosing two numbers in [0, `a`/√2] (the possible lengths of `x` and `y`) provided that `x` ≤ `y`. Then the areas of the rectangles are xy/2, which for x ≤ y are all possible values in [0, `a`^2/4].

Secondly, for a fixed `a`, the possible lengths for the second biggest rectangle area are [0, `a`^2/8] ∪ [`a`^2/4, 3`a`^2/8]. So we should calculate the probability that a rectangle area chosen in random falls into these intervals and then sum these probabilities while `a` varies from 0 to √2.

Here are the calculations:

“`

a^2/8 dx dy = a^2 da dx dy / 8

3 a^2 / 8 dx dy = 3 a^2 da dx dy / 8

a^2 / 4 dx dy = a^2 da dx dy / 4,

“`

Therefore:

“`

P(a^2 / 8 < A < a^2 / 4) = 1 / (a√2).
```
We want the expected value, so we need to integrate over `a` from 0 to √2. Using these, we get:
```
∫ from 0 to sqrt(2) of [ a^2 / 8 * 1 / (a sqrt(2)) + 3 a^2 / 8 * 1 / (a sqrt(2)) ] da = 1 / sqrt(2) * (1/8 + 3/8) * [a^3 / 3] from 0 to sqrt(2).
```
This gives a numerical value of approximately 0.3236067977 after rounding to 10 digits after the decimal point.

##### More Answers:

Siegbert and JoFinite Sequence Generator

Cube-full Divisors