A relationship between $a$ and $b$ related to algorithm Rock(1)-Scissor(0)-Paper(2)

173 Views Asked by At

This is related to algorithm Rock(1)-Scissor(0)-Paper(2)

I need to find a relationship between $a$ and $b$ so that $$\begin{matrix} a & b \\ 1 & 0\\ 0 & 2\\ 2 & 1 \end{matrix}$$ is always true and $$\begin{matrix} a & b \\ 1 & 2\\ 0 & 1\\ 2 & 0 \end{matrix}$$ is always false. I had read a book about this involving to binary and computer. I'm quite sure that we must do some analytics among $$\begin{matrix} 01 & 00 \\ 00 & 10 \end{matrix}$$ and $$\begin{matrix} 00 & 10 \\ 10 & 01 \end{matrix}$$ and $$\begin{matrix} 10 & 01 \\ 01 & 00 \end{matrix}$$ What should I do next ?? And I wanna know more about this knowledge, thanks a real lot !

Edit: another solution that is $$a- b+ 2\equiv 0\mod 3$$

2

There are 2 best solutions below

0
On BEST ANSWER

I want some new observations for this problem like system of modulo-equations

This answer shows three systems.

Let us define $f(a,b):=pa+qa^2+rb+sb^2$ where $p,q,r,s$ are integers. (This is because $x^3\equiv x\pmod 3$ always holds.)

We want $f(a,b)$ to satisfy $$f(1,0)\equiv f(0,2)\equiv f(2,1)\pmod 3,$$ i.e. $$p+q\equiv -r+s\equiv -p+q+r+s\pmod 3,$$ i.e. $$r\equiv -p+q\pmod 3,\qquad s\equiv -q\pmod 3$$

So, $f(a,b)$ can be written as $$f(a,b)\equiv pa+qa^2+(-p+q)b-qb^2\pmod 3$$

  • For $(p,q)\equiv (0,1)\pmod 3$, the only solutions of $f(a,b)\equiv a^2+b-b^2\equiv 1\pmod 3$ are $(a,b)\equiv (1,0),(0,2),(2,1),(1,1),(2,0)\pmod 3$.

  • For $(p,q)\equiv (1,1)\pmod 3$, the only solutions of $f(a,b)\equiv a+a^2-b^2\equiv 2\pmod 3$ are $(a,b)\equiv (1,0),(0,2),(2,1),(0,1),(2,2)\pmod 3$.

  • For $(p,q)\equiv (1,2)\pmod 3$, the only solutions of $f(a,b)\equiv a-a^2+b+b^2\equiv 0\pmod 3$ are $(a,b)\equiv (1,0),(0,2),(2,1),(0,0),(1,2)\pmod 3$.

From these observations, we get the following three systems whose solutions are $(a,b)=(1,0),(0,2),(2,1)$.

(1)$$\begin{cases}a^2+b-b^2\equiv 1\pmod 3 \\\\a+a^2-b^2\equiv 2\pmod 3\end{cases}$$

(2)$$\begin{cases}a^2+b-b^2\equiv 1\pmod 3 \\\\a-a^2+b+b^2\equiv 0\pmod 3\end{cases}$$

(3)$$\begin{cases}a+a^2-b^2\equiv 2\pmod 3 \\\\a-a^2+b+b^2\equiv 0\pmod 3\end{cases}$$

0
On

The first two tables you gave are one way of defining the relation. If you want an arithmetic definition, you can take $f(a,b) = ||a-b-1/2|-3/2|$.

Here is how to find $f$. Look at the possible values of $a-b$. When the relation $r$ is true, it is 1 or -2. When $r$ is false, it is -1 or 2. To get the same value for when $r$ is false, make 0 the average of the two outputs then take absolute value: $|a-b-1/2|$. Now the output is 3/2 when $r$ is false, so subtract 3/2: $|a-b-1/2|-3/2$ Now we deal with the output when true, which is $1$ or $-1$. To make this always 1, we take the absolute value: $||a-b-1/2|-3/2|$.