Looking for some other page?
In the last page, a villager from Lambda Village asked the following question:
Are there any calculations that lunchboxes cannot do?
To answer this question, we need to ask another question: Who invented lunchboxes?
Answer: Lunchboxes were invented in the 1930s by a mathematician Alonzo Church.
However: Alonzo Church did not call it a âlunchboxâ when he invented it. Instead, he called it âLambda calculusâ.
Letâs now talk about lambda calculus.
Lambda calculus, invented by Alonzo Church, works exactly like a lunchboxâalthough they look different.
Here is an example of lambda calculus. The leftmost letter, λ, is a Greek letter âlambdaâ. Thatâs why itâs called âlambda calculus.â
λA.B C
The above lambda calculus expression is exactly the same as the following lunchbox:
λA.B C
If you run the above lunchbox, it will become . Press Run :
Similarly: If you ârunâ the earlier lambda calculus expression, the result will also be B
.
λA.B C
B
Of course, there are more complicated lambda calculus expressions. Take a look at this one:
λA.(λB.A(B B))(λB.A(B B))
The above lambda calculus expression is exactly the same as this lunchbox:
If you replace with sushi , and replace with a sandwich , it will be the same as the Y Combinator lunchbox we used on previous pages.
So: The previous lambda expression represents Y Combinator.
λA.(λB.A(B B))(λB.A(B B))
We have been talking about lunchboxes in this course. But we really were talking about lambda calculus. I invented lunchboxes to make lambda calculus more approachable for non-programmers.
Now, letâs revisit the villagerâs question:
Are there any calculations that lunchboxes cannot do?
Earlier, we said that: Lambda calculus works exactly like a lunchbox.
So we can rephrase the above question as follows:
Are there any calculations that lambda calculus cannot do?
And hereâs the answer: Lambda calculus can do any calculations that can be done by todayâs computers. Therefore, any calculations that your computer or smartphone can do are also possible for lambda calculus.
And because lunchboxes are the same as lambda calculus: If something can be calculated by todayâs computer, it can also be done using a lunchbox.
So, to answer the villagerâs question: Lunchboxes can do any calculations that can be done by todayâs computers.
Lambda calculus, invented by Alonzo Church in the 1930s, had a big impact in the evolution of modern computer science.
Specifically: Lambda calculus influenced many programming languages. Todayâs popular programming languages usually have a feature that originated from lambda calculus.
Example: Python is one of the most popular programming languages today, especially in the field of AI.
The python language has a feature called âlambdaâ, which is similar to lambda calculus.
Hereâs an example of pythonâs âlambdaâ feature: Take a look at the Python code below (weâll use green for the Python code).
(lambda A: A)('B')
The above Python code is pretty much the same as the lambda calculus expression below:
λA.A B
If we represent this using a lunchbox, the final result will be .
Similarly, if you run the earlier Python code, the result will be 'B'
as well.
(lambda A: A)('B')
'B'
Summary: Todayâs popular programming languages like Python have a feature that originated from lambda calculus.
Weâre almost done, but let me say a few things about computer science and Y Combinator.
One of the most important ideas in computer science is to build a complex thing from simple things. After all, computers are made of very simple things: 0âs and 1âs.
In this course, we learned about lunchboxes (or lambda calculus). And lunchboxes are simple. There are only a few rules you need to know:
But we learned that: Even though lunchboxes are very simple, they can do any calculations that can be done by todayâs computers.
Why is that possible? Because, as weâve seen so far, by combining simple lunchboxes, you can build a complex lunchbox that can do complex calculations.
For example: We learned that we can use the Y Combinator lunchbox to do complex calculations like factorials.
Again: Computer science is all about building a complex thing from simple things. I think lunchboxesâespecially Y Combinatorâare a great example of this idea.
We didnât have time to talk about any other topics in computer science. But in every sub-field of computer science, youâll learn to build a complex thing from simple things.
For example: If you study artificial intelligence, youâll learn to build a âneural networkâ âa complex thing that can be used to process imagesâby combining simple things called âneuronsâ .
Hopefully, this course gave you an idea of what learning computer science is like. If you do end up learning computer science, youâll be surprised that most innovative ideas in computer science are based on lots of simple ideas.
Hereâs a quick summary of what we learned in this course:
Thatâs it for this course!
If youâre a programmer and are interested in trying out the Y Combinator program, press âTest Y Combinator in devtoolsâ below.
You need to be on a desktop browser thoughâyou canât do it on a smartphone.
If you have a question or a comment: Please email me at shu.chibicode@gmail.com.
If youâre a programmer:
Once again, thank you for reading!
About me: Iâm Shu Uesugi, a full-stack developer based in California, USA.