Difference between revisions of "Talk:2021-04-23 53 9"

From Geohashing
Line 41: Line 41:
  
 
:: ― [[User:Kripakko|Kripakko]] ([[User talk:Kripakko|talk]]) 12:35, 25 April 2021 (UTC)
 
:: ― [[User:Kripakko|Kripakko]] ([[User talk:Kripakko|talk]]) 12:35, 25 April 2021 (UTC)
 +
 +
:::Yeah I know, but the difference is so small that I didn't bother, that's why I said approximately. Also, I don't think it needs to be exactly once in this instance, at least once would suffice, but that depends on what exactly you want to calculate.
 +
:::Wouldn't, for a given distance, the axes of the ellipse (in degrees) be different in the northern and southern parts of the graticule, since its northern boundary is shorter than its southern one (consider, for example, a graticule adjacent to the north pole)? So a hash would have a bigger probability per area in the northern part of the graticule, and therefore such an event should be more likely there. I don't see how that's represented in your calculations, since with defining ''w<sub>grat</sub>''&nbsp;=&nbsp;65922&nbsp;m it seems to me you assumed a rectangular graticule. The hashes are uniform in grid space, but 384 m is a distance in cartesian coordinates. That's why my result, using your graticule dimensions, is exactly the same as yours: π*384²/(111195*65922) = 6.3197e-5, using a circle instead of an ellipsis – it's the same calculation. From that point of view, I don't see the advantage of using ellipses. But there might be a flaw in my reasoning.
 +
:::If, say, graticules were redefined as being between .5 in the latitudes (e.g. 53.5° to 54.5°), your calculated probability wouldn't change, but the actual probability would, I think, because the circle in coordinate space now takes up a different fraction of the graticule area in grid space. I haven't thought hard enough about this.
 +
:::Of course, all these calculations disregard that because the Earth is curved, a graticule isn't trapezoidal either, and you'd probably at least have to use solid angles. And then there's the Earth spheroid …
 +
:::Anyhow, I love calculating there kinds of things. Btw, have you heard about the Geohashing [[Discord]]? --[[User:Π π π|π π π]] ([[User talk:Π π π|talk]]) 20:13, 25 April 2021 (UTC)

Revision as of 20:15, 25 April 2021

I am sure you can calculate the probability yourself, but anyway here is my approximation:

Consider a circle of radius r at latitude θ and longitude ϕ. In the latitude/longitude coordinate space, if the circle is small (r ≪ graticule dimensions), it will look like an ellipse with semi-major axis ϕr and semi-minor axis θr. The semi-major axis will always be longitudinal due to the non-square shapes of the graticules. The lengths of the axes are:

ϕr = 1° × r / wgrat,
θr = 1° × r / hgrat,

where wgrat and hgrat are the width and the height of the graticule respectively at the centre point of the ellipse. Assuming that the Earth is a sphere with radius R = 6371000 m and taking θ = 53.6401767° from 2021-04-10_53_9, the dimensions of the graticule are approximately

hgrat = π R / 180 = 111195 m,
wgrat = hgrat cos θ = 65922 m.

Now, if r = 384 m, we get the axes of the ellipse:

ϕr = 0.00583°,
θr = 0.00345°.

The probability P1 that a random hashpoint hits this ellipse is simply the area of the ellipse divided by the area of the graticule:

P1 = (π ϕr θr) / (1° × 1°) = 6.32 × 10−5 = 1 / 15800.

Finally, the probability P2 that a hashpoint hits the ellipse at least once in 13 days is

P2 = 1 − (1 − P1)13 = 8.21 × 10−4 = 1 / 1220.

An event of this probability will happen on average about once in 3.33 years or three years and four months.

Kripakko (talk) 13:21, 24 April 2021 (UTC)

Wow, thanks for your calculations! I just used the area of my graticule, which I once calculated as 7299 km² (for spherical Earth), and then worked with ratios, but you actually put in the work with the ellipsis, and I suppose yours is more accurate, though we both disregarded that graticules are actually not rectangular. Anyway, I get (approximately) once in 7299/(0.384²*π*13) days = 3.32 years on average (3.33 with your calculated graticule area).
However, I don't visit every hash, so the probability of it happening for one of the geohashes I've been to this far (and could visit again) is only 1-(1-0.384²*π*13/7299)^76 = 6.1%. That's actually more than I expected! So for equal odds of it happening I'd have to do log(base 1-0.384²*π*13/7299)(0.5) = 840 hashes, which at my current pace would take me about 2.87+(840-78)/37 = 23.5 years total! I don't actually know if my method of calculating these is valid, but it makes sense to me. I just made the formulas up on the spot, since I don't really have any stochastical education.
I love that you're nerdy enough to calculate these as well. I was quite sure you'd notice this as you were the only other geohasher apart from Fippe who went on an expedition on 2021-04-10. Can I put your calculations on the expedition page? I think they'll be more appreciated there. --Π π π (talk) 10:10, 25 April 2021 (UTC)
Sure, go ahead and put the calculations on the expedition page. I am no mathematician nor statistician either, but I do mostly know what I am doing.
I did actually consider the non-rectangular shapes of the graticules. This is why is used the latitude/longitude coordinate space, and also since in that space the hashpoints are uniformly distributed, I could reason to myself that the calculations were valid. Of course, due to the non-rectangular graticule shape, the ellipse is not exactly an ellipse, but it is a good approximation when the radius of the circle is small.
Then, to make the calculations even more accurate, one could use the WGS84 ellipsoid to calculate the dimensions of the graticule. This is a much more complicated task, but fortunately there are tools for that, for example GeoCalcing². Using it, I got hgrat = 111296 m and wgrat = 66139 m for 2021-04-10_53_9 and finally P2 = 8.18 × 10−4 = 1 / 1220. Not really a significant difference.
I cannot see anything wrong with your calculations, except for the "once in 7299/(0.384²*π*13) days = 3.32 years". You are not supposed to simply multiply the probability of an event when you calculate the probability of the event happening once in a number of times. If you do that with a large enough multiplier, you end up with a probability greater than one, which is obviously wrong. In this case, the probability and the multiplier are so small that the error is negligible, but it is incorrect in principle. You have got the right idea in the next expression with the 76th power though.
Kripakko (talk) 12:35, 25 April 2021 (UTC)
Yeah I know, but the difference is so small that I didn't bother, that's why I said approximately. Also, I don't think it needs to be exactly once in this instance, at least once would suffice, but that depends on what exactly you want to calculate.
Wouldn't, for a given distance, the axes of the ellipse (in degrees) be different in the northern and southern parts of the graticule, since its northern boundary is shorter than its southern one (consider, for example, a graticule adjacent to the north pole)? So a hash would have a bigger probability per area in the northern part of the graticule, and therefore such an event should be more likely there. I don't see how that's represented in your calculations, since with defining wgrat = 65922 m it seems to me you assumed a rectangular graticule. The hashes are uniform in grid space, but 384 m is a distance in cartesian coordinates. That's why my result, using your graticule dimensions, is exactly the same as yours: π*384²/(111195*65922) = 6.3197e-5, using a circle instead of an ellipsis – it's the same calculation. From that point of view, I don't see the advantage of using ellipses. But there might be a flaw in my reasoning.
If, say, graticules were redefined as being between .5 in the latitudes (e.g. 53.5° to 54.5°), your calculated probability wouldn't change, but the actual probability would, I think, because the circle in coordinate space now takes up a different fraction of the graticule area in grid space. I haven't thought hard enough about this.
Of course, all these calculations disregard that because the Earth is curved, a graticule isn't trapezoidal either, and you'd probably at least have to use solid angles. And then there's the Earth spheroid …
Anyhow, I love calculating there kinds of things. Btw, have you heard about the Geohashing Discord? --π π π (talk) 20:13, 25 April 2021 (UTC)