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.

Non-programmers

Slide 1 / 7

This is the final page!

Looking for some other page?

Slide 2 / 7

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

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â

instead of a âlunchboxâ

instead of a âlunchboxâ

Letâs now talk about lambda calculus.

Slide 3 / 7

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

Lambda calculus works exactly like

a lunchbox

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:

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

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

lambda calculus more approachable

Slide 4 / 7

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

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

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

any calculations that can be

done by todayâs computers

Slide 5 / 7

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

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

like Python have a feature

that originated from lambda calculus

Slide 6 / 7

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

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

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

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âŠ

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.

Computer science is all about

building a complex thing from simple things.

Lunchboxes and 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)

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

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

- Lunchboxes are simple, but by combining them, you can create a lunchbox that can do complex calculations.
- Y Combinator is a special kind of a lunchbox that allows you to repeat any calculations.
- Lunchboxes are the same thing as lambda calculus, which was invented in the 1930s and influenced many programming languages.
- 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@gmail.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.

Here are some of the readersâ comments:

Press the button below to continue to the course!