Hello! This is page 17 of the course called âY Combinator for Non-programmersâ. If you just got here, click here to read from the beginning.

# .css-tfe8vv{color:#9575cd;}Epilogue:Computer Science, Lambda Calculus, and Y Combinator

Slide 1 / 7

### This is the final page!

This is the final page!

Looking for some other page?

Slide 2 / 7

### Who invented lunchboxes?

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?

Who invented lunchboxes?

Answer: Lunchboxes were invented in the 1930s by a mathematician Alonzo Church.

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â.

It was called âLambda calculusâ

Letâs now talk about lambda calculus.

Slide 3 / 7

### Lambda calculus and lunchboxes

Lambda calculus, invented by Alonzo Church, works exactly like a lunchboxâalthough they look different.

Lambda calculus works exactly like
a lunchbox

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`
The above lambda calculus expression is
exactly the same as this lunchbox:
1
1

If you run the above lunchbox, it will become . Press Run :

1
1

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:

1
12
2
1
1
12
2
1

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.

If you replace with , and
with , itâs the same as
the Y Combinator lunchbox
1
12
2
1
1
12
2
1

So: The previous lambda expression represents Y Combinator.

`Î»A.(Î»B.A(B B))(Î»B.A(B B))`
Y Combinator

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.

I invented lunchboxes to make
lambda calculus more approachable
Slide 4 / 7

### Back to the villagerâs question

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.

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.

Lambda calculus can do
any calculations that can be
done by todayâs computers

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.

Lunchboxes can do
any calculations that can be
done by todayâs computers
Slide 5 / 7

### Legacy of lambda calculus

Lambda calculus, invented by Alonzo Church in the 1930s, had a big impact in the evolution of modern computer science.

Lambda calculus 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.

Python Programming Language

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 .

Because the bottom two are the sameâŠ
1
1
on the top remains

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.

Popular programming languages
like Python have a feature
that originated from lambda calculus
Slide 6 / 7

### Building a complex thing from simple things

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.

One of the most important ideas
in computer science:

Build a complex thing from
simple things

In this course, we learned about lunchboxes (or lambda calculus). And lunchboxes are simple. There are only a few rules you need to know:

Lunchboxes are simple:
There are only a few rules
you need to know
tlr
tlr
tlr
tl

But we learned that: Even though lunchboxes are very simple, they can do any calculations that can be done by todayâs computers.

Lunchboxes 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.

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.

By combining Y CombinatorâŠ
1
12
2
1
1
12
2
1
âŠwith a lunchbox that can
calculate multiplicationsâŠ
You can do complicated 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.

building a complex thing from simple things.
Lunchboxes and 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â .

In AI, youâll learn to build
a neural network (a complex thing)
using neurons (a simple thing)

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.

Slide 7 / 7

### Conclusion

Hereâs a quick summary of what we learned in this course:

1. Lunchboxes are simple, but by combining them, you can create a lunchbox that can do complex calculations.
2. Y Combinator is a special kind of a lunchbox that allows you to repeat any calculations.
3. Lunchboxes are the same thing as lambda calculus, which was invented in the 1930s and influenced many programming languages.
4. Computer science is all about building a complex thing from simple things. Lunchboxesâespecially Y Combinatorâare a great example of this.

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.

Thank you for reading! Iâd appreciate it if you could share your thoughts by quote-retweeting the following tweet:

If you have a question or a comment: Please reply to the above tweet with a screenshot, or email me at shu@chibicode.com. You can also discuss this on Hacker News.

If youâre a programmer:

• You should also check out this article of mine: âYou Can Explain Functional Programming Using Emojisâ.
• This course is built using TypeScript and React. Check out the source on GitHub.

Once again, thank you for reading!

About me: Iâm Shu Uesugi, a full-stack developer based in San Francisco Bay Area, USA.