How to 'undo' mod, or solve equation with a mod.?

  • Context: Undergrad 
  • Thread starter Thread starter rsala004
  • Start date Start date
Click For Summary

Discussion Overview

The discussion revolves around solving equations of the form a = x mod b, exploring how to find x given a and b, and considering constraints such as specific ranges for x. Participants also delve into related scenarios, including quadratic residues and the implications of different values for k.

Discussion Character

  • Exploratory
  • Mathematical reasoning
  • Debate/contested

Main Points Raised

  • Some participants propose that x can be expressed as x = b*k + a, where k is a positive integer, to generate possible solutions.
  • Others question the necessity for k to be strictly positive and suggest that k could include zero or negative values depending on the context.
  • One participant introduces the idea that if a = x (mod b), then it can also be stated that x = a (mod b), referencing a theorem related to modular arithmetic.
  • Another participant raises the concern that there could be no solutions for certain equations, such as x^2 ≡ 2 (mod 4), highlighting the importance of quadratic residues.
  • A specific case is discussed where a = (x^2) mod b, leading to the formulation x^2 = b*k + a, with the condition that both x and k must be integers.
  • There is a suggestion that the number of solutions for x could be expressed as 1 + FLOOR(b/U), under certain assumptions about the values of b and U.

Areas of Agreement / Disagreement

Participants express differing views on the constraints for k and the conditions under which solutions exist. There is no consensus on the necessity for k to be positive or on the implications of specific ranges for x.

Contextual Notes

Participants note that the lack of specified ranges for b can affect the assumptions made about k and the potential solutions for x. The discussion also highlights the complexity of modular arithmetic and the conditions under which solutions may or may not exist.

Who May Find This Useful

This discussion may be of interest to those studying modular arithmetic, quadratic residues, or anyone looking to solve equations involving modular constraints in mathematics.

rsala004
Messages
23
Reaction score
0
if we are given something of the form

a = x mod b
where we are given a and b ...how can x be solved for ?

what if we are given a range for which x has to fall within?
something like 0 <= lowerbound <= x <= upperbound

--

I have thought about this a little while i came up with that
x = b*k + a
with k a positive integer.. would generate all the possible solutions

is this correct?
can anyone guide me in right direction to solving this?
 
Physics news on Phys.org
rsala004 said:
if we are given something of the form


where we are given a and b ...how can x be solved for ?

what if we are given a range for which x has to fall within?
something like 0 <= lowerbound <= x <= upperbound

--

I have thought about this a little while i came up with that

with k a positive integer.. would generate all the possible solutions

is this correct?
can anyone guide me in right direction to solving this?

What about negative numbers? Or 0? For k.

You're definitely in the right direction.
 
rsala004 said:
if we are given something of the form


where we are given a and b ...how can x be solved for ?

what if we are given a range for which x has to fall within?
something like 0 <= lowerbound <= x <= upperbound

--

I have thought about this a little while i came up with that

with k a positive integer.. would generate all the possible solutions

is this correct?
can anyone guide me in right direction to solving this?

Why must x be greater than a?
 
Why must x be greater than a?
no no, i mean some other defined lowerbound and upperbound.

for example, 0 to 1000000.. otherwise i assume there would be endless solutions.

---
norman said:
What about negative numbers? Or 0? For k.

I guess in my case i want to exclude negatives from k (since my boundary is positive), and include 0.

---
I read some more and I found this :
[PLAIN said:
http://homepage.smc.edu/kennedy_john/MODULARRSA.PDF][/PLAIN]
Theorem 7:
If a = b(mod n), then b=a(mod n)

So i guess I can say go from a=x(mod b) -> x = a(mod b)

Is this correct?
 
Last edited by a moderator:
1. a could be greater than b, so even if you want your x to be positive, k > 0 is too strict a condition.

2. Sure, x = a (mod b ) iff a = x (mod b). Remember that by definition, x = a (mod b) <=> b | x-a.
 
rsala004 said:
no no, i mean some other defined lowerbound and upperbound.

for example, 0 to 1000000.. otherwise i assume there would be endless solutions.

---


I guess in my case i want to exclude negatives from k (since my boundary is positive), and include 0.

---
I read some more and I found this :


So i guess I can say go from a=x(mod b) -> x = a(mod b)

Is this correct?
x = kb + a where kb + a > -1 is your general solution based upon your condition that x is not negative. Of course k could be any integer including even zero or a negative number for these conditions to be met.
 
Last edited:
the actual problem I am trying to solve is a bit different .. but similar problem i think (?)
okay, so with these problem settings below

a = (x^2) mod b, 0 <= x < U < b
(U being some integer to represent x's maximum value)

I can try to solve for x by setting up

x^2 = b*k + a

and the solutions are when both x and k are integers.

ramsey2879 said:
x = kb + a where kb + a > -1 is your general solution based upon your condition that x is not negative. Of course k could be any integer including even zero or a negative number for these conditions to be met.

ah i understand, since b wasn't specified to fall into any certain range :) , hm since we say now that it is always greater than x,

(I think I can) assume that k >= 0.

so is it right to think that there are 1 + FLOOR(b/U) solutions for x?
 
Last edited:
Bear in mind that there could be no solutions at all. For example,
[tex]x^2 \equiv 2 \pmod 4[/tex]
has no solutions, since all squares modulo 4 are either 0 or 1.

You can check this wikipedia entry,
http://en.wikipedia.org/wiki/Quadratic_residue
 

Similar threads

  • · Replies 11 ·
Replies
11
Views
3K
  • · Replies 3 ·
Replies
3
Views
1K
  • · Replies 12 ·
Replies
12
Views
3K
  • · Replies 3 ·
Replies
3
Views
4K
Replies
10
Views
5K
  • · Replies 13 ·
Replies
13
Views
2K
  • · Replies 13 ·
Replies
13
Views
4K
  • · Replies 4 ·
Replies
4
Views
3K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 5 ·
Replies
5
Views
8K