Mathematical Programming

Negations

Let's say we have a boolean function to determine if a certain number is acceptable,

isAcceptable(x){0,1}.\text{isAcceptable}(x) \to \{0,1\}.

Suppose we are now presented with the task of designing a boolean function that determines whether a function is unacceptable.

In Python, we would normally do something like this:

def is_unacceptable(bool_value: bool) -> bool:
    return not is_acceptable(bool_value)

A more generalized approach to this would be:

def negate(boolValue: bool) -> bool{
    return not boolValue
}
def isUnacceptable(boolValue: bool) -> bool {
    return negate(isAcceptable(boolValue));
}

Let's try to define negate(x)\text{negate}(x) mathematically. What we would like to do here is switch the outputs of the above function, such that we map 00 to 11 and 11 to 00. That is, we want to design a function negate(x)\text{negate}(x) such that

negate(0)=1\text{negate}(0) = 1
negate(1)=0.\text{negate}(1) = 0.

One thing to notice is that

negate(x)+x=1.\text{negate}(x) + x = 1.

So, we can use this to say that

negate(x)=1x.\text{negate}(x) = 1 -x.

And we're done!

© 2022 YMath.io owned and operated by Saumya Singhal