Show that f:N→N, given by $f(x)=\begin{aligned}
& x+1, \text { if } x \text { is odd },
& x-1, \text { if } x \text { is even }
\end{aligned}$ is both one-one and onto.
The image of 1 and -1 under f is 1 .
Fig 1.4 Solution Suppose f(x1)=f(x2). Note that if x1 is odd and x2 is even, then we will have x1+1=x2−1, i.e., x2−x1=2 which is impossible. Similarly, the possibility of x1 being even and x2 being odd can also be ruled out, using the similar argument. Therefore, both x1 and x2 must be either odd or even. Suppose both x1 and x2 are odd. Then f(x1)=f(x2)⇒x1+1=x2+1⇒x1=x2. Similarly, if both x1 and x2 are even, then also f(x1)=f(x2)⇒x1−1=x2−1⇒x1=x2. Thus, f is one-one. Also, any odd number 2r+1 in the co-domain N is the image of 2r+2 in the domain N and any even number 2r in the co-domain N is the image of 2r−1 in the domain N. Thus, f is onto.
\\
Get the complete, step-by-step math solution for: "Show that f: {N} → {N}, given by f(x)= & x+1, { if } x { is odd }, & x-1, { if } x { is even } is both one-one and onto. The image of 1 and -1 under f...". Powered by SolveForX AI math tutor.
Step-by-Step Solution
Step 1: Prove f is one-one (Case 1: x1 odd, x2 even)
To prove that the function
f
is one-one, we assume
f(x1)=f(x2)
and show that
x1=x2
. We consider different cases for
x1
and
x2
. First, let's assume
x1
is odd and
x2
is even. In this case,
f(x1)=x1+1
and
f(x2)=x2−1
. Setting them equal gives
x1+1=x2−1
, which simplifies to
x2−x1=2
.
Step 2: Prove f is one-one (Case 2: x1 even, x2 odd)
Next, let's consider the case where
x1
is even and
x2
is odd. Here,
f(x1)=x1−1
and
f(x2)=x2+1
. Setting them equal gives
x1−1=x2+1
, which simplifies to
x1−x2=2
. This is also impossible because if
x1
is even and
x2
is odd, then
x1−x2
must be an odd number, not an even number like 2.
Step 3: Prove f is one-one (Case 3: x1, x2 both odd or both even)
Since the previous two cases are impossible,
x1
and
x2
must either both be odd or both be even. If both
x1
and
x2
are odd, then
f(x1)=x1+1
and
f(x2)=x2+1
. Setting
f(x1)=f(x2)
implies
x1+1=x2+1
, which simplifies to
x1=x2
. Similarly, if both
x1
and
x2
are even, then
f(x1)=x1−1
and
f(x2)=x2−1
. Setting
f(x1)=f(x2)
implies
x1−1=x2−1
, which simplifies to
x1=x2
. In all valid cases,
x1=x2
, so
f
is one-one.
Step 4: Prove f is onto (Case 1: y is odd)
To prove that the function
f
is onto, we need to show that for every element
y
in the codomain
N
, there exists an element
x
in the domain
N
such that
f(x)=y
. Let
y
be an odd number in the codomain, so
y=2r+1
for some integer
r≥0
. If
y=1
, then
r=0
, so
y=2(0)+1=1
. We need to find an
x
such that
f(x)=y
. Consider
x=2r+2
. Since
r≥0
,
x=2r+2
is an even natural number (e.g., if
r=0
,
x=2
; if
r=1
,
x=4
). Since
x
is even,
f(x)=x−1=(2r+2)−1=2r+1=y
. Thus, every odd number in the codomain has a pre-image.
Step 5: Prove f is onto (Case 2: y is even)
Now, let
y
be an even number in the codomain, so
y=2r
for some integer
r≥1
(since
y∈N
,
y
must be at least 2). We need to find an
x
such that
f(x)=y
. Consider
x=2r−1
. Since
r≥1
,
x=2r−1
is an odd natural number (e.g., if
r=1
,
x=1
; if
r=2
,
x=3
). Since
x
is odd,
f(x)=x+1=(2r−1)+1=2r=y
. Thus, every even number in the codomain also has a pre-image. Since every element in the codomain has a pre-image,
f
is onto.