patternMinor
Can OR be "undone"?
Viewed 0 times
undonecanstackoverflow
Problem
Suppose that $Z = X \vee Y$, where $X$, $Y$ and $Z$ are 96-bit binary numbers. If I'm given the values of $Z$ and $Y$, is it possible to work out what $X$ is?
I know this is possible with XOR but can it be done with OR?
I know this is possible with XOR but can it be done with OR?
Solution
It is easy to find out that there can be more than one value, used as $X$, to satisfy $Z = X \vee Y$. When a specific bit of $Y$ is $1$, there are two possibilities for such bit in $X$, i.e., $0$ or $1$.
Let's make a simple example with a 2-bit number:
$Y$ = $10$ and $Z$ = $11$
The possible values of $X$ are:
because:
In short, you don't have the certainty that the end result of the reverse operation of $\vee$ will be a unique result.
Let's make a simple example with a 2-bit number:
$Y$ = $10$ and $Z$ = $11$
The possible values of $X$ are:
- $11$
- $01$
because:
- $11 \vee 10 = 11$
- $01 \vee 10 = 11$
In short, you don't have the certainty that the end result of the reverse operation of $\vee$ will be a unique result.
Context
StackExchange Computer Science Q#48422, answer score: 7
Revisions (0)
No revisions yet.