Wikipedia:Reference desk/Archives/Mathematics/2022 November 10

Mathematics desk
< November 9 << Oct | November | Dec >> November 11 >
Welcome to the Wikipedia Mathematics Reference Desk Archives
The page you are currently viewing is a transcluded archive page. While you can leave answers for any questions shown below, please ask new questions on one of the current reference desk pages.


November 10

edit

Locality-preserving functions

edit

Having a problem with locality-preserving functions. In particular, a locality-preserving hash function   (where   is a metric space) is a hash function satisfying  , and more generally, we can say that a locality-preserving function   for metric spaces   is a function satisfying  .

It can be seen that any such function must be injective. If   but  , then for any   with   (for example,   or   itself), we must have either   or  , but  , which is contradictory.

The area I'm having trouble with is that I have no idea if locality-preserving functions have to be continuous. I'm pretty sure I have it narrowed down to one problem which I am completely stuck on: if   is a locality-preserving function, is it possible for there to be some point   such that   is an accumulation point but   is an isolated point? Similar problem in establishing whether   is an open mapping, where the problem becomes whether it is possible for   to be an isolated point while   is an accumulation point.

As a quick aside, I'm fairly sure that if   (resp.  ) is compact, then the answer is no for continuity (resp. open mapping) GalacticShoe (talk) 04:22, 10 November 2022 (UTC)[reply]

Neither one needs to hold. For instance, let  ,   under the supremum norm, and  ,   (where   is the sequence with 1 in the  -th position and 0 elsewhere).   is a locality-preserving function and 0 is an accumulation point of  , but   is an isolated point of  . The inverse of   is also a locality-preserving function from   back to  . (Wrong, see below for a correct example.) BentSm (talk) 05:58, 10 November 2022 (UTC)[reply]
Writing   is the codomain   in this proposed counterexample one of scalar values?  --Lambiam 10:27, 10 November 2022 (UTC)[reply]
No. (I was basing my answer from his (extended) definition of a locality-preserving function.) BentSm (talk) 01:08, 11 November 2022 (UTC)[reply]
Hey BentSM, thanks for the response! Just wanted to clarify a point of confusion; is the distance under the supremum norm defined as  , and if so, would   not render   non-locality preserving? Thanks again! GalacticShoe (talk) 18:07, 11 November 2022 (UTC)[reply]
You're quite right. This does work, though:
 ,   under the   norm, and  ,  . If  ,   ( , of course). BentSm (talk) 00:32, 12 November 2022 (UTC)[reply]
Suppose we want to hash (one-dimensional) real values into integer-valued buckets. So the desired hash function has signature   A prime candidate is the rounding function defined by
 
If any function from the reals to the integers is a locality-preserving hash, this should be one. But (under the usual metric in which   ) we have
 
whereas
 
This suggest strongly that the given definition is off. Perhaps it should be the other way around: values mapped to the same bucket should be close. That would explain the suggested relation to space-filling curves: themselves being continuous, they are surjective and so have a (not unique) inverse. Such an inverse can be viewed as a hash, and pairs of points whose hashes are close are themselves close. Naively reversing the implication does not work, however:
 
whereas
 
So we may want a condition in the shape of
 
 --Lambiam 12:11, 10 November 2022 (UTC)[reply]
I do agree that the definition is rather unusual. It is certainly is not that of the two references listed in the corresponding section of the Wikipedia article referenced. I tried doing some searching, which turned up more references to "locality-preserving" than direct definitions; see, e.g., [1], [2], [3], [4]. For what it's worth, none of what I found matched up with the definition given in the article (except for one site that cites Wikipedia). BentSm (talk) 03:38, 11 November 2022 (UTC)[reply]
For example, the Hilbert curve satisfies this "inverse continuity" condition if we put   where I think we can take    --Lambiam 16:11, 10 November 2022 (UTC)[reply]

Slopes and angles

edit

If a line had a slope of S (assuming the line goes through the origin and S cannot be negative), how can I use that to find out the angle that the line makes with the X or Y-axis? Primal Groudon (talk) 14:18, 10 November 2022 (UTC)[reply]

By consulting our article Slope: it gives the relation between the slope of a line and its angle of inclination. It is not relevant whether the line goes through the origin, and the relation is valid regardless of the sign of the slope.  --Lambiam 16:35, 10 November 2022 (UTC)[reply]
  • The angle of the line to the X axis will be the arctan of the slope. That's because t the line will always be the hypotenuse of a right triangle where the X axis is one leg and a line parallel to the Y axis is the other leg. Since tangent Θ = Y/X = slope, to find the angle Θ you take the inverse tangent (arctan) of the slope. --2600:1004:B024:84EE:F02:CC26:4A9A:E65 (talk) 21:54, 10 November 2022 (UTC)[reply]
There's two angles corresponding to a slope differing by 180°. Very often you'll want the one between -90° and +90°. I'm not sure why you specified that the slope is not negative, that doesn't matter much. If anything the slope that is a bit peculiar is the vertical slope going straight up and down where the ratio is infinity. NadVolum (talk) 01:19, 11 November 2022 (UTC)[reply]