WOLFRAM

Best of Blog

Best of Blog

What Shall We Do with the Drunken Sailor? Make Him Walk the Plank!

Back in 1988 when Mathematica was just a year old and no one in my university had heard of it, I was forced to learn Fortran. My end-of-term project was this problem: "A drunken sailor returns to his ship via a plank 15 paces long and 7 paces wide. With each step he has an equal chance of stepping forward, left, right, or standing still. What is the probability that he returns safely to his ship?" I wrote a page or so of ugly code, passed the course, and never wrote Fortran again. Today I thought I would revisit the problem. We can code the logic of the sailor's walk quite easily using separate rules for each case. Firstly, if he is ever on the 16th step or already on the ship, then he is safely on the ship the next time.
Best of Blog

Test Your “Subitizing” Ability

Recently I found myself reading about “subitizing”, which is the process of instinctively counting small sets of items in a fraction of second. For example, try quickly counting a few of these: The Wikipedia article indicates that you can nearly always correctly count four or fewer items in a small fraction of a second. Above four, you start to make mistakes. I wanted to test this claim in Mathematica (using myself as the test subject). I decided to create a simple game in which small groups of items are momentarily displayed on the screen, after which players estimate how many they saw.
Best of Blog

Mathematica Q&A: Plotting Trig Functions in Degrees

Got a question about Mathematica? The Wolfram Blog has answers! We'll regularly answer selected questions from users around the web. You can submit your question directly to the Q&A Team using this form. This week's question comes from Brian, who is a part-time math teacher: How do you plot trigonometric functions in degrees instead of radians? Trigonometric functions in Mathematica such as Sin[x] and Cos[x] take x to be given in radians:
Best of Blog

Automatic Physical Units in Mathematica

I just published a Mathematica package that provides an alternative, richer implementation of units and dimensional analysis than the built-in units package. You can get it here. Aside from being a really nice extension to Mathematica, it is also an interesting case study in adding a custom data "type" to Mathematica and extending the knowledge of the built-in functions to handle the new "type". First I have to explain the point by answering the question, "What's wrong with the built-in units package?" Well, there is nothing actually wrong with it, it just doesn't apply Mathematica's automation principles. It can convert between several hundred units and warn if a requested conversion is dimensionally inconsistent. But give it an input like... and it does nothing with it until you specify that you want the result in a specific unit. The core reason is that it doesn't teach the system, as a whole, anything about units, or even that the symbol "Meter" is any different than the symbol "x". All of the knowledge about units and Meter in particular is contained in the Convert command.
Best of Blog

aMAZEing Image Processing in Mathematica

A little over a mile from the Wolfram Research Europe Ltd. office, where I work, lies Blenheim Palace, which has a rather nice hedge maze. As I was walking around it on the weekend, I remembered a map solving example by Peter Overmann using new image processing features in an upcoming version of Mathematica. I was excited to apply the idea to this real-world example. Once back at my computer, I started by using Bing Maps to get the aerial photo (data created by Intermap, NAVTEQ, and Getmapping plc). The maze is meant to depict a cannon with cannon balls below it and flags and trumpets above.
Best of Blog

Do Computers Dumb Down Math Education?

Since I just heard that the video for Conrad Wolfram's recent TED talk "Stop teaching calculating, start teaching math" will be coming out soon, I thought I would address the single biggest fear that I hear when I talk about using computers in math education. The objection that using computers will "dumb down" education comes with the related ideas "students have to learn to do it by hand or how will they know they have got the right answer", "they won't understand what is happening unless they do it themselves", and so on. Well, let's examine this by looking at a typical math question that I know I had to solve at some point in my education.
Best of Blog

25 Best Hangman Words

A simple question from a six-year-old about hangman turned into another analysis obsession that made me play 15 million games of hangman recently. Back in 2007, I wrote a game of hangman for a human guesser on the train journey from Oxford to London. I spent the time on the London Underground thinking about optimal strategies for playing it, and wrote the version for the computer doing the guessing on the return journey. It successfully guessed my test words and I was satisfied, so I submitted both to the Wolfram Demonstrations Project. Now, three years later, my daughter is old enough to play, but the Demonstration annoys her, as it can always guess her words. She asked the obvious question that never occurred to me at the time: "What are the hardest words I can choose, so that I can beat it?"
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.
Best of Blog

Twisted Architecture

I didn't set out to tie knots in Norman Foster's Hearst Tower or wrinkle his Gherkin, but I got carried away. It's one of the occupational hazards of working with Mathematica. It started with an innocent experiment in lofting, a technique also known as "skinning" that originated in boat-building. I wanted to explore some three-dimensional forms, and a basic lofting function seemed like a quick ticket to results. I dashed off the function Loft, which takes a stack of three-dimensional contours and covers it with a skin of polygons.