Odds and Ends: Jan 28, 2014

AreaTriangleIn the chapter on matrices we studied that the area of a triangle in the plane with vertices $latex (x_1, y_1), (x_2, y_2), (x_3, y_3)$ can be determined by calculating a determinant with row i consisting of $latex x_i \,y_i \,1$  for i between 1 and 3. Then take the absolute value it and divide by 2. If the value turns out to be 0 then the points must have been collinear. I've posted a Sage Interact to generate problems to use during the lesson since the book doesn't have enough extra problems. It's posted on the Sage in the Classroom page and you can see the output above.

In a recent post, I mentioned an audio interview with Simon Singh talking about his book ‘The Simpsons and Their Mathematical Secrets’. The NY Times had a piece on this today, too: "Examining the Square Root of D’oh!" which provides even more information: the creators have included, over the years, "J. Stewart Burns, who has a master’s degree in math from Harvard; David X. Cohen (master’s in computer science, University of California, Berkeley); and Ken Keeler (Ph.D. in applied math, Harvard). Most astonishing is Jeff Westbrook (Ph.D., computer science, Princeton), who was an associate professor at Yale before he joined the team.". That's got to be the smartest creative team in television history.

The Sagemath Twitter feed tweets that Sagemath Cloud is now capable of producing graphs using Plotly. As if you didn't have enough reasons to use Sage; now you've got one more.


Teaching Points: Law of Sines

LOSpresentationIn an earlier post, I mentioned the book I'm using did a poor job of explaining the ambiguous case of the Law of Sines. I put together an explanation for my class that I feel is more understandable but since it was my first time through the material I presented it on the whiteboard. Now, with a little more time, I've turned it into a beamer presentation, so next time I have to teach the Law of Sines things will look a little more polished. Beamer is the $latex \LaTeX$ version of Microsoft Powerpoint, just a lot nicer.

The presentation of the Law of Sines for the ambiguous case is an example of what I refer to as teaching points (the outline of the material which you can elaborate on along the way). I've posted it on the Teaching Points page along with the tex code so you can modify it to suit your needs; the fonts and colors were changed for illustrative purposes. Remember, an easy way to change the colors was mentioned here:  paste the code provided into a Sage Cell Server, select your color, copy the color code, go into the $latex \LaTeX$ code where the color is set:

\usecolortheme[rgb={ 1.0 , 0.651 , 0.0 }]{structure}

and paste in the number values you like best.

Sagetex, TikZ, and the Altermundus packages

I've finally had some time to experiment a bit. I ran across an intriguing post some time back which indicated sagetex could be used to provide some computational power to help in creating complicated TikZ plots more simply. I wanted to try using the basic method to make Sage do the computational work that is typically handled by Gnuplot. I never liked having to deal with Gnuplot and its crazy syntax. With the Sagemath Cloud harnessing the power of Sage to use in $latex \LaTeX$ documents (through the sagetex package), getting Sage to replace Gnuplot seemed probable.

In very important documents, Sage plots have different fonts and font sizes that detract from the overall presentation. I've always loved the look of TikZ, in particular the packages of Altermundus are outstanding. Here's an example of using sagetex to have Sage replace Gnuplot in doing the calculations of the coordinates.

SagetexTkzfct1I've created a new page, Plotting with Sagetex, where I've explained more of the details.  I've posted the code to get you started with designing graphics with sagetex, Tikz, and Sage. Later on I'll include information on graphics with sagetex and Python and sagetex and Sage. TikZ is the gold standard for the best graphics but it does have its limits. By creatively using sagetex, you can get Sage to replace Gnuplot in making  publication quality plots.

Odds and Ends: Jan 14, 2014

Just a few odds and ends for today. I've added a problem to the Problems page:

Find the Fahrenheit temperature, $latex x$, that is equal to $latex x$ degrees Celsius.

If you follow mathematics in education then you probably have heard statistics that are something like "1/3 of high school math teachers don't have a degree in math". This article, for example, says, "We would expect that all high school mathematics teachers would have at least a minor in mathematics, if not a major. But the actual results for high school are quite surprising. Less than half of all high school mathematics teachers surveyed had a major in mathematics. Almost one-third did not have either a major or a minor in mathematics.".

A natural question is: what's their background? The government data is here. You'll find the column for math teachers around the middle of the page. Down near the bottom you'll see the relevant section on majors. Here are some of the stats: English and language arts majors, 3%. Health and physical education, 5.6%. Social sciences, 8.3%. Vocational and technical degree, 13.3%. No degree, 0.3%.

This page has an audio interview with Simon Singh talking about his book ‘The Simpsons and Their Mathematical Secrets’. Apparently, many episodes of the Simpsons contain mathematical references--some of them are quite subtle (8208). And I've missed most of them. D'oh!


Sagetex: Sending/Receiving secret messages

SecretMessagesThere are many ways to use matrices to send/receive messages. The screenshot above shows 2 problems that use just the alphabet and set A=0, B=1,...,Z=25; the code has been added to the Sagetex: Matrices page. The alphabets used in sending messages can allow for spaces, numbers, punctuation, capitalization, and so on. The problems in the screenshot form the message from across rows, rather than columns and use multiplication on the left rather than on the right. But the basic structure is here for you to modify to your taste or just copy/paste to use in a test or quiz. You need to understand that if you're using a 2x2 matrix to encode a message then the message length should be divisible by 2. If it isn't then a dummy letter is needed to make it the correct length. Likewise, if you use a 3x3 matrix to encode a message then the message length should be divisible by 3; so you might need up to 2 dummy letters to end the message. You need to be careful to account for dummy variables if you choose to modify the code to handle 3x3 (or bigger) encoding matrices. I've chosen Z as the dummy variable but Q (or X) is a logical choice, too.

Sagetex: systems of equations

SolveSystems2In the previous post we had a problem where systems of equations were created through producing an invertible matrix and then solving the matrix equations. That led to output which was a little clumsy and didn't cover all the cases that can result from 2 lines. The 3 cases are:

  1. 1 point of intersection
  2. parallel lines
  3. coinciding lines

I've added more problems that let you pick the specific cases you want on the test and then generate the random numbers for each case. By controlling the random numbers, the output looks better, too. The sample tex file which produces the output shown above can be found on the Sagetex: Matrices page.