Sage: Polynomial Interpolation

PolyI1

In an earlier post I mentioned that it's not that uncommon for math teachers and even education professionals making up academic resources to mess up badly on sequences. For example, the IXL site, which is, in general, an excellent resource for teachers and students makes a common error with sequences both here and here. Experiment with the problems that are randomly created at those 2 links. Try entering a "wrong" answer and you'll get an explanation of what the "right" answer is. But the "logic" they're using is that here's a formula that describes the sequence, therefore the next term is... The problem is that if you follow the same logic you can justify the missing terms of the sequence to be whatever you want. Therefore those problems have no correct answer and should not be given. Moreover, they shouldn't mark other answers as wrong.

Whenever teachers and math professionals are wrong on the math, you've got a teachable moment. This lesson would be for someone teaching about matrices who has gotten through reduced row echelon form. I'll suggest that you start a class by working through the material on the IXL website and have them figure out what the terms of the sequence are. Write the various sequences on the board to refer to later. When they've gotten comfortable ask them what will happen if you put in a term that doesn't seem to fit the pattern. They'll predict that you will be marked wrong. After showing them that you are indeed marked wrong by IXL figure out a formula to justify your answer and have students confirm that it works. You now have a formula that justifies a sequence that IXL was marking you wrong for. Get the class to discuss what it must mean for an answer to be correct (you can find a formula) and for what it means to be incorrect (it's impossible for anyone to find a formula).

Now it's time for math! Elicit that a sequence is a function from the positive integers into the real numbers (or integers, depending on how you teach it). Remind them that this means the sequence -5, 3, 11, 19, 27, ... corresponds to the function where f(1)=-5, f(2)=3, f(3)=11, f(4)=19, f(5)=27. Give them the mathematics known as polynomial interpolation or Lagrangian interpolation, and using one of the IXL sequences written on your board, set up a Vandermonde matrix. Work through the mathematics to create the polynomial. Get those calculators out to solve the matrix equation. And at the end you'll have a polynomial which they'll need to confirm works to generate the sequence. By the end of class your students will have learned about Vandermonde matrices, seen the math behind polynomial interpolation, used the calculator to power through some of the calculations and construct a polynomial that shows that even the "experts" get things wrong. That's a lesson the class will remember long after they've forgotten how to do the math.

But it's easy to make mistake with calculations so I've constructed a Sage program to go through the steps to create an interpolating polynomial using Vandermode matrices. It's posted on the Python/Sage page. A little warning is necessary, however. Usually you just go to a SageCellServer (or SageSandbox on this site) and copy/paste the code and press "Evaluate" to get the code to run. For reasons I don't understand, sometimes you get some sort of I/O Error such as the one below.

PolyInterpError

That error can pop up at various stages in compilation. The code runs, sometime it's just a matter of pressing "Evaluate" several times.

In order to set the code for your sequence, you need to alter xvalues and yvalues in the code. For example, if your sequence is 3,2,_,0,-1,-2, _,... and someone says that the pattern is to subtract 1 from the previous terms so the missing numbers are 1 and -3 then you'll need to pick the values you want in your sequence. If you choose to complete the sequence as 3,2,5,0,-1,-2,11,... then you'll need to set xvalues = [1,2,3,4,5,6,7] because you have 7 terms in your sequence and yvalues = [3,2,5,0,-1,-2,11] because those are the terms of your sequence. Press "Evaluate" and you'll get a polynomial that goes through those points. So there is a formula for your sequence--it's just not obvious to most people.

Here are some stories that caught my eye this past week:

  • The74million notes that Common Core lowers standards and that's a good thing. HUH? "Implementation of the Common Core has run headlong into high school exit exams, which many states require students to pass in order to graduate. But now states that have adopted the Common Core are grappling with whether raising academic standards should also mean making it harder to graduate.To supporters, tough graduation requirements are necessary to encourage student effort and ensure a diploma “means something.” Some have even pushed for requiring students to demonstrate “college and career readiness” in order to graduate.But decades of research now show that exit exams have not really raised standards, and have actually harmed disadvantaged students....In other words, the unintended consequence of the Common Core may have been to lower the bar to graduate — and research suggests that this was a good thing."
  • Decades ago, a high school degree was normal and few people had college degrees. Yet people could get jobs that allowed them to provide for a family. Now the quality of high school education has been watered down, graduation rates are higher and a college degree is "necessary" to get a job. And that means people are some $30,000 in debt after college (which is more likely to be 5 years now) and too many students have taken courses in topics that lack rigor and meaning. And while I've taught algebra to many young students outside the US, somehow in the US algebra is too complicated for 18-22 year old students to master--it's actually standing in the way of people graduating. How can you get horribly educated students through college with a pesky math course in the way? Simple--water down standards at the college level. Now Wayne State University leads the charge in dumbing down education, "Up until now, students had to take one of three different math classes before they could earn their degree. Now, depending on their major, students may be able to squeak through college without taking math. The university is leaving it up to the individual departments to decide whether math will be a required part of a degree's curriculum." So in the future, students can graduate high school and college and still not have the math skills of someone who only graduated from high school 50 years ago...and pick up a lot of student loan debt along the way. But at least more people are graduating from college! Progress?
  • Now compare the American drive to banish math with this clip from NextShark called "Watch Korean Students Take the American SAT Math Section For the First Time". You'll hear some people talk about Americans as "exceptional"--that probably shouldn't be taken as a compliment. Even the weak Korean students are feeling better about their math now....
  • The Columbus Dispatch reports "The State Board of Education is expected to lower minimum proficiency standards on two new high school math tests after results came in lower than expected.The move raises questions about whether benchmarks for new assessments will accurately gauge a student’s readiness for college or a career" Somehow I doubt they care about college readiness...
  • Wired.com with an article on "deep learning" that underpins AlphaGo and other computer programs.
  • He's gone viral! ABC News with a video on "8TH GRADER GRABS BELLY LAUGHS FOR CANDIDATE IMPERSONATIONS"
  • Mental Floss with "15 Observational Facts About Isaac Newton"
  • The bit-player blog has a fascinating post on the non randomness of the prime numbers. "These remarkably strong correlations in pairs of consecutive primes were discovered by Robert J. Lemke Oliver and Kannan Soundararajan of Stanford University, who discuss them in a preprint posted to the arXiv in March. What I find most surprising about the discovery is that no one noticed these patterns long ago. They are certainly conspicuous enough once you know how to look for them...For the past few weeks I’ve been noodling away at lots of code to analyze primes mod m. What follows is an account of my attempts to understand where the patterns come from. My methods are computational and visual more than mathematical; I can’t prove a thing. Lemke Oliver and Soundararajan take a more rigorous and analytical approach; I’ll say a little more about their results at the end of this article."
  • A May 18th, 2016 interview with graph theorist Maria Chudnovsky on anthonybonato.com. Looking for a female mathematician to inspire the girls in your classes.  Look no further; she's even been in 2 commercials.

Leave a Reply

Your email address will not be published. Required fields are marked *

AlphaOmega Captcha Classica  –  Enter Security Code