- #1
Vital
- 108
- 4
Homework Statement
Hello!
Please, help me to learn how to solve the following task - I really have no idea how to do that. What's important is that I need an algorithm that I can apply to the equation with different values.
Homework Equations
The initial equation:
(y - z + i) mod m = x - z
Meaning that the value of (x - z) is the value of the remainder after dividing (y - z + i) by m.
Let me show one example with numbers, so it will be clear what I am asking about.
The Attempt at a Solution
[/B]
(y - 97 + 20) mod 26 = 98 - 97
According to the definition: a mod b = c, and a=c+kb
Therefore in my example:
c = 98 - 97 (I am not computing this difference on purpose, because it is important for me to see all values involved)
a = (y - 97 + 20)
b = 26
k is unknown, but also y is unknown, so I have two unknowns here.
Proceeding further I get:
k×26+98−97=y−97+20
How can I find both k and y? Is there a general algorithm for such equations?
I will be very grateful for your help and explanation - I need to learn this.
Thank you very much!