Contact
CoCalc Logo Icon
StoreFeaturesDocsShareSupport News AboutSign UpSign In
| Download

All published worksheets from http://sagenb.org

Views: 168770
Image: ubuntu2004

Mathlets for Visualizing the Geometry of Numbers

Karl-Dieter Crisman, Gordon College

CPS in Mathlets for Teaching and Learning Mathematics

Jan. 16, 2010

 

Many theorems in introductory number theory have multiple proofs; even if the theorem is quite algebraic, sometimes the easiest proof to comprehend is represented geometrically.  A case in point is the usual proof of quadratic reciprocity via the Gauss Lemma, done by counting the parity of two sets of points.  Below, the green and blue points represent (via the Gauss Lemma) the Legendre symbols (pq)\left(\frac{p}{q}\right) and (qp)\left(\frac{q}{p}\right).  The proof consists in believing that this is true, and that the number of lattice points above and below the blue strip are identical. 

Yet it is somewhat mysterious; will one picture suffice to understand?  In my own experience, not always - even for the instructor!  Contrast this with an interactive version, where one can see both how the Gauss Lemma numbers, and the picture proof of how it implies quadratic reciprocity, behave with different primes - without actually computing and drawing them each time.

[removed]
[removed]
[removed]
[removed]

It might even be possible to see the truth of the Gauss Lemma itself this way, if the students have done enough examples by hand.   It is particularly instructive to compare cases like the typical textbook case, where pp and qq are close, to edge cases such as p=5p=5 and q=71q=71 - for instance, to make it clear that the dotted blue line does not bisect the blue region (which is often not clear in the textbook case).

I use Minkowski's term "geometry of numbers" to refer to any proof which uses lattice points (n,m)(n,m) to represent pairs of integers in order to prove a theorem which seems algebraic.  As is well known, Minkowski (and later Blichfeldt) used this technique and specific geometric theorems to (re-)prove many things, most famously about representing integers as a quadratic form (especially as a sum of squares), but also Diophantine approximation and so on.  

Many texts use this idea to illuminate otherwise difficult proofs - but always in a static format, which is often still hard to interpret for the student. The point of this talk is to show a few ways of presenting such ideas interactively, as well as to encourage others to create similar interactive mathlets for their own purposes.

Our second example is in finding the "average" value of the function τ(n)\tau(n), which gives the number of divisors of nn.  This is usually given as limn1nk=1nτ(k)\lim_{n\to\infty}\frac{1}{n}\sum_{k=1}^n \tau(k)\, ; the curve below is the hyperbola xy=nxy=n

[removed]
[removed]
[removed]
[removed]

The fundamental observation one would make in class is that τ(n)\tau(n) is precisely the number of positive lattice points (x,y)(x,y) such that xy=nxy=n, or to be more in line with our previous notation, points (d,nd)(d,\frac{n}{d}) - so that dnd=nd\frac{n}{d}=n.  The graphic gives dotted lines for k=2k=2 and k=n2k=n-2; so k=1nτ(k)\sum_{k=1}^n \tau(k) is the number of lattice points on or under the hyperbola.  

For students, the difficult part is trying to interpret the points under the hyperbola in two different ways.  The first is the hyperbola slices.  The second way is to divide the lattice points up evenly in two, except of course for the ones on the line y=xy=x, of which there are n\leq \sqrt{n}.   Focusing just on the lattice points above the line and below the hyperbola, at each integer xx-value dd up to the point x=nx=\sqrt{n}, there are are about n/ddn/d-d such points (where "about" can be made precise using the greatest integer function). 

All this can be seen "in practice" in the mathlet, and it turns out that this is sufficient (along with some previously acquired facts about the harmonic numbers) to show that 1nk=1nτ(k)ln(n)+(2γ1).\frac{1}{n}\sum_{k=1}^n \tau(k)\approx \ln(n)+(2\gamma-1)\, .  Observe that any point of contention - for instance, about how to count the number of points below the black dotted line - may be examined easily with simple cases first, before looking at larger ones.  When the proof comes, it is reasonable, not just a series of formally verified steps which are otherwise mystifying. 

As an example for those thinking of creating their own such mathlets, look at how the picture may be modified for the average value of σ\sigma (the sum of divisors function).  

[removed]
[removed]
[removed]
[removed]

We are summing up things under a hyperbola, but now it's a weighted set of points, not just the number of points.   Proof: nxσ(n)=nxqnq=q,d such that qdxq=dxqxdq.\text{Proof: }\sum_{n\leq x}\sigma(n)=\sum_{n\leq x}\sum_{q\mid n} q = \sum_{q,d\text{ such that }qd\leq x} q = \sum_{d\leq x}\sum_{q\leq \frac{x}{d}} q\, .  

Our final example is to show the geometric interpretation of creating new integer solutions to the so-called Pell equation.  This equation is x2ny2=1x^2-ny^2=1 for nn not a perfect square; the key is that this can be represented geometrically as a hyperbola, and that the set of integer points is in fact an Abelian group!

I will consider a small case of this.  Suppose one has found a non-trivial positive integer solution (x,y)(x,y). Then one can generate a new solution by taking the line through the trivial solution (1,0)(1,0) (or indeed any other solution) with the slope of the tangent to x2ny2=1x^2-ny^2=1 at (x,y)(x,y) and seeing where it intersects the hyperbola.  In class, of course, we would explain how and why this works, both algebraically and geometrically - but it is always amazing to students to see this in action!

size 
[removed]
[removed]
[removed]
[removed]

This really brings home the sheer unpredictability of the Pell equation - one can adjust both the parameter and the initial search frame.  It's also fun to point out to students that Brahmagupta already knew how to do this in the seventh century of the common era (as well as how to find a non-trivial solution in the first place, which I don't do in my class), though of course he did it without our geometric interpretation.

In conclusion, I'd like to highlight the following ideas:

  • There has been great advantage taken of computers in teaching number theory, there has been much less advantage taken of visualizing using the computer in teaching number theory (though Gaussian integers and power/multiplication tables are exceptions).  Compare this with the excellent state of this in group theory, even though the areas are so similar.  
  • These "Sagelets" should be fairly easy to port to Mathematica's Manipulate objects, or to Maplets.  The key thing is to try something like this out if it might help you and your students.
  • For Sage it was particularly easy, because I only needed access to a non-ancient web browser and a public Sage server (such as the one at www.sagenb.org).
In any case, I find this aspect of number theory truly beautiful, and hope this inspires others to either use tools like these, or to create their own!  Here is the link to this talk online.  Thank you.