What am I doing wrong to get A = ~A

1.5k Views Asked by At

(Sorry if this is a bad question, I am new to boolean algebra)

If there is a simple expression:

~A

Couldn't I convert it to:

~(A + 0)

Then couldn't I distribute the not:

~A + ~0
~A + 1
1

What did I do wrong that got me to ~A = 1? Did I mess with the order of operations or what?

3

There are 3 best solutions below

0
On BEST ANSWER

As @Ian and @Graham Kemp have mentioned, the operator switches when you distribute the negative, and this is often referred to as deMorgan's Law. When you have a confusing situation in boolean logic like this, it often helps to draw a truth table (basically evaluate the expression for all possible combinations of variable states). We can see from the truth table below that ~(x+y) is equivalent to ~x ^ ~y, but not ~x + ~y (which is instead equivalent to ~(x^y)).

x y ~(x+y) ~x ~y ~x ^ ~y ~x + ~y ~(x^y)
0 0 1 1 1 1 1 1
0 1 0 1 0 0 1 1
1 0 0 0 1 0 1 1
1 1 0 0 0 0 0 0

In this case, we the commenters could point out that the error in the derivation was in the distribution step. In general case, where you don't know what is the incorrect step and there are few steps, you could calculate the truth table for each step, to see where it changes and is no longer equivalent to the previous step. But if there are many steps/variables or the expressions are involved, then you could do binary search starting from the middle step, to find where it switches.

0
On

Here's where you're wrong:

~(A + 0)

According to you, this is equal to:

~A + ~0

However this is wrong: it should be equal to:

~A * ~0

(rule behind this: ~(a+b) = ~a*~b and ~(a*b)=~a+~b)

When you go further that road, you get:

~A * 1
~A
0
On

The other answers assume by + you mean inclusive or. If you meant exclusive or (XOR), as user3840170 suggested, ~(x + y) is equivalent to ~x + y and x + ~y, but not ~x + ~y. In this case, you could rewrite ~(A + 0) as ~A + 0 = ~A or as A + ~0 = A + 1 = ~A.