4

There was a challenge question in this Socratica video and [EDIT: I misunderstood the question and] boy is it giving me a headache!

I thought the question was:

How many $(a,b,c)$ triples in $\Bbb Z_{12}$ satisfy $|r|=2$ where $r$ is the largest subset of $\Bbb Z_{12} : \forall x \in r, a x^2 + b x + c \equiv 0\pmod {12}$

Even solving this for mod 4 has proved too challenging for me! For example, I tried to construct all the unique $(dx+e)(mx+n)$ pairs that would generate two roots, and I found to my horror that not only do some pairs have more than two roots, but some (such as $\left(3x+2\right)^2$) aren't even unique! Avoiding over-counting seems quite tricky...

So, what am I missing? How can you cleanly generate these quadratics?

Thank you

vaebnkehn
  • 143
  • 1
    maybe this helps: if there is two roots mod 12 there can be 1 root mod 3 and two mod 4, or one root mod 4 and two mod 3. – Asinomás Apr 10 '21 at 14:05
  • I'm not sure what you mean... Like, take (3,2,3) in the mod 4 case. There are two roots to that quadratic: 1 and 3. Both roots are 1 mod 2... – vaebnkehn Apr 10 '21 at 14:14
  • i just meant that you can break down the problem into counting the polynomials with 1 and 2 roots mod 4 and mod 3. – Asinomás Apr 10 '21 at 14:42
  • 1
    Hopefully someone rolls in with a better solution but I did what I could :) – Asinomás Apr 10 '21 at 20:09
  • 1
    Can you post a link where it says that's the challenge question? In the video there are two puzzles but they seem to be easier than this one – Asinomás Apr 10 '21 at 20:16
  • Oh! You're right. I misunderstood the question That's why it was using math we weren't taught ‍♀️ Thanks @HereToRelax – vaebnkehn Apr 10 '21 at 21:33
  • Lol no worries. – Asinomás Apr 10 '21 at 21:33

1 Answers1

3

Because of the Chinese Remainder Theorem every polynomial $P$ in $\mathbb Z_{12}$ corresponds to a pair of polynomials $(Q,R)$ such that $Q$ is a polynomial in $\mathbb Z_3$ and $R$ is a polynomial in $\mathbb Z_4$ (the correspondence is just done coordinate by coordinate).

The number of roots of the polynomial $P$ is equal to the product of the number of roots of $R$ and $Q$. So if we want $P$ to have $2$ roots we require that one of $R$ and $Q$ has $1$ root and the other has $2$ roots. So in order to count how many polynomials $P$ have $2$ roots we can count the number of polynomials with $1$ and $2$ roots in $\mathbb Z_4$ and $\mathbb Z_3$.

In $\mathbb Z_3$ the constant polynomials all have $0$ or $3$ roots so they don't matter to us.

The polynomials of degree $1$ all have $1$ root.

To approach the polynomials of degree $2$ we can study $x^2+bx$ and see the possible sizes for the fibers:

If $b=0$ then $P$ is $0$ at $\{0\}$ and $1$ at $\{1,2\}$.

If $b=1$ then $P$ is $0$ at $\{0,2\}$ and $2$ at $\{1\}$.

If $b=2$ then $P$ is $0$ at $\{0,1\}$ and $2$ at $\{2\}$.

The case $2x^2+bx$ is the same since multiplying the polynomial by $2$ preserves structure.

Therefore the number of polynomials with $1$ root is $6+2(3) = 12$.

Therefore the number of polynomials with $2$ roots is $0+2(3) = 6$

In $\mathbb Z_4$ The constant polynomials all have $0$ or $4$ roots so they don't matter to us.

The polynomials of degree $1$ $bx+c$ in which $b$ is odd all have $1$ root. When $b=2$ there are two with $2$ roots.

The polynomials of degree $2$ can be understood in the following way:

Look first at the polynomial $S=ax^2+bx=(ax+b)x$ and analyze how much it contributes to each quantity when we consider the $4$ values of $c$. (to do this we just have to see how many fibers of size $1$ and $2$ each of the $12$ combinations has).

Case $1$: $a=2$

If $b$ is $0$ then $P$ is $0$ at $\{0,2\}$ and $2$ at $\{1,3\}$

If $b$ is $1$ then $P$ is $0$ at $\{0\}$, is $3$ at $\{1\}$, is $2$ at $\{2\}$ and is $1$ at ${3}\$

If $b$ is $2$ then $P$ is $0$ at $\{0,2\}$ and $2$ at $\{1,3\}$

If $b$ is $3$ then $P$ is $0$ at $\{0\}$ is $1$ at $\{1\}$ is $2$ at $\{2\}$ and is $3$ at $\{3\}$.

Case $2$: $a=1$ or $3$.

Both of these cases are the same because multiplying $ax^2+bx$ by $3$ is a bijection between the two cases that preserves fiber sizes, so we assume $a=1$.

If $b$ is $0$ then $P$ is $0$ at $\{0,2\}$ and $1$ at $\{1,3\}$

if $b$ is $2$ then $P$ is $0$ at $\{0,2\}$ and $3$ at $\{1,3\}$

If $b$ is $1$ then $P$ is $0$ at $\{0,3\}$ and $2$ at $\{1,2\}$

The case $b=3$ is the same as the previous one.


Hence we have the following:

There are $6$ polynomials with $1$ root in $\mathbb Z_3$

There are $18$ polynomials with $2$ roots in $\mathbb Z_3$

There are $[8+0] + [0+4+0+4 + 2(0+0+0+0) ]=8+8 = 16$ polynomials with $1$ root in $\mathbb Z_4$

There are $[0+2] + [2+0+2+0 +2(2+2+2+2)] = 2+18 = 20$ polynomials with with $1$ root in $\mathbb Z_4$

Hence the number of polynomials of degree at most $2$ with exactly $2$ roots in $\mathbb Z_{12}$ is $12\cdot20 + 6\cdot16 = 336$.

Code to check the final result and intermediate results are all correct:

#include <iostream>
using namespace std;

int numpols(int n, int r ){ //calculates the number of pols in Z_{n} with r roots. int res = 0; for(int a=0;a<n;a++){ for(int b=0;b<n;b++){ for(int c=0;c<n;c++){ int sols = 0; for(int i=0;i<n;i++){ if( (aii + b*i + c)%n == 0) sols ++; } if( sols == r) res ++; } } } return res; }

int main(){ cout << numpols(3,1) << endl; cout << numpols(3,2) << endl; cout << numpols(4,1) << endl; cout << numpols(4,2) << endl; cout << numpols(12,2) << endl; }

J. W. Tanner
  • 63,683
  • 4
  • 43
  • 88
Asinomás
  • 107,565
  • Very thorough, including the code to verify. I was missing the trick of using x(ax+b) to determine both possible Cs and the number of roots. Thanks! – vaebnkehn Apr 10 '21 at 22:20