Beginner 2
Hello! This is page 4 of the course called “Y Combinator for Non-programmers”. If you just got here, click here to read from the beginning.

Y Combinator for
Non-programmers

Beginner 3: Lunchboxes

Slide 1 / 11

The devil appears

One day, the devil suddenly appeared in Lambda Village.

The devil appears

The villagers are all scared to death.

Oh no, the devil is here! We’re doomed!

Please spare our lives!

The devil responds:

Don’t worry. I’m not here to take your lives away…

However, I will take all of your mathboxes . They’re all mine now!

What? No way!

You can’t take our mathboxes. That’s too cruel!

Looking for some other page?

Beginner 2·
·Beginner 4
Slide 2 / 11

Why did the devil take mathboxes?

And just like that: The devil has taken every single mathbox in Lambda Village.

I’m taking all your mathboxes!

The villagers, who all relied on mathboxes for doing additions and subtractions, were very upset.

Why did you do this to us?

We’re all really bad at math.

Without mathboxes, we can’t do any calculations. Our businesses will struggle, and our economy will crash!

The devil answers:

That’s exactly why I took away your mathboxes. It’s because you all are bad at math.

You see, your math skill hasn’t improved because you’re relying on mathboxes to do everything.

Hmm… you’re right…

So, by taking away your mathboxes, I’m giving you an opportunity to finally study math.

You should thank me for it.

But… but… we don’t want to study math!

Slide 3 / 11

The challenge

The villagers are now pleading with the devil to have the mathboxes returned.

Please return the mathboxes to us. We’ll do anything!

We beg you!

Hmm…okay. Maybe I’ll give you a chance.

What does the devil mean by “a chance”?

How about … the puzzle challenge?

I’ll give you some puzzles that require lots of thinking. If you can solve all of them, I’ll give your mathboxes back.

Puzzles…? They sound hard… I don’t know if we can do it.

But…we have to get our mathboxes back.

We’ll accept your challenge!

I like that answer. Let’s begin the challenge!

So: The villagers are now on a mission to solve the devil’s puzzles and get the mathboxes back.

Let’s take back the mathboxes!
Slide 4 / 11

The “Lunchbox” puzzle

The puzzle you’ll be solving is called the “Lunchbox” puzzle .

First, take a look at this:

LunchboxJapanese lunchboxes. Photo taken at Kiyoken
in Yokohama, Japan, the author’s hometown.

Wow, they look delicious…

These are traditional Japanese lunchboxes (called “Bento Boxes” ).

As you can see, each lunchbox has several sections, and each section has some type of a food item.

Lunchbox

Now, take a look at this below. This is an example of the “Lunchbox” puzzle .

A “Lunchbox” puzzle

It looks like a Japanese lunchbox.

It has 3 sections, each containing a food item. It has sushi and a sandwich .

Yes. It’s called the “Lunchbox” puzzle because it looks like a Japanese lunchbox.

Now, let’s take a look at it in more detail…

Explanation: In this example, the top section has a sandwich :

The top section has a sandwich

And each of the bottom two sections has sushi , a traditional Japanese food:

Each of the bottom two sections has sushi

I noticed that it also looks like a mathbox. A mathbox contains numbers, but a lunchbox contains food items.

A mathbox contains numbers…
And a lunchbox contains food items.

Yeah, they’re similar.

Now, let’s talk about how we can run a “Lunchbox” puzzle .

Slide 5 / 11

How to run a lunchbox

We can run a “Lunchbox” puzzle , just like how we can run a mathbox. Try pressing Run below:

Press this button!

After running it, the bottom two sushi disappeared, and only the sandwich is left.

If you run it…
Only the sandwich is left

Yes, and there is actually a specific set of rules that determines what happens when you run a lunchbox.

Your task is to figure out what these rules are.

There’s a specific set of rules for
the “Lunchbox” puzzle .
Your task is to figure out what that is.

Hmm… I can’t tell what the rules are yet. Can we look at more examples?

Sure, let’s look at more examples.

Slide 6 / 11

More examples of the “Lunchbox” puzzle

Let’s take a look at more examples of the “Lunchbox” puzzle .


This one has fried potatoes on the top row and a hamburger and chicken on the bottom row. Try pressing Run :

This time, we’re left with chicken at the end.

Hmm… this pattern seems to be a little different from the last time.


Next, we’ll talk about the cases where there are more than one item on the top row.

This one has spaghetti and bread on the top row and two slices of pizza on the bottom row. Try pressing Run :

This time, we’re left with spaghetti and bread at the end.


This one has curry and tacos on the top row and salad and a hot dog on the bottom row. Try pressing Run :

This time, we’re left with a hot dog at the end.


They all follow a pattern. Can you guess what that is?

Can you guess what the pattern is?
Slide 7 / 11

Did you figure out the pattern?

So, did you figure out what the pattern is?

Hmm… Not too sure yet…

For your reference: Here are the four lunchboxes we’ve seen so far, and what happened when we ran them.

Example 1:

Example 2:

Example 3:

Example 4:

Hmm… maybe I’m seeing a pattern…

Alright. Let’s do a Yes / No quiz then.

I’ll check if you’ve figured out the pattern correctly.

I’m not 100% sure… but I’ll try!

Slide 8 / 11

Yes / No Quiz, Part 1

We’ve shown you four lunchbox puzzles. They all follow a specific set of rules. Let’s see if you’ve figured it out!

Let’s see if you’ve figured out the pattern

Question: Take a look at this “Lunchbox” puzzle :

If you run this, will it become the following lunchbox at the end?

It’s okay if you have no idea.
Just guess!

Beginner 2
Japanese Site (日本語版) · About this Site · Twemoji