Wednesday, July 16, 2014

Super Mathio

Hedge wrote this fun post on Mario Brothers and math - specifically parabolas - that got me to tweet: I also now want a video game where you jump by clicking the vertex to make a precise parabola based on where you are. She asked the good question: Can you make that?

Should have thought that one through.

Fortunately, though, it's Twitter, so brilliant people to the rescue.

Desmos tweeted:

Pretty sweet! Find it at Desmos:

Beyond my current Desmos levels, but pretty amazing. Great image use. 

Then Andrew Knauft tweeted:
Find it at OpenProcessing.

You click to do the jump. Beyond my current Processing skills, but excellent.

So I did -of course- have to try it in GeoGebra. I'm pretty happy with the result. The math wasn't too hard, though the scripting the buttons and resetting graphics is always tricky for me.

It's at GeoGebraTube for you to play with. There's a data mode that let's you try to calculate the best high point first - which is where I would want to go with it. It's an insufficient data situation as I purposely left off the coordinates of the bonus box.

There are some things to notice about parabolas as you play it, and for deeper work it would be interesting to think about how to add scoring.

GeoGebra Note: Andrew Knauft also helped with this! You define piecewise functions in GeoGebra using the If command, which also has an else variant. I.e. either If[<condition>,<then>] or If[<condition>,<then>,<else>]. I was getting errors with the inequalities to make the towers, and Andrew figured out that GGB didn't like an inequality with the else form. Redefined them as Ifs alone, and I was good to go.

This was very fun. I'm curious to know if or how you would use it, or what features you might add. As always, if you have an idea for dynamicizing, let me know!

Friday, July 11, 2014

Complex Instruction

Complex instruction isn't real.

OK. I think that's enough of that. (Complex instruction is an actual instructional approach for differentiation, check it out.) This post is part my general thinking about complex numbers and, in other part, a very specific visualization.

I. In General
This summer teaching the math-history-themed capstone class for our seniors, one of the themes that came out was how complex numbers are the natural setting for much of mathematics. In my own experience, I didn't really appreciate that until grad school, and our majors are graduating without enough experience to feel like they are really numbers.

My perspective: I think counting numbers feel like numbers to us because:
  • we have an intuition for them as quantities, 
  • we can represent them in multiple ways, we can compare them fluidly, 
  • we are comfortable with what operations mean, 
  • and we have multiple ways to compute with them. 
The more of those aspects are broken down, the less they feel like numbers to us. We see that with students at large whole numbers, fractions, decimals, radicals, etc. I've surveyed about 50 math major seniors and inservice math teachers now, and they are significantly less comfortable complex numbers than radicals and transcendentals. When I shared some of those results on Twitter, several mathematicians wrote back that this means the students have not developed an appreciation for how weird the real numbers are. Part joke, all truth.

Part of the power of being a mathematician is being able to make this transition for wide classes of objects: functions, matrices, operators, manifolds, algebras, etc.

Complex numbers came up in math history in the solving of quadratics with the great Islamic mathematicians; the solving of cubics with Cardano, Bombelli and Tartaglia; the great acceptance of them under Euler; and the deep understanding of them that followed Gauss. The students saw the connections amongst the lack of acceptance for irrationals, negatives and complex, but - in general - saw their discomfort with complex as justifiable, while rejecting irrationals or negatives was just a bit silly. The exception to this was the few students who had taken a second semester of abstract algebra and saw C as a beautifully complete field.

I think the problem might be that algebra is before we see our students, and the focus on calculus and linear algebra in our program has to support the engineering students as well as serve math majors. Algebra and linear algebra seem like the natural places to start seeing complex numbers as natural and necessary.

It was probably Michael Pershan who really got me thinking about this, as he started sharing his usual deep reflections on the topic a couple of years ago.  Bonus: Mike Lawler has a couple extensions (one and two) which my students this summer found interesting and valuable.

II. The Fundamental Theorem of ... Algebra

One of the morals of the capstone class was that if mathematicians labeled a theorem as Fundamental, it's worth your focus and understanding.

If you have time, please watch at least the beginning of this terrific Numberphile video with David Eisenbud, director of MSRI at Berkeley.

Marvelous. One of the things that so infatuated me with my advisor, Nigel Higson, was his ability to motivate and moralize the mathematics. The dog on the leash is the nice metaphor here. I think the power of this representation is not in the static image he draws, but his ability to manipulate and use this imagery to connect ideas. For most of history, this has been a significant barrier in mathematics.

III. The Visual
Of course this has to end up in GeoGebra...

The ability of GeoGebra to have two graphics windows allows us to dynamicize Eisenbud's picture. Here's the GeoGebraTube page for this sketch. In works online (the student page), but is better if you can download and open it. GeoGebra does not compute in complex numbers natively - yet - so this sketch has a lot of workarounds to treat points as complex numbers. This post isn't about how to make the ssketch, though, it's about using it.

GeoGebra tip: when a point or slider is selected, you can move it with the arrow keys. Hold down shift while clicking an arrow for smaller changes.

The sketch has one window for input to a polynomial, and the second window for the output. For example:
 To get that feel for what Eisenbud was doing, I turned on the trace for the points. Complex valued functions and analysis is very much about paths and what happens to them under transformation.

We can use this sketch to find real and complex roots. When you click circular path, it plots all the points in the input plane with the same magnitude as A, the blue point. The output plane shows the result. So when the orange transform of that circle goes through the origin, there's a root with that magnitude. The green slider rotates around the circle, allowing you to findthe exact value. Above is a real root for that function, \(f(x)=x^3+2x^2+x+1\), near \(x=-1.76\). Where are the complex roots?

One more example: Find the first root.

So, since this is a real coefficient function, the conjugate must be a root. I made this cubic to have the root \( x=2 \), so I show that root also. The transformation of the rectilinear path by the function is quite fascinating, no?

Studying different kind of roots can be pretty interesting. What do you think is going on here?

We can investigate the winding number phenomena as well:

There are so many things to notice once we have a visual. It supports more people in developing the kind of intuition and acceptance that might some day see accepted status for our complex brothers and sisters. After all, the reals are complex, too.

Seriously, I'd like to think that we're coming into an age where technology makes these ideas more accessible to a wider number of people. Can you think of other features or visualizations that we should try to make? What are the key concepts of complex numbers that need the support of a dynamic visualization?

  • GeoGebra's gif export only does the active graphics window, so these are done with the RecordIt app for Mac - highly recommended.
  • It's a little weird that the function has real coefficients but complex constant, but it seemed worth it to get at some of the points that Dr. Eisenbud raises in Numberphile video.
  • The work arounds consist of making separate real and imaginary functions from the input function. It looks like this: