October 02, 2017 Monday
Bedtime Story
NOT Function in Lambda Calculus
So what we are claiming is that if we feed
in True to the NOT function, then we should get False as the output.
Let us check if that is true.
One way to go about it is to expand the
definition of NOT.
Our definition of NOT was as follows:
NOT = λb.b False True
The above definition of NOT can be rewritten
as follows.
(λb.b False True) True
Mind you that this is only the right side
of the previous lambda equation.
What the above expression says is that we
have taken a Boolean b and applied to False and True and just copy down the
True.
Now we shall the take the Boolean to be
True and apply it in this function
Since the Boolean b is True, what we get is
follows:
True False True
Now let us expand this further.
We had agreed that True is a function that
takes in two values as input and chooses as output the first one.
In that case, we can expand the above
equation as:
(λx.λy.x) False True
So now we have a function that when it
takes in two inputs, it chooses the first
Here the two things that are going in as
inputs are False and True.
The output here has to be False as it is
the first of the two inputs and the lambda function (λx.λy.x) will chose the
first of two inputs.
If you are confused, let me recapture all
the steps in one go in one snapshot
NOT True
= (λb.b False True) True
= True False True
= (λx.λy.x) False True
= False
So you see mon ami that in very steps we
could manage to encode the NOT function into the lambda calculus.
Similarly logical operators AND and OR
could be encoded into lambda calculus.
I could stop lambda calculus with this but
it would be an injustice to the great American mathematician and logician
Haskell Curry and his famous Y combinator.
Stay tuned to the voice of an average story storytelling
chimpanzee or login at http://panarrans.blogspot.com
Good night mon ami and my fellow cousin ape.
Advertisements
Another great educator and a teacher that I am aware of is
Professor Subhashish Chattopadhyay in Bangalore, India.
While I narrate stories, Professor Subhashish an electronic
engineer and a former professor at BARC, does and teaches real mathematics and
physics.
He started the participation of Indian students at the
International Physics Olympiad.
Do visit him here:
All his books can be downloaded for free through this link:
For edutainment and English education of your children, I
recommend this large collection of Halloween Songs for Kids:
No comments:
Post a Comment