WOLFRAM

Recreational Computation

Computation & Analysis

Calling All Goblins: Tweet-a-Program Halloween Code Challenge

Halloween is quickly approaching, and to help you gear up for trick-or-treating, costume parties, and pumpkin carving, we're issuing another Tweet-a-Program Code Challenge! This time, instead of spaceships and planets, we want you to tweet us your spookiest Halloween-themed lines of Wolfram Language code. We'll then use the Wolfram Language to randomly select three winning tweets (and a few of our favorites) to pin, retweet, and share with our followers. Winners will also be awarded a free Wolfram T-shirt! Take some inspiration from these examples, while you come up with your creepy codes:
Computation & Analysis

Solving the Knight’s Tour on and off the Chess Board

I first came across the knight's tour problem in the early '80s when a performer on the BBC's The Paul Daniels Magic Show demonstrated that he could find a route for a knight to visit every square on the chess board, once and only once, from a random start point chosen by the audience. Of course, the act was mostly showmanship, but it was a few years before I realized that he had simply memorized a closed (or reentrant) tour (one that ended back where he started), so whatever the audience chose, he could continue the same sequence from that point. In college a few years later, I spent some hours trying, and failing, to find any knight's tour, using pencil and paper in various systematic and haphazard ways. And for no particular reason, this memory came to me while I was driving to work today, along with the realization that the problem can be reduced to finding a Hamiltonian cycle—a closed path that visits every vertex—of the graph of possible knight moves. Something that is easy to do in Mathematica. Here is how.
Education & Academic

Spellbound Valentines: DIY Art from 3D-Printed Sound

An original gift can make people feel much warmer, especially in the icy weather affecting so many places this winter---including our headquarters. Valentine's Day is a good excuse to get a little creative in the art of gift making. And for me, "getting creative" long ago became synonymous with programing in the Wolfram Language. It is that medium that compels me to treat programming as art, where one can improvise, easily pulling magical rabbits out of a hat. So what shall we make? I think the best gift is a DIY one---especially if it says a lot without even making a sound. Below you see a 3D-printed silver earring in the shape of a sound wave recorded while a person is saying "I love you."
Education & Academic

How to Win at Rock-Paper-Scissors

Rock-paper-scissors* isn't obviously interesting to look at mathematically. The Nash-equilibrium strategy is very simple: choose equally and randomly from the three choices, and (in the long run) your opponent will not beat you (nor will you beat your opponent). Nevertheless, it's still possible for a computer strategy to beat a human player over a long run of games. My nine-year-old daughter showed me one solution with a Scratch program that she wrote that won every time by looking at your choice before making its decision! But I will walk you through a simple solution that wins without cheating.
Computation & Analysis

The Wolfram Technology Conference Egg-Bot Challenge Winners

We have a programming competition every year at the Wolfram Technology Conference, which in past years was the Mathematica One-Liner Competition (2010, 2011). This year we held the Egg-Bot Challenge, a change of pace to give attendees a chance to exercise their graphics skills. The idea of the competition was to use Mathematica to generate designs that could be plotted on spheres via Egg-Bots, computer-controlled plotters that draw on eggs, Ping-Pong balls, light bulbs, mini-pumpkins, golf balls... nearly anything spherical or ovoid that is less than four inches in diameter.
Computation & Analysis

Bringing Zombies to Life… Is That an Oxymoron?

I was lucky enough in college to be able to double-major in physics and film/media. One of the coolest connections that formed from these completely opposite subjects was the use of Mathematica. What started out as just a computational tool for all the work in my physics classes turned into an experimental playground for the digital animation I was creating in my film classes. Mathematica is an ideal program to model the true science of motion. And as you'll come to see, it looks complicated, but is actually quite simple! Let's start with understanding some basic human anatomy (or zombie anatomy, since this post is technically about zombies):
Computation & Analysis

A Response to “Falling with Helium”

Recently the author of xkcd, Randall Munroe, was asked the question of how long it would be necessary for someone to fall in order to jump out of an airplane, fill a large balloon with helium while falling, and land safely. Randall unfortunately ran into some difficulties with completing his calculation, including getting his IP address banned by Wolfram|Alpha. (No worries: we received his request and have already fixed that.)
Computation & Analysis

Even More Formulas… for Everything—From Filled Algebraic Curves to the Twitter Bird, the American Flag, Chocolate Easter Bunnies, and the Superman Solid

This blog post is the continuation of my last two posts (1, 2) about formulas for curves. So far, we have discussed how to make plane curves that are sketches of animals, faces, fictional characters, and more. In this post, we will discuss the constructions of some filled curves (laminae).
Best of Blog

Using Formulas… for Everything—From a Complex Analysis Class to Political Cartoons to Music Album Covers

In my last blog post, I discussed how to construct closed-form trigonometric formulas for sketches of people’s faces. Using similar techniques, Wolfram|Alpha has recently added a collection of hundreds of such closed-form curves for faces, shapes, animals, logos and signatures. In today’s post, I want to show some of the entertaining things one can do with these parametrized curves. Although these are just simple curves, a large variety of fun images (and animations) can be constructed from them. These can then be used, for example, in political cartoons, talk shows, posters, music album covers or just to spice up an advanced calculus or first-year theoretical mechanics class. I will first discuss the fun applications, and then the more mathematical ones.