Looks like the villagers have figured out the patterns for the “Lunchbox” puzzle .
I think I’ve figured out how lunchboxes work!
Really? Then explain to me.
Looking for some other page?
Let me explain. First, you compare the bottom two items.
If the bottom two items are the same, then when you run it, we’re left with the top row at the end.
So this is the solution for the first Yes / No quiz:
Now, let’s talk about the case where the bottom two items are different.
In this case, when you run it, we’re left with the bottom-right item at the end.
So this is the solution for the second Yes / No quiz:
This has to be the solution. Am I correct?
You’re exactly right. Good job!
Yay!
However, don’t celebrate just yet.
Huh? Why not?
Because: Before going to the next page, we still need to formalize the rules of the “Lunchbox” puzzle .
Formalize? What do you mean?
Here are the patterns you discovered:
They’re not wrong, but they are not detailed enough to solve more difficult puzzles.
Hmm… okay…
In order to solve more complex puzzles, we need to formalize the rules. We must be more detailed.
So: I’ll explain to you the formal, more detailed rules of the “Lunchbox” puzzle .
Once you understand it, I’ll give you more complex puzzles to solve.
Okay… show me what the formal rules look like.
Here are the formal rules of the “Lunchbox” puzzle . There are four steps:
1. Label: t l r
2. Match: l r
3. Copy: t r
4. Remove: t l
Now, let’s talk about each step.
We’ll use this lunchbox to explain each step:
First: We label:
Let’s see it in action. Press Next :
The sandwich is labeled as t, and sushi on the bottom are labeled as l and r.
Second: We check to see if some of l’s and r’s match. If they match, add the sign.
Press Next :
The sushi labeled as l and r now have a sign.
Third: We copy t’s to where the matched r’s are.
Press Next :
The sandwich (labeled as t) is copied to where the matched r is.
Finally: We remove t’s and l’s.
Press Next :
t’s and l’s have turned into .
After removing these, we’re left with just the sandwich .Press Next :
That’s it!
Question: What happens if there are more than one item on the top, like the example below?
Answer: In this case, both spaghetti and bread will be labeled as t (for “Top”).
Then: The pizzas match …
Therefore: Both spaghetti and bread get copied to where the matched r is.
Finally: t’s and l’s disappear…
And we’re left with spaghetti and bread .
To wrap up, let’s go through the entire process from the beginning to the end.
We’ll be using the Run button with the “Show every step” functionality, which automatically shows every step that happens between the beginning and the end.
If you use this button…
Here’s the previous example with one item on the top. Press Run . (Or press to step through manually.)
Here’s the previous example with two items on the top. Press Run :
Let’s review what we’ve learned so far:
1. Label: t l r
2. Match: l r
3. Copy: t r
4. Remove: t l
I see, now I understand everything clearly.
Good. And by formalizing the rules in detail like this, we’ll be able to solve more complex puzzles.
But wait. What happens if l’s and r’s don’t match?
For example, the lunchbox below has no match among l’s andr’s.
Press Next :
Answer: If l’s and r’s don’t match, skip the “copy” step, and just remove t’s and l’s.
Press Next :
In this case, we’re left with the chicken . Press Next :
Review: Let’s go through all the steps again—this time for cases where l’s and r’s don’t match.
Here’s the previous example with one item on the top. Press Run . (Or press to step through manually.)
Here’s the previous example with two items on the top. Press Run :
If none of l’s and r’s match: Skip the copy step and simply remove t’s and l’s.
That’s it for the formal rules of the “Lunchbox” puzzle .
Ok…
I understood them, but I haven’t fully memorized them yet.
It’s ok. Don’t worry if you haven’t memorized the rules. We’ll do a review when we use them later.
Oh, that’s good to hear.
(Maybe the devil isn’t so evil after all… )
On the next page, I’ll give you more challenging puzzles.
If you want your mathboxes back, you better solve all of them.
Alright, bring it on!