Talk:Pairing function

message: Changed the author's name in reference to comply with Mathworld's citation scheme.
(plus it's the correct author name, now)  —Preceding unsigned comment added by 24.37.252.19 (talk) 14:15, 9 August 2008 (UTC)
replies: text: Thanks. JRSpriggs (talk) 06:35, 10 August 2008 (UTC)
thread_title: minor edit

message: There are other ways to make a pairing function too, such as INTERCAL's bit interleave operator (extended so it is not limited to sixteen or thirty-two bits); this was my first idea when I thought about pairing functions, actually. (It also seems that this can then be used not only for natural numbers but for p-adic numbers too.) There may be more possiblities? What would they be, if it is? --Zzo38 (talk) 06:34, 10 August 2012 (UTC)
replies: text: Certainly, there are an infinite number of distinct pairing functions. So I will not try to list them. This one is perhaps the simplest one mathematically (at least of those which do not give undue weight to one of the two inputs) which is why we use it here. JRSpriggs (talk) 07:07, 10 August 2012 (UTC)
thread_title:  Alternate methods 

message: I'm not sure that the section on inverting the pairing function is entirely correct. The section proves that given a z \in \mathbb{N} there exist x, y \in \mathbb{N} such that \pi(x, y) = z and thus that \pi is onto. We still need to prove that \pi is one-to-one before we can conclude that \pi has an inverse. — Preceding unsigned comment added by 24.212.164.204 (talk • contribs)  16:53, 23 June 2015‎ (UTC)
:Frankly, to a mathematician, it is obvious from the formula and the diagram that π is one-to-one and onto.
:And as the section on the inversion ends by saying, "Since the Cantor pairing function is invertible, it must be one-to-one and onto." which is the converse of the theorem to which you are appealing (and also a theorem).
:Any z is bracketed between two successive triangle numbers, so the lower of those two (t) is unique. Thus y=z-t is unique. And t 's triangle root (w) is unique. Thus x=w-y is unique. So π is one-to-one. OK? JRSpriggs (talk) 07:38, 24 June 2015 (UTC)
replies: text:  It really looks to me that this whole section just shows that if π is invertible, then this function we get here will be the inverse of π, because it seems to assume that the x and y can be found even though that is what it should prove. The bijectivity of the pairing function might be “obvious” from the formula to someone who has been staring primitive recursive functions for years, but most Wikipedia users have not been (and at least it should be said that the proof is based on the assumtion). (I admit that the diagram is pretty believable but diagrams are never mathematical proofs.) I just spent quite some time myself thinking this through and concluded that you first need to know that the function is one-to-one and onto because proving the inverse function to actually be the inverse function is something that is nowhere near trivial. Stupid Hedgehog (talk) 11:06, 9 April 2017 (UTC)
thread_title:  Is it really invertible? 

message: Given a number, is there a way to check whether that number has been encoded using Cantor Pairing function or not?  — Preceding unsigned comment added by 1.186.134.44 (talk) 11:13, 13 July 2015 (UTC)
replies: text: No. A natural number is just a natural number. How you interpret it must be determined from the context, not from the number itself. JRSpriggs (talk) 21:06, 13 July 2015 (UTC)
replies: text: Wrong: As the pairing function is surjective, each natural number is in the range of the pairing function. I.e. the "check" answers "yes" for each number. Jack Rusell (talk) 20:32, 19 April 2024 (UTC)
thread_title:  Encoded or not? 

message: A numerical example of coding and decoding would be helpful.--Billymac00 (talk) 23:58, 6 September 2015 (UTC)
replies: text: I added a new section, Pairing function#Examples, in which I calculated π forwards for one case and backwards for another case. JRSpriggs (talk) 02:17, 7 September 2015 (UTC)
replies: text: Why not backward for the same case to empirically show invertibility? paolor (talk) 22:00, 3 March 2021 (UTC)
replies: text: Reversing the calculations is trivial and would add nothing. To show invertibility, we need to see that it is not necessary to know ahead of time what the forward calculation is, when doing the backward calculation. And that is what I showed. JRSpriggs (talk) 02:25, 4 March 2021 (UTC)
thread_title:  Suggestion 

message: Szudzik's pairing function already appeared in a 1965 paper . This idea goes back to Godel according to Nagashima's paper. Sillycrown (talk) 05:44, 6 September 2022 (UTC)
thread_title:  Origin of the Elegant pairing function