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
Thread Post new topic Reply to topic
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 17278
Location: In your JS exploiting you and your system
revolution
Okay, for the north/south reading we are using the rotational north/south, not the magnetic north/south.
Post 28 May 2013, 11:21
View user's profile Send private message Visit poster's website Reply with quote
YONG



Joined: 16 Mar 2005
Posts: 8000
Location: 22° 15' N | 114° 10' E
YONG
Define "starting point" please.

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?! Rolling Eyes Wink
Post 28 May 2013, 12:13
View user's profile Send private message Visit poster's website Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 17278
Location: In your JS exploiting you and your system
revolution
YONG wrote:
Define "starting point" please.
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.
Post 28 May 2013, 12:25
View user's profile Send private message Visit poster's website Reply with quote
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.
Post 28 May 2013, 12:39
View user's profile Send private message Visit poster's website Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 17278
Location: In your JS exploiting you and your system
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.
Post 28 May 2013, 12:47
View user's profile Send private message Visit poster's website Reply with quote
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

http://wiki.answers.com/Q/Will_a_compass_work_at_the_south_pole

Am I right? Rolling Eyes Wink
Post 28 May 2013, 13:04
View user's profile Send private message Visit poster's website Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 17278
Location: In your JS exploiting you and your system
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

http://wiki.answers.com/Q/Will_a_compass_work_at_the_south_pole

Am I right? Rolling Eyes Wink
Yup. Well done. But you haven't answered the question.
Post 28 May 2013, 13:20
View user's profile Send private message Visit poster's website Reply with quote
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.
Post 28 May 2013, 15:34
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 17278
Location: In your JS exploiting you and your system
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.
Post 28 May 2013, 19:21
View user's profile Send private message Visit poster's website Reply with quote
bitRAKE



Joined: 21 Jul 2003
Posts: 2915
Location: [RSP+8*5]
bitRAKE
We call the solution "hole in the arc of revolution". Very Happy
Post 28 May 2013, 21:06
View user's profile Send private message Visit poster's website Reply with quote
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    



EDIT: corrected answer re-posted below Sad


Last edited by tthsqe on 31 May 2013, 15:42; edited 3 times in total
Post 28 May 2013, 21:45
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 17278
Location: In your JS exploiting you and your system
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.
Post 29 May 2013, 00:49
View user's profile Send private message Visit poster's website Reply with quote
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.

_________________
¯\(°_o)/¯ unlicense.org
Post 29 May 2013, 07:44
View user's profile Send private message Visit poster's website Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 17278
Location: In your JS exploiting you and your system
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.
Post 29 May 2013, 08:40
View user's profile Send private message Visit poster's website Reply with quote
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.) Very Happy

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?

_________________
¯\(°_o)/¯ unlicense.org
Post 29 May 2013, 09:57
View user's profile Send private message Visit poster's website Reply with quote
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)    
Post 29 May 2013, 10:56
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 17278
Location: In your JS exploiting you and your system
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?
Post 29 May 2013, 11:05
View user's profile Send private message Visit poster's website Reply with quote
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?
Post 31 May 2013, 00:27
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 17278
Location: In your JS exploiting you and your system
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. Razz
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.
Post 31 May 2013, 01:45
View user's profile Send private message Visit poster's website Reply with quote
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
    fadd st0,st0
    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    

_________________
¯\(°_o)/¯ unlicense.org
Post 31 May 2013, 09:14
View user's profile Send private message Visit poster's website Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  
Goto page Previous  1, 2, 3 ... 22, 23, 24, 25, 26  Next

< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Copyright © 1999-2020, Tomasz Grysztar.

Powered by rwasa.