Function with discrete domain and range, does order matter?

383 Views Asked by At

Say I have the function $$ f:\{0,1\} \rightarrow\{0,1\} $$ Q1: Does the order of the elements in the domain och the range matter?

I.e. does this notation mean we only have $f(0)=0$ and $f(1)=1$?

Or could we have $f(1)=0$ and $f(0)=1$?

Q2: And what about a more general case, $$ g:\{0,1, 2, \dots, n\} \rightarrow \{0,1, 2, \dots, n\} $$ Does this mean we only have $g(0)=0$, $g(1)=1$, $g(n)=n$ etc.?

Or can we for instance have $g(1)=n$, $g(0)=n-1$, $g(10)=5$ and so on?