Tuesday, July 14, 2009

Boolean algebra, what is a "unary" operator '?

Formally, a Boolean algebra is a mathematical system consisting of a set of elements, B={0,1}, together with two binary operations, (denoted by the symbols + and •) There is also a unary operator ′.





I understand the laws and the operations ( and, or, not). I just need help understanding this unary ' thing.





For instance : Z=( A ' • B ' ) '+ C ' ) '





Also : Z = ( A • B ' ) ' + B ) • C





- I thought it was the "not" symbol until i saw these. Please help me understand.

Boolean algebra, what is a "unary" operator '?
"Unary" just means "operates on one thing only." Negation ("-x") is a unary operator that you often see in standard math.





"Not" is an example of a unary operator. It looks to me as if they mean + (or), * (and), and ' (not) for their operations.... though the parentheses are not balanced in your examples.





Z=( A ' • B ' ) '+ C ' ) '





I would read that as:





Z = not{ not[ not(a) AND not(b) ] or not(c) }





PS - You can't just "ignore the extras." All of those "nots" have meaning.





For example, "not[ not(a) AND not(b) ]" is shown in this table, along with intermediate calculated values:





a, b, a', b', (a' and b'), (a' and b')':


T, T, F, F, F, T


T, F, F, T, F, T


F, T, T, F, F, T


F, F, T, T, T, F





Note that "not( not(a) AND not(b) )" is exactly the same as "a OR b" (false only when a and b are both false).





Personally, I would simplify:





Z = ( ( A ' • B ' ) '+ C ' ) '





... as:





Z = ( (A + B)' • C )
Reply:A unary operator acts on one element (negation or "not" in Boolean algebra)


A binary operator acts on two elements (like + or *)
Reply:You are correct ' is the symbol being used for NOT.





AND (*) and OR (+) are binary operators because they work with TWO things [operands] e.g. T * F gives F





NOT (') is a unary operator because it only needs ONE operand e.g. T' gives F





-------------





Unary operators usually take precedence over binary operators. So with A * B' , B' is evaluated first.





With the problems like you gave as examples, its best to work from the inside of the parenthesis out e.g. in ( A • B ' ) ' + B ) • C do the A*B' first ... another example...


    (F' * T)' -%26gt; (T * T)' -%26gt; (T)' -%26gt; F





OR use some of the properties of Boolean algebra to rearrange things


    e.g. [distributing the not]    (A * B)' = A' + B'


    also (A * B')' = A' + B since B'' = B


No comments:

Post a Comment