Archive for Uncategorized

Thursday, May 3rd, 2012

Getting Graphic in the Data Deluge

April was Math Awareness Month with the theme, “Mathematics, Statistics, and the Data Deluge.” Massive amounts of data are collected every day. Decisions inferred from analyzing the data can impact our daily life. What you are wearing today may be such an example. Indeed, you got dressed with math. One particular way this is true relates to the clothes you buy in a store. Your choices are constrained by the retailer’s selections. To get a sense of what is “popular,” opinion groups rate products via surveys and polls. From the data, decisions are made as to what line a designer or retailer will offer.

From a history of credit card purchases to a stream of measurements from a satellite to Twitter activity, our technological world offers amounts of data almost beyond comprehension. The field of data mining searches for information and insight in such troves of bits and bytes. Using data to rank results in the order of web pages that Google returns when you conduct a search. Neflix mines its ratings data to predict how many stars you’ll give a movie.

Note, however, that mining through the data deluge does not necessarily involve considering all the data. At times, an important step is choosing a representative sample. Suppose a company wants to monitor Twitter as to the public’s opinion of a new product. What words should be included in a tweet or taken as a positive versus negative comment? Even if one cannot track every posting, if a representative sample is found, such data can return meaningful results.

Political polling is an example of conclusions from data drawn from a sample. In fact, Gallup Polls achieved national recognition by correctly predicting that Franklin Roosevelt would defeat Alf Landon in the 1936 presidential election. This was in direct contradiction of the Literary Digest, a widely respected magazine. George Gallup polled 50,000 whereas the magazine’s conclusions came from over two million responses. Choosing a representative sample was the key of Gallup’s successful prediction.

Data can yield a wealth of information. But, first, we must be able to interpret it. An important decision is how to sift through the data. For example, will we group the data by similarities or rank the elements? Taking Netflix user ratings, one could group movies into mathematical genres such that each group contains movies that users tend to view in a similar way. Alternatively, someone else might want to rank the movies by user ratings to create a top 100 movies on Netflix list.

Once the data is processed, visualization often offers added insight. For example, how might you interpret the wind data for the continental United States? Below we see an example from the IVRG-gallery of a 3D graph containing the Kevin Bacon number of a social network.

Visualization is an active field of research. Choosing how to graph a dataset is, in itself, an important decision. One may have meaningful results after computation and appropriate visualization may make the associated insight obvious. However, some data is more appropriate for graphing than others. For instance, do you see the following pie chart as a helpful display of information?

While this graph is intended to make the point with some humor, choosing how and when to graph data is an important part of many applications of data mining.

Returning to presidential politics, let’s view two word clouds, which scale the size of words proportionally to their frequency in a source text. Below, we see two word clouds created with Wordle from transcripts gathered from a LexisNexis search of “Obama OR McCain” from September 1, 2008 until November 4, 2008 (Election Day). One word cloud comes from MSNBC transcripts and the other from Fox. Do you know which is which?

The images were created by Greg Newman, a political science major at Davidson College, who is using mathematical clustering algorithms to further analyze such data. While the pictures cannot capture all the inferences that Newman hopes to make with his research, they can give helpful information of these datasets prior to the work involved in data mining. (The image on the left is from MSNBC and the one on the right is Fox.)

As we march further into May, keep in mind that data surrounds us. While you may or may not have expertise in the field of data mining, graphically displaying data, in itself, can lead to useful insight. Like an artist with a blank canvas, you must choose what tools to use to paint your picture of the data. What choice you make is often both a science and an art.

Saturday, March 3rd, 2012

Bracketology 101

Every year, people across the United States predict how the field of teams will play in the Division I NCAA Men’s Basketball Tournament by filling out a tournament bracket for the postseason play. Recently, Amy Langville and I published techniques of creating personalized brackets with math. This past week, I discussed these ideas as part of the Distinguished Lecture Series of the Mathematical Association of America.

A highlight of the talk, at least for me, was creating our own ranking during the talk. How do you do it? Want to try yourself? Here are two lectures that give details on March Mathness and creating your own brackets.

  • Full length lecture created as part of a webinar series on applications of linear algebra supported in part by the Associated Colleges of the South. Includes instructions on using the Java application that will rank basketball teams.
  • Short presentation on how to create your ranking with the Java application.

Finally, here is a link to Java code to rank!

Start honing your math models. When you have something you like, want to test it against others? Try the Princeton University Press March MATHness pool! For more details see their March Mathness blog.

Good luck!

Tuesday, February 14th, 2012

Sum kiss!

Suppose this Valentine’s Day your sweetheart asks what you’d like as a gift. You innocently request, “How about you give me one kiss right now, twice as many in an hour and twice that the next hour?” Just one simple kiss right now, 2 kisses in an hour and 4 kisses in the next hour!

It’s about 11 o’clock in the morning at the time of this post. How many kisses will you have by 10 PM, which is 11 hours away? How many kisses would you be getting at 10 PM? You start with 1 kiss, after one hour you receive 2^1, after two 2^2 and so forth. So, after 11 hours you would receive 2^{11} = 2048 kisses which would take just over 34 minutes if you received a peck on the cheek at 1 pps (pecks per second). Just think, if your love had asked before 10 AM, then by 10 PM, the kissing at 1 pps would happen continually for those final hours!

Now, how many total kisses would you receive over that time? Recall

  sum_{k=0}^n 2^k = 2^{k+1}-1

So, after 11 hours, you get 2^{12} - 1 = 4095 kisses. That’s sum kissing!

Sunday, February 5th, 2012

Costly blink

In several hours, Super Bowl XLVI will begin. Sports fans will fall silent as the Giants and Patriots meet, yet again, in the championship game. Fans and not-so-strong-fans will turn and focus on the TVs, large and small alike, as the multimillion dollar adds will also air. This year, a 30 second commercial costs 3.5 million dollars. That’s $116,666.66 a second!

That left me wondering, how much would a commercial, assuming the same pricing, lasting only the blink of an eye cost to air in the Super Bowl? According the John Brenkus’ book The Perfection Point, it takes 4 tenths of a second to blink one’s eye completely. This fact is relevant to Brenkus’ book since a 99 mph fastball reaches the batter in 395 milliseconds. As such, a baseball is invisible to the batter when it is within 15 feet of home plate. In fact, the images from the last 15 feet can’t be processed by the brain in time!

This same fact, in the context of Super Bowl ads, means that the time one blinks during a 3.5 million dollar ad is worth just under $50,000 ($46 666.66, specifically).

So, soon, we’ll see how well the agencies produced such costly ads and whether we don’t want to miss even a tenth of a second or whether we’d like to blink and stop halfway and stop watching!

Monday, January 16th, 2012

I have dream in a cloud

Today is Martin Luther King, Jr. Day, which honors and remembers the accomplishments of this influential and historic leader. My children enjoyed “King Day for Kids” activities at Davidson College, which sparked conversation about King, civil rights, and freedom.

As I read my children’s self-authored books about freedom and civil rights, I thought about King’s “I have a dream” speech. I remembered interviewing a family friend in high school about his trip to DC for the historic event. I thought of what I might do in my blog to honor this day. In the end, it seemed like a graphical representation of the speech fit my blog. So, below is a word cloud, created at Worldle. The size of the text is proportional to its frequency in the Martin Luther King, Jr.’s “I have a Dream” speech. Click the image to see it in higher resolution.

May we all continue to find ways to take these lofty words to our everyday life and keep them from simply being dreams in the clouds…but reality on earth.

Tuesday, January 10th, 2012

Tebow time tweeting

If you didn’t see it live, you’ve seen it — again and again…yes, and again! The Denver Broncos and Pittsburgh Steelers were locked in a tie in their Wildcard game. Only 11 seconds of overtime were needed for Tim Tebow to throw the longest overtime touchdown pass in what then became the shortest overtime playoff game in the history of the NFL. The fervor in the Denver stadium shook the Rockies and created the Internet tsunami that followed.

According to the USA Today, thumbs were typing at a rate of 9,420 tweets per second on Sunday night as they announced the victory. How much textual content flew through Twitter from this inspirational win?

While tweets cannot exceed 140 characters in length, their average length is 81.9 characters according to MediaFuturist. So, in one second, 771,498 characters zoomed through Twitter. From Wikipedia, we’ll take the average length of a word (in English) to be 5.1 characters. Note, here I make an assumption that 1) tweets are written in English and 2) even so, that tweets conform to the standard length of words in the English language. This would imply that 151,274 words were tweeted in one second on Twitter.

Can you conceptualize this number? Here are some word counts for the first three Harry Potter books:

  • Harry Potter and the Philosopher’s Stone – 76,944 words
  • Harry Potter and the Chamber of Secrets – 85,141 words
  • Harry Potter and the Prisoner of Azkaban – 107,253 words

Note, in one second more words were tweeted about the Broncos win than any one of these Harry Potter books! In fact, if that rate of 9,420 tweets per second was kept for two seconds then more words were tweeted than all 3 of these books combined.

Twitter definitely got Tebow-ed on Sunday! Quite a finish and quite a Twitter sensation!

Tuesday, January 3rd, 2012

A Color Change Charm for Ron Weasley

Ron Weasley’s twin brothers Fred and George convinced him that the following poem was a Color Change Charm:

“Sunshine, daisies,
butter mellow,
turn this stupid,
fat rat yellow.”

The incantation of the poem was supposed to turn Ron’s rat Scabbers yellow. All Ron got was teasing and snickering from his brothers! If linear algebra were taught in Charms Class at Hogwarts and applied to Scabbers, how could Ron turn him yellow?

The color of each pixel in an image is determined by a vector (r, g, b). With paint, yellow is a primary color. With RGB, equal amounts of red and green make yellow. Therefore, we will use the following linear transformation on each pixel in Scabbers’ image:

  left(  begin{array}{ccc}  1/3 & 1/3 & 1/3 \  1/3 & 1/3 & 1/3 \  0   & 0   & 0  end{array}  right)  left(  begin{array}{c}  r \  g \  b \  end{array}  right)  =  left(  begin{array}{c}  (r + g + b)/3 \  (r + g + b)/3 \  0  end{array}  right).

This transformation produces the following change:

The white background turned yellow which can be a bit displeasing. It’s almost as if we are wearing yellow-tined glasses.

Note, with this linear transformation a white pixel (255,255,255) becomes (255,255,0), which is full yellow. Let’s make such a pixel black. To do this, we want 255 to become 0 and take 0 to 255. That is, we have the points (0,255) (255,0), which becomes the line:

y = –x+255

This can be done via matrices where we take

N = –Y + 255(1),

where N is the new image, Y is the yellow Scabbers and 1 is the matrix of all ones. This produces the following image:

With some matrix vector multiplication, Ron could have turned Scabbers yellow and snickered at his brothers! While linear algebra isn’t quite the same as a wand from Ollivander’s Wand Shop, it does lead to some magic, at least in a Muggle-ish way.

Tuesday, November 29th, 2011

X marks the spot

This fall, I’ve been leading a seminar for the Charlotte Teachers Institute entitled, Math through Popular Culture. This Thursday will be our last session together. We will lead a Celebration of Mind event co-hosted by CTI, the Bernard Society of Mathematics at Davidson College, UNCC Math Department, the
Charlotte Teachers Circle, and HHMI Outreach at Davidson College. Throughout the evening, we will explore games, puzzles and magic as we celebrate and honor Martin Gardner, who touched millions of lives with his mathematical writing. This is one of worldwide Celebration of Mind events occurring on all 7 continents and a fitting way to complete our study of popular math.

To warm up our mathematical engines, I share a magic trick emailed just this morning among our seminar group. First, here’s the trick:

  • Think of a number 1-20
  • Double it in your head
  • Add 6
  • Divide by 2
  • Subtract original number

I bet I know your number! How? Let’s see (and create some space until I unveil the answer).

I don’t know the number you’ll pick so I’ll call is x. It’s the treasure of the problem and I must uncover it. So, x is marking the spot where I’m trying to use math to find a number.

Next, we double it so we get 2x.

Adding 6 yields 2x + 6.

Next, dividing by 2 gives us (2x + 6)/2 = x + 3.

Finally, we subtract the original number! Ack, I don’t know the original number! However, I do know that it equals x. So I subtract x and get x + 3 – x = 3.

Wait! I never needed to know your original number. In fact, you didn’t even need to select a number between 1 and 20. You can try an integer bigger than 20 and see that it still works. I’m going to stay within our original interval but be less rational and choose π.

Let’s see if that works. We double it and get 2π. Add 6 which results in 2π+6. Now, divide by 2 and get π + 3. Subtract the original number, which equals π, to get 3.

Such tricks can be fun and engaging ways to teach mathematical concepts. Martin Gardner was a master at it!


Thanks to Emily Sansale, a fellow in the 2011 Charlotte Teachers Institute Math through Popular Culture seminar, for inspiring this blog entry with her email.

Thursday, November 24th, 2011

Algebra for Angry Birds webinar

Yesterday, I recorded my first webinar. The process was much simplier than I anticipated. The results? Take a look for yourself and see what you think! The webinar is based on my previous blog posting on using the topic of polynomials as studied in many secondary algebra classrooms to play Angry Birds. Just click the image below to see the webinar.

I look forward to recording future webinars and exploring a new medium for conveying mathematical ideas.

Sunday, November 13th, 2011

polynomials & Angry Birds

They’re a phenomenon! They’re addictive. They’re angry…really, angry! But, they’ll be happier when they see how math can help them. Yes, we’re going to use ideas often introduced in algebra, specifically polynomials, to help those Angry Birds take out their aggression on the sneaky pigs.

Much of angry birds comes down to choosing the angle to sling the bird through the air! Note that a bird’s initial angle out of the slingshot equals the angle between the horizon and the stretched sling at the moment of release. The angle determines the path the bird will follow in the air.

Can math help us determine an angle to shoot the bird? Keep in mind, though, it can be difficult to shoot exactly at, say 35 degrees versus 40 degrees.

So, we will restrict ourselves to the path of a red angry bird with 3 different initial angles – 30, 45 and 60 degrees. Which of them would land the bird closest to a desired point? This can give us a sense of how to shoot the angry bird.

Trajectory depends on the angle and the initial velocity of a projectile. How fast does an angry bird travel? To answer this, we need a sense of scale. Rather than using a meter or inch, we’ll use a scale of 1 slingshot, which we’ll denote as 1 AB.

A key component to determining the path of a slung angry bird
is knowing the underlying model of motion used within the programming of the game. In the Wired.com article, The Physics of Angry Birds, Rhett Allain, an Associate Professor of Physics at Southeastern Louisiana University, determined that an angry bird enjoys a frictionless flight, not feeling any effects of the air through which it passes. So, the bird follows parabolic motion. In particular, the path an angry bird follows for different launching angles are:

  begin{array}{rcl}  y & = & 1 + 0.5773503x - 0.0704629x^2 mbox{~for~} 30^circ\  y & = & 1 + x - 0.105694x^2 mbox{~for~} 45^circ \  y & = & 1 +  1.7320508x - 0.211389x^2 mbox{~for~} 60^circ \  end{array}

Given we are trying to get an estimate of an initial angle, let’s round our formulas and use:

  begin{array}{rcll}  y & = & 1 + 0.577x - 0.070x^2 mbox{~for~} 30^circ\  y & = & 1 + x - 0.106x^2 mbox{~for~} 45^circ \  y & = & 1 +  1.732x - 0.211x^2 mbox{~for~} 60^circ \  end{array}

These are pleasing mathematically but can be a bit difficult to visualize. So, let’s graph them and see what the trajectories look like?

The graph of the trajectories helps us see that of these three initial angles only 30 degrees results in a hit that will teeter the tower! Suppose instead, we want to know where a bird will be at some point along its flight. Let’s pose this type of question in this way: What height will a bird be when it crosses the vertical line seen below if shot at 45 degrees?

First, we need to know how far the dotted line is from the slingshot or, in terms of graphing, the coordinate along the x-axis. Remember 1 unit = length of slingshot. So, we lay down slingshot after slingshot and find that the dotted line is (conveniently) 5 slingshots away. So, we need only to set x = 5 in the parabola the angry bird will follow, specifically, y = 1 + x - 0.106x^2 to know the height of the bird at that point, which equals 3.35. Again, laying down slingshots shows this height below.

Compare this to the red dotted trajectory earlier. How did we do? How else could you use this information to help you play Angry Birds? What other mathematical questions come to mind? Ponder it a bit, you might find posing the questions and the search for answers to be a bit addictive, just like the game you’ll be analyzing.


The topic of polynomials fall within a variety of areas of mathematical study. This blog posting is cast within algebra as a way of thanking Kristianna Luce and Maryellen Magee, fellows in the 2011 Charlotte Teachers Institute Math through Popular Culture seminar. Both teachers will be using these ideas in their curriculum units. Soon, I’ll be posting an entry on deriving such polynomials with the use of Calculus.