The average distance from a square’s center to its edges

calculus

The question is self explanatory.

Let me quickly explain my approach, and one of you smart fellows point out where I'm going wrong.

(I want to do this in polar on purpose. I feel I could probably do it in rectangular (since I did many similar problems in calc 3 class), but my polar is really weak and I want to improve it)

I called the distance from origin to edge at some angle theta: $d(\theta)$.

I imagined a circle within the square whose radius $r$ is a constant, and is equal to $d(0)$.

Since I'm looking for the average distance, I can integrate $d(\theta)$ from $\theta=0$ to $\theta=2\pi$, and then multiply the result by $1 / (2\pi)$.

Before I attempt to define our $d(\theta)$, I make another observation. Because of symmetry, I can just work with a $\pi / 4$ radian section, and generalize on that, since the average over the $\pi / 4$ section will be equal to the average over the entire square.

Now, to define $d(\theta)$.

My definition was: $d(\theta) = \sqrt{r^2 + (r\tan(\theta))^2}$

And plug the $d(\theta)$ into below integral:

$(1/(0.25\pi)) (0.5) \int(d(\theta))^2d\theta$ on the interval $[0, 0.25\pi]$

(Note that the first multiplier is because I am calculating the average over that interval. The second multiplier comes from the polar integral formula $\int((1/2)r^2)d\theta$.)

Now, I will spare you my subsequent computations, as they were a bit messy and I don't want to include them. My result is way too large and obviously incorrect.

Have you spotted an error in how I set this up? If not, I must be making a mistake in the computation.

I'd also greatly appreciate any additional wisdom. Thank you very much.

Best Answer

Why are you squaring $r$? That "polar integral formula" is the integral for the area. That's fine if what you're trying to do is to calculate the area of a square with side $2r$, but that's not the problem you claim to be trying to solve.

Now, one thing to watch for - the average depends on the probability distribution. Your setup here looks like a uniform distribution with respect to angle, while the rectangular coordinate setup you alluded to implies a uniform distribution with respect to length. Those are not the same thing; the latter should result in a slightly larger average distance. Make sure to be clear exactly what you're trying to find - the question is not as self-explanatory as you think.

In better news, your distance formula is correct for a square of side $2r$, and the reduction to an interval of length $\frac{\pi}{4}$ is good. Those parts won't cause problems.

Related Question