WELCOME TO THE UNIQUE MATHEMATIC QUESTIONS BY: VIKASH RAHII

DISTANCE BETWEEN TWO RANDOM POINTS IN A SQUARE.



Question.What is the average distance of two  randomly  chosen point in a square with a  side length 1?





specifically, select two points at random from interior of the unit square. what is the mean distance between two random point?

solution:-
.
. .before i solve the problem,let's we get   approximation. for each trial we randomly pick  two points  in a square and calculate the distance between the points. we can average the distance over many trials two  estimate  the average distance.

here, we take  a point is a pair (x,y). which each  co-ordinate  is random number 0 to 1. we can generate two  points by generating four random numbers from 0 to 1.

Let (x1, y1) = (rand();, rand();) and (x1, y1) = (rand();, rand();). In the spreadsheed I generated random numbers and then pasted values.The distance between two points can be found from the Pythagorean Theorem. The distance between two points is the hypotenuse of a right triangle with the legs being the horizontal and vertical distances








mean-distance-square-distance-formula-diagram

The formula for the distance between two points is therefore:
mean-distance-square-distance-formula
The spreadsheet performs 10,000 trials and estimates the average distance is equal to 0.517.

An exact answer
We want the expected value of the distance, where each variable is a random number drawn from the standard uniform distribution. The probability density of each variable is 1.
The expected distance is the quadruple integral of the distance formula:


The expected distance is the quadruple integral of the distance formula:
mean-distance-square-quadruple-integral

This is pretty hard to calculate, so we want to simplify it. First, we can simplify to 2 variables by focusing on a variable for the x-distance (|Δx|) and a separate one for the y-distance (|Δy|).


 change-delta-x-delta-y-abs-value
Consider two random variables u and v drawn from the standard uniform distribution. What is the distribution of the difference between the variables w = |uv|? The distance will range from 0 to 1. We want to find the probability density that |uv| = k.

 Therefore we have found the distribution for |Δx|, denoted as x, and |Δy|, denoted as y. The distance formula is multiplied by those densities, and the integral becomes the following:

 mean-distance-square-double-integral
This integral is still hard to compute! Now we will use a change of variables into polar coordinates. We let:
x = r cos θ y = r sin θ
First we have to remember the new integral has to include an extra factor of r, which is the determinant of the Jacobian matrix, required for the change of coordinates to polar.
Next we have to find change the limits of integration. Here is a diagram that will help.

 mean-distance-square-change-coordinates-polar-diagram
Instead of integrating the entire square, we will integrate the lower triangle and then multiply by 2. Then θ ranges from 0 to π/4, and the variable r ranges from 0 to 1/(cos θ) = sec θ.
The change of coordinates results in the following, where I have written f(r, θ) for the function to be written in polar coordinates:

 mean-distance-square-polar-change-coordinates
Here is the integral in polar coordinates:
mean-distance-square-polar-change-coordinates 2
Now let’s simplify the integral in polar coordinates. Integrating over r is not too difficult.
mean-distance-square-solving-polar-integral-r
Integrating for θ requires the special formula .
mean-distance-square-solving-polar-integral-theta













And that gets us to the exact answer:
(2 + √2 + 5 ln(√2 + 1))/15 ≈ 0.52140
BY: Vikash Rahii
DISTANCE BETWEEN TWO RANDOM POINTS IN A SQUARE. DISTANCE BETWEEN TWO RANDOM POINTS IN A SQUARE. Reviewed by biharishayar on December 31, 2017 Rating: 5

5 comments:

We will contact soon.

Powered by Blogger.