flat assembler
Message board for the users of flat assembler.

 Index > Heap > Numerical oddities Goto page Previous  1, 2, 3 ... 22, 23, 24, 25, 26  Next
Author
revolution
When all else fails, read the source

Joined: 24 Aug 2004
Posts: 17278
revolution
Okay, for the north/south reading we are using the rotational north/south, not the magnetic north/south.
28 May 2013, 11:21
YONG

Joined: 16 Mar 2005
Posts: 8000
Location: 22° 15' N | 114° 10' E
YONG

Are you talking about a particular point on a 2-D plane?

Or are you talking about a particular point in a 3-D space?

We need to take in account Earth's rotation?!
28 May 2013, 12:13
revolution
When all else fails, read the source

Joined: 24 Aug 2004
Posts: 17278
revolution
YONG wrote:
A starting point is a fixed point on the surface of the Earth. It could be a stake in the ground, a paint spot, or anything similar that is not moveable relative to the surface in normal circumstances.

Other than using the Earth's rotation to determine north and south I don't think that the rotation would be an important consideration. But I know you guys and gals here are smart and could possibly prove me wrong here, but we shall see.
28 May 2013, 12:25
bitRAKE

Joined: 21 Jul 2003
Posts: 2915
Location: [RSP+8*5]
bitRAKE
I'm concerned about the sensitivity of measurement required to accurately traverse that distance. Not that they couldn't get close, but the exact spot might be impossible. It's easier to get close and look around for the stake, monolith, or whatever. Anyone who travels is constantly adjusting their heading as better information becomes available.
28 May 2013, 12:39
revolution
When all else fails, read the source

Joined: 24 Aug 2004
Posts: 17278
revolution
For the purposes here the compass is perfect. So that means even a micro-fraction of a degree off course would be detected instantly. And the man is able to follow the compass direction perfectly also.
28 May 2013, 12:47
YONG

Joined: 16 Mar 2005
Posts: 8000
Location: 22° 15' N | 114° 10' E
YONG
I guess the trick of this problem lies here:

"Upon discovering that he can no longer walk any further south, ..."

By that time, the man is situated exactly at the south pole!

References:

http://www.polartrec.com/forum/icecube-in-ice-antarctic-telescope/compass-the-south-pole

Am I right?
28 May 2013, 13:04
revolution
When all else fails, read the source

Joined: 24 Aug 2004
Posts: 17278
revolution
YONG wrote:
I guess the trick of this problem lies here:

"Upon discovering that he can no longer walk any further south, ..."

By that time, the man is situated exactly at the south pole!

References:

http://www.polartrec.com/forum/icecube-in-ice-antarctic-telescope/compass-the-south-pole

Am I right?
Yup. Well done. But you haven't answered the question.
28 May 2013, 13:20
tthsqe

Joined: 20 May 2009
Posts: 724
tthsqe
revolution,
if the answer you are expecting is not the obvious one of zero, then the problem is not defined well enough, or you have some strange notion of probabilities.

The man essentially starts on the latitude line 10km away from the south pole, and returns to this same latitude only now with an arbitrary longitude.
28 May 2013, 15:34
revolution
When all else fails, read the source

Joined: 24 Aug 2004
Posts: 17278
revolution
tthsqe wrote:
revolution,
if the answer you are expecting is not the obvious one of zero, then the problem is not defined well enough, or you have some strange notion of probabilities.
Actually I didn't ask for probability but instead the likelihood. But, essentially, yes, the likelihood of returning to the starting point is negligible.
tthsqe wrote:
The man essentially starts on the latitude line 10km away from the south pole, and returns to this same latitude only now with an arbitrary longitude.
Yes, so now for the second part of the puzzle:

Assume the starting point is a circle of one metre in diameter. Compute the probability that the man will return to some point that lies within the one metre circle.

Hint: This is actually trickier to work out than it might first appear. But there is a precise answer.
28 May 2013, 19:21
bitRAKE

Joined: 21 Jul 2003
Posts: 2915
Location: [RSP+8*5]
bitRAKE
We call the solution "hole in the arc of revolution".
28 May 2013, 21:06
tthsqe

Joined: 20 May 2009
Posts: 724
tthsqe
So just to clarify, we want to calculation the probability that the man will return to within 1 meter of the point where he started given that he return point is uniformly distributed on the latitude where he started?

Someone should definitely try it and see if they got the same answer of
Code:
`0.00318310017018888629% chance    `

Last edited by tthsqe on 31 May 2013, 15:42; edited 3 times in total
28 May 2013, 21:45
revolution
When all else fails, read the source

Joined: 24 Aug 2004
Posts: 17278
revolution
tthsqe wrote:
So just to clarify, we want to calculation the probability that the man will return to within 1 meter of the point where he started ...
I defined the start point as one metre in diameter.
29 May 2013, 00:49
bitRAKE

Joined: 21 Jul 2003
Posts: 2915
Location: [RSP+8*5]
bitRAKE
I got 0.0124602 % chance. (which seems too large)

Given an arc length L on a circle of radius R, the distance from the center of the circle to the mid-point of line (connecting the two arc end-points) is:

d = R cos(L / 2R)

The area of a spherical cap is (h=R-d): 2 pi R h

The traveler can return to an area between 10000.5 and 9999.5 distance from the pole - which creates an arc length of 20001 and 19999 respectively, across the pole. First we calculate the height to the arc, subtract the smaller cap from the larger to get our destination area.

Next we have the starting circle of 1 meter diameter. We use the same equations - with L=1.

Divide to get probability.

Edit: oh, it was 10k, 0.00124603 % chance.

_________________
29 May 2013, 07:44
revolution
When all else fails, read the source

Joined: 24 Aug 2004
Posts: 17278
revolution
bitRAKE wrote:
The traveler can return to an area between 10000.5 and 9999.5 distance from the pole
Oh, I might not have explained this properly. But the man stills walks exactly 10km both to and from the pole. Let's assume that he originally starts as precisely the centre of the start circle (thus the centre of the start circle is exactly 10km from the pole) and now we need to compute the probability that he will return to some point within that circle.
29 May 2013, 08:40
bitRAKE

Joined: 21 Jul 2003
Posts: 2915
Location: [RSP+8*5]
bitRAKE
It was so much easier the way I chose to interpret it. (...and you can see why I called it the "hole in the arc of revolution" - triple entendre if you will, lol.)

So there is an arc destination within the original 1 meter starting position. This arc is on the earth sphere and 10km from the pole? Making the probability the ratio of that arc and the circumference of the 10km circle?

_________________
29 May 2013, 09:57
tthsqe

Joined: 20 May 2009
Posts: 724
tthsqe
I think that revolution intends for the man to start and return to the same latitude. The problem is then: which points on that latitude are less than 0.5 meters away. In my answer, I calculated it for 1.0 meters away because I confused radius and diameter. So, my corrected solution would be the same except that the equation for phi2 should be phi2 = 0.5/r. This gives
Code:
`0.0015915500843919805897%    `

We have good reasons to believe that the answer should be close to
Code:
`0.5/(10^4*Pi)    `
29 May 2013, 10:56
revolution
When all else fails, read the source

Joined: 24 Aug 2004
Posts: 17278
revolution
tthsqe wrote:
I think that revolution intends for the man to start and return to the same latitude. The problem is then: which points on that latitude are less than 0.5 meters away. In my answer, I calculated it for 1.0 meters away because I confused radius and diameter. So, my corrected solution would be the same except that the equation for phi2 should be phi2 = 0.5/r. This gives
Code:
`0.0015915500843919805897%    `

We have good reasons to believe that the answer should be close to
Code:
`0.5/(10^4*Pi)    `
Did you know that the Earth is not perfectly round but it more like an oblate spheroid?
29 May 2013, 11:05
tthsqe

Joined: 20 May 2009
Posts: 724
tthsqe
Quote:
Did you know that the Earth is not perfectly round but it more like an oblate spheroid?

Yes, but I was hoping that it would not come up, as geodesics on ellipsoids are complicated enough that I would rather not think about them.

Do you agree with my corrected solution if we assume that the earth is a sphere with that radius?
31 May 2013, 00:27
revolution
When all else fails, read the source

Joined: 24 Aug 2004
Posts: 17278
revolution
tthsqe wrote:
... geodesics on ellipsoids are complicated enough that I would rather not think about them.
I said it was tricky, not hard or impossible.
tthsqe wrote:
Do you agree with my corrected solution if we assume that the earth is a sphere with that radius?
No. I get a value that is very close but is nevertheless still different.
31 May 2013, 01:45
bitRAKE

Joined: 21 Jul 2003
Posts: 2915
Location: [RSP+8*5]
bitRAKE
I used numerical integration method.

0.00159155007810710868 %
Code:
```fstcw word[rsp]
pop rax
push rax
or    word[rsp],      11'0000'0000b ; extended precision
and   word[rsp],not 1100'0000'0000b ; round closest
fldcw word[rsp]
push rax

.integrate:
fld [..L]       ; L = length desired
fld [..dt]      ;dt = change between measures
fldz            ; S = sum of partial lengths
fld [..b]       ; v = previous (y), b cos 0
fldz            ; u = previous (x), a sin 0
fldz            ; t = current measure index (time)
.slice:
fadd st0,st4    ; t u v S dt L

; Ellipse:
;   x = a sin t, major axis, start in center (0)
;   y = b cos t, minor axis, start at top pole
fld st0         ; t t u v S dt L
fsincos         ; y x t u v S dt L
fmul [..b]      ; Y x t u v S dt L
fxch st1        ; x Y t u v S dt L
fmul [..a]      ; X Y t u v S dt L

; Extremely general numerical integration to approximate length of arc:
;   S = lim Sum[sqrt( dx^2 + dy^2 )]
fsubr st3,st0   ; u Y t dx v S dt L
fxch st1        ; Y u t dx v S dt L
fsubr st4,st0   ; v u t dx dy S dt L
fxch st4        ; dy u t dx v S dt L
fmul st0,st0    ; DY u t dx v S dt L
fxch st1        ; u DY t dx v S dt L
fxch st3        ; dx DY t u v S dt L
fmul st0,st0    ; DX DY t u v S dt L
faddp st1,st0   ; dl t u v S dt L
fsqrt           ; dl t u v S dt L
fadd st0,st4    ; S t u v # dt L
fcomi st6       ; S t u v # dt L
fxch st4        ; # t u v S dt L
fstp st0        ; t u v S dt L
jc .slice       ; stop if sum over L

fstp st0
fldpi
fmulp
fld1
fdivrp st1,st0  ; <-- ST0 is lost traveler

fldcw word[rsp]
int3

..dt dq     1e-12
..L  dq   10000.0
..a  dq 6378136.6 ; major (equatorial) and
..b  dq 6356751.9 ; minor (polar) radii of approximate Earth oblique spheroid    ```

_________________