## Solving Equations With Modulos

Are there general methods for solving equations of the form

a+bx = mod(c+dx, m),

where, in the notation I have made up here, mod is the modulo function which resets the argument to zero when it reaches m. I hope it's clear what I mean here.
 PhysOrg.com mathematics news on PhysOrg.com >> Pendulum swings back on 350-year-old mathematical mystery>> Bayesian statistics theorem holds its own - but use with caution>> Math technique de-clutters cancer-cell data, revealing tumor evolution, treatment leads
 Mentor Every solution of that equation will also satisfy 0 = mod(c-a+(d-b)x, m), or, in a more conventional notation, f=g x mod m where f=a-c and g=d-b. This is a simple modular equation, and general methods to find all solutions exist. All solutions which satisfy 0<=a+bx
 I dont quite follow. When you switch from my made up notation to the real notation (sorry about that), it looks like a completely new equation. Unless you moved terms to the other side, which I didn't think was allowed. I could get a better idea of the solution by considering: mod(x,n) = x- n*floor(x/n) so that for my equations: a+bx = c+dx - m*floor((c+dx)/m) But what are the general methods for finding the solutions here? I should be clear here that I'm considering x as a real number and not necessarily and integer here.

Mentor

## Solving Equations With Modulos

 Unless you moved terms to the other side, which I didn't think was allowed.
It is.

0 = mod(c-a+(d-b)x, m)
switch notation
0 = c-a+(d-b)x mod m
add a-c (for mathematical details: you can do this as addition is a group in Z/nZ, and it works for non-integer values as well)
a-c = (d-b)x mod m

Note that "mod m" refers to the whole equation in mathematics. It is used differently in programming languages.

 I should be clear here that I'm considering x as a real number and not necessarily and integer here.
No, this is not clear, and really unexpected in modular expressions. It is not a problem, however: it might change the general methods to solve f=gx mod m, but it does not change the other parts.

 Quote by mfb It is. 0 = mod(c-a+(d-b)x, m) switch notation 0 = c-a+(d-b)x mod m add a-c (for mathematical details: you can do this as addition is a group in Z/nZ, and it works for non-integer values as well) a-c = (d-b)x mod m