Question:
Let's have $a$ and $b$ denote two arbitrary objects where $a \neq b$.
Define a bijection $f : \mathbb N \times \{a , b\} \to \mathbb N$. The inputs to this function will be elements of $\mathbb N \times \{a,b\}$, so you can define your function by writing:
$f=f(n,x)$
where $n \in \mathbb N $ and $x \in \{a,b\}$
Hint: In defining this function, you cannot assume $a$ or $b$ are numbers, since they are arbitrary values out of your control. See if you can find a way to define this function that doesn't treat a and b algebraically. You may find it helpful to use piecewise functions.
My solution:
I'm not really sure if the solution I came up with is right. I was wondering if someone can check it. $$ f(n,x) = \begin{cases} (n,a) & \text{if } x = a \\ (n,b) & \text{if } x = b \\ \end{cases} $$ Before this part of the question, in the previous part, I was asked to do this:
Draw a picture showing a way to pair off the elements of $\mathbb N \times \{a,b\}$ with the elements of $\mathbb N$ so that no elements of either set are uncovered or paired with multiple elements.
My answer for this question depended on how i drew the picture.
Rough Picture:
$0 \to ${a,b}
$1 \to ${a,b}
$2 \to ${a,b}
$3 \to ${a,b}
....
$N \to ${a,b}
Having decphered that quaint computer talk
it appears the function you quest is
f(n,a) = 2n
f(n,b) = 2n + 1