# Let $A=\{\text{-1,0,1,2}\}$ and $B=\{\text{-4,-2,0,2}\} and$f,g: A $\rightarrow B$ be functions defined by $f(x)=x^2-x, \;x \in A$ and $g(x)=2 |x- \frac {1} {2} | -1,\; x \in A$. Are $f$ and $g$ equal?

Justify your answer. [Hint: One may note that two functions $$f : A \to B$$ and $$g : A \to B$$ such that $$f(a) = g(a) \forall \;a \in A,$$ are called equal functions.]

Toolbox:
• If $f(a)=g(a)$ for all $a \in A$ then $f$ and $g$ are equal
Given $A=\{-1,0,1,2\}, B=\{-4,-2,0,2\}$, $f(x)=x^2-x, \; x\in A$ and $g(x)=2|x-\frac{1}{2}|-1, \; x \in A$
We can substitute the values of $x$ from $A$ and verify if $f=g$.
$\textbf{Check x = -1}$:
$f(-1)=(-1)^2-(-1)=2$
$g(-1)=2|x-\frac{1}{2}-1=2(\frac{3}{2})-1=2$
=>$f(-1)=g(-1)$
$\textbf{Check x = 0}$:
$f(0)=0^2-0=0$
$g(0)=2|0-\frac{1}{2}|-1=2 \frac{1}{2}-1=0$
$f(0)=g(0)$
$\textbf{Check x = 1}$:
$f(1)=1^2-1=0$
$g(1)=2|1-\frac{1}{2}|-1=1-1=0$
$f(1)=g(1)$
$\textbf{Check x = 2}$:
$f(2)=2^2-2=4-2=2$
$g(2)=2|2-\frac{1}{2}-1=2 \frac{3}{2}-1=2$
$f(2)=g(2)$
Since $f(a)=g(a) \forall a\in A$, $f$ and $g$ are equal.
edited Mar 20, 2013