Solution of a system of congruences whose moduli are not pairwise coprime

405 Views Asked by At

I need to know if some system of congruences of form:

$$x \equiv a_1 \pmod{b_1}$$ $$\ldots$$ $$x \equiv a_n \pmod{b_n}$$ has a solution and how big this solution could be. I can't assume that b are relatively prime so I can't use Chinese remainder theorem. Any ideas?

2

There are 2 best solutions below

0
On

Try to find partial solutions $x_1, ..., x_n$ such that $x_i \equiv \delta_{i,j} \pmod{b_j}$ for all $i,j \in [1,n]$ (where $\delta$ is the Kronecker delta function).

You can do so by trying integers in $\text{lcm}_{j\ne i}(a_j)\Bbb Z$

You'll find that $x = \sum_{i=1}^n a_i x_i$ is solution to your system.

0
On

A solution exists $\iff \gcd(b_i,b_j)\mid a_i-a_j\,$ for all $\,i\ne j,\,$ i.e. iff they are pairwise solvable. See this answer for a proof.

Any solution is unique mod $m = $ lcm of all moduli, so the least natural solution can be as large as $\,m-1,\,$ e.g. $\, x\equiv -1 \pmod {b_i}\iff x\equiv -1\pmod m\,$ has least solution $\, x = m-1$

Indeed if $\,x'$ and $\,x\,$ are solutions then all $\ b_i\mid x'-x\,$ so $\ m = {\rm lcm}\{b_i\}\mid x'=x,\ $ i.e. $\,x'\equiv x\pmod m.\,$ Conversely $\,x'\equiv x\pmod{m}\,\Rightarrow\,x'\equiv x[\equiv a_i]\pmod{b_i}\,$ by $\,b_i\mid m.$