Poll

1 vote (100%)
1 vote (100%)

1 member has voted

sr71
sr71
  • Threads: 1
  • Posts: 13
Joined: Aug 30, 2021
August 30th, 2021 at 6:36:01 PM permalink
Below, there is a math problem from the web site ..... 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."
Last edited by: unnamed administrator on Aug 30, 2021
unJon
unJon
  • Threads: 16
  • Posts: 4763
Joined: Jul 1, 2018
August 30th, 2021 at 6:54:35 PM permalink
The median distance away from center is 1/sqrt(2). Is that what you calculated?
The race is not always to the swift, nor the battle to the strong; but that is the way to bet.
BleedingChipsSlowly
BleedingChipsSlowly
  • Threads: 23
  • Posts: 1033
Joined: Jul 9, 2010
August 30th, 2021 at 7:20:01 PM permalink
Welcome to the forum, sr71! The problem you reference is posted at http://mathproblems.info/group1.html .The reason this site is referenced is that Michael Shackleford, who posted the solution, is the creator of this site, posting as Wizard. He also created the site where you found the problem example.
“You don’t bring a bone saw to a negotiation.” - Robert Jordan, former U.S. ambassador to Saudi Arabia
ChesterDog
ChesterDog
  • Threads: 9
  • Posts: 1709
Joined: Jul 26, 2010
August 30th, 2021 at 7:30:30 PM permalink
Quote: sr71

Below, 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.
Wizard
Administrator
Wizard
  • Threads: 1518
  • Posts: 27033
Joined: Oct 14, 2009
August 30th, 2021 at 7:40:52 PM permalink
One unsolved problem of mine is what is the mean distance between TWO darts thrown at a dartboard of radius 1? I've solved it for a unit square, which isn't easy, but never got far with a circle.
"For with much wisdom comes much sorrow." -- Ecclesiastes 1:18 (NIV)
sr71
sr71
  • Threads: 1
  • Posts: 13
Joined: Aug 30, 2021
August 31st, 2021 at 6:30:47 AM permalink
Yes. I got sqrt(2)/2 = 1/sqrt(2) = ~ .707
So the posted answer of 2/3 was indeed incorrect.

An isosceles triangle’s center of mass is 2/3.

Thanks
Last edited by: sr71 on Aug 31, 2021
sr71
sr71
  • Threads: 1
  • Posts: 13
Joined: Aug 30, 2021
August 31st, 2021 at 8:13:29 AM permalink
That 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.
ThatDonGuy
ThatDonGuy
  • Threads: 122
  • Posts: 6675
Joined: Jun 22, 2011
August 31st, 2021 at 12:08:38 PM permalink
Quote: sr71

That 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)
sr71
sr71
  • Threads: 1
  • Posts: 13
Joined: Aug 30, 2021
August 31st, 2021 at 1:03:37 PM permalink
I 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.
Wizard
Administrator
Wizard
  • Threads: 1518
  • Posts: 27033
Joined: Oct 14, 2009
August 31st, 2021 at 1:13:13 PM permalink
Quote: sr71

That 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.
"For with much wisdom comes much sorrow." -- Ecclesiastes 1:18 (NIV)
sr71
sr71
  • Threads: 1
  • Posts: 13
Joined: Aug 30, 2021
August 31st, 2021 at 2:04:05 PM permalink
Quote: Wizard

Simulations 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.
ThatDonGuy
ThatDonGuy
  • Threads: 122
  • Posts: 6675
Joined: Jun 22, 2011
August 31st, 2021 at 2:33:03 PM permalink
Quote: sr71

I 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.
unJon
unJon
  • Threads: 16
  • Posts: 4763
Joined: Jul 1, 2018
August 31st, 2021 at 2:39:14 PM permalink
Quote: sr71

I 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.
The race is not always to the swift, nor the battle to the strong; but that is the way to bet.
sr71
sr71
  • Threads: 1
  • Posts: 13
Joined: Aug 30, 2021
August 31st, 2021 at 3:27:23 PM permalink
Quote: ThatDonGuy

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.



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.
TinMan
TinMan
  • Threads: 22
  • Posts: 463
Joined: Nov 17, 2009
August 31st, 2021 at 3:38:05 PM permalink
Quote: Wizard

Simulations 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.
If anyone gives you 10,000 to 1 on anything, you take it. If John Mellencamp ever wins an Oscar, I am going to be a very rich dude.
ThatDonGuy
ThatDonGuy
  • Threads: 122
  • Posts: 6675
Joined: Jun 22, 2011
August 31st, 2021 at 3:39:26 PM permalink
Quote: sr71

Quote: ThatDonGuy

I 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)?
sr71
sr71
  • Threads: 1
  • Posts: 13
Joined: Aug 30, 2021
August 31st, 2021 at 5:04:14 PM permalink
yes, I did PM you. Let me know if you didnt get the message.
Last edited by: sr71 on Aug 31, 2021
unJon
unJon
  • Threads: 16
  • Posts: 4763
Joined: Jul 1, 2018
August 31st, 2021 at 5:21:45 PM permalink
I feel like a voice in the wilderness. DonGuy see if he’s simulating the mean, not the median.
The race is not always to the swift, nor the battle to the strong; but that is the way to bet.
sr71
sr71
  • Threads: 1
  • Posts: 13
Joined: Aug 30, 2021
August 31st, 2021 at 5:30:21 PM permalink
Quote: unJon

I 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.
unJon
unJon
  • Threads: 16
  • Posts: 4763
Joined: Jul 1, 2018
August 31st, 2021 at 5:31:43 PM permalink
Quote: sr71

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 calculated the distance as That DonGuy did.



Sqrt(2)/2 is the median not mean for original problem. Hence my suspicion.
The race is not always to the swift, nor the battle to the strong; but that is the way to bet.
sr71
sr71
  • Threads: 1
  • Posts: 13
Joined: Aug 30, 2021
August 31st, 2021 at 5:38:16 PM permalink
Quote: unJon

Quote: sr71

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 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"?
ThatDonGuy
ThatDonGuy
  • Threads: 122
  • Posts: 6675
Joined: Jun 22, 2011
August 31st, 2021 at 5:44:43 PM permalink
Quote: sr71

Quote: unJon

Quote: sr71

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 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.
gordonm888
Administrator
gordonm888
  • Threads: 61
  • Posts: 5357
Joined: Feb 18, 2015
August 31st, 2021 at 6:19:23 PM permalink
Here is my attempt to do the problem analytically. It has a been a long time since I have been in college and used calculus extensively.

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?
So many better men, a few of them friends, are dead. And a thousand thousand slimy things live on, and so do I.
unJon
unJon
  • Threads: 16
  • Posts: 4763
Joined: Jul 1, 2018
August 31st, 2021 at 7:14:15 PM permalink
Quote: ThatDonGuy

Quote: sr71

Quote: unJon

Quote: sr71

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 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.
The race is not always to the swift, nor the battle to the strong; but that is the way to bet.
ThatDonGuy
ThatDonGuy
  • Threads: 122
  • Posts: 6675
Joined: Jun 22, 2011
August 31st, 2021 at 7:36:24 PM permalink
Quote: sr71

yes, 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.
sr71
sr71
  • Threads: 1
  • Posts: 13
Joined: Aug 30, 2021
September 1st, 2021 at 12:54:08 PM permalink
You 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 fixed my formula and re-simulated it. i got ~ .9053 about the same as what you got.
I guess that answers that.
Last edited by: sr71 on Sep 1, 2021
ThatDonGuy
ThatDonGuy
  • Threads: 122
  • Posts: 6675
Joined: Jun 22, 2011
Thanked by
sr71
September 1st, 2021 at 2:48:27 PM permalink
Quote: sr71

You 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.
gordonm888
Administrator
gordonm888
  • Threads: 61
  • Posts: 5357
Joined: Feb 18, 2015
Thanked by
sr71
September 1st, 2021 at 3:05:32 PM permalink
Quote: ThatDonGuy

No 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 θ
So many better men, a few of them friends, are dead. And a thousand thousand slimy things live on, and so do I.
sr71
sr71
  • Threads: 1
  • Posts: 13
Joined: Aug 30, 2021
September 1st, 2021 at 3:52:34 PM permalink
I see. that was the single dart problem.

for the two dart problem, I fixed my formula and re-simulated it. i got ~ .9053 about the same as what you got.
sr71
sr71
  • Threads: 1
  • Posts: 13
Joined: Aug 30, 2021
September 1st, 2021 at 4:22:23 PM permalink
That was a good exercise. I learned something.
  • Jump to: