I have to find an injection from $f:\mathbb{N} \times \mathbb{N} \to \mathbb{N}$
THX
I have to find an injection from $f:\mathbb{N} \times \mathbb{N} \to \mathbb{N}$
THX
You have to find a function that has as input a couple of natural numbers (n,m) and as an output just one natural number. By injectivity, to different couples (and (n,m) ≠ (m,n)) there must correspond different natural numbers.
To figure it out, think of a way to uniquely decompose a natural number. How would you decompose 5? And 10? And 7? And 14? (not random numbers, try to think out the structure)
I'm giving you just hints because I think it's more useful for you to think it by yourself, once they tell you what's the trick it looks quite silly
You need to find an injective function which takes in an element of $\mathbb N\times\mathbb N$, that is, a tuple $(m,n)$ with $m$ and $n$ natural numbers, and which returns a natural number. Here is an example of a function from $\mathbb N\times\mathbb N$ to $\mathbb N$, although it is not injective (why?): $$ f(m,n) = m + n. $$ This is a difficult question because we intuitively think of $\mathbb N\times\mathbb N$ as being "larger" than $\mathbb N$. The point of this question is to show that, contrary to our intuition, $\mathbb N\times\mathbb N$ is no bigger than $\mathbb N$. (Whenever there is an injection from one set to another set, the cardinality [i.e. size] of the first set is less than or equal to the cardinality of the second set.)
As a warm-up exercise, think of injective functions from $\mathbb N$ to $\mathbb N\times \mathbb N$. If you can't, let me know, and we'll talk about it. As for the injection from $\mathbb N\times\mathbb N$ to $\mathbb N$, I have one hint, which I can elaborate on if you first give it some serious thought: "prime factorization".
To find this function you should think of "counting" every element of $\mathbb{N}\times\mathbb{N}$. This way you assign to each element of $\mathbb{N}\times\mathbb{N}$ a natural number and it will of course be an injection.
Think about the squares on a chess board. You can refer to each one by a pair of numbers, row and column or you can number them linearly from 1 to 64. So, there is an injective function function from (row, column) to square number.