without changing the mapping rule - to make the function both injective and surjective?
(Restricting the domain and codomain means replacing it with a subset). The restricted domain
and codomains should be the largest you can think of.
To give an example, the function f: [-3..3]-> [-9..9] given by f(x) = x^2 is neither injective nor
surjective, but we can restrict the domain and codomain to f:[0..3] -> {0, 1, 4, 9} with the same
mapping rule, that is f = x^2, which is both injective and surjective. The codomain is as large as
possible because adding every other number in [-9..9] that is not a square would break
subjectivity and the domain is as large as possible because adding any negative number breaks
injectivity./nh : 2[1..n] → → [0..2n] given by h(S) = |S| where n ≥ 2.
Fig: 1
Fig: 2