Questions about the system $x+c_1\equiv y \pmod z$ and $d=y+c_2$ for integers $x$, $y$, $z$, $c_1$, $c_2$

92 Views Asked by At

Let $x, y, z \in \mathbb Z$ and $c_1, c_2$ be two arbitrary constants (not necessarily equal).

Given that $x + c_1 \equiv y \pmod z$ and $d = y+c_2$,

My queries are,

Can I find a general solution for $x$ ? If yes, then how?

Consider another case,

If $x$ lies between $ 0 \le x \le 256 $ and $z$ is a Constant. Then, looking at a set of values for $y$, What is the probability of predicting $x$ correctly?

( The term Predicting stands for : Consider among all the possible values of $x$, only 1 value of $x$ is considered as required. Say, if in a case where, $x \in {1,2,3} $. But One wants only '2' from it. Thus the probability of predicting $x$ correctly will be : $1/3$ )

I am new here (Posting my first question) . Please help.

EDIT : Let me explain with an example, Suppose, $x + c_1 \equiv y \pmod 2$. As we can see, The value of $x$ is either Even or Odd. If, it's Even, then Depending on some $c_1$ , the resultant value will be either Even or Odd. Right? Now, obviously $y\in {0,1} $.

Given some $y$, can I ever have probability to predict the $x$ correctly?

i.e $ (4 + 13) \equiv 1 \pmod 2$, and $ (5 + 13) \equiv 0 \pmod 2$. Given, $y = {0,1}$ what will be the probability for finding $x={4,5}$ respectively ?

Motivation : I want to know how hard it would be to find the $x$ or there exists some formal mathematical way to obtain such a solution.

Instead of $y$, if $d$ is given. What would be it's impact on this problem? Will it be harder to solve?

1

There are 1 best solutions below

0
On BEST ANSWER

the congruences you have provided in general can be solved by traditional ways, as in framing:

$x=y-c_1+nz$ and likewise.

However, if you choose to conceal the values of either $c_1$ or $c_2$, which you presumably aim at doing, that shouldn't be much of a problem each other.

For you then have, a simple linear congruence of the form $ax+by \equiv 1 \pmod m$.

If both $c_1$ and $c_2$ are unknown,

You could then go about replacing them by some arbitrary variable $p$ and $q$, solve for them. After having obtained the values of $p$, and $q$, what you could do is obtain the number of ways you could sum upto $p$ ( and $q$ ), using two variables.

By elementary combinatorics, this is the number :

$(n+r-1) \choose (r-1)$ ,which equals $n+1$ in this case, because evidently $r=2$

You could then have a good-enough searching algorithm with corresponding lower and upper bounds set, that would land you with the desired values of $c_1$ and $c_2$'. Binary search would do it for you in $log(n)$ time. So, that could be something.

Thank You.