Monday, January 21, 2013

Guess the Function

I substitute teach middle school. Anyone that's ever subbed (especially middle school) knows that one of the cardinal rules of subbing is to not allow any downtime. (I have a story involving downtime in a middle school classroom that ends with a student shouting, "No Brad, you're stapling your face wrong!") Because of this, I'm always prepared with a math game or activity to occupy my students.

My favorite game (and often their's too) is Guess the Function. The rules are to guess the function. Allow me to elaborate:

First I write down a function on a piece of paper. The difficulty of the function varies with the skill level of the class, but usually I start with a linear function.

Next I generate inputs (sometimes I do this by rolling dice, sometimes I ask students to shout numbers out, and sometimes I just pick numbers myself).

Then I write the number and the result of applying the function to that number on the board. Students then have the option of guessing my function, or waiting to see the result of my function on more numbers.

I give one point for right answers and penalize two points for wrong answers.

For example: suppose my function is f(x) = x + 2. I would start by writing 2  4 on the board (because f(2) = 4). Now bold students might start guessing, but that's a bad idea. With the available information, they might guess f(x) = 2x or f(x) = x2, and they'd lose two points. After everyone has either guessed or passed, I would write another pair of numbers on the board (for example 3  5).

Some notes:

  • I use arrow notation (3  5) instead of function notation (f(3) = 5) because I usually play this game with students that haven't been exposed to function notation.
  • I usually have students play this in teams of four or five.
  • Usually, sixth graders are much better at this game than seventh and eighth graders. Typically, seventh and eighth graders tell me that they "haven't learned this yet," whereas sixth graders don't seem to know that they don't know.
  • Mathematicians will point out that for any finite collection of points, there is literally an infinite number of functions that will fit the points. This is true, but I like to think of this game as a game about psychology (what am I thinking?) as much is a game about math.
  • Younger students often give English descriptions of rules (like plus two or times itself), whereas older students are comfortable with describing things algebraically (like x+2 or x2).
  • I use the scoring system +1 for right answers and -2 for wrong answers because I want to discourage wild guessing. (Recall that as a sub, my goal is primarily to keep a class under control-- wild guessing descends in to chaos rather quickly.)
  • When I play this game, I announce that I'm writing down a rule (not a function) because most of my students don't know what a function is.
  • Examples of functions that I would use include x+1, 2x, 2x+5, x2, x(x-1), 2x, x/2, 1/x, 10 - x...
I love this game. One of my favorite things is that since it's not a part of the curriculum, the students that "aren't good at math" actually do quite well. This is because the psychological hurtles they have when facing math class aren't in place when they're just playing some dumb game the sub made up.

Monday, December 24, 2012

Merry Christmath



MATLAB:

x = -4:.01:4;
a = 1.5;
p = @(x) (1+abs(x)./x)/2;
tree = {@(x) (10-a*abs(x)).*p(x+2).*p(2-x)
         @(x) 7*p(x-.6).*p(2-x) + 7*p(x+2).*p(-.6-x)
         @(x) (8-a*abs(x)).*p(x+3).*p(3-x).*(1-p(-x+1/a).*p(1/a+x))
         @(x) (6-a*abs(x)).*p(x+4).*p(4-x).*(1-p(1.7-x).*p(1.7+x))
         @(x) 3.5*p(x-1.7).*p(3-x) + 3.5*p(-x-1.7).*p(3+x)
         @(x) 0
         @(x) p(x+1.1).*p(-x+1.1).*(5*abs(x)-5.5).*(p(x-.9)+p(-x-.9))
         @(x) (p(x-1)-1).*p(x+1)};
hold on
for i = 1:length(tree)
   plot(x,tree{i}(x),'g.');
end
red_ornaments = [1 2 4 5 2 3 6 9 4 3 2 2 1];
cyan_ornaments = [1 .2 3 7.5 5 .5 6 1 .6 4 1];
plot(linspace(-3,3,length(red_ornaments)),red_ornaments, 'ro');
plot(linspace(-3,3,length(red_ornaments)),red_ornaments, 'r*');
plot(linspace(-3,3,length(cyan_ornaments)),cyan_ornaments, 'co');
plot(linspace(-3,3,length(cyan_ornaments)),cyan_ornaments, 'c*');
hold off
axis([-6, 6, -2, 10]);


There are certainly easier ways to plot this. I just wanted to have fun with absolute values.

Thursday, November 1, 2012

Cayley Tables!


Long ago I posted about a mathematical structure called a group. In particular I described the group S3. If you would like a refresher, read this post. This post picks up where that one left off.

S3 can be thought of as the set of rotations and reflections on equilateral triangle. Doing that gives the following table called a Cayley Table:

*
R1 R2 F1 F2 F3
I R1 R2 F1 F2 F3
R1 R1 R2 I F2 F3 F1
R2 R2 I R1 F3 F1 F2
F1 F1 F3 F2 I R2 R1
F2 F2 F1 F3 R1 I R2
F3 F3 F2 F1 R2 R1 I

Here's the thing though: This table is too busy to read. Sure, if you wanted to know what R1*F1 was, you could look it up (F2), but it's hard to take in all this information at once. Basically, it's hard to see. 

But you know what's easy to see? Color!

*
R1 R2 F1 F2 F3
I R1 R2 F1 F2 F3
R1 R1 R2 I F2 F3 F1
R2 R2 I R1 F3 F1 F2
F1 F1 F3 F2 I R2 R1
F2 F2 F1 F3 R1 I R2
F3 F3 F2 F1 R2 R1 I

Two simplifications are in order: First, the top row and far left column are redundant, so we can dispense with them. Secondly, the labels are more distracting than helpful, so lets dispense with them as well. This leaves us with just a square grid:

The Cayley Table for S3

This allows us to more easily see symmetries (the whites are symmetrical along the main diagonal) as well as asymmetries (notice the pattern of blues, greens and purples in the top right corner vs the same colors in bottom left). 

As I mentioned, the group we have been considering is called S3. There are other groups too:

The Cayley Table for S4

The Cayley Table for S5


The Cayley Table for S6

All of the pictures above are of what mathematicians call Symmetric Groups. But not all groups are symmetric groups. For example, there are the Alternating groups:
The Cayley Table for A4

The Cayley Table for A5

The Cayley Table for A6
And the Cyclic groups:
The Cayley Table for Z60

The Cayley Table for Z60 with the elements arranged by their order
Hopefully I will post some explanations of these groups soon. In the mean time, try your luck with Wikipedia.

The groups are generated by a Python script I wrote. The Pictures are generated by Processing. The list of all possible ways four people can stand in line was generated by Matlab. Altogether there's about 450 lines of code going into these pictures. Anyone who wants access to this code is welcome to leave a comment.



Tuesday, September 25, 2012

Myth of the Right Answer Redux


A classmate brought this riddle to a study group I'm in:
You have eight pills. One of them is poisonous. The poisonous pill weighs slightly more than the others, but otherwise they appear to be identical. You have access to a scale, but you may only use the scale twice (for some reason). How do you determine which pill is the poisonous one?
The solution produced by our group (four undergraduate math majors) is as follows:


Satisfied with this solution, the other members of my study group were ready to move on. This is the myth of the right answer.

We are programmed since elementary school to find "the" answer and move on to our next assignment. Each quiz, riddle, puzzle, and problem is simply an obstacle to overcome in the ongoing mission to meet our teachers', principals', parents', and professors' approval. Why should the authority figure determine when our problem is solved?

So it's great that we found the algorithm to solve this problem with two weighs. But why stop there? Some related questions:
  • Given n pills, what is the minimum number of weighs required to finding the poison pill?
  • Given n pills that can be weighed with w weighs, is there an alternate weighing scheme that can find the poison pill  in exactly w weighs?
  • What if we don't know if the poison pill is heavier or lighter (only that it weighs a different amount)?
    • What if every pill weighs a different amount, but the poison pill is still heavier than all the others?
  • What if there are two poisoned pills
    • Given n pills, m of which are poisoned, how many weighs are required to find the poisoned pills?
  • What if the scale can only hold two or fewer pills at a  time?
    • Given n pills, one of which is poisoned, and a scale that can only hold k or fewer pills, how many weighs does it take to find the poisoned pill?
    • Given n pills, m of which are poisoned, and a scale that can only hold k or fewer pills, how many weighs does it take to find the poisoned pills?
    • Given n pills, m of which are poisoned, and a scale that can only hold exactly k pills, how many weighs does it take to find the poisoned pills?
  • Suppose we would settle for knowing which is the poisoned pill with probability p, what is the minimum number of weighs?
None of my classmates asked these questions, they were satisfied with just having the answer. To be clear: my classmates are not stupid. In fact, they're all quite bright. But they (we) have been programmed to find the answer, to report the answer, then to forget the question. Somewhere in all of this answer-fetishism we have forgotten how to ask questions. We have lost our curiosity.

A good question is more interesting than a satisfying answer. Why then do we let other people ask all the questions? 


Thursday, August 9, 2012

First World Problems

That is one really ugly red car.

Wednesday, August 1, 2012

Three Page Comic




I really hope I caught all the spelling errors. I probably didn't.


Saturday, October 29, 2011

Note Taking in Math Class

I'm a math undergrad with a real passion for mathematics (enough to try to maintain a blog about it). As of today, I'm taking four math classes, have a gpa of 3.9, and spend a good amount of my time tutoring. Also, I don't take notes.

I'm not sure what place note taking has in a math classroom. The books that I spent more than $100 a piece on (way too much!) cover all the same content that my classmates' notes do. If I forget the definition of the Laplace Transform, then I don't need notes to look back on, I have a book. Failing that, I have Wikipedia, Wolfram's Math World, and Paul's Online Math Notes. If I need to have problem worked out, I have Khan Academy or any other of a variety of YouTube videos. My school, and I imagine every other school in the world, is packed with thousands of books, many of which are about differential equations. If I need help with Laplace Transforms, or any other topic in math, I have a plethora of sources to reference. Why then, on top of all that, should I take notes?

Further, I think taking notes in math class have negative consequences. Sometimes I look around and notice my classmates too absorbed in their note taking to actually be paying attention in class. The professor might add a bit of interesting information verbally, and my classmates are often too busy copying what's on the board to hear it. Also, there is the problem of divided attention: if your attention is being put into your notes, you are not working on comprehending the material. I assume that these students go back over their notes at a later time and try to make sense of the material then, but that has to be very tough when there is no professor to offer insights.

So why do so many students take notes? I suspect it's because of years of programming by high school and elementary school teachers. I also think it's because students have developed skills that are appropriate for other classes (note taking is very valuable in English or history class) and mistakenly believe that those good habits will translate to their math classes. I think all of this negatively impacts math students' education.