Poll
1 vote (100%) | |||
1 vote (100%) |
1 member has voted
Oddly enough, that web site Contact link, points the visitor to this site,
I believe Puzzle #17 gives the wrong answer. I used monte carlo simulation and came up with a different result.
17. Integral calculus required. A dart is thrown at a circular dart board of radius one. The dart can land at any place on the dartboard with equal probability. What is the mean distance between where the dart hits and the center of the board? (Answer), (Solution).
Just wondering if any math wizzes out there think the solution provided is correct.
Here the solution provided from that site.
"Problem 17 Solution
Lets consider the dartboard in polar coordinates. The dart can land at any angle relative to the center with equal probability. Next take the intregral from the least to the greatest distance, 0 to 1. The density function at distance d is 2*pi*d/pi = 2d. So the answer is:
Integral from 0 to 1 of d*2d = 2d3/3 from 0 to 1 = 2/3.
Michael Shackleford, A.S.A."
Quote: sr71Below, there is a math problem from the web site ml/]Example well I cant get the link to paste.
Oddly enough, that web site Contact link, points the visitor to this site,
I believe Puzzle #17 gives the wrong answer. I used monte carlo simulation and came up with a different result.
17. Integral calculus required. A dart is thrown at a circular dart board of radius one. The dart can land at any place on the dartboard with equal probability. What is the mean distance between where the dart hits and the center of the board? (Answer), (Solution).
Just wondering if any math wizzes out there think the solution provided is correct.
Here the solution provided from that site.
"Problem 17 Solution
Lets consider the dartboard in polar coordinates. The dart can land at any angle relative to the center with equal probability. Next take the intregral from the least to the greatest distance, 0 to 1. The density function at distance d is 2*pi*d/pi = 2d. So the answer is:
Integral from 0 to 1 of d*2d = 2d3/3 from 0 to 1 = 2/3.
Michael Shackleford, A.S.A."
I get 2/3 as the mean distance from the dart to the center, also.
So the posted answer of 2/3 was indeed incorrect.
An isosceles triangle’s center of mass is 2/3.
Thanks
Quote: sr71That should not be too difficult to simulate. It would just be the distance between two random x, y coordinates within the bounds of a circle.
Simulating is easy enough; I get around 0.9054. It's determining an exact solution that is hard.
Let (x,y) be one point and (u,v) be another; assume the circle is centered at (0,0).
I think the average is:
(the integral over x from -1 to 1 of
(the integral over u from -1 to 1 of
(the integral over y from -sqrt(1-x^2) to sqrt(1-x^2) of
(the integral over v from -sqrt(1-u^2) to sqrt(1-u^2) of
sqrt((x - u)^2 + (y - v)^2) dv
) du
) dy
) dx
) divided by PI^2 (since both points can be chosen from a region with area PI)
That's about 5% difference from .9054
That's a big spread, even for a simulation.
Quote: sr71That should not be too difficult to simulate. It would just be the distance between two random x, y coordinates within the bounds of a circle.
Simulations are reliable, but so unsatisfying. I want a closed form solution.
Quote: WizardSimulations are reliable, but so unsatisfying. I want a closed form solution.
Well that's a personal feeling not shared by everyone. The fact that simulations can provide answers when calculation is not possible or too complex, makes it a quite powerful alternative.
Quote: sr71I did a few simulations of 10 million each. The average I got was pretty close to 3 decimal places. 0.9525
That's about 5% difference from .9054
That's a big spread, even for a simulation.
I can't find any glaring errors in my code. Maybe it's in my methodology?
Choose four random numbers X1, Y1, X2, and Y2, each in the interval [-1, 1].
This represents the coordinates of two points (X1, Y1) and (X2, Y2) in the square -1 <= x <= 1, -1 <= y <= 1.
If sqrt(X1^2 + Y1^2) < 1, it is inside the circle of radius 1 centered at (0,0).
If sqrt(X2^2 + Y2^2) < 1 as well, both points are "on the dartboard"; calculate the distance.
Add up the distances (sqrt((X1 - X2)^2 + (Y1 - Y2)^2)) of all pairs where both darts are on the board, and divide by the number of times this happens.
Quote: sr71I did a few simulations of 10 million each. The average I got was pretty close to 3 decimal places. 0.9525
That's about 5% difference from .9054
That's a big spread, even for a simulation.
You might be simulating the median, like you were for the original problem, and not the mean.
Quote: ThatDonGuyI can't find any glaring errors in my code. Maybe it's in my methodology?
Choose four random numbers X1, Y1, X2, and Y2, each in the interval [-1, 1].
This represents the coordinates of two points (X1, Y1) and (X2, Y2) in the square -1 <= x <= 1, -1 <= y <= 1.
If sqrt(X1^2 + Y1^2) < 1, it is inside the circle of radius 1 centered at (0,0).
If sqrt(X2^2 + Y2^2) < 1 as well, both points are "on the dartboard"; calculate the distance.
Add up the distances (sqrt((X1 - X2)^2 + (Y1 - Y2)^2)) of all pairs where both darts are on the board, and divide by the number of times this happens.
Try <= rather than <
If sqrt(X1^2 + Y1^2) <= 1
If sqrt(X2^2 + Y2^2) <= 1
that should slightly increase the result.
Otherwise, maybe its the random number generator your using.
Quote: WizardSimulations are reliable, but so unsatisfying. I want a closed form solution.
I agree. I don’t know for sure if these are the same but Several years ago the “four color map” problem was solved by brute force (they literally tried every possible combination) rather than a rigorous proof. It’s nice to have an answer but it’s an unsatisfying solve. That said, it’s not like I could try follow a rigorous proof. But it does seem like a more rigorous approach has more carryover value to helping with other problems. You don’t get that with brute force.
Quote: sr71Quote: ThatDonGuyI can't find any glaring errors in my code. Maybe it's in my methodology?
Try <= rather than <
If sqrt(X1^2 + Y1^2) <= 1
If sqrt(X2^2 + Y2^2) <= 1
that should slightly increase the result.
Otherwise, maybe its the random number generator your using.
Changing < 1 to <= 1 will not change the result by more than an insignificant amount.
Also, I am varying the number of "dummy" values being taken from my RNG, but the result is still almost always near 0.9054.
Can you post your code here (or in a PM)?
Quote: unJonI feel like a voice in the wilderness. DonGuy see if he’s simulating the mean, not the median.
Quote: ThatDonGuy.... calculate the distance.
Add up the distances (sqrt((X1 - X2)^2 + (Y1 - Y2)^2)) of all pairs where both darts are on the board, and divide by the number of times this happens.
I used the same basic formulas as the orig. problem, which did produce the correct result, sqrt(2)/2, then I modified it for two random points instead of one. and calculated the distance as That DonGuy did.
Quote: sr71Quote: ThatDonGuy.... calculate the distance.
Add up the distances (sqrt((X1 - X2)^2 + (Y1 - Y2)^2)) of all pairs where both darts are on the board, and divide by the number of times this happens.
I used the same basic formulas as the orig. problem, which did produce the correct result, sqrt(2)/2, then I calculated the distance as That DonGuy did.
Sqrt(2)/2 is the median not mean for original problem. Hence my suspicion.
Quote: unJonQuote: sr71Quote: ThatDonGuy.... calculate the distance.
Add up the distances (sqrt((X1 - X2)^2 + (Y1 - Y2)^2)) of all pairs where both darts are on the board, and divide by the number of times this happens.
I used the same basic formulas as the orig. problem, which did produce the correct result, sqrt(2)/2, then I calculated the distance as That DonGuy did.
Sqrt(2)/2 is the median not mean for original problem. Hence my suspicion.
.707... was the result.
...Adding up the distances (sqrt((X1 - X2)^2 + (Y1 - Y2)^2)) of all pairs where both darts are on the board, and dividing by the number of times this happens.
Isnt this the "average" or "mean"?
Quote: sr71Quote: unJonQuote: sr71Quote: ThatDonGuy.... calculate the distance.
Add up the distances (sqrt((X1 - X2)^2 + (Y1 - Y2)^2)) of all pairs where both darts are on the board, and divide by the number of times this happens.
I used the same basic formulas as the orig. problem, which did produce the correct result, sqrt(2)/2, then I calculated the distance as That DonGuy did.
Sqrt(2)/2 is the median not mean for original problem. Hence my suspicion.
.707... was the result.
...Adding up the distances (sqrt((X1 - X2)^2 + (Y1 - Y2)^2)) of all pairs where both darts are on the board, and dividing by the number of times this happens.
Isnt this the "average" or "mean"?
Yes, it is, and that is what was asked - the mean distance between two random darts on a dartboard of radius 1.
I did try to simulate the median for the two-dart distance roblem, but I get something around 0.891.
The work is shown as a jpg of a writeup in Word, because the HTML language used by this site is too clunky for equations.
Did I screw this up, and if so, where?
Quote: ThatDonGuyQuote: sr71Quote: unJonQuote: sr71Quote: ThatDonGuy.... calculate the distance.
Add up the distances (sqrt((X1 - X2)^2 + (Y1 - Y2)^2)) of all pairs where both darts are on the board, and divide by the number of times this happens.
I used the same basic formulas as the orig. problem, which did produce the correct result, sqrt(2)/2, then I calculated the distance as That DonGuy did.
Sqrt(2)/2 is the median not mean for original problem. Hence my suspicion.
.707... was the result.
...Adding up the distances (sqrt((X1 - X2)^2 + (Y1 - Y2)^2)) of all pairs where both darts are on the board, and dividing by the number of times this happens.
Isnt this the "average" or "mean"?
Yes, it is, and that is what was asked - the mean distance between two random darts on a dartboard of radius 1.
I did try to simulate the median for the two-dart distance roblem, but I get something around 0.891.
Weird. Do you get 2/3 of 1/sqrt(2) for first problem? Because latter definitely the median and that’s what other poster simulated.
Quote: sr71yes, I did PM you. Let me know if you didnt get the message.
I got your latest message, and checked your code - and I think I know why our numbers are different.
What you are doing is, you select an X value from -1 to 1, then select a Y value from -sqrt(1 - X^2) to sqrt(1 - X^2).
However, I don't think every point has an equal probability of being selected when you do it that way.
Look at it this way:
Let X = 3/5; Y can be anywhere from -4/5 to 4/5.
Let X = 4/5, which is equally likely as X = 3/5; Y can be anywhere from -3/5 to 3/5. However, there are 9/7 as many points to choose on the X = 3/5 line as there are on the X = 4/5 line.
It appears to show lower probability on the lower end of the -1 to +1 range on the y-axis. Unfortunately I cant post the histogram to show you.
I fixed my formula and re-simulated it. i got ~ .9053 about the same as what you got.
I guess that answers that.
Quote: sr71You might be right. I generated several histograms of 1000 simulations to visualize the X-axis (RNG) Vs. the Y-axis (my formula).
It appears to show lower probability on the lower end of the -1 to +1 range on the y-axis. Unfortunately I cant post the histogram to show you.
I will fix my formula and re-simulate - and hopefully will provide a more confident result.
No need to explain - Wolfram Mathworld pretty much explains what happens.
Quote: ThatDonGuyNo need to explain - Wolfram Mathworld pretty much explains what happens.
Oh, I see, so my analytic derivation was wrong because it did exactly what Wolfram Mathworld said you shouldn't do:
I set x = rcosθ and y = r sin θ
rather than x = r½cosθ and y = r½ sin θ
for the two dart problem, I fixed my formula and re-simulated it. i got ~ .9053 about the same as what you got.