Monday, June 22, 2020

Stewart Chapter 5: Celestial Police

Table of Contents

1. Introduction
2. Shapelore Learning 14-1: Sunderly Right Threenooks
3. Three June Celebrations
4. Juneteenth and the School Calendar
5. Calculating the Cosmos Chapter 5: Celestial Police
6. A Rapoport Math Problem
7. Music: "Be Happy," "U-N-I-T Rate," "Learning to Communicate," "Diagrams"
8. Lemay Chapter 8 Part 1: "Java Applet Basics"
9. More About Applets in Java
10. Conclusion

Introduction

You may have heard of the movie franchise How to Train Your Dragon, but what many people don't know is that the book series written by Cressida Cowell is completely different from the movie.

No, I'm not going to start comparing the books and movies here on the blog. The reason I'm bringing this up is because of something else. It's come to my attention that in her latest book (which has nothing to do with dragons, but wizards), Cowell has written some lines in Anglish. In describing some classes at a school for wizards, she writes:

History of Magic, tree climbing, wort-cunning, leechdom, and starcraft (the last three being study of herbs and plants, medical remedies, and the art of interpreting and reading the stars, those sorts of things).

I have no idea why Cowell's class names are in Anglish. Perhaps it's to distinguish her wizarding classes from their more famous equivalents -- at JK Rowling's Hogwarts. Cowell's Starcraft class corresponds to Rowling's Astronomy class, but note that the Anglish website uses starcraft to mean "astrology" and starlore to mean "astronomy."

Cowell's Wort-Cunning class corresponds to Rowling's Herbology class. But I believe that Rowling unwittingly refers to wort (meaning plant) in her series as well -- the school name Hogwarts actually means "hog-plant" or "hog-lily."

Rowling, unlike Cowell, doesn't have a Leechdom class at her school. The word leech may sound weird to modern ears, but it just means "doctor." The Anglish website mentions several words that combine leech with the other words mentioned thus far -- leechdom, leechwort, leechcraft, and of course leechlore. It also lists healcraft -- and yes, I assume that modern doctors would much rather be called healers than leeches, regardless of what the latter originally meant in Old English.

No, Cowell doesn't have a Shapelore class at her school. Hmm -- I wonder whether Cowell names her classes in Anglish because those names are less intimidating to young students. Those Greek names like Astronomy and Herbology sound scary, but Starcraft and Wort-Cunning sound like fun.

And it's the same reason why I'm recasting Geometry as Shapelore here on the blog. Perhaps our subject will be more accessible to students if they aren't afraid of the vocabulary. Remember, "fear of a name increases fear of the thing itself" (Rowling, not Cowell).

Shapelore Learning 14-1: Sunderly Right Threenooks

Lesson 14-1 of the U of Chicago text is called "Special Right Triangles." We already know that "triangles" are threenooks in Anglish (and threesides in our Plain English), but how should we say "special" in Anglish?

Well, the Anglish website mentions sunderly as the word for "special." It states that this is similar to the German word sonderlich. But most likely, we'll keep "special" in our Plain English instead of sunderly, since "special" is a well-known word in non-mathematical English.

OK, so let's begin translating the lesson into Plain English:

Some right threesides have such relationships (Latin, but non-mathematical) among their sides and angles that they are considered special. These triangles occur in many situations that involve other manysides. By drawing the leanings of a square, eight sameside right threesides are formed. (Can you find all eight? Suppose the allsame sides have length x and the longside has length c, as in the triangle at the right below.

By the Pythagorean (Greek, but proper name -- the only Anglish possibility is to insert an Anglish ending, such as PythagorishProvedsaying, c^2 = x^2 + x^2.
So c^2 = 2x^2.
Taking the forward square root, c = x * sqrt(2).

(Forward is the suggested word in Anglish for "positive," while "negative" of course is backward. As for "square root," the suggested word is fourside root, but I disagree because I use fourside to mean "quadrilateral," not "square." We're grandfathering in "square" anyway, and so we might as well keep "square root" too. By the way, notice that "cube root" is readily written in Anglish as third root, but "square root" can't become "second root" because "second," unlike all other ordinals, is Latin!)

The answer is a relationship among the sides of any sameside right threeside:

Sameside Right Threeside Provedsaying:
In a sameside right threeside, if a leg is x then the longside is x sqrt(2).

Notice that all sameside right threesides are shapesame ("similar"), because they all have the same angles: 45, 45, and 90. Sometimes they are called 45-45-90 threesides.

The first example here is from baseball. While terms from baseball can be translated into Anglish (the suggested word for "baseball" is hardball, in analogy to softball), we're only going to translate the Geometry words. Therefore I'm skipping all non-mathematical examples, since our focus is on translating the mathematical words.

Another special right threeside is the 30-60-90 threeside. It can be formed by any height ("altitude") of an allsameside threeside or by drawing leanings in a steady (regular) sixside. How many 30-60-90 threesides are in the drawing below at the right?

Again the lengths have a simple relationship:

30-60-90 Threeside Provedsaying:
In a 30-60-90 threeside, if the short leg is x then the longer leg is x sqrt(3) and the longside is 2x.

(At this point, I'm now questioning the wisdom of using longside for "hypotenuse," since we now have both longer leg and longside. I wonder whether longestside would be better -- the longer leg is x sqrt(3) and the longestside is 2x. Hey -- I sort of like the sound of that!)

Proof:
Here is a shape with the given and what is to be proved in terms of the shape.

Given: Threeside ABC with Angle A = 30, B = 60, C = 90. The shorter leg is withering the smaller inward angle, so let BC = x.

Prove: (1) AB = 2x;
            (2) AC = x sqrt(3)

The idea is to think of Threeside ABC as half an allsameside threeside and use the Pythagorean Provedsaying.

(1) Flip Threeside ABC over Line AC. Let D = r_AC(B). Flippings preserve length, so CD = x. Since flippings preserve angle breadth, the image Threeside ADC is a 30-60-90 right threeside, with Angle ACD = 90, ADC = 60, and CAD = 30. (Actually, I'm wondering whether the word "image" needs to be replaced. Since transformations are just functions, perhaps we can replace "preimage" and "image" with just input and output, which are Anglish.) Thus, B, C, and D are samelineful ("collinear"), and the big threeside ABD has three 60-degree angles making it allsameside with AB = BD = 2x.

(2) Now, using AB = 2x, we can apply the Pythagorean Provedsaying to Triangle ABC and get AC:

AC^2 + BC^2 = AB^2
AC^2 + x^2 = (2x)^2
AC^2 + x^2 = 4x^2
AC^2 = 3x^2

Taking the forward square root of each side,

AC = x sqrt(3).

We'll now skip up to Example 3, which is a purely mathematical example:

In Threeside XYZ, Angle Z = 45, Angle Y = 30, and XY = 8. Find XZ and YZ.

Answer: Right threesides are needed, so a helper ("auxiliary") line is drawn, the height from x to YZ. This forms 45-45-90 right threeside XZW and 30-60-90 right threeside XYW. Now apply the provedsayings of this lesson. h, withering the 30-deg angle in Threeside XYW, is half of 8, so h = 4. YW = h sqrt(3) = 4sqrt(3). Since the left threeside is sameside, ZW = h = 4.
Adding, YZ = 4 + 4sqrt(3) = 10.93. XZ = h * sqrt(2) = 4sqrt(2) = 5.66.

Check: An accurate picture verifies these lengths.

Of course, you could always measure to get close ("approximate") lengths and angle breadths in a threeside. One advantage of having the provedsayings of this lesson is that for these common threesides you do not have to measure. Another advantage is that they give exact values.

Here we use close for "approximate" yet keep "exact." The phrase "exactly one" is replaced with either one and only one or one and one-off, but "exact" itself can be grandfathered in.

For Chapter 13, we covered two lessons for each post, but here in Chapter 14, I'll do one and only one lesson per post. I want to focus more on simplify this chapter -- which, if you recall, will lead directly into trigonometry.

So for this chapter, let me start doing some of the problems from this lesson. I'll focus on the problems which don't require diagrams, for the benefit of you blog readers who can't see them.

1. In a sameside right threeside, each inward angle measures _____. (Answer: 45)

2. In a right threeside in which the longestside is double one leg, the inward angles have breadths of _____ and _____. (Answer: 30 and 60. By the way, I wonder whether we should keep "double," since this word might confuse some students. The Anglish word would be twice, while of course "two times" would be the least confusing.)

3. In the drawing ... (Skip this one, since it mentions a drawing that you can't see.)

4. True or false/untrue? (OK, I think "false" is simple enough for students to understand, even though the word is Latin.)
a. All right threesides are shapesame. (Answer: false/untrue)
b. All right threesides with a 60-degree angle are shapesame. (Answer: true)
c. All sameside right threesides are shapesame. (Answer: true)

5. In Example 3 ... (Skip this and the next one, since you can't see the diagram for Example 3.)

7. If one leg of a sameside right threeside has length 10 cm, the longestside has length _____. (Answer: 10sqrt(2))

8. A square has side s. What is the length of its leanings? (Answer: s sqrt(2))

9. If the shortest side of a 30-60-90 threeside is 6 cm, what are the lengths of the other two sides (to the nearest 0.1 cm)? (Answer: 10.4 cm, 12 cm. Some readers might point out that metric units like "cm" might be confusing to students. Interestingly enough, the Anglish website argues that the word meter is actually Anglish -- mete means "measure," so meter just means "measurer." So all we'd have to do is change "centi-" to hundredth and get hundredthmeter. But once again, students don't really have to know what "cm" means to answer this problem.)

10. In Major League baseball ... (Skip this since I skipped the baseball example earlier. Besides, with the coronavirus and the ongoing owner-player dispute, there might not be MLB this year anyway.)

11. An allsameside threeside has a side of length E units. What is the length of one of its heights? (Answer: 2E/sqrt(3), since E is the longestside of a 30-60-90 threeside with the height of the first threeside as its longer leg.)

12. (Skip this since it has a diagram.)

13. The longestside of a sameside right threeside is 100 feet. Find the lengths (here the book says "dimensions") of the other sides of the threeside. (Answer: 100/sqrt(2) = 50sqrt(2) feet.)

That's eight problems done -- and as we all know, eight is enough.

By the way, I'll be using these Shapelore posts to discuss other places in math where simplifying the language might be useful. For example, earlier I mentioned that the word "equal," though Latin, is simple enough to grandfather in. Well, here I read that maybe "equal" isn't so simple:

https://www.mentalfloss.com/article/603955/mathematicians-say-equal-sign-is-insufficient

According to this link, the idea that two objects are equal if they have the same elements comes from set theory. (It's called the Axiom, or Postulate, of Extensionality.) But we should think in terms of not set theory, but category theory. (Recall that Eugenia Cheng is a category theorist and wrote about the subject in her first book.) So we should replace "equal" with "equivalent."

From an Anglish/Plain English perspective, replacing the two-syllable word "equal" with a word that not only has more syllables, but clearly contains the same Latin root, is a non-starter.

Recall that the Anglish word for "equation" is worthlink. So perhaps this is the way to go -- we replace "equal" with the word worthsame, and so an "equation," or worthlink, is a sentence that shows two quantities to be worthsame. Then unworthlink could stand for "inequality."

In mathematics, an equivalence relation is any relation that satisfies the Reflexive, Symmetric, and Transitive Properties. In Geometry, the two most important equivalence relations are, of course, congruence and similarity.

Two figures are similar if they have the same shape. So I've already suggested shapesame as a new word for "similar." Perhaps "similarity" should become shapelink, in analogy with worthlink.

Two figures are congruent if they have the same shape and size. Earlier, I suggested using the word allsame for congruent, but this discussion on "equal" has left me second-guessing. Even though the word "size" is French, sizeshapesame is a better Plain English word for "congruent," with once again sizeshapelink as the word for "congruence."

Another Plain English word for "equal" is just is. It might be OK to use "is" in situations where only one type of equivalence is being discussed, such as early elementary school arithmetic. Thus we can ask kindergartners, "What is one plus one?" Later on we can introduce worthsame, and ask, "What is one plus one worthsame to?" (Maybe worthsame as might be better, since we expect same to be followed by as.)

Before we leave Plain English here, notice that a few days ago was the summer solstice. There's an Old English word for the summer solstice -- namely Litha. This word is used to name two of the months on the Anglish website, Forelithe (June) and Afterlithe (July), since the usual names of the months are Latin (you know, as in Julius Caesar and the Julian Calendar.)

I notice that JRR Tolkien, in his Middle Earth series, also uses Forelithe and Afterlithe as months. So this means that Tolkien is yet another author who sneaked Anglish into his work, joining Cressida Cowell and George Orwell.

Oh, and speaking of calendars ...

Three June Celebrations

Today is Monday June 22nd, and my last post was Thursday, June 18th. The three days that I didn't post comprise a full weekend of celebrations:
  • Yesterday, June 21st, was Father's Day.
  • The day before that, June 20th, was Litha, the summer solstice.
  • And the day before that, June 19th, was Juneteenth -- the day that slavery was finally abolished in Texas, the last former Confederate state to end the practice.
I've mentioned Juneteenth on the blog before -- mainly in connection with another day associated with emancipation -- April 16th, when slavery ended in DC. I was trying to explain why income tax returns are due after April 15th in some years. (DC Emancipation Day -- just like Veteran's Day or the Fourth of July -- is observed a day early in years when it falls on a Saturday. Since the IRS is in DC, it would be closed on Friday, April 15th, so that taxes are due on Monday, April 18th in such years.)

I also posted on Juneteenth once. But it was in a year when it fell on Sunday, and so that day was also Father's Day. And while I briefly mentioned Juneteenth that day, I mostly blogged about Father's Day.

I was considering mentioning this in my last post, on Juneteenth Eve. But I didn't because I was desperately trying to keep that post race-free after four straight racial posts (with the last one in discussion of an explosive traditionalists' post). So now I've just reopened a can of worms by writing about race in this post.

And indeed, it's because of the ongoing George Floyd protests that Juneteenth -- a niche holiday unknown to most people who aren't black -- has suddenly become more prominent. Indeed, protesters have used the date to highlight the connection between slavery and the current plight of blacks.

Some businesses have responded by giving their workers half- of full-days off on Friday. And there is now a movement to make Juneteenth the newest federal holiday.

The main objective of the protests isn't just to get another day off from work, of course. The goal is to make our country and the world safer for people of all races. Again, I think of my former students, especially those from the the old charter school (majority black, with some Hispanic). My hope is that these protests will achieve a better world for those students as they approach adulthood.

But still, I like discussing calendars here on the blog -- especially school calendars. And so I'm going to write more about what our calendar will look like if Juneteenth ever becomes a federal holiday. (I will add the "Calendar" label for this reason.)

Juneteenth and the School Calendar

If Juneteenth becomes a federal holiday, it would become only the fourth holiday during the light half, or sunny half, of the year (joining Memorial Day, Fourth of July, and Labor Day). Thus we expect people to spend the new holiday outdoors -- and indeed, current black Juneteenth celebrants do exactly that.

Of course, most schools are already out for the summer by Juneteenth. But notice that this wasn't always the case -- as late as my freshman year of high school, the first day of school was over a full week after Labor Day, and so the last day of school was sometimes after Juneteenth.

When my school started during the week of Labor Day, the last day was before Juneteenth. To see why, consider a year when Labor Day is on its latest possible date, September 7th. If we allow a school year of 41 weeks (180/5 = 36 + 2 weeks for assorted days off/long weekends + 2 weeks for winter break + 1 week for spring break), then Friday of the 41st week is June 18th. Therefore school was always out by Juneteenth.

But then schools started taking off the entire week for Thanksgiving. Thus districts had to decide between starting before Labor Day and ending after Juneteenth -- and most schools ended up choosing the former. Thus Juneteenth (or perhaps more accurately, the summer solstice) became a wall, past which the school year can't extend. Once schools started the year early enough for finals to fall before winter break, they now ended several weeks before Juneteenth.

If Juneteenth becomes a national holiday, will it always be observed on the 19th (unless it's a weekend), or will be something like the nth x-day in June? If it's always on the 19th, then we'll have two holidays 15 days apart that can fall midweek -- if Juneteenth is on a Tuesday or Wednesday, then the 4th of July is on a Wednesday or Thursday. With both holidays falling during the light half of the year, expect workers to be tempted to take extra days off around both holidays in such years.

We could declare the third Monday in June to be Juneteenth. Then this will always fall exactly three weeks after Memorial Day. (This would also fit the Andrew Usher Calendar, where all holidays are a fixed number of days from Labor/Memorial Day.)

Some cities here in Southern California have held small Juneteenth celebrations (though not this year due to the coronavirus). These often took place on the Saturday on or before Juneteenth. This date (exactly 19 days after Memorial Day) is in the range June 13th-19th -- that is, all those dates have "teenth" in their names. I sort of like the idea of Juneteenth always falling on a June "teenth," as opposed to the 21st (unless it's "eleventeenth"). Of course, our federal holiday won't be a Saturday.

There's also a possible clash between Juneteenth and Father's Day -- indeed, recall that when the 19th falls on a Sunday, the two holidays share the day. (This might lead to a situation where blacks refer to it as "Juneteenth weekend" and other races as "Father's Day weekend.")

Returning to schools, I notice that the mayor of New York City has already declared Juneteenth to be a school holiday. NYC is an interesting case because not only does school not begin until after Labor Day there, but it observes many other cultural holidays. Thus school regularly ends after June 19th -- and so Juneteenth will have the result of delaying the last day of school by one day.

For most other districts, Juneteenth will only affect summer school. Most summer schools have two three-week sessions -- and because of the 4th of July, the second session may have one fewer day than the first session. A Juneteenth holiday will fall during the first session, so that the two sessions can be balanced.

Calculating the Cosmos Chapter 5: Celestial Police

It's time for us to return to Stewart's book on starcraft -- I meant starlore -- I meant astronomy.

Chapter 5 of Ian Stewart's Calculating the Cosmos is called "Celestial Police." As usual, it begins with a quote:


The dinosaurs didn't have a space program, so they're not here to talk about this problem. We are, and we have the power to do something about it. I don't want to be the embarrassment of the galaxy, to have had the power to deflect an asteroid, and then not, and end up going extinct.

-- Neil deGrasse Tyson, Space Chronicles

(Oh, so now I have the "Neil deGrasse Tyson" label, too! No, I won't, if this is the only reference to the famous starlorer.) And the proper chapter begins:

"Pursued by a fleet of interstellar warships firing sizzling bolts of pure energy, a small band of courageous freedom fighters seeks refuge in an asteroid belt, weaving violently through a blizzard of tumbling rocks the size of Manhattan that constantly smash into each other."

This is a scene of science fiction -- with the emphasis on fiction. Stewart tells us that this scent is impossible, because it makes bad assumptions about the nature of the asteroid belt. And that's the topic of this chapter -- the asteroid belt. We're reminded from the last chapter:

"According to the Titius-Bode law, there ought to have been a planet between Mars and Jupiter, but there wasn't."

Instead, there was a group of many smaller objects. The German astronomers who discovered them were called Himmelspolizei, which means "celestial police." The largest new world was Ceres, now known as a dwarf planet. It was the mathematician Carl Friedrich Gauss who estimated its position:

"When Ceres duly reappeared within half a degree of the predicted position, Gauss's reputation as a great mathematician was sealed."

Others continued to search for more of these new worlds:

"Later in 1801 one of the Celestial Police, Heinrich Olbers, spotted one such body, naming it Pallas. He quickly came up with an ingenious explanation for the absence of one large planet but the presence of two (or more)."

Olbers believed that there was a large planet there but it was hit by a comet or volcano, leaving the asteroid fragments behind. But this theory has been disproved, because the asteroids contain very different material from one another. Instead, it's more likely that a planet started to form, but it was disturbed by resonant orbits:

"These occur, as previously remarked, when the period of a passing body pursuing one orbit is a simple fraction of that of another body -- here Jupiter."

According to the author, it's simple -- inner planets plus two or more giants imply asteroids. We now learn more about why the asteroids became part of a "belt":

"A huge fuzzy ring composed of thousands of asteroids dominates the picture. I'll come back to the Hildas, Trojans, and Greeks later."

And here Stewart inserts the picture so we know what he's talking about. It's a picture of the asteroid belt, along with three major clumps of asteroids: Hildas, Trojans, and Greeks. They are drawn in a rotating frame so that Jupiter remains fixed.

But he tells us that this image is misleading. The distance between most asteroids is larger than the size of our planet:

"In a diagram, with dots for the various bodies, the asteroids form a dense stippled ring. So we expect the real thing to be equally dense."

But they aren't. Indeed, there are many large gaps between the asteroids -- at certain distances from the sun, there are no asteroids. These are called Kirkwood gaps for their discoverer Daniel Kirkwood:

"These effects make the gaps so fuzzy that they can't be seen in a picture. Plot the distances, however, and they immediately stand out."

And now the author shows us a graph of the Kirkwood gaps in the asteroid belt and associated resonances with Jupiter. The asteroids range from 2 to 3.5 AU apart. While there are 300 asteroids about 2.40 AU from the sun, from the graph, we see that the gaps are at 2.06 (4:1 resonance), 2.50 (3:1), 2.82 (5:2), 2.95 (7:3), and 3.27 AU (2:1) from the sun:

"There are weaker or narrower ones at 1.9 AU (9:2), 2.25 AU (7:2), 2.33 AU (10:3), 2.71 AU (8:3), 3.03 AU (9:4), 3.08 AU (11:5), 3.47 AU (11:6), and 3.7 AU (5:3)."

At this point, we learn about the so-called "2 1/2-body problem" in physics -- it's not quite three-body because two objects are large (such as earth and moon) and the third object is tiny. We imagine a rotating turntable to which the earth and moon are attached:

"Relative to a system of coordinates attached to the turntable, both bodies are stationary, but they experience the rotation as 'centrifugal force.'"

Stewart includes another picture here of the gravitational landscape for the 2 1/2-body problem in a rotating frame. On the left is the 3D-surface, and on the right are its 2D-contours. On it are marked several special points where a tiny object is stable (centifugal = gravitational force). These were discovered by Joseph-Louis Lagrange (of base 11 fame):

"Lagrange proved that, for any two bodies, there are precisely five such points. Technically the orbits corresponding to L4 and L5 generally have different radii from those of the other two bodies."

As for the other Lagrange points, L1 is between earth and moon, L2 is on the far side of the moon, and L3 is on the far side from earth. Some tiny objects follow a more complex orbit here:

"Such motion is called a tadpole orbit. The key point is: the dust speck stays close to the peak. (I've cheated here because the picture shows positions but not velocities.)"

In the case where the two large objects are the sun and Jupiter, these tiny asteroids are known as Greeks and Trojans:

"Although these bodies form relatively small clusters in the picture, astronomers think there are about as many of them as there are regular asteroids. Greeks follow much the same orbit as Jupiter, but 60 degrees ahead of it [at L4]; Trojans are 60 degrees behind [at L5]."

In the last picture, the author shows how the Greek and Trojan asteroids form clumps. The Hilda family forms a fuzzy equilateral triangle with two vertices at L4 and L5. He also explains that most other planets have Trojans, not just Jupiter:

"Mars boasts five, Uranus has one, and Neptune has at least 12 -- probably more than Jupiter, perhaps ten times as many. What of Saturn?"

As it turns out, Saturn has no known Trojans itself, but two of its moons have two Trojans each. Here Stewart ends the chapter by discussing the Hilda asteroids, which most likely formed when Jupiter was farther from the sun than it is now:

"Asteroids at that distance with circular orbits would either have been cleared out as Jupiter migrated inwards, or would have changed to more eccentric orbits."

A Rapoport Math Problem

There is still no Geometry this week on the Rapoport calendar. So I'll do today's problem only:

Today on her Daily Epsilon of Math 2020, Rebecca Rapoport writes:

22! mod 23

This is our second straight problem involving factorials and mod. But this one is much simpler to those who are familiar with Wilson's Theorem. Let's assume here that you're not. Once again, the fact that the modulus is prime makes a big difference here.

We're trying to find the following product:

1 * 2 * 3 * ... * 20 * 21 * 22 mod 23

When the modulus is prime, every number has a multiplicative inverse. For example, since 24 is equivalent to 1 mod 23, we have:

2 * 12 = 1 mod 23
3 * 8 = 1 mod 23
4 * 6 = 1 mod 23

So we can take 1 * 2 * 3 * ... * 20 * 21 * 22 and start cancelling 2/12, 3/8, 4/6, and all other pairs of multiplicative inverses.

In fact, all that's left are the ones that are paired with themselves -- that is, they are their own multiplicative inverse. But which ones are these?

Obviously 1 * 1 = 1, so 1 is its own inverse. Also, 22 is its own inverse -- it helps for us to think of it as 22 = -1 mod 23, and -1 is its own inverse. As it turns out, if the modulus is prime, then 1 and -1 are the only values which are their own inverse. A full proof of this uses "Lagrange's Theorem" -- yes, the same Lagrange who used base 11 and discovered the stable points in an orbit.

Here's how we use Lagrange's Theorem. We know that if a is a "leftover," then a^2 = 1 (since all the other terms cancel with their multiplicative inverses). So we write:

a^2 = 1
a^2 - 1 = 0
(a - 1)(a + 1) = 0

Now according to Lagrange, if the modulus is prime, then the Zero Product Property holds -- if the product is zero, then either factor must be zero. This is the equivalent of Euclid's Lemma -- if prime p divides a product, then p must divide either factor. Otherwise, we could derive from these factors a nontrivial factorization of p, so that p isn't prime. (For example, in mod 24, 9 * 16 = 0. We see that 3 divides 9 and 8 divides 16, and 3 * 8 = 24. So that's the factorization of 24 -- which means that 24 isn't prime.)

So we have:

(a - 1)(a + 1) = 0
a - 1 = 0 or a + 1 = 0
a = 1 or a = -1

So these are the only leftovers that don't cancel -- 1 and -1. In mod 23, these are 1 and 22.

Thus everything cancels out except 1 * 22 = 22. Therefore the answer is 22 -- and of course, today's date is the 22nd.

In any prime modulus, everything cancels except 1 * (-1) = -1. Therefore (p - 1)! = -1 mod p. This is called Wilson's Theorem (named for John Wilson, an 18th century British mathematician).

Music: "Be Happy," "U-N-I-T Rate," "Learning to Communicate," "Diagrams"

Here are the songs that I sang at the old charter school during Weeks 9-10 of that school year.

The first song for today is "Be Happy." But I only sang it once, to a tune I no longer remember -- then I combined it with an earlier song to make the second song for today, which is...

..."U-N-I-T Rate." It's sung to the tune of the UCLA fight song, and I first performed it on the day that the Bruin Corps members arrived in my class. I'd always known that they were coming, but I didn't know exactly what day.

So when the first student from my alma mater arrived, I needed to come up with impromptu lyrics for the UCLA tune. That's why I just went back and combined "Be Happy" with a previous song to create my new "U-N-I-T Rate" song.

Here are the resulting lyrics:

U-N-I-T RATE RATE RATE

To find the mighty unit rate,
All you do is divide.
The answer, two dots, and then a one,
Right on the other side.
And if you have a fraction,
There's no need to hate.
Flip the second and then you'll find,
The mighty unit rate!
U! N! I! T!
U-N-I-T! Rate! Rate! Rate!

Please don't be sad,
To multiply powers, just add.
And it is a fact,
To divide powers, just subtract.
Zero powers are fun,
'Cause the answer's always one.
Don't be negative, don't frown,
To get rid of them, move down.
U! N! I! T!
U-N-I-T! Rate! Rate! Rate!

And here's a video of the song, played by the UCLA marching band, of course:


The third song for today is "Learning to Communicate." As I mentioned earlier, I wrote this song for the Illinois State project of the same name -- but unfortunately, I'd misinterpreted the project in the text and didn't realize that students were supposed to build their own mousetrap cars (as opposed to using the provided parts and instructions to build them).

I've decided that for today's post, I'll go back and merge the songs for all three projects into a single mousetrap song with three verses. Each verse corresponds to one of the three projects, and details what the students are supposed to do for that particular project:

THE MOUSETRAP CAR SONG

First Verse:
Looking at the pictures,
They show us the way.
To install three wheels
On a mousetrap today.
The need for speed
To tell us every time
We can go how far
When we build a better mousetrap...
Mousetrap car!

Second Verse:
Figure out the lever,
Then put on the string.
We can use math,
To learn all of something.
What's the best advantage?
To change the wheels and hub
Tell us where we are
When we build a better mousetrap...
Mousetrap car!

Third Verse:
Design another car then,
Assess how it can run.
Plan it with your team,
Implement it for fun.
Learning to communicate,
To tell us just how fast
We can be a star
When we build a better mousetrap...
Mousetrap car!

I'll post the Mocha version again, changing Line 20 to reflect that there are now three verses:

https://www.haplessgenius.com/mocha/

10 N=1
20 FOR V=1 TO 3
30 FOR X=1 TO 46
40 READ A,T
50 SOUND A,T
60 NEXT X
70 RESTORE
80 NEXT V
90 END
100 DATA 13,2,13,2,12,2,12,2,13,4,13,2,13,2
110 DATA 11,4,13,2,13,2,15,8
120 DATA 15,2,15,2,13,2,13,2,11,4,13,4
130 DATA 11,4,11,4,11,6,11,2
140 DATA 12,4,11,4,15,6,15,2
150 DATA 15,2,15,2,12,2,12,2,18,4,18,2,18,2
160 DATA 18,4,15,4,12,4,15,2,15,2
170 DATA 13,2,13,2,13,2,13,2,15,4,15,4
180 DATA 13,4,16,4,18,24

As usual, click on Sound before you RUN the program. Technically, the "music" label on this blog should be for computerized music only, so unless I post this code, the "music" label shouldn't be used (but lately, I've broken my own rule).

Then again, I wonder when I'll ever be able to sing the new version of this song. It's unlikely that I've ever be in a classroom again with the Illinois State mousetrap car projects.

The fourth and final song for today is "Diagrams." Here are the lyrics:

DIAGRAMS

Sixteen notebooks,
They cost 88.
Tape Diagrams!
What's the unit rate?
Draw 16 boxes
So you won't get lost.
Four for 22 dollars,
Five-fifty unit cost.
Or you could write an equation...
Tape Diagrams!

Three-fourths of an hour,
To travel 12 miles.
Line Diagrams!
What's the speed meanwhile.
Draw a double line
For distance and for time.
Four in a quarter hour,
Sixteen M-P-H on the line.
Or you could write an equation...
Line Diagrams!

This is the only song for which I'll need to create a new tune, as its original tune is lost (and I never sang a replacement tune for it, like the UCLA Fight Song). I'm leaning towards 20EDL as the scale for this song, in honor of the date I performed the original version of this song, October 20th.

I'm not sure when I'll actually go back and create the tunes -- again, I have so many other summer projects, and my plan was to repost the lyrics, not the tunes.

I wrote the Mocha code to generate these songs back in my Halloween 2018 post, but I'm finding it a pain to keep rewriting it each time I wish to create a new song. Of course, if I had the real computer that Mocha's based on, I could just save the generating code on cassette or disk. In fact, I could even have the program generate the code that plays the song that it generates and save it on disk, similar to the quine programs from earlier. (I actually did this once as a young student -- wrote code that generates more code, save it on disk, and then run the code as its own program.)

But since Mocha is just an emulator, it can't save code. There is no real cassette or disk there. The next best thing might be to write the program in TI-BASIC, since my calculator really does have a memory. The output will be a list of numbers which I enter directly into the DATA lines in Mocha.

As for now, I'll continue simply to post lyrics for now. But I might come up with tunes for some of the other songs as the summer proceeds.

Lemay Chapter 8 Part 1: "Java Applet Basics"


Here's the link to today's lesson:

http://101.lv/learn/Java/ch8.htm

Lesson 8 of Laura Lemay's Teach Yourself Java in 21 Days! is called "Java Applet Basics." Here's how this chapter begins:

Much of Java's current popularity has come about because of Java-enabled World Wide Web browsers and their support for applets-Java programs that run on Web pages and can be used to create dynamic, interactive Web sites. Applets, as noted at the beginning of this book, are written in the Java language, and can be viewed in any browser that supports Java, including Netscape's Navigator and Microsoft's Internet Explorer. Learning how to create applets is most likely the reason you bought this book, so let's waste no more time. Last week, you focused on learning about the Java language itself, and most of the little programs you created were Java applications. This week, now that you have the basics down, you'll move on to creating and using applets, which includes a discussion of many of the classes in the standard Java class library.

So according to Lemay, applets are most likely the reason I bought this book. Well, first of all, I didn't buy her book at all -- I just followed the link above. Second, the reason I'm reading her book is because I want something to fall back on as a possible career --Of  especially if the coronavirus severely impacts my ability to get a full-time teaching job (due to budget cuts), or even day-to-day subbing (if all classes are held online due to virus concerns).

But of course, she's right -- the reason I chose Java is because it's popular, and the reason it's popular is because of web programming. My problem is that I don't have access to a website where I can post Java applets -- and I'm not sure how effectively I can learn about applets if I'm not actually coding.

Let's begin with a review of what applets actually are:

Java applets, however, are run from inside a World Wide Web browser. A reference to an applet is embedded in a Web page using a special HTML tag. When a reader, using a Java-enabled browser, loads a Web page with an applet in it, the browser downloads that applet from a Web server and executes it on the local system (the one the browser is running on). (The Java interpreter is built into the browser and runs the compiled Java class file from there.)

Because Java applets run inside a Java browser, they have access to the structure the browser provides: an existing window, an event-handling and graphics context, and the surrounding user interface. Java applications can also create this structure (allowing you to create graphical applications), but they don't require it (you'll learn how to create Java applications that use applet-like graphics and user interface (UI) features on Day 14, "Windows, Networking, and Other Tidbits").

Hmm, those graphics applications sound interesting -- since they're not applets, I might actually be able to run them. But we're a long way away from Day 14.

We learn that there are several restrictions (the "sandbox") governing applets:

All these rules are true for Java applets running Netscape Navigator or Microsoft Internet Explorer. Other Java-enabled browsers or tools may allow you to configure the level of security you want-for example, the appletviewer tool in the JDK allows you to set an access control list for which directories an applet can read or write. However, as an applet developer, it's safe to assume that most of your audience is going to be viewing your applets in a browser that implements the strictest rules for what an applet can do. Java applications have none of these restrictions.

Once again, this shows how dated this text is -- Lemay's going to refer to Netscape a lot here. And indeed, even Internet Explorer has been replaced with Edge.

In addition to the applet restrictions listed, Java itself includes various forms of security and consistency checking in the Java compiler and interpreter for all Java programs to prevent unorthodox use of the language (you'll learn more about this on Day 21). This combination of restrictions and security features makes it more difficult for a rogue Java applet to do damage to the client's system.

So how do we begin creating applets?

To create an applet, you create a subclass of the class Applet. The Applet class, part of the java.applet package, provides much of the behavior your applet needs to work inside a Java-enabled browser. Applets also take strong advantage of Java's Abstract Windowing Toolkit (awt), which provides behavior for creating graphical user interface (GUI)-based applets and applications: drawing to the screen; creating windows, menu bars, buttons, check boxes, and other UI elements; and managing user input such as mouse clicks and keypresses. The awt classes are part of the java.awt package.

We learn that applets consists of initialization, starting, stopping, and destroying:

Destroying sounds more violent than it is. Destroying enables the applet to clean up after itself just before it is freed or the browser exits-for example, to stop and remove any running threads, close any open network connections, or release any other running objects. Generally, you won't want to override destroy() unless you have specific resources that need to be released-for example, threads that the applet has created. To provide clean-up behavior for your applet, override the destroy() method:

public void destroy() {
    ...
}

Don't worry -- I'm not alarmed by the "violent" name destroying, since I've had to deal with C++, which has destructors.

Oh, and the most important part of the applet is called painting. The first listing in this lesson is an applet that overrides the paint() method:


Listing 8.1. The Hello Again applet.
 1:  import java.awt.Graphics;
 2:  import java.awt.Font;
 3:  import java.awt.Color;
 4:
 5:  public class HelloAgainApplet extends java.applet.Applet {
 6:
 7:     Font f = new Font("TimesRoman", Font.BOLD, 36);
 8:
 9:     public void paint(Graphics g) {
10:        g.setFont(f);
11:        g.setColor(Color.red);
12:        g.drawString("Hello again!", 5, 40);
13:     }
14: }
For laughs, I decided to see what would happen if I just type this in to my new compiler anyway, even though it doesn't connect to a webpage.

Well, here's what happened -- the following warning message appeared on the screen:

Warning: Can't read AppletViewer properties file: C:\***** Using defaults.

(Note: I blocked out the filename intentionally, because I don't want you hacking into my computer!)

But a warning isn't an error. And believe it or not, an applet viewer appeared with this applet (that is, "Hello again!" in red letters) running!

I'm actually wondering whether I accidentally downloaded the applet viewer -- recall that I'd made several attempts to download Java, and so the applet viewer might have been downloaded during one of these attempts.

Well, now that I know I indeed have an applet viewer, I can proceed with the applets in this chapter.

Here's how the applet works:

The paint method is where the real work of this applet (what little work goes on) really occurs. The Graphics object passed into the paint() method holds the graphics state for the applet-that is, the current features of the drawing surface, such as foreground and background colors or clipping area. Lines 10 and 11 set up the font and color for this graphics state (here, the font object held in the f instance variable, and a Color object representing the color red).

Line 12 draws the string "Hello Again!" by using the current font and color at the position 5, 40. Note that the 0 point for x, y is at the top left of the applet's drawing surface, with positive y moving downward, so 50 is actually at the bottom of the applet. Figure 8.1 shows how the applet's bounding box and the string are drawn on the page.

I can't post Figure 8.1 here. As usual, follow the Lemay link above to see the figure.

We can skip over Listing 8.2 today, since that's not Java code -- instead, the author shows us the HTML code to include the applet on a webpage. And this is actually a great stopping point for today, since Listing 8.3 will be the same applet as 8.1, and then we start modifying it in Listing 8.4, though I am worried here -- Lemay starts writing about parameters, but I don't know whether this applet viewer can get these parameters or not. Recall that I never did figure out how to get arguments from to command line into args[] in applications.

More About Applets in Java

Well, I haven't learned much yet about what I can do with applets in Java. All I want to do is get my hands typing on the keyboard and create my own applet.

import java.awt.Graphics;
import java.awt.Font;
import java.awt.Color;

public class MyApplet extends java.applet.Applet {

     Font f = new Font("TimesRoman", Font.BOLD, 36);

     public void paint(Graphics g) {
        g.setFont(f);
        g.setColor(Color.black);
        g.drawString("Happy Juneteenth!", 5, 40);
        g.setColor(Color.green);
        g.drawString("Happy Summer Solstice!", 5, 80);
        g.setColor(Color.blue);
        g.drawString("Happy Father's Day!", 5, 120);
     }
}

I didn't try messing with the fonts, but I did set the color three different times. My applet prints three messages, one for each of the three holidays that were celebrated over the weekend.

Conclusion

Since I did mention race in this post, I probably should add the traditionalists' label. Barry Garelick has posted a few times this week, although each post has drawn only a few comments. He posted the following on Juneteenth (and no, it's not racial, despite the date):

https://traditionalmath.wordpress.com/2020/06/19/still-relevant-after-all-these-years-dept/

I do wish to respond to this comment:

Wayne Bishop:
One of the best lessons in the futility of genuinely constructivist educational methods is a true believer persuading her (overt sexism intended) audience by convincing them of its effectiveness by using genuinely constructivist pedagogy. Beyond the ineffectiveness, there is often quiet but respectful derision. The only way these educational leaders are effective is to give a good effective lecture on the topic.

Bishop repeats here a complaint made by other traditionalists -- ed schools teach constructivism or other anti-traditionalist methods via direct instruction, therefore they are hypocrites.

Once again, I don't dispute that traditionalism is the most effective mode of instruction. But what Bishop and the others leave out is that traditionalism is boring -- and that's the key difference between students in a middle school class and those in an ed school class.

When middle school students are bored, they leave the traditionalist worksheets blank, because they see no connection between learning math and having a successful future. But when ed school students are bored, they do the worksheets anyway, because they see a direct connection between learning the material, earning a credential, getting hired as a teacher, and having a successful future.

Therefore there's more reason to use non-traditionalist teaching methods in a middle school class than an ed school class.


END

No comments:

Post a Comment