United States
Member #197,030
March 28, 2019
1,647 Posts
Offline
Quote: Originally posted by Orange71 on Jul 23, 2022
Here's another puzzle similar to the original #3.
Suppose we have a circle of radius R. Two points are chosen at random on or inside the radius of the circle. All locations on or inside the circle have equal (uniform) probability. A line segment L is drawn between the two points. If a square is then drawn with side length L, what is the average area of the square?
Spoiler: I get (2/3)R^2. Can anyone confirm he gets the same answer?
If you set the coordinates of your random points as (r*cos(theta), r*sin(theta)) and (p*cos(phi), p*sin(phi)), where r and p are uniformly distributed over (0, 1) and theta and phi are informly distributed over (0, 2*pi) you will get (2/3)R^2 as your answer. However, there is a problem with that approach. The random point (r*cos(theta), r*sin(theta)) (where r and theta are uniformly random) is not uniformly distributed over the circle. The points are concentrated in the center.
So if you want to points to be uniformly distributed, you have to start with rectangular coordinates. When you change x,y coordinates to r,theta coordinates, the dx dy term is replaced by r*dr dtheta, which comes from the Jacobian. That extra r factor is essentially a scaling correction that preserves true uniformity over the disk. Hope that makes sense. I haven't worked out the integral yet.
(I did try it the wrong-integral way first and got the same answer as you, and then compared the answer to a sample of 1000000 random uniform points in a disk. The way I made sure the points were uniformly distributed over the disk was to first pick a random point in a square and then discard any that fell outside the circle. With the samples I got an answer much smaller than (2/3)R^2.)
Texas United States
Member #200,559
August 28, 2019
159 Posts
Offline
Agree. Relative to the problem statement, I had erroneously used polar coordinates assuming uniform r on the interval [0,R] and random theta on the interval [0,2*Pi]. The probability per unit area as a function of the random variable r here is 1/(Pi*R*r), so as we approach the origin the probability per unit area becomes asymptotically infinite.
I will also think about the correct integral for true random uniform x/y Cartesian probabilities on/inside the circle.
United States
Member #197,030
March 28, 2019
1,647 Posts
Offline
Quote: Originally posted by db101 on Jul 23, 2022
Problem 3 is good because it can spawn a lot of related questions. Here are a couple I came up with.
Given a 1x1 square and 2 random points on the boundary (not inside), what is the average distance between them? I worked out that you have to take the weighted average of 3 cases: both points on the same side (1/4), points on adjacent sides l1/2), and points on opposite sides (1/4).
Given a circle of radius R and 2 random points on the circumference, the average distance between them is 4R/pi. Now if you have 3 random points on the circumference, what is the average area of the triangle they form?
Average distance between two random points on the boundary of a 1x1 square is
(3 + sqrt(2) + 5*LN(sqrt(2) + 1)) / 12 ≈ 0.7351
Average area of a triangle whose vertices are random points on the boundary of a circle with radius 1 is