# Playing with Riemann Sums

I had a satori [Note 2].  I felt like the guy in the ads who sits in front of his new ultrafast computer with the wind blowing his hair back and bracing himself by holding onto the desk.  (My hair was dark then but I certainly was not wearing a tie.)

That convergence theorem was talking about something BIG.

I visualized a Cloud of Riemann Sums floating around and swerving closer to the Right Answer as their meshes decreased.

A Riemann Sum has a lot of parameters:

• Its mesh.  This can be any positive real number.
• Its choice of subintervals. Any positive integer!  There can be billions of subintervals.
• And, ye gods, the individual choice of each evaluation point for each subinterval in each Riemann Sum

Those are three independent parameters, except for the constraint imposed by the mesh on each choice of subintervals.  [Note 3]. This means there are uncountably infinitely many of these sums.

I tell my students that we have to zoom in and zoom out [Reference 2] from a problem.  When we zoom out a complicated structure is thought of as a point in a certain relationship with other structures-as-points.  Then to understand something we zoom in (selectively) to see the details that make it work.  What I remember from my satori is that I didn’t visualize them as points but rather as little blurs, sort of like the blurs in Mumford’s red book [Reference 3], which I think was the first non-constipated math text I had ever seen.

### Riemann Sums in Mathematica

In the nineties, I was on a grant to create Mathematica programs for students, and one of the notebooks I created allowed you to easily exhibit Riemann sums with various parameters.  I also included code that would show a cloud.

Below is a cloud.  It is a plot of the values of 300 Riemann sums for $\int_0^{\pi} \sin x \,dx$.  They have randomly chosen meshes from $0$ to $\pi/2$ and the subintervals and individual evaluation points for each subinterval are also chosen randomly.

The cloud below is a plot of the values of 300 Riemann sums for the area of the upper right quarter circle of radius 2 with center at origin.  Its meshes range from 0 to 1, and other properties are similar to the one above.  The vertical spread of the points is considerably bigger,  presumably because of the vertical tangent line at the right hand end of the integral.

When you click on the code for either of these you get a different cloud with the same parameters.

You can access the notebook containing the code for this via Abmath Gate.    Be sure to read the ReadMe file.

### Notes

[1] This was 1961.  Of course the book didn’t say things such as “with any choice of points-to-evaluate-at”.  It said what it had to say in stilted academic prose which required reading it two or three times before understanding it.  Academic prose is much better these days.  See Reference [1].

I was quite good at reading complicated prose. My ACT scores were a tad higher in English or Language or whatever it is called that they were in Math.  With the Internet, math exposition should do much more with pictures, interactive things, and lots of examples (which don’t waste paper now).  But that is another diatribe…

[2] This is a snooty word for lightbulb flashing over your head.  Every once in awhile I give in to the temptation to use some obscure word to impress people as to the variety of things I know about.  Teachers, don’t do this to your students.  Other professors are fair game.

[3] The same choice of subinterval can correspond to many different meshes, if your definition of mesh requires only that each subinterval be narrower than the mesh, rather than requiring that the mesh be the size of the biggest subinterval.  (I had never thought about that until I wrote this.)

[4] The Mathematica Demonstrations website has several other notebooks that exhibit Riemann Sums.

### References

[1]  The Revolution in Technical Exposition II, post on this blog.

[2]  Zooming and Chunking in abmath.

[3] D. Mumford, The Red Book of Varieties and Schemes (second expanded ed.), Springer Lecture Notes in Math 1358, Springer-Verlag, Berlin, 1999.   (I have not seen this edition.  What I remember is the Red Book as it was in the 1967 Algebraic Geometry Summer School at Bowdoin.  I hope the smudges survive in the new version.  As I remember the smudges were bigger for points that were more generic or something like that.  Those smudges caused me a kind of sartori, too.)

Send to Kindle