# $T_p$ is a group of permutations defined $t(x)=ax+b$ for some $a,b,x \in \mathbb{Z}_p$ where $a \neq 0$

$T_p$ is a group of permutations defined $t(x)=ax+b$ for some $a,b,x \in \mathbb{Z}_p$ where $a \neq 0$

and $p =$ prime.

a) Show that $T_p$ is a group with order $p(p-1)$.

b) Also prove that given any two ordered pairs $(x_1,y_1)$ and $(x_2,y_2)$ of distinct elements of $\mathbb{Z}_p$, there is a unique permutation $t$ in $T_p$ such that $t(x_1)=x_2$ and $t(y_1)=y_2$.

I've done part a but I put it in there just in case it will help with solving the second part, which I am stuck on.

So for part b, where do I start? I'm stuck but I figured that if $t$ is the same function in both expressions, this must mean that $x_1$ is in the same orbit as $y_1$, and $x_2$ must be in the orbit of $y_2$, right? But where do I go from there?

HINT: The problem's notation with the x's and y's is a little misleading on this score, but essentially this is the same as showing two distinct points define a unique line in $\mathbb R^2$.
SOLUTION: Suppose we have $(x_1,y_1)$ and $(x_2,y_2)$ for $x_1\neq y_1,x_2\neq y_2\in \mathbb Z_p$. We will simultaneously prove existence and uniqueness of such a map by assuming it to exist and determining its precise form from the points.
If such a map exists, then $t(x)=ax+b$ for some $a\neq 0$ and $b$. Then $x_2=ax_1+b$ and $y_2=ay_1+b$. First note that we must have $x_2-ax_1=b=y_2-ay_1$, so $b$ is determined by $a$ and the points. Rearranging this equation, we see that $y_2-x_2=a(y_1-x_1)$. Since $y_2\neq x_2$ and $y_1\neq x_1$, $y_2-x_2\neq 0$ and $y_1-x_1\neq 0$. In particular, we see that $$a=\frac{y_2-x_2}{y_1-x_1}\neq 0$$ and thus $$b=x_2-x_1\frac{y_2-x_2}{y_1-x_1}=\frac{x_2y_1-x_1y_2}{y_1-x_1}.$$
Therefore, $t(x)=\frac{y_2-x_2}{y_1-x_1}x+\frac{x_2y_1-x_1y_2}{y_1-x_1}$ is the desired map, and moreover we see that the values of $a$ and $b$ were completely determined by the points $(x_1,y_1)$ and $(x_2,y_2)$.