Proving the range of a piecewise function

Join the discussion
Ask a follow-up here, or get your own question answered by working scientists, mathematicians and engineers — people, not an autocomplete.
Real named experts · corrections over time · the nuance an AI answer skips
3 replies · 2K views
ver_mathstats
Messages
258
Reaction score
21

Homework Statement


Allow f:ℤ→ℤ be defined by, for all n∈ℤ

f(n) = {n-1 if n is even, n+5 if n is odd

Prove that ran(f) = ℤ

Homework Equations

The Attempt at a Solution


I am unsure of how exactly to prove this due to the fact now I am working with a piecewise function.
Here is what I have so far:
We must demonstrate that ran(f) ⊆ ℤ and that ℤ ⊆ ran(f).
I know that when n is odd, f(n) is even and that when n is even, f(n) is odd. And now I know I must show that a certain integer is in the range. And I know that if m is odd, m + 1 will be even and that when m is even, m - 5 will be odd, now I do not know where to go from here.
Thank you.
 
Last edited:
on Phys.org
ver_mathstats said:

Homework Statement


Allow f:ℤ→ℤ be defined by, for all n∈ℤ

f(n) = {n-1 if n is even, n+5 if n is odd

Prove that ran(f) = 2
I don't see how this can be true at all. If you plot a graph of this function, you get two sets of points, one along the line y = x - 1, and the other along the line y = x + 5.
ver_mathstats said:

Homework Equations

The Attempt at a Solution


I am unsure of how exactly to prove this due to the fact now I am working with a piecewise function.
Here is what I have so far:
We must demonstrate that ran(f) ⊆ 2 and that 2 ⊆ ran(f).
Firstly, do I have to split this into cases? I think I must, is this right?
I started working with n-1, if n is even and I got let y ∈ ran(f). By definition of range we can fix x ∈ ℝ such that y = n-1, however since n must be even must we define what even is and substitute it into n? Resulting in y=2k-1. I am unsure of where to go from here if this is correct so far.

Thank you.
 
Mark44 said:
I don't see how this can be true at all. If you plot a graph of this function, you get two sets of points, one along the line y = x - 1, and the other along the line y = x + 5.
There was typo, but it was clarified it was supposed to be ran(f) = ℤ. My apologies, I will fix it right now.
 
ver_mathstats said:
There was typo, but it was clarified it was supposed to be ran(f) = ℤ. My apologies, I will fix it right now.
That makes a lot more sense. Do you see why every integer in ##\mathbb Z## is the image of some other number in this set?