For
$$f : \mathbb{Z} \times \mathbb{Z} \to \mathbb{Z}$$
$$f(m,n) = 3m + 2n -1$$
I think it's injective, but don't know how to prove it. I've been trying numbers for m and n.
For
$$f : \mathbb{Z} \times \mathbb{Z} \to \mathbb{Z}$$
$$f(m,n) = 3m + 2n -1$$
I think it's injective, but don't know how to prove it. I've been trying numbers for m and n.
This function is not injective. But it is surjective.
It is not injective, since $f(1,-1)=3-2-1=0$ and $f(-1,2)=-3+4-1=0$ $f$ is surjective:
Consider $f(0,n)=2n-1$ this gives us every odd integer immediatly. Now consider $f(1,n)=3+2n-1=2n+2=2(n+1)$ which gives us every even integer.
It's surjective, but not injective. Take $(m_1, n_1)=(2, 0)$ and $(m_1, n_1)=(0, 3)$ and check yourself that $f$ yields te same output for both different inputs. For surjectivity, choose for chosen $z \in Z$, $(m, n)=((z+1)/3, 0)$ if $z+1=3k$, for a $k \in \mathbb{Z}$, choose $(m, n)=((z+1)/3, 1)$ if $z+1=3k-2$, for a $k \in \mathbb{Z}$, and chose $(m, n)=(0, (z+1)/2)$ if $z+1=2k$, for a $k \in \mathbb{Z}$.