To prove that the function f: NN defined as N→N defined as f(n) = [n+1, nis odd n-1, nis even] is an inverse of itself, we need to show that applying the function twice, in either order, returns the original input.

Let’s consider two cases:

  1. n is odd:

If n is odd, then f(n) = n+1. If we apply f again to this result, we get f(f(n)) = f(n+1) = (n+1)+1 = n+2. This is not equal to n, so f is not an inverse of itself in this case.

  1. n is even:

If n is even, then f(n) = n-1. If we apply f again to this result, we get f(f(n)) = f(n-1) = (n-1)+1 = n. This is equal to the original input n, so f is an inverse of itself in this case.

Since f is not an inverse of itself for all odd integers, but is an inverse of itself for all even integers, we can conclude that f is not an inverse of itself for all integers. Therefore, the given function f: NN defined as N→N defined as f(n) = [n+1, nis odd n-1, nis even] is not an inverse of itself.

JOIN OUR NEWSLETTER
And get notified everytime we publish a new blog post.