Saturday, July 17, 2021

Cheng Mysteries 1-2: It's All Inside Out and The Impossible Staircase


Table of Contents

1. Introduction to Molly and the Mathematical Mysteries: The Adventure Begins
2. Molly and the Mathematical Mysteries 1: It's All Inside Out
3. Molly and the Mathematical Mysteries 2: The Impossible Staircase
4. Catching up with Lemay Chapter 13
5. Conclusion

Introduction to Molly and the Mathematical Mysteries: The Adventure Begins

My copy of Eugenia Cheng's latest book finally arrived from the library. I was going to read Stewart until Cheng arrived and then return to Stewart after finishing Cheng. But I didn't realize that Cheng's book would arrive so late, and that there would be just one measly chapter of Stewart left. So instead, I edited in Stewart's last chapter into my July 9th post so that we can make a clean transition from Stewart to Cheng.

Eugenia Cheng's fifth and latest book, Molly and the Mathematical Mysteries: Ten Interactive Adventures in Mathematical Wonderland, isn't like her first four books. The first four books covered adult topics such as category theory, infinity, logic, and gender. But her fifth book is geared towards a younger audience -- younger than the students I normally teach. It's Cheng's first children's book. Let's step inside!

Cheng begins with a message right on the title page:

"When you think about math, what do you think about? Do you think it's all just numbers and equations? Then think again..."

Indeed, we know that the author is a category theorist -- and there's much more to category theory than just numbers and equations, as we learned in her first book. Later on this page, we meet our heroine:

"Molly is a curious explorer, and she is about to go on a fantastic adventure by following a trail of mysterious clues. She'll need to be imaginative, and she just might need some help. So are you felling adventurous? Then step inside!"

Cheng's goal with this book, of course, is to motivate not just young children in general, but young girls in particular, to study math. As we learned back in her fourth book on gender, many girls are turned off by math because the subject is too -- as the author puts it -- "ingressive." In other words, math classes are too focused on competition and speed. If math could be more "congressive" -- that is, focused on working together towards a common goal -- then girls might enjoy it more. This is why it's so important for the author to have a young female protagonist, Molly, in order to see and enjoy math through her eyes.

Of course, you might ask, if young girls are Cheng's target demographic, then why am I, a middle-aged male, reading this book? Well, I already know and enjoy math, but there are many students in my classes, including young girls -- and they are the ones who need to learn math. Even though this book might be a bit too young for them, this book can help me appreciate math from a more congressive perspective, so that I can engage my girls effectively.

(Note: I don't ordinarily use the words "ingressive" and "congressive," but since we're reading a Cheng book now, we might as well revisit her terminology."

When we turn the page, the adventure begins...

"This is Molly. She's an ordinary girl with an ordinary bedroom. But what's that on the floor?"

As it turns out, this is a pop-up book -- there is a note on the floor, and the young book readers can open the note to read it:

"Hi! Are you ready to get going? The journey will be implausible but not impossible. To begin, just turn your room inside out! I'll meet you on the other side..."

But what does it mean to turn a room inside out, anyway? The author explains:

"Think about holding a sock (or even find a real sock to experiment with!). To turn the sock inside out, you have to push the material through the round opening. Now imagine the opening is a window and the material is your room. Turning your bedroom inside out doesn't seem so impossible anymore...at least in your imagination!"

And there's also a challenge for the reader:

"How many socks can you find in Molly's bedroom? Can you match three pairs?"

This one's tricky -- there are more than six socks in the room, including several that don't match. So it took me a while to find the three pairs.

Molly and the Mathematical Mysteries 1: It's All Inside Out

Let's begin Cheng's first adventure:

"Molly has done it! All of her bedroom furniture is stuck to the outside of her house. It's Molly's bedroom...turned inside out!"

There is another note for Molly on this page:

"Things here aren't always what they seem... To move forward, just follow the white rabbit. But is it going up or down?"

A white rabbit -- is this a reference to Lewis Carroll's Alice's Adventures in Wonderland? But then again, there's a difference between the two books. Alice only travelled through the looking-glass, and so Wonderland is only backwards (that is, reversed in only one dimension). But Molly's destination is inside-out, and so it's reversed in two dimensions. Indeed, the rabbit hole is itself inside-out, and so the White Rabbit is climbing up a pillar rather than jumping down a hole.

At this point you might be wondering, where's the math? After all, the subtitle of the book tells us that this will be a mathematical adventure. Well, Cheng provides the math on this page:

"There are many different opposites in math. They are sometimes called inverses. For example, the inverse of multiplication is division. The inverse of adding is subtracting."

And the author adds -- or is it "subtracts," since we're inside-out:

"If you invert something, you can always invert it again to get back to where you started. Just like the negative of a negative number is positive: -(-1) = 1."

Notice that both of these are taught in our Math 7 classes. Seventh graders learn about positive and negative numbers, and they also use inverse operations to solve equations.

And there's also a challenge for the reader:

"What other inside-out things can you see on this page?"

Some of the other inverted objects include a toolshed (with tools hanging on the outside of the shed) and a pond (the water forms a mound on the ground).

Before we leave our inside-out world and proceed to the next page, whenever I think about inside-out objects, I always think about the ending of the Simpsons' Treehouse of Horror V. On Halloween, there is a fog that turns entire people inside out!

Oh, and there's one more mathematical example of inside-outness that I can think of -- while a usual (line) reflection takes us to Wonderland, a circle inversion can be described as a transformation that maps the interior of a circle to the exterior and vice versa. So it really does make objects inside-out.

Molly and the Mathematical Mysteries 2: The Impossible Staircase

Let's begin Cheng's second adventure:

"Molly pops out of the rabbit hole at the other side and finds herself on a staircase. There's something very strange about it, but Molly can't figure out what. What will she find at the top?"

But unfortunately for our young heroine, the staircase doesn't seem to have a top! That's because the staircase is an optical illusion.

Two years ago, our side-along reading book was Douglas Hofstadter's Godel, Escher, Bach. That middle name, Escher, was an artist who drew optical illusions. One of his works featured in Hofstadter's introduction was Ascending and Descending, and it has a staircase where one can continually ascend the stairs without getting any higher, or descend the stairs without getting any lower. And as it appears, Molly is currently on the exact same type of staircase.

Oh, and by the way, recall that the subtitle of Hofstadter's book is A Metaphorical Fugue on Minds and Machines in the Spirit of Lewis Carroll -- and Cheng already invoked Carroll in her own book. The difference is that Cheng referenced the White Rabbit, while Hofstadter focused on Carroll's version of the Tortoise and Achilles. Still, we keep coming up with the same references over and over again no matter what side-along book we read -- it's as if twisted minds think alike!

OK, so let's get back to Molly. How does she escape her own impossible Escher staircase? Well, there's another note for Molly on this page:

"Don't worry, Molly! You're only going around and around on the 2D page. Lift the staircase at a corner to escape using the third dimension!"

And indeed, there is a staircase for the reader to lift that leads to "Exit." The author explains:

"The Impossible Staircase is something known as an impossible object. That means it can exist as a 2D drawing or in our minds -- but it could never exist in the 3D world."

And indeed, the artist Escher took full advantage of this idea. All of his painting were 2D, which is why he could draw impossible staircases in his paintings. But the real world is 3D. Cheng explains that the real, physical world only has three space dimensions:

  • left and right
  • forward and backward
  • up and down

Yet she hints that more than three dimensions are possible:

"Our amazing brains can imagine in four, five, or even infinite dimensions!"

Indeed, Cheng herself writes about additional dimensions in her third book on logic. (Rudy Rucker, another author we've read on the blog before, explores the fourth dimension in more detail.)

In our math classes, we might consider mentioning this in Geometry, in particular when it's time to compare two- and three-dimensional objects.

As usual, there's also a challenge for the reader:

"This is another impossible object. How many others can you spot in the room?"

This challenge is too visual for me to describe on the blog, and so I won't. I will point out that there are upside-down objects (including several potted plants) near the bottom of the page -- rotate the book 180 degrees, and these objects now appear to be resting on the floor near the top of the room.

Catching up with Lemay Chapter 13

As we were reading Chapters 14-18 of Ian Stewart's book, I tried to keep up with Lessons 14-18 in Java, so that I'd always remember which lesson we're on. But now that we're done with Stewart, let's get back to Lemay and pick up some of the parts that we missed.

In particular, there was a long listing in Chapter 13 that we never reached. So let me see whether I can finally get it working on my computer now:

Listing 13.3. The ColorTest applet.

 1:import java.awt.*;
 2:
 3:public class ColorTest extends java.applet.Applet {
 4:  ColorControls RGBcontrols, HSBcontrols;
 5:  Canvas swatch;
 6:
 7:  public void init() {   
 8:    setLayout(new GridLayout(1,3,5,15));
 9:    
10:    // The color swatch
11:    swatch = new Canvas();
12:    swatch.setBackground(Color.black);
13:    
14:    // the subpanels for the controls
15:    RGBcontrols = new ColorControls(this, "Red", "Green", "Blue");
16:    HSBcontrols = new ColorControls(this, "Hue", "Saturation", "Brightness");
17:
18:    //add it all to the layout
19:    add(swatch);
20:    add(RGBcontrols);
21:    add(HSBcontrols);
22:  }
23:
24:  public Insets insets() {
25:    return new Insets(10,10,10,10);
26:  }
27:
28:  void update(ColorControls controlPanel) {
29:    Color c;
30:    // get string values from text fields, convert to ints
31:    int value1 = Integer.parseInt(controlPanel.tfield1.getText());
32:    int value2 = Integer.parseInt(controlPanel.tfield2.getText());
33:    int value3 = Integer.parseInt(controlPanel.tfield3.getText());
34:
35:    if (controlPanel == RGBcontrols) {  // RGB has changed, update HSB
36:      c = new Color(value1, value2, value3);
37:
38:      // convert RGB values to HSB values
39:      float[] HSB = Color.RGBtoHSB(value1, value2, value3, (new float[3]));
40:      HSB[0] *= 360;
41:      HSB[1] *= 100;
42:      HSB[2] *= 100;
43:
44:      // reset HSB fields
45:      HSBcontrols.tfield1.setText(String.valueOf((int)HSB[0]));
46:      HSBcontrols.tfield2.setText(String.valueOf((int)HSB[1]));
47:      HSBcontrols.tfield3.setText(String.valueOf((int)HSB[2]));
48:   
49:    } else {  // HSB has changed, update RGB
50:      c = Color.getHSBColor((float)value1 / 360, 
51:        (float)value2 / 100, (float)value3 / 100);
52:
53:      // reset RGB fields
54:      RGBcontrols.tfield1.setText(String.valueOf(c.getRed()));
55:      RGBcontrols.tfield2.setText(String.valueOf(c.getGreen()));
56:      RGBcontrols.tfield3.setText(String.valueOf(c.getBlue()));
57:    }
58:
59:    //update swatch
60:    swatch.setBackground(c);
61: swatch.repaint();
62:}
63:}
Listing 13.4. The ColorControls class.
 1:import java.awt.*;
 2:
 3:class ColorControls extends Panel {
 4:  TextField tfield1, tfield2, tfield3;
 5:  ColorTest applet;
 6:
 7:  ColorControls(ColorTest parent,
 8:        String l1, String l2, String l3) {
 9:
10:    // get hook to outer applet parent
11:    applet = parent;
12:
13:    //do layouts
14:    setLayout(new GridLayout(3,2,10,10));
15:    
16:    tfield1 = new TextField("0");
17:    tfield2 = new TextField("0");    
18:    tfield3 = new TextField("0");    
19:
20:    add(new Label(l1, Label.RIGHT));
21:    add(tfield1);
22:    add(new Label(l2, Label.RIGHT));
23:    add(tfield2);
24:    add(new Label(l3, Label.RIGHT));
25:    add(tfield3);
26:  }
27: 
28: public Insets insets() {
29:    return new Insets(10,10,0,0);
30:  }
31:
32:  public boolean action(Event evt, Object arg) {
33:    if (evt.target instanceof TextField) {
34:      applet.update(this);
35:      return true;
36:    } else return false;
37:  }

38: }

As only one class is public, I can include it all in one file (but don't import java.awt.*; twice). I enjoy looking at all the possible colors. When trying this out, recall that RGB values each range from 0 to 255, while for HSB, the hue goes from 0 to 360 (like degrees on a color wheel) while saturation and brightness go from 0 to 100 (like percentages).

Conclusion

We'll continue revisiting the missing Lemay programs as we continue to read Cheng's book. I look forward to seeing what Molly sees after she leaves the impossible staircase!

And I know, I know -- this is a children's book that I could read entirely in one day. Ten pages -- we've covered Stewart chapters that are twice as long as this entire book in one post. Still, I have the book for three weeks, and I plan on enjoying it for the entire length of time. 

No comments:

Post a Comment