How to Sketch a Polynomial

Monday, July 25, 2011

Note: This is a repost of a post from back in 2008 when I was working at Powerset and did more math. I love how this trick is so simple yet completely mystifying.

I’ve been swapping cute math tricks with my coworker Paul Pedersen, and recently he showed me this beautiful method for sketching polynomials:

As an example let’s pick a random polynomial:

y4 + x3 – y2 + x – 1 = 0.

Plot on the x axis of a graph a point for every x power. For example for x3 plot the point (3,0). For x1 plot the point (1,0).

Now label “+” the positive coefficient’s points and “-” the negative coefficient’s points. Do the same for the y axis.

Now connect the lines.

Now reflect across both axis. If you have an even exponent flip the sign.

Now draw a line between every positive and negative sign.

Now connect the lines. My freehand splines are a little sloppy, but you get the idea…

And there it is. Compare with an actual graph:

Let’s try with some simpler curves where we know the answer: take x2 + y2 = 1 or x2
+ y2 – 1 = 0:

Connect the lines:

Circle!

Just for fun, try x2 – y2 – 1 = 0:

Connect the lines:

Wow. Why don’t they teach this as part of the high school math cannon? These kinds of simple inexplicable patterns remind me why I loved math in the first place.

Note – If you want to plot a function like y=x^3, transform it into 0=x^3-y and follow the above steps and it should work.

Rahul points out an interesting counterexample in x^2+y^2-4x+3=0, but I might argue that in some sense it does work. You end up with a diamond and the x axis has a + at (0,0), a – at (1,0) and a + at (2,0). No other edges should have lines through them. So you would draw a circle. I think it’s clear that this method can’t make any claims about x intercepts and y intercepts, just the overall shape. Same comment about x^4-3x^3+x^2-x+20.

Can anyone find a counterexample where the shape is completely “wrong” (for some definition of wrong that doesn’t include intercepts or stretching)?

Relaunch

Monday, July 25, 2011


After a several year hiatus, I updated my website and I’m blogging again.

I’m going to start by reposting a few of my favorite posts from the 2007-2008 era.

Media

Wednesday, July 16, 2008

It made me really happy today to see FaceStat and Dolores Labs in Slate. It brought in less traffic than the wall street journal, or even ny daily news, but it’s not every day your site is featured in your favorite magazine :) . And they even talked a little about the fun research we’ve been doing.Some of the better quotes:Slate: “It’s market research for the individual! Not some shallow exercise for the insecure!”news.com.au: “Facestat site perfects public humiliation.”CNet: “What happens when Hot or Not hooks up with Google Analytics” What does that mean?Thrillist: “You look at yourself in the mirror every morning and think, “what a handsome, intelligent, athletic, manly man I am!”, but how does the rest of the world really interpret your neckbeard? Find out the awesome/horrible truth, with FaceStat.”Buzzfeed: “Reinforcing Shallow Stereotypes. Now Online!”Miss Bimbo: “FaceStat is sad.”