Prove Piecewise Function is a Bijection
📺 Video Explanation
📝 Question
Let:
\[ f:\mathbb{N}\to\mathbb{N} \]
be defined by:
\[ f(n)= \begin{cases} n+1,& \text{if } n \text{ is odd}\\ n-1,& \text{if } n \text{ is even} \end{cases} \]
Show that \(f\) is bijective.
✅ Solution
🔹 Understand the Mapping
Function swaps consecutive numbers:
- \(1\to2\)
- \(2\to1\)
- \(3\to4\)
- \(4\to3\)
- \(5\to6\)
- \(6\to5\)
So numbers are paired.
🔹 Step 1: Prove One-One
Suppose:
\[ f(a)=f(b) \]
Since function only swaps adjacent pairs:
- each value has exactly one partner
So:
\[ a=b \]
✔ Hence, one-one.
🔹 Step 2: Prove Onto
Take any:
\[ m\in\mathbb{N} \]
Need \(n\) such that:
\[ f(n)=m \]
- If \(m\) is odd, choose \(n=m+1\) (even)
- If \(m\) is even, choose \(n=m-1\) (odd)
Then:
\[ f(n)=m \]
So every natural number has pre-image.
✔ Hence, onto.
🎯 Final Answer
\[ \boxed{f\text{ is bijective}} \]
🚀 Exam Shortcut
- Function swaps odd-even pairs
- Every number has unique partner
- Swap-type functions are bijections