How to solve for b in a = b mod q

  • Thread starter John Harris
  • Start date
  • Tags
    Modulus
In summary: H(m) + x*r) mod qx = ((s * k) – H(m)) * r-1 mod qs = k-1 (H(m) + x*r) mod qx = ((s * k) – H(m)) * r-1 mod qs = k-1 (H(m) + x*r) mod qx = ((s * k) – H(m)) * r-1 mod qs = k-1 (H(m) + x*r) mod qx = ((s * k) – H(m)) * r-1
  • #1
John Harris
19
1

Homework Statement


How do I solve for b in a= b mod q

Homework Equations


I'm not sure what mod operations for equations are allowed. I would like to know.

The Attempt at a Solution


Unsure how to move the mod q to the other side.
 
Physics news on Phys.org
  • #2
Back up a bit:
Pick some numbers for a and q, and see what values of b will make the relation true.
i.e. 1 = b mod 2

Try for some other numbers?
What do you notice?
 
  • #3
Simon Bridge said:
Back up a bit:
Pick some numbers for a and q, and see what values of b will make the relation true.
i.e. 1 = b mod 2

Try for some other numbers?
What do you notice?
Got to make sure I work for it... Any odd number. b divides q-a
 
  • #4
Good - you just solved the problem for a specific example.
Next step is to see if you can generalize.
 
  • #5
Simon Bridge said:
Good - you just solved the problem for a specific example.
Next step is to see if you can generalize.
b=qk+a

But I don't understand how they did it here. They solved for x without removing the mod or adding a k.
s = k-1 (H(m) + x*r) mod q
x
= ((s * k) – H(m)) * r-1 mod q
 
  • #6
Go through it one step at a time - make sure you know what each bit means.
 
  • #7
s = k-1 (H(m) + x*r) mod q

I see how they got it to ((s * k) – H(m)) * r-1= x mod q
But I don't see how they get it farther. If I knew I wouldn't be asking for help. I'm just asking for the simple equation property that they used. This isn't a HW assignment. I don't have time to derive it myself. What you asked me to do hasn't helped.
 
  • #8
John Harris said:
s = k-1 (H(m) + x*r) mod q

I see how they got it to ((s * k) – H(m)) * r-1 = x mod q
But I don't see how they get it farther. If I knew I wouldn't be asking for help. I'm just asking for the simple equation property that they used. This isn't a HW assignment. I don't have time to derive it myself. What you asked me to do hasn't helped.
Are you saying that you can get from
s = k -1 (H(m) + x*r ) mod q
to
((s*k ) – H(m)) * r -1 = x mod q ,​

but you can't solve that for x ?

Well, if a ≡ b mod q, then b ≡ a mod q . Right?
 
  • #9
SammyS said:
Are you saying that you can get from
s = k -1 (H(m) + x*r ) mod q
to
((s*k ) – H(m)) * r -1 = x mod q ,​

but you can't solve that for x ?

Well, if a ≡ b mod q, then b ≡ a mod q . Right?

But this is an equality not a congruence.
3=19 mod 8
19≠3mod 8
 
  • #10
John Harris said:
But this is an equality not a congruence.
3=19 mod 8
19≠3mod 8
Yes, I overlooked the ' = ' sign.
 
Last edited:
  • #11
John Harris said:
But this is an equality not a congruence.
3=19 mod 8
19≠3mod 8
True, but the solution to the equation, ##\ 3=x\mod 8 \,,\ ## is ##\ x=3+8n \ ##.

The mod function is periodic, so there are many solutions for x . One of the solutions is 3 itself. For that solution it is true that ##\ x=3\mod 8 \ ##.
But I don't understand how they did it here. They solved for x without removing the mod or adding a k.
s = k-1 (H(m) + x*r) mod q
x
= ((s * k) – H(m)) * r-1 mod q
What they are doing here is certainly strange. What information, if any, do we know regarding, H(m), r, and k ?
 

FAQ: How to solve for b in a = b mod q

What is the meaning of "b mod q" in the equation a = b mod q?

"b mod q" refers to the remainder when b is divided by q. In other words, it is the number that is left over after you divide b by q.

How do I solve for b in a = b mod q?

To solve for b, you need to divide both sides of the equation by q. This will give you the equation b = a mod q. Then, you can use the remainder theorem to find the value of b.

Can b be any number in the equation a = b mod q?

No, b must be a positive integer less than q. This is because the remainder in the equation a = b mod q cannot be larger than the divisor q.

What if there is no solution for b in the equation a = b mod q?

If there is no solution for b, then the equation a = b mod q is not satisfied. This can happen if the remainder after dividing a by q is not a whole number. In this case, the equation has no solution.

Can I use algebraic manipulation to solve for b in a = b mod q?

Yes, you can use algebraic manipulation to solve for b. However, it is important to remember that the remainder theorem must still be applied to find the final value of b.

Similar threads

Replies
2
Views
2K
Replies
10
Views
2K
Replies
6
Views
1K
Replies
4
Views
357
Replies
28
Views
4K
Replies
8
Views
1K
Back
Top