Rules for moving over equality sign?

2.6k Views Asked by At

What are the rules for moving over the other side of equal sign in boolean equations ?

For example lets take XOR, just speculating :

 x ^ y = z
 (x ^ y) & z

OR

 (x ^ y) & z = 0

OR

what are the rules ?


hmm... may be, just for this specific case :

 x ^ y = z

 expr z logical-result
 0    0   true
 0    1   false
 1    0   false
 1    1   true

So, not-xor :

 (x ^ y) ~^ z
1

There are 1 best solutions below

1
On BEST ANSWER

Remember that one never really - in any context - moves something over an equal sign. In ordinary arithmetic, if you have something like $$x+2=5$$ it's better to think of the operation you do to solve this not as moving the $2$, but as applying a function to both sides - that function being $f(z)=z-2$, which gives $$(x+2)-2=5-2$$ and then you can simplify on both sides to get $x=3$. This is to say that the basic property of equality is substitution: if $x=y$ then $f(x)=f(y)$. It often looks like things are going across the equals sign because one carefully selects $f$ to undo an operation applied to one side - like subtracting $2$ from $x+2$.

Arithmetic operations are really nice: if I know $x$ and $x+y$ or $x-y$ or $x/y$ or $x\cdot y$ (assume $x\neq 0$), then I can find $y$. The only boolean operations that are like that are XOR and XNOR - in general, AND and OR can't be inverted because, for instance, as soon as AND has one false parameter, it will be false irrespective of the other parameter.

Your idea for XOR is basically correct - note that $a$ XOR $a$ is always false and that XOR is associative, so if you have $$\text{$a$ XOR $b$ = $c$}$$ You can XOR both sides by $b$ to get $$\text{$a$ XOR $b$ XOR $b$ = $c$ XOR $b$}$$ $$\text{$a$ XOR false = $c$ XOR $b$}$$ $$\text{$a$ = $c$ XOR $b$}$$ However, this is a pretty special case and is pretty much the only thing that works.

(You can also note that if you're treating $=$ as itself a boolean operation that might evaluate to true or false rather than a statement about equality of two expressions, then it means the same thing as XNOR - but it's easiest just to use XOR and NOT to express that operation because the rules for XOR are very nice)