Math Bytes: Google Bombs, Chocolate-Covered Pi, and Other Cool Bits in Computing

Image of Math Bytes: Google Bombs, Chocolate-Covered Pi, and Other Cool Bits in Computing
Release Date: 
April 6, 2014
Princeton University Press
Reviewed by: 

“This reviewer is simply a fool for math puzzles (though some readers might stop at simply a fool). Math Bytes scratches that itch quite nicely.”

Math Bytes is fun and full of puzzles and brainteasers in a mashup of mathematics, social media, and pop culture referencing Beyoncé, Google, and Twitter among others. You might ask yourself, what does Twitter have to do with mathematics? Twitter holds the power of power laws. If someone tweets an unfavorable movie review to five friends, and they retweet it to five of their friends, and they retweet it and so on, the end result would not only be a crimping of cinema profits but also the soaking up of a tremendous amount of bandwidth—consider how Ellen’s selfie at the Oscars crashed Twitter through its ginormous number of retweets.

The author of Math Bytes, Tim Chartier initiates an exploration of fractals with a gratuitous photo of Beyoncé. Fractals are self-similar shapes that can be found in nature, like landscapes, coastlines and broccoli, and there is a connection to Beyoncé . . . wait for it . . . Where else but in Math Bytes might you get the question “Can we start with a picture of Beyoncé and create a Sierpinski’s triangle?” OMG! (Sorry, I couldn’t resist).

Chartier shows you can create fractals by iconifying images and using them as pixilated building blocks, and fractals generated by a recursive algorithm improve in detail with greater recursion. When starting with a pixilated icon of Beyoncé Chartier suggests, “It’s a matter of taste as to when to stop.”

After tending to Beyoncé‘s iconfication and fractilization, it is no great stretch for the author to delve into the mathematics of typography, a subject that leads to the scaling of geometries and to the coding of information. To this reviewer it seems almost as if everything were connected to everything!

The reader is next introduced to the mathematics that underlies the “physics of Angry Birds.” An angry bird once launched follows the estimated trajectory of uncontrolled flight under gravity, and that turns out to a parabola expressed in the form of quadratics. Who knew?

The reader will also get to see puzzles generated by graph theory. These are puzzles created by visualizing three-dimensional objects in two dimensions. The explanation of how they are made incorporates the Travelling Salesman Problem (TSP). In the Travelling Salesman Problem, paths are traversed across a large number of cities. Every path between any two cities has a value (or weighting), and the goal is to search for a complete circuit that goes through every city once that also generates a minimum weighted path (that is, the salesman has to travel to every city once, in the shortest possible accumulated distance).

As an interesting side effect of “connecting the dots” in creating a TSP circuit generates a pattern that looks a lot like geometric art that can be used to create a maze. To demonstrate, the author generates a maze out of a stippled outline of Bart Simpson. The reader is shown how to turn any image into a stippled image for creating mazes.

The reader is next shown the mathematics of “clustering:” the grayscale mapping of pixels for the purpose of reducing resolution. Clustering can also be used for diagnosing illnesses, identifying specific communities from large social networks, and for predicting crime (shades of Minority Report!), though for the puzzle demonstrated here, clustering is used to create a paint-by-number challenge, a black-and-white tiled image, in which each tile has a number. When all tiles are colored according to their numbered code, the pattern will reveal a secret message.

With just two colors an artist (or mathematician) can create a complex mosaic of tiles. Anything can be used for tiles, even candy. “While we have many choices of candy to use as tiles, we’ll pick m&ms since they melt in your mouth and not in your hand, giving us ample time to create a mosaic.” Chartier provides an m&m image and then performs calculus on it, estimating Pi as a Riemann sum. This is a singularly bravura performance that combines art, candy, and mathematics, and this reviewer can only express his astonishment and awe. Tim Chartier is a true master of the mathematics puzzler.

He doesn’t stop. Next is a puzzle that consists of three rectangular tiles that when rearranged produce what can only be described as an optical illusion. For the initial arrangement, the image on the tiles shows a fixed number of figures but when rearranged (mind you there are only three tiles), one of the figures in the image disappears. The disappearing/reappearing act between two side-by-side images kept this reviewer busy for quite some time.

Chartier’s magic act continues as he maps an image of Marilyn Monroe into polar coordinates, gives the coordinates a twist, and then maps back the image. The result has to be seen to be believed.

One might wonder if there are transforms that manipulate images, can there be transforms that detect images? The answer is yes, and Chartier explores the mathematics of facial recognition, starting with thumbnail-sized images of celebrity A-listers. The algorithm he uses for image detection consists of weighted matrices. By solving the matrix equation a match is selected. Though the algorithm doesn’t truly “recognize” faces, the selection by solution of an equation does come close. (The real-world problem though is that close is not always good enough). Chartier explains that algorithmic recognition is at best an approximation.

Chartier then adds his own image to the set to see if his face can be recognized separately from the celebrities. He says of the results, “Notice that the celebrities with the higher weights to produce an approximation to my image are Brad Pitt, George Clooney, and Orlando Bloom—all of whom have been named People magazine’s ‘Sexiest Man Alive.’ I must say I’m pretty pleased with the results coming from the residual vector of minimal length!” A slightly less biased perspective might point out that use of a limited data set for complex calculations can lead to skewed results, though actually saying this would not be in the spirit of things, so let’s let this slide.

Next Chartier analyzes the mathematics of picking winning teams in basketball—a probability analysis of selecting March Madness brackets. Though there are nine quintillion ways to fill out a 64-team bracket, a winning guess does not have to be completely random. By noting that teams are ranked by initial placement (called “seeding”), and every team seeded #1 has historically won its first round gives the mathematically minded bettor an in.

Chartier notes that seeding indicates a difference in the quality of teams; for example, a team that wins against strong teams is qualitatively different from a team that can only beat weaker opponents. Picking the winner of the previous match to win the next doesn’t differentiate between the two but picking the higher seeded team to win does. Teams picked strictly by seeding reaches the final four 49.8% of the time—almost even odds (determined by submitting the bracket to ESPN‘s Tournament Challenge for comparison).

Chartier adds linear equations to his calculations to end up with a formula that can beat 73% of the eight million brackets submitted to ESPN. Not too shabby—though the reviewer must note that the requisite details of Chartier’s algorithm needed to duplicate his results have not been presented in the text.

The book’s last chapter is an analysis of how search engines rank web pages and how those algorithms can be exploited to unfairly raise page ranking. Chartier asks the reader: What do we want from a search query? His answer, which shouldn’t be too surprising is relevance and quality. Relevance can be easily met by matching search words against the content of the web page (though this reviewer has found via search-engine links to files consisting solely of random words, hinting that keyword matching does not always lead to relevance).

Quality can be more difficult to translate into a suitable algorithm than relevance. For an example consider if web page ranking were to be calculated by counting the number of links that pointed to a web page (where more links corresponded to greater quality). If this were the case, we still wouldn’t know if the links were for positive or negative reasons, or were truthful or not.

To determine a page’s quality, an algorithm would have to not just count references but also evaluate the context of the reference: who the linker is and the linker’s bone fides in providing the link. Attribution of data on the web is tenuous if not outright impossible; as some wag once said, “On the Internet, no one knows you’re a dog.” This reviewer offers up Robert Pirsig’s Zen and the Art of Motorcycle Maintenance for a philosopher’s take on the difficulty in defining quality—which was written before the Internet.

As a consequence of not having a meaningful algorithm for quality, Google’s PageRank algorithm judges only by link structure—ranking is based on popularity. How to “own” a web page becomes an algorithmic game of manipulating networked circuits with probabilistic weights. Chartier really gets into his explanation, including a discussion of matrices, Markov transitions, and eigenvalues and eigenvectors.

If understanding his explanation becomes the most challenging part of Math Bytes, boosting a webpage’s rank really is not all that complicated. The way to increase a web page’s rank is to get it linked to a webpage that already has a high rank, and the reader is encouraged to Google “Google bomb” and “link farm” to see how this is done.

This reviewer is simply a fool for math puzzles (though some readers might stop at simply a fool). Math Bytes scratches that itch quite nicely.