Inverse of the function $f(x) = 3x+2 \pmod 5$

218 Views Asked by At

I'm trying to do one of my Maths past papers and I am stuck on this question:

Let $f:\mathbb{Z}_5 \rightarrow \mathbb{Z}_5$, where $f(x) = 3x+2 \pmod 5$. Find $f^{-1}(2)$ and a formula for $f^{-1}(x)$. Note that $2\times 3 = 1 \pmod 5$.

I've found that $f^{-1}(2) = 0$ but I can't find the equation for the inverse of $f(x)$ and I don't know how their clue of "Note that $2\times 3 = 1 \pmod 5$" is relevant. Please help! Thanks in advance.

2

There are 2 best solutions below

0
On BEST ANSWER

Well, let $y = f(x) \in \mathbb{Z}_5$ for some $x$, then

$$ y \equiv 3x+2 \pmod 5 $$

Subtracting two from each side, we get

$$ y - 2 \equiv 3x \pmod 5 $$

Now, multiplying by 2 to each side (this is when we use the suggestion),

$$ 2y - 4 \equiv x \pmod 5 $$

So $f^{-1}(y) \equiv 2y - 4 \pmod 5$.

0
On

$x=f^{-1}(2)\iff f(x)\equiv 2\pmod{5}\iff 3x+2\equiv 2\pmod{5}\iff 3x\equiv 0\pmod 5$

Now let's multiply by $2$

[ we do not loose equivalence when multiplying an equation by a number relatively prime with the modulo ]

$\iff\require{cancel}6x\equiv 0\pmod 5\iff (\cancel{5}+1)x\equiv 0\pmod 5\iff x\equiv 0\pmod 5$

Since we limit ourselves to the values in $\mathbb Z/5\mathbb Z$ then $f^{-1}(2)=0$


If we do this with $x$ instead of $2$, this is very similar

$y=f^{-1}(x)\iff f(y)\equiv x\pmod{5}\iff 3y+2\equiv x\pmod{5}$

Now let's multiply by $2$

$6y+4\equiv 2x\pmod 5\iff y\equiv 2x-4\equiv 2x+1\pmod 5$

So there are two possibilities to write the result in $\mathbb Z/5\mathbb Z$

either $f^{-1}(x)=2x+1\pmod 5$

either $f^{-1}(x):\begin{cases}2x+1 & x\in\{0,1\}\\2x-4 & x\in\{2,3,4\}\end{cases}$