LaTeX: Plot template with spy

PlotTemplateSpyOver the last week I found myself working on graphics for calculus (arc length and linearization) which required learning a bit about the spy capabilities of tikz. Spy allows you to magnify a part of your picture which is useful when you're dealing with small changes as is typical in calculus. After creating said graphics it seemed only appropriate that I create a plot template which uses spy. I've worked the capability into the previous plot template for consistent plotting graphics; you can see the output above. That's for illustrative purposes only; in my opinion there's too much happening in the picture above: so many functions, the grid and the spy area, and the vertical line. Recall that changing the "grid" option from "both" to "none" will turn off the graph paper. The new template is posted on the Handouts page, under the first template.

Here are some issues that caught my eye recently:

  • A NY school district is apologizing after letting a student recite the Pledge of Allegiance in Arabic during National Foreign Language Week. Fury follows and the article mentions a tweet: "State Education Department regulations specifically say the Pledge of Allegiance should be read in English.".
  • Illinois Watchdog reports "After working one day as a substitute teacher in Illinois, David Piccioli could be entitled to an annual pension of more than $30,000." This story is attracting attention and is well worth reading.
  • Chessbase hosts John Stewart's piece on U.S. buying (chess playing) nerds. No offense Fabiano!
  • RT reports on over 1,000 arrested in a mass cheating scandal. Watch the video of them scaling walls to position themselves by windows to help out. The article notes,"More than 1,000 people were detained, half of them were parents and teachers while the other half consisted of friends and relatives," Gupteshwar Pandey, a police official in Bihar state, told AFP on Sunday. "Fifty percent have been released but I believe that the others are still probably in jail." followed by "According to Pandey, at least two policemen were also arrested and 10 more were dismissed after being implicated in the scam." and "Numerous photos and a video presented earlier this week showed the students using smuggled crib sheets, which friends and relatives had handed to students after climbing the walls of examination centers." You have to see it to believe it.

March 20, 2015: Odds and Ends



  • I've added code for plotting the upper Riemann and upper Riemann sums using sagetex. You can find them on the Plotting with Sagetex page, in the Riemann sums section.
  • The problem: "Find a function whose domain is the positive real numbers and whose range is the integers." has been added to the Problems page.
  • Infowars hosts the CBS news video on a student who was tased, arrested, and "...charged with assault on an officer, and two misdemeanors."
  • In the last post there was an article on the poor performance of American Millennials compared with the rest of the world. ZeroHedge hosts  a more in-depth piece by Michael Snyder: "It's Official: Americans R Stoopid". From the article: "In Japan, Finland and the Netherlands, young adults with only a high school degree scored on par with American Millennials holding four-year college degrees, the report said." and reference stats from a USA today article on college students, showing,"-“Students also spent 50% less time studying compared with students a few decades ago”-“35% of students report spending five or fewer hours per week studying alone.” “50% said they never took a class in a typical semester where they wrote more than 20 pages”, “32% never took a course in a typical semester where they read more than 40 pages per week.”. Sobering.
  • TheConversation reports on the roll of Twitter in the Common Core debates and studies the content of a large selection of Tweets: "There are upwards of 40,000 tweets using #commoncore each month right up to the present."

Sagetex: Derivative 5/6 without the Chain Rule


I've added two more problems (Problems 5 and 6) to the Sagetex: Derivatives page. Problem 5 requires the student to calculate the derivative of a product of polynomials using the Product Rule. Problem 6 looks like a Quotient Rule but the derivative is more easily calculated by carrying out division before taking the derivative.

Here are some stories which caught my eye:

  • L.A. Times reports 9 students at Venice High School were arrested and 14 accused, " connection with a series of sex crimes that began more than a year ago and involved at least two female classmates. All but one of the arrests were on campus; authorities were attempting to locate five other students." No doubt this story will continue to evolve.
  • Mathematically challenged: it could cost you your marriage. The New York Post reports "Bride Walks out on groom after he botches simple math problem". In a country of arranged marriages, it was a sign to the bride she had been "misled" about his education. "“The groom’s family kept us in the dark about his poor education,” said Mohar Singh, the bride’s father. “Even a first-grader can answer this.”"
  • LaTeX Community has a nice piece on "Why I like the TikZ Math library".
  • Welcome to school today: a student intentionally runs into a school security officer " what has been described as an attempt to ‘chest bump’ the officer...". This knocks the officer to the ground. The officer gets up, grabs the boy and according to Infowars, which has the video posted: "The video shows Hardin lifting the 13-year-old child into the air with a chokehold. The child kicks and flails around before becoming limp and lifeless. Hardin then drops the student to the ground, resulting in what a doctor has described as “an injury to the brain” due to loss of blood flow.". Be aware of the graphic nature before you watch this.
  • It's obvious to "older" people that school quality has dropped dramatically over the years (think Calculus students who struggle with fractions) but at least the students of today are tech-savy, right? According to this Fortune article, no. "American Millennials are among the world's least skilled" reports that a new study shows, "...Millennials in the U.S. fall short when it comes to the skills employers want most: literacy (including the ability to follow simple instructions), practical math, and — hold on to your hat — a category called “problem-solving in technology-rich environments.” Not only do Gen Y Americans lag far behind their overseas peers by every measure, but they even score lower than other age groups of Americans."

Python/Sage: Finding roots with Newton's Method


An earlier post dealt with a fractal that resulted from Newton's Method. Today I've posted some Python code for finding the root of a function using Newton's Method on the Python/Sage page. Copy and paste the code into a Sage Cell Server, change the function to what you want and set the number, N, of iterations. It's quicker than using the calculator, less prone to mistakes, and shows the estimates of roots along the way (which is especially useful in cases where Newton's Method fails to find a root).

Here are some stories which caught my eye:

  • Over 1,000 people turned out in Long Island to rally against Common Core. Long Island Press has the coverage.
  • edSurge explains "Why the Smarter Balanced Common Core Math Test is Fatally Flawed".
  • South Carolina has abandoned Common Core.
  • In the last post I mentioned Saturday is Super Pi day because 3/14/15 matches up with 3.1415. But as this article points out, "in 2015, Pi Day really is significant as the mathematical moment of Pi–3.141592653–will only come around once in a lifetime, on March 14th, 2015 at 9:26 a.m. and 53 seconds....A moment like this won’t be back for another hundred years, March 14th, 2115.". Get your geek on!
  • The Guardian has an article "Confessions of a mathematical Olympian: an insider view of film X+Y", which opens this weekend.
  • The Daily Signal has a good piece on the growing concern over the Common Core standards. "A Pioneer Institute report coauthored by Milgram detailed that, by seventh grade, Common Core mathematics standards leave American students two grade levels behind their peers internationally and do not prepare them for admission into highly selective four-year universities and STEM (Science, Technology, Engineering, and Mathematics) programs....And recently, reports surfaced that the Common Core architects left what some consider holes in the standards. Richard A. Askey, a professor emeritus at the University of Wisconsin-Madison and former member of the math standards’ feedback group, later noticed an omission of a geometry standard in Common Core. In fact, according to Education Week, Askey said “the process toward the end was so hurried that an entire high school standard was left out of the final draft.”"

Graphics: Hyperbolic Trig Functions


The latest change is the addition of the hyperbolic trig functions to the Graphics page. The graphs were created using the Tikz plot template posted earlier. Therefore, I've posted just the PDFs and not the (.tex) file.

Here are some current events that caught my eye recently:

  • The AMS Blogs has Part 1 of a piece on the Mathematical Education of Teachers. Finally someone I can agree with!
  • Clark County has announced some schools that will be open all year. Not that students are going to school without a break but that, "Year-round scheduling means schools can accommodate about 20 percent more students by splitting them between five tracks. Students still receive 180 days of instruction, with one track of students always on break. However, the change does comes with an increase in operational costs, estimated to be about $308,000 for each school, a school spokeswoman said.".
  • The new trend to be on the lookout for? Ohio parents are suing Amazon when their son overdoses on caffeine powder.
  • The Daily Caller reports that parents called 911 when the local school wouldn't release their daughter from a Common Core test: "The...mother showed pick up her daughter because she wanted to opt the fifth grader out of a Common Core-aligned writing test. School officials informed the mother that they would not allow her daughter to leave, ...".
  • Nerd alert! Mark your calendar for this Saturday. Not only is it Pi Day but this year it's Super Pi Day: "This year is particularly special because it’s Super Pi Day: The date represents the first digits of pi, 3.1415."

Dragon Curve, revisited


One of the most active posts on TeX StackExchange recently was on the Dragon Curve, a topic I had covered here with a Sage Interact manipulative. The TeX StackExchange post included two interesting videos: 1 from Numberphile and the other with Donald Knuth. These two interesting videos as well as the numerous resources created on the TeX StackExchange site makes the Dragon Curve an even more appropriate fractal to cover in class. I've thrown in my two cents with the example above using Sage to show how the curve grows. The code can be found on the Python/Sage page. I've added the animated GIF, the TeX StackExchange link, and the video links to the Sage in the Classroom page.

Here are some issues which caught my eye recently:

  • A teacher in Ohio has been put in jail for 90 days for showing, "....a movie including graphic sex and violence to a high-school class". Sounds like she should have gotten more time for some pathetic excuses: "Kearns, 58, contended she was unaware of the movie's content. Her attorney said she never would have knowingly showed it.". Sounds sincere you say? "After the conviction, the jury foreman said it was not proved at trial that Kearns was aware of the movie's content the first time she showed it but that she would have known by the second, third, fourth, and fifth showings.". But it's even worse; according to article the movie was 129 minutes and, "The student said the movie was "disturbing" and said students in the class went "crazy" while watching it.".
  • The Atlantic has  a piece on a public school teacher who sends her child to private school. Clearly aware of the contradiction she tries to explain her stand only to make it worse, "...the tangible difference between this environment and that at the public high school in the area was stunning to me—even though I'm a veteran public-school teacher.". The problem with public school? "It’s not a classroom-management issue in this case. The teacher could outlaw food and cellphones, but there would still be jokes, fidgeting, students with passes to or from another place—something to distract them.". Not pointed out was the fact the private school, whose tuition was, "...roughly $3,000 and $7,000 per student in annual tuition..." is less than what is spent in public school as mentioned in this post.
  • This article in Education Week deserves a look. It starts, "The first round of a Consumer Reports-style review for instructional materials paints a dismal picture of the textbook-publishing industry’s response to new standards: Seventeen of 20 math series reviewed were judged as failing to live up to claims that they are aligned to the common core." but then mentions, "The project is funded primarily by $3 million in grants from the Seattle-based Bill & Melinda Gates Foundation—which also was a major financial backer of the development of the common core...". It sounds like damage control before the elections--Common Core is just standards and if you don't like what's happening then that's a complaint about the the content and not on the standards. Considering Common Core was sold as a way of improving education (despite it just being standards) this sounds like full retreat. One lesson shines through; the inability of government to manage the process: despite having years of time to prepare for the transition to Common Core it's been bungled badly.

LaTeX: lapdf package


I was hunting around the CTAN site recently and I came across the lapdf package which, according to the CTAN site, "­vides the means to use PDF draw­ing prim­i­tives to pro­duce high qual­ity, col­ored graph­ics". A search of TeX StackExchange resulted in 0 uses. Since the package documentation is from 2011 it appears that the package isn't being developed anymore. I was unable to get a response from the package author, either. The documentation is a little weak, but if you download the contents of the package, there are numerous examples covering many topics:

  • parametric curves
  • polynomials, derivatives, and tangents
  • integral and rational Bezier curves
  • polar functions
  • super-ellipses
  • trig functions, inverse trig functions, hyperbolas, hyperbolic functions, log and exponential functions, power and root functions, and more
  • turtle graphics

and more. The weak documentation means you have to be willing to puzzle your way through by looking at the examples. One of the jarring errors in the documentation is that examples are given with the line


which is incorrect. It should be \usepackage{lapdf} to compile properly. I liked the fact that ellipses could be defined by specifying the center along with the major and minor axis lengths, and the rotation; that's done in the line


Which means 50 line segments were used in creating an ellipse centered at (1,2) with a=3, b=2, and a rotation of 30 degrees. Unfortunately, drawing the major and minor axes seems to be done by hand off on the side: if you look closely, the axes don't go through the proper vertices. So why not use sagetex and let Sage do the calculations? Now, in general, you can't trust that a package will work with sagetex; however, it seems as if lapdf does.


I've designed the code so that by specifying the center, major axis length, minor axis length, and rotation angle, the picture plotting parameters will be set and the ellipse, its center and its axes will be drawn. The code (shown above) has been added to the Plotting with SageTex page along with a version providing comments.

Here are some things that caught my eye recently:

  • has educational resources for middle school to college. With respect to math, the "higher level" courses of trigonometry, calculus (I, II, III), differential equations, and linear algebra can be found here. Click on "Textbook Correlations" to display topics aligned to specific math texts(!). I've added the HippoCampus link to the sidebar.
  • RT reports on a 16 year old who hacked into school computers to change his grades.
  • The DailyPilot has a piece on Common Core materials with numerous math errors frustrating the teachers. From the article: "Earlier this month, at the district's request, a panel of 11 teachers began performing what administrators describe as "edits" to the Swun materials, placing teachers in the uncommon position of fixing the contractor's mistakes. But the remedy frustrates the head of the teacher's union. "We already paid for this. We should not have to fix something we already paid for," Kimberly Claytor, president of the Newport-Mesa Federation of Teachers, said after a school board meeting earlier this month."". Almost 2 million was spent on the new materials(!)
  • Stanford math professor and author Keith Devlin is pushing video games to help students pick up the rules of math without getting bogged down in the symbols. Standard Examiner has the story here.

SageTeX: derivative problems


I've added 2 more problems to the SageTex: Derivatives page. The one shown above creates a random rational function and the task is to find the tangent line for a random value of x. The second problem forces the student to differentiate an expression involving constant^constant, contant^function, and function^constant. I've also added the links for 2 more packages to the list on the LaTeX page: pgf/tikz and spreadtab. While pgf/tikz needs no explanation, the spreadtab package provides support for building tables as is done in a spreadsheet.

Here are some current events that caught my eye:

  • Education Next has depth coverage of this year's Common Core test season and Oregon Live has a roundup of major stories. PJMedia records the frustration of 3 Ohio high school students taking a 6th grade math test. Some sample questions are shown and the keyboard entry doesn't look bad. A legitimate complaint about not being able to go back and check their work and an all too typical admission by a 12th grade student, “I can’t do fractions. I couldn’t even do fractions in 6th grade.”.
  • The Journal reports that, "Sony Opens Math Challenge to U.S. for First Time". The details can be found here.
  • CNA Finance has a look at the big business of testing. From the article: "It is also notable that Pearson landed the major contract, as approved by the PARCC consortium, to administer these tests aligned to the common-core standards, a project described as being of “unprecedented scale.”  For a contract of such an “unprecedented scale,” one might assume that competition was fierce; however, after interest from several companies, Pearson ended up being the only bidder." It's all about Pearson, Pearson, Pearson, "Pearson software grades student essays, tracks student behavior, even diagnosing attention deficit disorder. The company also oversees teacher licensing exams, trains teachers once they’re in the classroom through continuing education; Pearson advises principals—even going as far as paying for trips for school administration officials from across the country to trips abroad, to conferences where the only education company represented was Pearson, until the New York attorney general cracked down on this practice in 2013. Pearson also operates a network of three dozen online public schools, as well as being a co-owner of the for-profit company that now administers the GED."
  • Major changes may be coming, according to EducationNext. "...Friedrichs v. California Teachers Association (CTA), has been appealed to the Supreme Court,..." and the ability of unions to collect dues from nonmembers might could be in trouble.
  • The St. Louis-Dispatch reports on the positive impact that chess has on high school students. Since that's the site of the World Chess Hall of Fame we shouldn't be too surprised.

Python/Sage: Bisection Method


The Intermediate Value Theorem provides a theoretical basis for finding the roots of a continuous function. The Bisection Method starts with two x-values whose corresponding function values have a different sign (positive/negative or negative/positive). The Intermediate Value Theorem guarantees the existence of an x value between them with a function value of 0.  Guessing the midpoint of the interval either finds the root or, more likely, is either positive or negative. Depending on the sign the root will either be to the left (or right) of the midpoint. Each iteration reduces the length of the interval in which the root is by half. I've put together some Python code to work through the algorithm, it's posted on the Python/Sage page. Copying the code into a Sage Cell Server gives the output above.

Here are some issues that caught my eye:

  • The Washington Post has a piece about a, "mother, former teacher and full-time practicing attorney in New Jersey..." who is challenging a superintendent over opting out of Common Core. Get out of her way!
  • Common Core wasn't ready to be implemented in my state and that led to a lot of teachers scrambling to develop the resources to implement the standards. Apparently other teachers have experienced something similar--but they're getting a little more help. The Saint Louis Post-Dispatch reports that Representative Kurt Bahr doesn't want, "...educators, teachers and business leaders paying out-of-pocket to help develop Common Core replacement standards -- but to fix that, the state will have to shell out nearly $89,000 later this year."
  • The Daily Signal reports on the pushback against Common Core in Mississippi and Wisconsin. From the article, "But as the deadline for implementation loomed closer, states began to realize the costs of adopting Common Core, both financial and in terms of their educational decision-making autonomy. By June 2014— two months before the implementation date— 19 states had either withdrawn from the tests or paused implementation of the standards."
  • TechRadar gives Microsoft's Mathematics the thumbs up: "The program is a completely free complex calculator that has everything you'd expect on a small screened scientific calculator or graphical calculator just in a larger and more manageable screen without the tedious button combinations that have plagued regular plastic calculators."

Fractal World Generator


Fractals are are one of the more popular topics in mathematics because of all the interesting and unusual pictures they create. They also tie in with recursion and limits and some have unusual properties such as the Koch's Snowflake having finite area and infinite length perimeter. But it's also worth mentioning that nature can display fractal qualities as well; consider the list at Wikipedia. Fractal World Generator provides a more visual example: students can set a seed value, the percentage of water and ice, the type of map projection, color pallete, and other parameters and create their own fractal world graphic which can then be downloaded. Make sure you check out the "Animated Globe" map projection. I've added the link to the Fractal World Generator page. It's under the Mathematics links on the sidebar.

Here are some other recent events and changes:

  • In the last post I posted code for Riemann sum using the left hand rule. I've posted the code for right hand rule and midpoint rule to the Plotting with Sagetex page.
  • The 2015 Zurich Challenge is over and Nakamura has claimed yet another title, on an Armageddon playoff game versus Anand. Though officially second, Anand has to be happy for winning the Classical chess portion of the tournament. Chessbase has a good report here.
  • Education Next has an article on "competency-based learning" where students advance upon mastery. I like this idea but the concept would be less "radical" if schools would enforce a standard which would keep failing students from going on. If you've ever had to teach Algebra 2 to students who had trouble with arithmetic you know what I mean. Graduating from high school has to mean students have mastered "the basics".
  • Arizona has taken a step towards eliminating Common Core.
  • Here's a website with integral tables and other resources to download. They even have the tex files.