206k views
3 votes
Problem 1. Give an example of a function f:Z→N which is onto but not one-to-one (and prove that f has these desired properties).

User TWilly
by
7.7k points

1 Answer

2 votes

Main Answer:

To provide an example of a function
\(f: \mathbb{Z} \rightarrow \mathbb{N}\) that is onto but not one-to-one, consider the function
\(f(x) = |x|\).

Step-by-step explanation:

The function
\(f: \mathbb{Z} \rightarrow \mathbb{N}\) is defined as follows:


\[ f(x) = \begin{cases} x, &amp; \text{if } x \geq 0 \\-x, &amp; \text{if } x < 0 \end{cases}\]

Onto:

For any
\(y\) in the codomain
\(\mathbb{N}\), there exists at least one
\(x\) in the domain
\(\mathbb{Z}\) such that
\(f(x) = y\). For instance, for
\(y = 5\),
\(f(5) = 5\), and for
\(y = 3\), \(f(-3) = 3\), showing that
\(f\) is onto.

Not One-to-One:

The function is not one-to-one because multiple elements in the domain can map to the same element in the codomain. For example, both
\(f(2) = 2\) and
\(f(-2) = 2\), violating the one-to-one property.

Thus, the function
\(f(x) = |x|\) serves as an example of a function that is onto but not one-to-one from
\(\mathbb{Z}\) to
\(\mathbb{N}\).

User Cwharris
by
8.5k points