WOLFRAM

Best of Blog

Best of Blog

Find Waldo Faster

Martin Handford can spend weeks creating a single Where's Waldo puzzle hiding a tiny red and white striped character wearing Lennon glasses and a bobble hat among an ocean of cartoon figures that are immersed in amusing activities. Finding Waldo is the puzzle's objective, so hiding him well, perhaps, is even more challenging. Martin once said, "As I work my way through a picture, I add Wally when I come to what I feel is a good place to hide him." Aware of this, Ben Blatt from Slate magazine wondered if it's possible "to master Where's Waldo by mapping Handford's patterns?" Ben devised a simple trick to speed up a Waldo search. In a sense, it's the same observation that allowed Jon McLoone to write an algorithm that can beat a human in a Rock-Paper-Scissors game. As Jon puts it, "we can rely on the fact that humans are not very good at being random."
Best of Blog

Extending Van Gogh’s Starry Night with Inpainting

Can computers learn to paint like Van Gogh? To some extent---definitely yes! For that, akin to human imitation artists, an algorithm should first be fed the original artists' creations, and then it will be able to generate a machine take on them. How well? Please judge for yourself. Second prize in the ZEISS photography competition Recently the Department of Engineering at the University of Cambridge announced the winners of the annual photography competition, "The Art of Engineering: Images from the Frontiers of Technology." The second prize went to Yarin Gal, a PhD student in the Machine Learning group, for his extrapolation of Van Gogh's painting Starry Night, shown above. Readers can view this and similar computer-extended images at Gal's website Extrapolated Art. An inpainting algorithm called PatchMatch was used to create the machine art, and in this post I will show how one can obtain similar effects using the Wolfram Language.
Best of Blog

Modeling a Pandemic like Ebola with the Wolfram Language

Data is critical for an objective outlook, but bare data is not a forecast. Scientific models are necessary to predict pandemics, terrorist attacks, natural disasters, market crashes, and other complex aspects of our world. One of the tools for combating the ongoing and tragic Ebola outbreak is to make computer models of the virus's possible spread. By understanding where and how quickly the outbreak is likely to appear, policy makers can put into place effective measures to slow transmissions and ultimately bring the epidemic to a halt. Our goal here is to show how to set up a mathematical model that depicts a global spread of a pandemic, using real-world data. The model would apply to any pandemic, but we will sometimes mention and use current Ebola outbreak data to put the simulation into perspective. The results should not be taken as a realistic quantitative projection of current Ebola pandemic.
Best of Blog

Which Is Closer: Local Beer or Local Whiskey?

In today's blog post, we will use some of the new features of the Wolfram Language, such as language processing, geometric regions, map-making capabilities, and deploying forms to analyze and visualize the distribution of beer breweries and whiskey distilleries in the US. In particular, we want to answer the core question: for which fraction of the US is the nearest brewery further away than the nearest distillery? Disclaimer: you may read, carry out, and modify inputs in this blog post independent of your age. Hands-on taste tests might require a certain minimal legal age (check your countries' and states' laws). We start by importing two images from Wikipedia to set the theme; later we will use them on maps.
Best of Blog

Predicting Who Will Win the World Cup with Wolfram Language

Check out Etienne’s updated predictions from Thursday, June 26 here. The FIFA World Cup is underway. From June 12 to July 13, 32 national football teams play against each other to determine the FIFA world champion for the next four years. Who will succeed? Experts and fans all have their opinions, but is it possible to answer this question in a more scientific way? Football is an unpredictable sport: few goals are scored, the supposedly weaker team often manages to win, and referees make mistakes. Nevertheless, by investigating the data of past matches and using the new machine learning functions of the Wolfram Language Predict and Classify, we can attempt to predict the outcome of matches. The first step is to gather data. FIFA results will soon be accessible from Wolfram|Alpha, but for now we have to do it the hard way: scrape the data from the web. Fortunately, many websites gather historical data (www.espn.co.uk, www.rsssf.com, www.11v11.com, etc.) and all the scraping and parsing can be done with Wolfram Language functions. We first stored web pages locally using URLSave and then imported these pages using Import[myfile,"XMLObject"] (and Import[myfile,"Hyperlinks"] for the links). Using XML objects allows us to keep the structure of the page, and the content can be parsed using Part and pattern-matching functions such as Cases. After the scraping, we cleaned and interpreted the data: for example, we had to infer the country from a large number of cities and used Interpreter to do so: From scraping various websites, we obtained a dataset of about 30,000 international matches of 203 teams from 1950 to 2014 and 75,000 players. Loaded into the Wolfram Language, its size is about 200MB of data. Here is a match and a player example stored in a Dataset:
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.
Best of Blog

Using Mathematica to Simulate and Visualize Fluid Flow in a Box

The motion of fluid flow has captured the interest of philosophers and scientists for a long time. Leonardo da Vinci made several sketches of the motion of fluid and made a number of observations about how water and air behave. He often observed that water had a swirling motion, sometimes big and sometimes small, as shown in the sketch below. We would now call such swirling motions vortices, and we have a systematic way of understanding the behavior of fluids through the Navier–Stokes equations. Let's first start with understanding these equations.
Best of Blog

Is There Any Point to the 12 Times Table?

My government (I'm in the UK) recently said that children here should learn up to their 12 times table by the age of 9. Now, I always believed that the reason why I learned my 12 times table was because of the money system that the UK used to have---12 pennies in a shilling. Since that madness ended with decimalization the year after I was born, by the late 1970s when I had to learn my 12 times table, it already seemed to be an anachronistic waste of time.
Best of Blog

Data Science of the Facebook World

More than a million people have now used our Wolfram|Alpha Personal Analytics for Facebook. And as part of our latest update, in addition to collecting some anonymized statistics, we launched a Data Donor program that allows people to contribute detailed data to us for research purposes. A few weeks ago we decided to start analyzing […]