February 2, 2012 — Christopher Carlson, Senior User Interface Developer, User Interfaces

I was amazed to see this tweet from our friends at the Museum of Mathematics:

A quick check with Mathematica verified that, yes indeed, 10*9*8+7+6-5+4*321 = 2012. Wow! How in the world did anyone discover that rare factoid? And how long will it be until another year arrives that can be similarly expressed?

That’s the sort of question that’s so easy to answer with Mathematica that I couldn’t not have a look. It turns out that what seemed to me like a rare jewel is as common as dirt. In fact, there is only one year in the next 100 that can’t be expressed by interspersing +, -, *, /, or nothing between the numbers in order from 10 to 1! In subsequent correspondence with George Hart, the museum’s Chief of Content, he told me that he learned the idea from Hans Havermann, who wrote about it in a blog post last year. I’ve discovered what he had up his sleeve: abundant computing.

Read More »


January 11, 2012 — Jon McLoone, International Business & Strategic Development

UPDATE: The solution to the puzzle and more comments from Jon have been added at the bottom of the post.

On the long flight to the recent Wolfram Technology Conference, I ended up on the puzzle page of a newspaper. My attention was drawn to a word ladder puzzle, where you must fill in a sequence of words from clues, but each word differs from the previous by only a single letter. Here, for example, is a simple puzzle already solved:

best from a position of superiority or authority
bast strong woody fibers obtained especially from the phloem of
from various plants
bash a vigorous blow
bath a vessel containing liquid in which something is immersed
(as to process it or to maintain it at a constant temperature or to lubricate it)
math a science (or group of related sciences) dealing with the logic
of quantity and shape and arrangement

I wasn’t going to do a blog entry on this, as it is a very similar task to my “Exploring Synonym Chains” post that I wrote some time ago, but that changed with a chance conversation at the (excellent) Technology Conference. Proving that one never stops learning, Charles Pooh, one of our graph theory developers, pointed out to me that my synonyms item could have been done much better. I had broken one of the very rules that I wrote about in my “10 Tips for Fast Mathematica Code” entry—”Use built-in functions.” I had effectively re-implemented the built-in Mathematica commands GraphPeriphery and GraphDiameter.

So, armed with these two new functions, let’s find the longest word ladder puzzle that can be made using Mathematica‘s English dictionary.

Read More »


November 10, 2011 — Sol Lederman, Technical Communication & Strategy

World War I officially ended in 1918 at the 11th hour of the 11th day of the 11th month. Remembrance Day is observed in Commonwealth countries to recall the end of the war and to remember the members of the armed forces who gave their lives for the cause. This year we observe Remembrance Day on 11/11/11.

Beyond the somberness of this memorial day, those of us who are mathematically inclined consider the surprising ways we can combine 1s to achieve beautiful results. Some of these combinations involve rather unpleasant calculations, so we’ll let Mathematica do the heavy lifting while we marvel at the results!

Today I’ll share 11 interesting places in which 1 appears. Let’s jump in.

1. Can anything of interest come from combining the humble digit 1 with the square root and plus symbol? As the demonstration below suggests, given the right nesting, you get an infinite series that converges to φ = 1.61803…, the golden ratio.

Read More »


October 28, 2011 — Yu-Sung Chang, Technical Communication & Strategy

The art of pumpkin carving is hard to master, yet once a year parents in many countries are asked to perform this traditional and messy form of art.

It’s time for a change in this old tradition. In fact, our colleague Jon McLoone already made a significant advance in pumpkin carving, mainly using implicit functions and RegionPlot3D.

This year, I decided to make a contribution of my own that is more interactive and easier to use, with Mathematica or Mathematica Home Edition, of course.

Let’s start with a list. These are the things you need for traditional pumpkin carving.

  1. A nice looking pumpkin
  2. Carving tools of your choice: from a spoon and knife (if you are a true
    professional) to an industrial 36,000 rpm power rotary tool (seriously, I know someone who uses one)
  3. A bunch of candles to be placed inside the pumpkin
  4. A pattern for the carving on paper

For industrial Mathematica pumpkin carving, you need these tools.

  1. B-spline curve, surface, and function
  2. Color processing functions
  3. Morphological image processing functions
  4. ParametricPlot3D with Texture
  5. A pattern for the carving as a bitmap

Intrigued? Let us begin.

Read More »


September 15, 2011 — Elizabeth Shack, Technical Communication and Strategy

Neil Bickford calculated the first 458 million terms for the continued fraction of pi, breaking the previous record of 180 million. He used Mathematica to develop his code and verify his results—which he posted shortly after he turned 13.

Stephen Wolfram with Neil Bickford

Neil Bickford meets Stephen Wolfram at Gathering 4 Gardner 9.

Bickford, who broke the record last fall, said creating the early version of the pi continued-fraction generator was “the best thing I’ve ever used Mathematica for.”

Read More »


July 28, 2011 — Christopher Carlson, Senior User Interface Developer, User Interfaces

Eons ago, plants worked out the secret of arranging equal-size seeds in an ever-expanding pattern around a central point so that regardless of the size of the arrangement, the seeds pack evenly. The sunflower is a well-known example of such a “spiral phyllotaxis” pattern:

A sunflower as an example of a "spiral phyllotaxis" pattern

It’s really magical that this works at all, since the spatial relationship of each seed to its neighbors is unique, changing constantly as the pattern expands outwardly—unlike, say, the cells in a honeycomb, which are all equivalent. I wondered if the same magic could be applied to surfaces that are not flat, like spheres, toruses, or wine glasses. It’s an interesting question from an aesthetic point of view, but also a practical one: the answer has applications in space exploration and modern architecture.

Read More »


July 1, 2011 — Yu-Sung Chang, Technical Communication & Strategy

What could be a better way to celebrate the Fourth of July than beautiful fireworks in the dark sky?

And what could be a better way to create fireworks on your screen than using Mathematica?

Fireworks

There are a few different ways to create firework “effects” on computers, but it would be a shame if we chose to use just graphical effects with Mathematica. Yes, we are going for the full-scale particle simulation.

Here is the synopsis. We create a firework simulation. With a mouse click, we seed a number of particles on the screen. Each particle has a different initial velocity, and it will follow the projectile motion. The particles spend a limited time on the screen, in which their opacity will diminish gradually. There will be a few customizable effects—colors and trails.

Read More »


June 30, 2011 — Jon McLoone, International Business & Strategic Development

When I first learned about π, I was told that a good approximation was 22/7. Even when I was 12 years old, I thought this was utterly pointless. 22/7 agrees with π to two decimal places (so three matching digits):

N[22/7]

3.14286

Since there are three digits to remember in 22 and 7, what have you gained? You have just as much to remember, but have lost the notion that π is “just over 3”.

Is there a better rational approximation where we actually get out more digits than we put in? Here is a brief and rather low-brow investigation (and the chance to win something if you can do better).

Read More »


June 8, 2011 — Jon McLoone, International Business & Strategic Development

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.

A drunken sailor returns to his ship

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.

Read More »


June 1, 2011 — Andrew Moylan, Technical Communication & Strategy

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:

subitize

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.

Read More »