WOLFRAM

Recreational Computation

Best of Blog

Doing Spy Stuff with Mathematica

I was reading about the IT problems of the recently arrested, alleged Russian spies, and I wondered if they could have managed secret communications better with Mathematica. One of the claims was that they were using digital steganography tools that kept crashing. I wanted to see how quickly I could implement digital image steganography in Mathematica using a method known as "least significant bit insertion". The idea of steganography is to hide messages within other information so that no one notices your communications. The word itself comes from a Latin-Greek combination meaning "covered writing", from earlier physical methods that apparently included tattooing a message on a messenger's head before letting him grow his hair back to hide it. In the case of digital steganography, it is all done in the math.
Computation & Analysis

Simulating the World Cup Knockout Stage

The knockout stage of the 2010 FIFA World Cup is about to begin in South Africa. At the time of writing, every team has one group stage match remaining, and most teams still have a chance to finish in the top two places in their group and progress to the knockout stage (see the tournament schedule and group stage standings). There are different approaches to ranking world football teams. The most well known is FIFA's official world rankings, which are derived from points gained and lost in each match according to a heuristic set of rules that generally reward winning against higher-ranked opponents in more-important tournaments. A simple alternative with a more statistical basis is an Elo rating system (described in more detail below). A handy property of Elo rating systems is that they directly provide an estimate of the probability that a given team will perform better than another. We can use Mathematica with that to set up simulations of the knockout stage of the World Cup. This lets us estimate things like the chance of each team winning the tournament. We'll also generate some nice visualizations of the results, such as the following simulated knockout stage (based on the current top two teams in each group):
Computation & Analysis

Following Baseball with Mathematica

No sport places more importance on its statistics than does baseball. The late sportswriter Leonard Koppett wrote in his standout 1967 book The Thinking Fan's Guide to Baseball that "statistics are the lifeblood" of the game. In fact, statistics are so important to baseball that they have inspired their own field: sabermetrics. Derived from SABR, the abbreviation for the Society for American Baseball Research, sabermetrics were popularized by Bill James with the publication of his first Bill James Baseball Abstract in 1977.
Computation & Analysis

Get Ready for March Madness 2010 with Mathematica

For every college basketball fan, there come points in your life when you have to make some decisions, tough decisions. Who will be in your Final Four this year? Will the number-one seeds ride the bracket to the Final Four? Who's the 5–12 seed upset? How will the Big Ten fare? We're heading for the tipoff of what I feel is the greatest sports weekend in the United States. While gearing up for a lot of game watching, I found a great blog post from last March by Jeff Todd, one of our Commercial Sales Account Managers, called "March Madness in Mathematica." In it he explained how he created an interactive NCAA Men's Basketball bracket in Mathematica.
Computation & Analysis

Hurrah for 3.14159265358979… Day!

This March 14 marks the 22nd annual Pi Day. You can learn a lot about pi on MathWorld, Wolfram|Alpha, The Wolfram Functions Site, and the Wolfram Demonstrations Project. And since pi is a built-in Mathematica symbol, you can find more information in the Mathematica Documentation Center. I remember my first Pi Day celebration---in the fourth grade. My teacher, Mr. Thompson, had our entire class cut construction paper strips and write numbers on each piece of paper. The end result was Northview Elementary School's largest paper chain, with over 300 of the constant's numerals.
Computation & Analysis

Down, Set, Compute! Checking Quarterback Ratings with Mathematica

Comparing favorite teams and players is a favorite pastime for sports fans. Most fans, including myself, understand their sports' basic statistics—batting averages, yards per carry, and so on—but may have trouble calculating the stats. With the Super Bowl coming up in Florida this weekend, I thought it would be interesting to see what Mathematica could do to help calculate one of the most well-known and tough-to-calculate statistics of the National Football League (NFL): quarterback passer rating.
Computation & Analysis

Twittering with Mathematica

The popularity of Twitter has really exploded in the past few months. The service poses a simple question: "What are you doing?" Users respond in 140 characters or less. The 140-character limit comes from the 160-character limit of SMS messages, minus a few characters for things like the user's screen name. Twitter could probably best be described as "micro-blogging." It's kind of a cross between blogging and instant messaging. People use Twitter for all kinds of reasons, everything from staying in touch with friends to receiving announcements and support from companies with a presence on Twitter. Here are a few examples:
Computation & Analysis

Word Facts

Recent versions of Mathematica introduced useful data functions related to linguistics. In Version 7, Mathematica's integrated string manipulation and visualization functions provide a powerful platform for computational linguistics. Both DictionaryLookup and WordData give programmatic access to curated data that's ready for computation. DictionaryLookup has been extended to cover more languages, while WordData has information on word meaning, structure, and usage, as well as cognitive and grammatical relationships between words. Let's look at a range of examples, starting with some interesting and amusing word facts. DictionaryLookup currently contains word lists for 27 different languages: