Living Museum of Learning

Where real moments become exhibits
← Prev Next →
“Ah, Yes!” — Two New Tricks in One Class

“Ah, Yes!” — Two New Tricks in One Class

A problem needed a theorem, a forgotten pattern was rediscovered, and a new pattern learned to check itself

Tianjing's 1.5-hour class on the last day of August began with a piece of homework that was supposed to be “working.”

She had written a Python program to generate seven random numbers and find the second largest:

import random

box = []

for _ in range(7):
n = random.randint(0, 200)
box.append(n)
print(box)

if box[0] > box[1]:
max = box[0]
second = box[1]
else:
max = box[1]
second = box[0]

for i in range(2, 7):
if box[i] > max:
second = max
max = box[i]
elif second < box[i] < max:
second = box[i]

print(second)

It seemed to work.

We ran it.

It produced answers.

And fortunately, we found a hidden bug.

I told Tianjing that hidden bugs are much worse than crashing bugs.

A crashing program tells you immediately:

“Something is wrong!”

A hidden bug says:

“Everything is fine.” 😇

Her earlier logic had somehow “fixed itself” on the examples she happened to test, allowing the bug to hide.

Tianjing fixed it and then went further. She changed the program so the user could choose how many random numbers to generate, handled the case where only one number was requested, and generalized the loop.

The result became a more useful program rather than merely a repaired one.

Then came a Khan Academy Grade 8 course challenge.

The problem asked for the area of a right triangle when one leg and the hypotenuse were known.

Tianjing immediately said:

“I know how to calculate the area of a triangle, b*h/2. But …”

Exactly.

She knew how to calculate the area.

But she did not know the missing leg.

She had heard of the Pythagorean theorem before, but had no idea what it actually was.

So instead of simply giving her the formula, we went to Desmos.

We created different right triangles.

We estimated their hypotenuses.

And we looked for a pattern.

For 3, 4, 5:

a = 3
b = 4
c = 5

a^2 + b^2 = 25
c^2 = 25

Then we tried a scaled version:

a = 30
b = 40
c = 50

a^2 + b^2 = 900 + 1600 = 2500
c^2 = 2500

Then something less familiar:

a = 1
b = sqrt(3)
c = 2

a^2 + b^2 = 1 + 3 = 4
c^2 = 4

And finally, an arbitrary example:

a = 7
b = 11

Tianjing guessed:

c = 13 ?

We checked:

a^2 + b^2 = 49 + 121 = 170

So:

c = sqrt(170) = 13.0384

Her guess was close.

The pattern was now hers.

She had heard the name “Pythagorean theorem” before.

Now she knew what it meant.

The second new trick came from a completely different direction.

We looked at squares of numbers ending in 5:

15 * 15 = 225
25 * 25 = 625
35 * 35 = 1225
45 * 45 = 2025
55 * 55 = 3025
65 * 65 = 4225
75 * 75 = 5625
85 * 85 = 7225
95 * 95 = 9025

Tianjing noticed something.

The tens part of each square followed:

2
6
12
20
30
42
56
72
90

And the increases were:

2, 4, 6, 8, 10, 12, 14, 16, 18

She told me she had figured out this pattern before, but had forgotten it.

I said:

“Good. Re-find it then.”

She did.

We verified the pattern pair by pair.

But then I challenged her again:

“Your pattern is cool, but not convenient since we have to know a previous value. Could you find a more direct pattern?”

One or two minutes later, she found one.

For numbers ending in 5:

15^2 = 1 * 2 * 100 + 25
25^2 = 2 * 3 * 100 + 25
35^2 = 3 * 4 * 100 + 25
...
95^2 = 9 * 10 * 100 + 25

In other words:

(10n + 5)^2 = 100n(n + 1) + 25

But then came one of my favorite moments.

I told her:

“For 85 and 95, you don't need to calculate on paper. Just use your earlier pattern to verify your new-found pattern.”

Tianjing immediately:

“Ah, yes!”

LOL.

That little “Ah, yes!” contained an important mathematical idea.

A pattern does not have to disappear when a better pattern is found.

The old pattern can become a checking tool.

The new pattern can be tested against the old one.

One way of calculating can verify another.

This is a small but powerful step from finding patterns to working with patterns.

The same spirit appeared in her Python homework.

A program that appears to work is not automatically correct.

A pattern that looks convincing is not automatically true.

A solution should be tested.

A new idea can be checked against evidence.

And a solution can often be improved after it works.

So the class contained three different kinds of mathematical and computational thinking:

Debugging:
“Why does this program appear to work when something is wrong?”

Discovery:
“What relationship do these right triangles have?”

Pattern finding:
“What is happening in these squares?”

Verification:
“Can one pattern check another?”

None of these required Tianjing to memorize everything beforehand.

She needed to notice, test, compare, and try again.

And perhaps the nicest part is that she had forgotten one pattern.

That turned out not to be a problem.

She simply found it again.