[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vip /vp / vr / w / wg / wsg / wsr / x / y ] [Search | Home]
system of congruences
If images are not shown try to refresh the page. If you like this website, please disable any AdBlock software!

You are currently reading a thread in /sci/ - Science & Math

File: screenshot.png (9 KB, 311x230) Image search: [iqdb] [SauceNao] [Google]
9 KB, 311x230
How do i solve system of congruences if gcd of mods is not equal to 1(which is ussualy done with chinese remainder theorem)?
For example this system

x(congruent) to 21 by mod 36
x(congruent) to 5 by mod 8

I ussualy solve this with chinese theorem of remainder but in this case gcd is not 1 equal to 1..
Anyone has any tips on how to solve this ?
>>
make it so that the gcd is 1
>>
How do i make this system so that gcd is 1 ? I dont get it,i dont think you can do it.
>>
>>7772137
For the system you provided, try the following:

The first equation says that $x$ is of the form $36t + 21$. The second equation says that $x$ is of the form $8r + 5$.

So we have $36t+21 = 8r + 5$
$4*(9t-2r) = -16$
$2r - 9t = 4$

There, now we solve for integers $r$ and $t$ that satisfy this equation (which I would think you should have learned how to do) and plug back into the original equation to find $x$.

This procedure can be generalized to more than 2 equations.
>>
>>7772155
Yes you can. Make it like this:
x(congruent) to 3 by mod 9
x(congruent) to 5 by mod 8
>>
solution is 21+k*72 I guess
>>
>>7772199
That method does not work in general.

For example, consider
$x \equiv 1$ (mod 8)
$x \equiv 3$ (mod 6)

If we did your method, we'd "reduce" the problem to
$x \equiv 1$ (mod 2)
$x \equiv 3$ (mod 6)

But there is clearly a solution of the latter system that is not a solution of the original system.
>>
I managed to get r=-16 and t=-4 now my question is where do i put it again?
>>
>>7772217
I assume you meant to reply to >>7772196. Learn how to use 4chan.

We had that $x = 36t + 21$, so plug $t$ into that to find a value of $x$.

If you find all $t$ that satisfy $2r-9t=4$, you can in this way find all $x$ that satisfy the original system.
>>
>>7772222
Then give an algoritm. You can't just "find" stuff.
I don't get why you don't recommend the standard way (in every discrete math book) of solving this to the OP.
>>
>>7772214
>But there is clearly a solution of the latter system that is not a solution of the original system.
Which one?
>>
>>7772232
3, silly.
>>
>>7772222
Uhm this part is pretty confusing to me ,from here im geting that x =-123 now if i add 36 on this until i get into >0 <=21 range i get 21 which is correct answer,now my question is when i get x (when i put t in it) why do i have to search for r ? Isnt t only necessary here?
>>
>>7772238
Yes.
>>
>>7772235
ok
>>
>>7772241
I hadn't realized that this was homework, OP. This board is not for homework problems. I thought you had a general inquiry. Do not ask homework problems in the future.
>>
Let me get this right.
The key here is to express first equation and 2nd as a value like for example 36t+21=8r+5
no i solve equation and get t and i just put it in x=36t+21 for example and if i get x to be negative i just increase it by 36 in this case untill i get to >0 <=36(mod) value which will be the answer?Does this work for all cases or?This seems pretty easy ,i guess this will not work for every case...
>>
>>7772252
Im not OP...
OP has a name (anon)
>>
>>7772252
How did you determine this was homework?This has nothing to do with homework,i just want to learn these stuff as i need it for things not related to school.
>>
>>7772214
Here it should reduce to
x(congruent) to 1 by mod 8
x(congruent) to 0 by mod 3
Anyway, I used to solved this years ago with this method, bit rusty now. I'll think some more and will post general way of solving later.
>>
Ok OP, here's how I generally solve system of congruences when the moduli aren't relativiely prime, I'll use the problem in your OP as example:

$x \equiv 21 (\text{mod} 36)$
$x \equiv 5 (\text{mod} 8)$

Step 1) make prime decomposition of all moduli with shared divisors:
$x \equiv 21 (\text{mod} 2^{2}3^{2})$
$x \equiv 5 (\text{mod} 2^{3})$

Step 2) replace the congruences by making a congruence for each factor:
$x \equiv 21 (\text{mod} 2^{2})$
$x \equiv 21 (\text{mod} 3^{2})$
$x \equiv 5 (\text{mod} 2^{3})$
Becomes:
$x \equiv 1 (\text{mod} 2^{2})$
$x \equiv 3 (\text{mod} 3^{2})$
$x \equiv 5 (\text{mod} 2^{3})$

Step 3) for all the congruences in which the moduli share factors, keep the one with highest power. BUT you need to check if the congruence you keep, also satisfies the ones you will delete (if this isn't the case, there's no solution):
$x \equiv 1 (\text{mod} 2^{2})$ -> delete (since 2^2 is smaller then 2^3) if check turn out OK
$x \equiv 3 (\text{mod} 3^{2})$ -> keep (theres no other congruence with factor 3 in prime decomposition)
$x \equiv 5 (\text{mod} 2^{3})$ -> keep

Check:
$x \equiv 5 (\text{mod} 2^{2})=1$ OK

Step 4) you can now use chinese remainder theorem to solve the system