The Value of Mathematics

When I began this blog, I imagined and suggested that one of the common topics would be mathematics education.  That has so far not turned out to be the case.  But this past weekend, a rather disconcerting opinion piece in the Howard County Times got my attention that I think warrants review and discussion.

(Normally, I would simply say that disconcerting opinions are in abundant supply and leave it at that.  However, this particular opinion was written by H. Jean Thiebaux, the current chair of the Mathematics Advisory Committee for the Howard County Public School System in Maryland.  When the disconcerting opinion is held by someone in a position with some significant influence, it is time to pay attention.  I encourage you to read the article first before I cloud your judgment.)

Before diving into the article, I submit two main points that may at first seem contradictory.  First, I think very few people need even basic mathematics to function in their daily life, let alone in their jobs.  That may sound strange coming from a mathematician; shouldn’t I be a champion of my field?  Isn’t mathematics everywhere?  Yes I am, and sure it is.  But not everyone needs to be a mechanic to drive a car.  Having said that– and this is my second point– understanding mathematics is useful to everyone, as a mode of thought.  That is, mathematics should not be treated as a vocational skill that some need and others do not, but instead as a teachable, testable, “cleanroom” environment in which everyone can learn to think critically, a skill that I think everyone should have.

In the article, Ms. Thiebaux suggests that “consumer mathematics” should be considered sufficient mathematics education for those students “who do not aspire to becoming mathematicians and scientists.”  As an example of the core mathematical competency that should be expected of such non-mathematicians or non-scientists, she provides a list of “practical questions to illustrate situations in which any of us might find ourselves needing to use basic mathematics.”  Following is one of those questions from the article:

For dinner for two at a pleasant restaurant, the kitchen bill might be $52 and the bar bill $28, before tax and service are added. With a 20 percent tip and 5 percent tax, what will the total be? Quickly, without using your calculator!

My main objective here is not to pick apart these problems.  But highlighting the issues with this one will hopefully serve to make my first point, namely that we simply don’t need much mathematics here.  When was the last time that you encountered a restaurant bill that didn’t provide an itemized total including tax (which, by the way, is 6% in Maryland, not 5%, making the “quick without a calculator” business a little iffier)?  Also, the specific numbers in this question suggest that a nice, round $100 is the intended solution.  But this is only if you tip on the pre-tax bill (i.e., if you add instead of multiply the tax and tip percentages); if you do this, you are a cheapskate with more mathematical ability than you let on.  Yes, you.

Another example question asks for the monthly payment on a car loan.  The only skills necessary to answer this question involve not mathematics, but the use of a computer to navigate the dozens of web sites with loan and investment calculators that can provide this information.

So, why bother teaching any more than “consumer” mathematics?  Why struggle with algebra or geometry if most of us will never use either, if most of us will get whatever mathematical information we need in our lives and jobs from tables, handbooks, or calculators?  I feel this is a critical question, the answer to which we must not get wrong.  Learning mathematics shows us how to find logical paths to truth, how to unambiguously describe those paths to others, and how to recognize descriptions of faulty paths that lead in the wrong direction or in circles.  A young budding journalist may have no aspiration to mathematics or science; but does he or she not also need the tools to think critically?

I strongly recommend Underwood Dudley’s very interesting (and somewhat cynically amusing) article on this subject; as he eloquently puts it, to teach mathematics is “to teach the race to reason.”

Mouse picking

My wife and I enjoy playing games together, specifically games that involve solving puzzles.  We particularly enjoyed Safecracker for the Wii, a good example of the genre niche that we like: a “pass the controller” interface that allows us to sit together while we play, and puzzles with some mathematical meat to them, with solutions that involve at least some ingenuity and not just tedious systematic brute force search.  Plot and atmosphere don’t hurt, but if you have played Safecracker, then you know neither are necessarily high on our list of priorities.

We brought home a game this evening to try out called Mystery Legends: Sleepy Hollow.  It has also been fun, but of a different and unexpected sort.  The game is, I think, really for kids, and is essentially an “I Spy”-type “find the hidden objects in the scene” game.  There are a few puzzles sprinkled throughout, but these are also not really challenging.  In summary, it wasn’t what we were looking for, but it’s a fun way to spend time together anyway.

So where am I going with this?  Well, as we played the game, I noticed that when we saw an object in the scene, and clicked the mouse on the object to identify it, we had to click directly on the object… but we could click on any part of the object, no matter how oddly shaped it might be.  In fact, whenever you click on an object, the game briefly highlights its irregular outline, suggesting the very specific “interior” set of pixels that comprise the object.

How does this work?  That is, when the software detects a mouse click at a particular location on the screen, how does it determine whether the click is on an object, and if so, on which object?  I encountered exactly this problem not long ago, while implementing my computer version of the board game Carcassonne.  However, I suspect that the solution in that case was different than the approach used in Sleepy Hollow.

In Carcassonne, the window displays a 3D perspective view of the tiles and “meeples” on the board.  When clicking (or even passively moving) the mouse in the window, it is necessary to transform the mouse position from 2D window pixel coordinates to the 3D coordinates of the corresponding location on the virtual tabletop on which the tiles make up the board.  This is a pretty standard technique, effectively “ray tracing” from the mouse position in the window viewport back “into” the 3D virtual world coordinate frame.  It is so standard, in fact, that there is a function in the OpenGL API, gluUnProject, that does most of the math for us.

There is at least a little still to think about, though; in particular, a location in window coordinates maps to an entire line in world coordinates, so we have to determine where along that line the user “meant” to point.  In this case, it’s simple: we only care about things on the tabletop, and the tabletop lies in the plane z=0.  So we need only find the intersection of the ray from the window with the plane of the tabletop, and we have our desired position on the board where the user meant to click.

In Sleepy Hollow, the scenes and the shapes of the objects within them are much more complicated.  In this case, there is another technique which is easier to implement– and thus I would imagine is being implemented– using what is called a stencil buffer.  When drawing a 3D image, there are generally several 2D arrays in video memory that accumulate information about the image being drawn.  The obvious one is the color buffer, which contains the red/green/blue color values of the corresponding pixels in the image.  The stencil buffer is less frequently used, but is handy here.  The idea is to draw each of the objects in the scene in turn; before drawing an object, assign it a unique numeric identifier, and when drawing the object “render” that numeric value to the corresponding locations in the stencil buffer.

The result is sort of a “paint by numbers” view of the scene, where the background is made up of zero values (or whatever), and the interior of each object is made up of values corresponding to that object’s identifier.  With this “stencil” in hand, whenever the user clicks the mouse on the scene, we simply look up the corresponding value in the stencil buffer to see what, if any, object was selected.

(A side note: I doubt that the scenes in the game are really 3D.  By that I mean that the objects in the scenes, and the “camera” location from which they are viewed, are all fixed.  You can’t “walk around” and look at the scenes from different angles.  The scenes may have been rendered from individual 3D object models during development, but I would guess that in the final version of the software the scenes are simply “stills,” bitmaps of the entire pre-rendered scene, as opposed to pushing all of the individual objects through a rendering pipeline.  And so the resulting stencil buffers are probably also pre-computed.)

The Cube of Rubik

Sorry about the goofy title.  I just watched Night at the Museum 2: Battle of the Smithsonian.

A team of mathematicians, engineers, and programmers, along with some heavy duty computing power from Google, recently “solved” the Rubik’s cube.  More precisely, they found “God’s number,” proving it to equal 20, as it has been conjectured to be since 1995.  The story can be found in quite a few places now, but I first read it here; much of the text appears to have been taken from a web site put together by the research team here.

“God’s number” is the name given to the maximum number of moves required to solve the cube from any starting configuration.  This number has been known to be at least 20 since 1995, when Michael Reid proved that a particular configuration, the “superflip,” required 20 moves.  What this latest team did was to show that God’s number is at most 20, by finding a solution for every possible configuration, each involving no more than 20 moves.

Note that they found a solution, not necessarily an optimal one, for each configuration.  I was at first confused by the table in the Daily Mail article, showing the number of cube configurations grouped by “distance” (in the cube graph) from the solved configuration.  The values from 16 to 20 moves are all approximate, such as “about 1,100,000,000,000,000,000.”  Why not just “1.1 quintillion”?  Why bother with an approximation when you still include all of the zeros?

The team’s web site explains why: they only found a solution involving 20 moves or less for all configurations, but since their solution was not necessarily optimal, they aren’t sure of the true “distance” from some of the configurations to the solved state.  (However, they are sure that whatever that distance is, it’s at most 20.)

Another question I had after reading the original article was also answered by the team’s web site.  What is meant by a “move”?  That is, does a move consist of just a quarter-turn of a single face, or are half-turns included as well?  This certainly affects the structure and thus diameter of the cube graph… and I would imagine that the choice of one or other convention might make some of the symmetry reductions much “cleaner” as well.  At any rate, this question can be answered by simply inspecting the second line of the table; the fact that 18 configurations are a single move away from the solved state implies that there are 3 possible moves for each of the 6 faces, which must include half-turns.

Carcassonne and intellectual property

Recall my post from a couple of weeks ago about board games in general, and about the game Carcassonne in particular.  As I mentioned at the end of the post, I have been working on a computer version of the game, with a couple of main objectives.  This weekend I finished an initial version that meets the first objective (more on this later).  My wife and I have really enjoyed playing it; here is a screenshot:

Carcassonne screenshot

Carcassonne screenshot.

I include a screenshot here as an explicit example of the subject of this post.  In the few cases when I manage to put together software that others might actually find useful or enjoyable, I try to make it as freely available as possible, usually on my download page here.  However, I am reasonably sure that I cannot do that here, at least not without infringing on the copyright of the artist responsible for the tile artwork (which, by the way, is Copyrighted (C) 2000 Hans im Gluck, and is also available online from the game publisher; see below).

This protection of the work of the original artist makes sense to me.  But as far as I can tell, this seems to be just about the only restriction preventing me from posting the software, which is a little surprising.  That is, the mechanics of the game itself are not copyrighted– indeed, they are not even copyrightable.  The important distinction here is between “ideas” themselves, and particular expression of those ideas.  In this case the “idea” is the concept of the game, the distribution and function of the tiles and pieces in the game, and the rules governing how the tiles and pieces are used and scored.  The “expressions” that are protected by copyright include the specific text printed in the rule book, and the artwork on the tiles.

A recent interesting example of this distinction was the Facebook app Lexulous, formerly Scrabulous, and originally differing in name only from the board game Scrabble.  Briefly, a couple of guys developed an online version of Scrabble called Scrabulous, and after Hasbro brought a copyright infringement suit, the guys changed the name to Lexulous and also changed the rules and tile distribution from the original game.  I recommend reviewing the details yourself, but my impression is that Hasbro almost certainly did not have a case, but it wasn’t worth the fight.

(I should emphasize that I am not a lawyer, I am not an expert in the law, and as such my opinions here are likely the least informed among everything in this blog.  I welcome any corrections of my inaccurate or misleading statements.)

So is it even legal for me to develop and play a computer version of this game, using the name Carcassonne and using the original tile images, even if I never give it to anyone else?  Even without adding any functionality beyond what the board game provides, this seems like a clear example of “fair use,” since (1) I have purchased and own the original board game; (2) Rio Grande Games, the game publisher here in the States, provides both the rules and even the tile artwork on its web site; and (3) restricting use of this computer version to my own home has no effect on the market value of the original game.

But I do mean to add functionality beyond what the original game provides, which brings us back to my two main objectives for this project.  The first was to provide more detailed score tracking.  For those not familiar with the game, you score points by completing features on tiles as they are played.  But at the end of the game, you also score points for incomplete features remaining on the board (e.g., farms).  This “projected score” information is useful well before the game ends, but it is also relatively difficult to compute, since it can fluctuate up and down as tile features are aggregated.  It is handy to let the computer track this projected score for you.

The result is a game that is even more fun to play.  I hook my laptop up to our 10-foot projection screen… and remember the Xbox wireless controller I bought a while back for my space flight simulator?  I configured the controller to use the joystick and buttons to drive mouse and keyboard input, so my wife and I can sit together with just the wireless controller, without the laptop or its monitor cabling, and play the game together.

Finally, my second main objective for this project was to develop a competent AI player for the game… but that’s for another post.

Reality TV, the Olympics, and Voting

I have been following the reality TV competition So You Think You Can Dance for some time now.  This is one of a couple of competition shows that I enjoy watching (the other is Bravo’s Top Chef).  I think both shows are relatively unique in the genre, in that they involve people competing in an area where they are truly the best at what they do.

The format of the show is pretty simple.  Each week, the dancers perform, viewers vote for their favorite dancer by calling a toll-free number, and a panel of judges selects one of the three dancers with the fewest votes to be eliminated that week.  This continues until some small number of dancers remains, at which point “America votes” for their favorite again, with the dancer receiving the most votes winning the competition.

Every season there seems to be confusion and surprise as to how some particular talented dancer ends up in the “bottom three,” or worse, that the seemingly obviously least-talented performer is not in the bottom three, and so someone is forced to go home prematurely.

I am always surprised at the surprise, so to speak, since the voting format is extremely vulnerable to this sort of unexpected outcome.  Consider what happens in every round except for the finals: voters provide information about only their favorite dancer… and this information is used to attempt to identify what should be the voters’ least favorite dancer among those remaining.

It seems to me that voting for your least favorite dancer, and eliminating whoever receives the most such votes, would be at least marginally less likely to yield outcomes that are surprising or inconsistent with a majority of viewers.

A very similar situation occurred in 1993, during the International Olympic Committee’s process of selecting the host city for the 2000 Summer Olympics.  This process was also a series of voting rounds, with each round eliminating a candidate city with the least number of votes.  The voting results are available here.  In every round but the last, the voting results were consistent with the overall ranking Beijing > Sydney > Manchester > Berlin > Istanbul.  Leading up to the final voting round, Beijing appeared to be the clear favorite.  But in the final round, Sydney edged out Beijing in a 45-43 vote.

Neither of these examples is meant to suggest that antiplurality voting is always superior to the much more common plurality vote.  But I think in the case of “runoff” procedures such as in these reality TV competitions it can be better, while still being practical in allowing a simple means of casting a ballot, so to speak, with a text message or simple automated phone call.

But I haven’t even dug into just how bad a poor choice of voting procedure can get.  The economist Kenneth Arrow’s “Impossibility Theorem” is relevant here… but only when properly interpreted and applied.  As “popular” as mathematics ever is in mainstream media, it is surprising how badly it can get mangled or mis-applied.  I think this happens a lot, from Godel to Heisenberg to, in this case, Arrow.  This post has already gotten rather long, so perhaps we can get into the theorem in more detail later if there is interest.