If f:W→W is defined as f(x)=x-1 if x is odd and f(x)=x+1 if x is even. Show that f is invertible. find the inverse of f, where W is a set of whole numbers.
Open in App
Solution
It is given that
P:w→w is defined as
⇒f(x)=x−1 if x is odd
=x+1 if x is even
For one - one
Let f(x)=f(y)
It can be observed that if x is odd and y is even then we have
⇒x−1=y+1
⇒x−y=2
This is impossible
Similarly the possibility of x being even and y being odd can also be ignored under similar argument.
So both x and y must be either odd or even.
If both are odd then ,
⇒f(x)=f(y)
⇒x−1=y−1
⇒x=y
If x and y both even then
⇒f(x)=f(y)
⇒x+1=y+1
⇒x=y
so f is one one
For on to ;
It is clear that any odd number 2r+1 in c0-domain N is the image of 2r in domain N and any even number 2r in co-domain N is the image of 2r+1 in domain N.
∴f is on to
Hence f is invertible
Let us define g:w→w as
⇒g(x)=x+1 if x is even
=x−1 if x is odd
Now when n is odd
⇒g of (n)=g(f(n))=g(n−1)=n−1+1=n
when n is even g of (n)=g(n+1)=n+1−1=n
similarly,
when m is odd
⇒f0g(m)=f(g(m))=f(m−1)=m−1+1=m
and when m is even
⇒f0g(m)=f(g(m))=f(m+1)=m+1−1=m
∴g0f=Iw and f0g=Iw
Thus f is invertible and the inverse of f is given by f−1=g which is same as f. Hence the inverse of f is f itself.