Git Teaching

I’m back in Santa Cruz again, where the Fall quarter just began.  Fall in Santa Cruz means warm weather, busy surf on weekends, and time to Git Teaching!

Overhead surf wrapping around the Lane, September 24, 2016.

In the programming community, Git and GitHub are popular tools for version control and sharing.  As a pair, they accelerate project development and collaboration.  I didn’t use them for writing the book (regrettably), but I decided to use them to create and share teaching materials.  Thanks to the Udacity course on Git/GitHub, I was able to pick up the basics in about 5 hours.  So what do I mean by using Git for teaching?  I now have two public Git repositories on GitHub.

Git Lesson Plans

The first contains my lesson plans for the quarter.  Since this is at least the 10th time I’ve taught this material, I usually prepare for class by scribbling down a half-page of notes to myself.  I wanted something almost as quick as scribbling, but which would be easy to share with the world (and perhaps to polish later).  So I made a little lesson plan template, made 20 copies (for 20 lectures), and put it up on GitHub.  Using Markdown is almost as quick as scribbling, since I can edit it right in my web browser at GitHub (then print a copy for class).  You can see my first lesson plan, from last Thursday.

Git Assessment Generator

The second repository is more ambitious.  Since I’m teaching 70+ students, I want to create quizzes with some randomly generated questions.  I considered ad-hoc solutions with PythonTex, started poking around, and realized that there isn’t a sufficiently general Python package for creating and rendering questions for math assessments.  Webwork has PGML and MathObjects.  But this is PERL-based, oriented towards calculus and online assessments, and not as flexible as I wanted in the creation and rendering of questions and answers.  I found myself a bit over my head in programming, but a contribution from Janis Lesinskis got things off the ground.  His began the project at his GitHub repository.  I forked the project at my repository and added code for flexible Python-generated questions.  It’s not close to ready for the public, but I think Janis set up a great foundation on which I can build something useful.  I’ll build it further as I write the first quizzes for my class, and I hope to leverage the power of LaTeX, Python, and the Jinja for templating.

How are these related to the Illustrated Theory of Numbers?

The Illustrated Theory of Numbers is a text, designed primarily for print media.  It is not open-source, though I am sharing some excerpts and some methods I used to create it.  On the other hand, I want to build an open community to share resources related to teaching number theory — lesson plans, assessments, and resources outside of the text I’m writing.  My own lesson plans might be helpful to instructors who wish to teach out of the book I’m writing, and so I’m happy to post them for the world to see.  Similarly, writing quizzes is time-consuming, and I think that sharing assessments is a good way to build a community.

Unlike the calculus textbook industry, I don’t want to put out new editions every year, charge for online accessories, etc..  I hope that by the time the book appears in print (mid-2017?), students and faculty can find a great set of free complementary resources online.




Generalization with purpose

Modern number theory begins with the integers, all those whole numbers, positive, negative, and zero. A few times, when teaching number theory, I began simultaneously with the integers, the Gaussian integers, and the Eisenstein integers. One pedagogical reason is this: if you spend the first few weeks of number theory class proving things that students “learned” by fifth grade, then students will not likely be excited. The Euclidean algorithm can excite students, but proving the existence and uniqueness of prime decomposition is — from the students’ perspective — proving something they already (think they) know. Number theory teachers can get flustered by this. “No!” they say, “You only think you know this! It needs to be proven. It’s really not trivial! Really! Pay attention!”

I think there are two important roles for the instructor at this stage. One is to guide the student to wiser ignorance, as in Plato’s Meno, where Socrates says “Is he not better off in knowing his ignorance?”.  To this end, the instructor gives counterexamples, where irreducible elements p (those that cannot be factored further) are not prime (do not satisfy the implication p \vert ab \Rightarrow p \vert a or p \vert b). The first counterexample that I learned was in the ring Z[\sqrt{-5}] in which (1 + \sqrt{-5}) \cdot (1 - \sqrt{-5}) = 2 \cdot 3. The element 2 is irreducible but not prime. I think this counterexample is natural to the number theorist and instructor — having a prior background in quadratic rings — but most unusual to the elementary number theory student.  It also leaves the instructor having to convince the student that 1 \pm \sqrt{-5} and 2 and 3 are irreducible.  That is probably too difficult for the beginning student.  A more elementary example occurs in Hilbert’s monoid \{ 1,5,9,13,17,\ldots \} of natural numbers congruent to one modulo 4. In this monoid (under multiplication), 9 is irreducible. On the other hand, 9 \vert 21 \cdot 21 but 9 does not divide 21. Another way to say this is that 441 factors into irreducible in two ways:  9 \cdot 49 and 21 \cdot 21.  So this Hilbert monoid might break the student’s false intuition that irreducible elements are prime, and that factorization must be unique.

Besides leading the student to wiser ignorance, the instructor should motivate the proof of existence and uniqueness of prime decomposition by demonstrating its application to number systems beyond the integers.  To this end, one strategy is to simultaneously teach students the basic arithmetic of integers, Gaussian integers, and Eisenstein integers. I think students appreciate the details of proofs when they are proving something they don’t already “know”. Only those already devoted to pure mathematics will appreciate a proof of prior “knowledge”.

I have devoted Chapter 5 to a study of Gaussian and Eisenstein integers. I hope that some instructors will follow this chapter as they go through Chapters 2 and 3 to pique the interest of students. It is not technically necessary for what comes later, but Gaussian and Eisenstein integers are beautiful and important in their own right. I have always liked their kaleidoscopic symmetry, so I devoted an entire two-page spread to visualizations of Gaussian and Eisenstein primes.

A two-page spread from Chapter 5
Click to enlarge a two-page spread from Chapter 5

The pictures display the ramified, inert, and split primes in different colors, and the inert primes are displayed below on a number line to provide a scale. A fundamental domain is highlighted to exhibit the kaleidoscopic symmetry. Symmetry will reappear in the study of orthogonal groups of binary quadratic forms later, so it is good to see a few examples here.  Hecke proved equidistribution of prime angles in the Gaussian context (and much more), in efforts to prove the infinitude of primes of the form x^2 + 1. Thus I have drawn attention to the prime angles (with tick marks on the circumference) and the primes of the form x^2 + 1 (with parallel horizontal lines across the Gaussian plane).  Analogously, I have drawn attention to the primes of the form x^2 - x + 1 in the diagram of Eisenstein integers.

Why else study Gaussian and Eisenstein integers?  Some students think that generalization is a worthy goal for its own sake, but I prefer generalization with purpose.  In Chapter 5, we use properties of Gaussian and Eisenstein primes to study properties of ordinary primes (infinitude of primes congruent to one modulo three and modulo four, and relations to primes of the form x^2 + 1).  One “big picture” lesson of this book is that the study of larger and stranger number systems sheds light on the natural numbers.  Exhibit G:  The Gaussian Integers.  Exhibit E:  The Eisenstein Integers.  Later on, quadratic rings, and the rings of modular arithmetic.

Why is the treatment of Gaussian and Eisenstein integers delayed until Chapter 5, instead of following my pedagogical advice to include them in the teaching of prime decomposition?  There are two reasons.  First, for shorter courses, I can imagine an instructor skipping Chapter 5.  Second, Gaussian and Eisenstein integers connect the first part of the book (foundational properties of integers and rational numbers) to the second part of the book (on binary quadratic forms).  By Chapter 7, we will study definite binary quadratic forms, and the Gaussian and Eisenstein integers will reappear in relation to the unique forms of discriminants -3 and -4, respectively.

Fractions and semiotics.

Fractions haunt elementary school teachers and occupy a disproportionate (1/2? 2/3? 15/17?) amount of time in math teacher professional development. Many college students arrive with a distaste for fractions; they are generally much happier talking about 3.4 rather than 17/5. There are a few likely reasons: it is much easier to work with decimals on a handheld calculator, and numbers are easier to compare as decimals rather than fractions.

But I like fractions, especially comparing them, and teaching fractions raises some important issues at the heart of mathematics. My two favorite fraction topics are the mediant fraction and kissing fractions. Both topics can be found in L. R. Ford’s article “Fractions” from the American Mathematical Monthly, vol. 45, no. 9 (Nov. 1938), pp. 586–601.

The mediant fraction is what happens every day when a child adds fractions the wrong way. The mediant of 1/3 and 1/2 is 2/5. Add the numerator, add the denominator — it’s a natural thing to try, but it doesn’t give you the sum. It gives you the mediant.

I wish more teachers would tell these children something like “What you’ve done isn’t adding the fractions, it’s something much more interesting. You’ve made the mediant fraction!”

What does this operation do? If you start with fractions with positive denominator, the output fraction is between the fractions you start with. But strangely, to a novice, the operation is really an operation on fractions, not on rational numbers. For example, the mediant of 2/6 and 1/2 is 3/8. But hang on a second — the mediant of 1/3 and 1/2 is 2/5, and 1/3 = 2/6, so how can this be?

This is one sign that the mediant isn’t an operation on rational numbers. It makes sense for fractions, but it depends on how the fraction is written. Further explanation is in the two-page spread below.

Screenshot from Chapter 4 of the Illustrated Theory of Numbers
Click to enlarge a two-page spread from Chapter 4

I think teachers and students have trouble with this, and the obstruction is a poor understanding of semiotics. In other words, teachers and students do not adequately distinguish between numbers and how numbers are written. I made a common decision to use the word “fraction” to mean a written expression like “a/b”, and “rational number” to mean a number which can be described by a fraction. So “1/3” and “2/6” are different fractions, which mean the same rational number.

Why is this so important (besides the fact that the mediant is an operation on fractions)? I think this issue arises again and again. Eventually, I would guess most students think that numbers are decimal expansions. The number \pi is the decimal expansion 3.14... for most students. But this too is incorrect, leading to confusion when students or teachers hear that 0.999\ldots equals 1 for the first time. Real numbers are not decimal expansions, nor are rational numbers fractions.

What about kissing fractions? Given integers a, b, c, d, I say that a/b kisses c/d if ad - bc = 1 or ad - bc = -1. I call this kissing, because two fractions kiss when their Ford circles kiss; kissing circles have been around for a long time, sometimes called tangent (touching) circles or osculating circles. Kissing fractions are the algebraic counterpart of kissing circles. Kissing fractions leads to more kissing, love triangles, and more. You’ll have to read Chapter 4 to find out. In case you think it is all a love-fest, Chapter 4 also contains material on the construction of the 17-gon and Dirichlet’s approximation theorem.

The mediant fraction and kissing fractions forced me to make a few notational decisions. Since the mediant fraction is not the sum, nor even really related to the sum, how should one write it? I use the “vee” symbol, as in

\frac{1}{2} \vee \frac{2}{3} = \frac{3}{5}.

I think the “vee” symbol is good since it is symmetric (like the mediant operation) and it points to where the mediant ends up: right between the fractions you start with (if the denominator is positive).

For kissing, I couldn’t resist using the heart symbol, as in

\frac{1}{2} \heartsuit \frac{2}{3}. since (1)(3) - (2)(2) = -1

Again the heart symbol is symmetric, and kissing is a symmetric relation. I hope I’m not getting carried away.

Now here is an activity for teachers who have made it all the way to the bottom of this blog post; an audience of 20-50 students is ideal. Write fractions on index cards; include all the reduced fractions between 0/1 and 1/1, with denominators up to 7 or 8 or 9. Your cards should include fractions like 2/5 and 3/7 and 1/4 and the like, one fraction per card.

Begin the activity by passing out the cards, and asking everyone with a card to stand up and line up in order of their (now personal) fractions. Quickly 0/1 and 1/1 will stand at opposite sides of the room. The activity usually takes a bit of time, as 2/5 and 3/7 have difficulty sizing each other up.

Next is a good opportunity to share how students compare fractions (common denominators, some weird butterfly technique, etc.).

Finally, have the students sit down, except for 0/1 and 1/1, who should stand at the corners of the front of the room. Ask them to add themselves, the wrong way (yielding 1/2), and ask 1/2 to stand between them. Then ask 0/1 and 1/2 to add themselves the wrong way, and ask the result (1/3) to stand between them. The students can take it from there… and they will remember the mediant fraction.

May the readers always understand signs, what they signify, and the difference between the two

With respect to history

Last winter, I had the privelege of teaching our History of Mathematics (Math 181) course at UC Santa Cruz. As I had lobbied previously for the course to satisfy the campuswide “textual analysis” requirement, I had to focus on primary sources in the class. Fortunately, I had plenty of fair warning and spent a few months reading and pretending to be a historian before the first day of class.

My goal in teaching was to have every student engage directly with at least two primary mathematical sources, in translation of course. The first resource was the textbook I chose: The Mathematics of Egypt, Mesopotamia, China, India, and Islam: a Sourcebook, edited by Victor Katz. This book is a goldmine, if you understand what it is. It is not a history of math textbook; rather, it presents a huge number of primary sources, some in short excerpts and some in extended passages, with background and guidance from five experts. This covered everything I wanted, except for Greek mathematics, for which primary and secondary source material is plentiful and free online. I enjoyed teaching from the Sourcebook and I have referred to it often, for enjoyment, and also in teacher education projects.

After reading the Sourcebook and other modern scholarship in the history of mathematics, I found the typical treatment of history in math textbooks inadequate (and often just plain false). Certainly some great mathematicians have ventured into a study of history; Dickson and Weil and van der Waarden are three prime examples. But I find their treatments most useful as annotated bibliographies. More appealing to me are treatments by David Fowler of Greek Mathematics; after reading Fowler I am convinced that “translating” Euclid into modern algebraic notation is historically destructive. On the other hand, I don’t have the time to bury myself in Chapter X of the Elements, trying to understand the whole text as Euclid’s contemporaries might have understood it.

Historical Notes, from Chapter 2
Click to enlarge the historical notes from Chapter 2.

In writing the Illustrated Theory of Numbers, I am trying to give respect to history.  Even if I devote less space to history than to mathematics, I hope I give them the same scholarly respect.  To that end, I have avoided spreading legends (like Gauss adding the numbers from 1 to 100) and I have avoided relying on secondary accounts as much as possible. I sometimes “translate” older sources into modern notation, but I try to raise a caution flag when this might be misleading. I incorporate historical information from China and India and elsewhere, to avoid Western bias as much as possible (given the history of scholarship and my Western-only language skills). At the end of each chapter, I am including some historical notes. These contain historical highlights and bits of primary source material and historical scholarship. In the style of Tufte, I have provided annotated citations in the margins.