Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Name for the logical operator A & (~B)

Is there a name for logical AND with the negation (~) of the second variable, i.e:

A & (~B)

The truth table for such operation is:

0 & (~0) = 0
0 & (~1) = 0
1 & (~0) = 1
1 & (~1) = 0

And in longer sequences of bits,

A       = 10110011
B       = 10111001
A & B   = 10110001
A &(~B) = 00000010

PS - I'm interested with OR with the negation of the second variable, too.

like image 415
Adam Matan Avatar asked Nov 26 '12 13:11

Adam Matan


People also ask

What is the name of this logical operator?

Logical Operators/is the logical not operator. && is the logical and operator. It returns TRUE if both of the arguments evaluate to TRUE. This operator supports short-circuit evaluation, which means that if the first argument is FALSE the second is never evaluated.

What are the 5 logical operators?

There are five logical operator symbols: tilde, dot, wedge, horseshoe, and triple bar.

What are the 4 logical operators?

There are four logical operators in JavaScript: || (OR), && (AND), ! (NOT), ?? (Nullish Coalescing).

What is logical operator example?

Example 5: Logical Operators(a == b) && (c > 5) evaluates to 1 because both operands (a == b) and (c > b) is 1 (true). (a == b) && (c < b) evaluates to 0 because operand (c < b) is 0 (false). (a == b) || (c < b) evaluates to 1 because (a = b) is 1 (true).


2 Answers

Incredible. A & (~B) is called Material nonimplication, and A | (~B) is called Material implication Seems that every possible binary operation has a name.

like image 124
Adam Matan Avatar answered Jan 01 '23 17:01

Adam Matan


The set theoretic term is the "relative complement" of B with respect to A.

like image 24
wye.bee Avatar answered Jan 01 '23 18:01

wye.bee