Wolfram Blog http://blog.wolfram.com News, views, and ideas from the front lines at Wolfram Research. Thu, 08 Oct 2015 15:10:08 +0000 en hourly 1 http://wordpress.org/?v=3.2.1 Using the Wolfram Language in the Classroom: History http://blog.wolfram.com/2015/10/08/using-the-wolfram-language-in-the-classroom-history/ http://blog.wolfram.com/2015/10/08/using-the-wolfram-language-in-the-classroom-history/#comments Thu, 08 Oct 2015 14:58:34 +0000 Adriana O'Brien http://blog.internal.wolfram.com/?p=28072 It’s on to history for the Wolfram Language in the Classroom series. History and social studies have the potential to incorporate lots of real-world data to examine relationships between politics, economics, and geography. The Wolfram Language comes with built-in knowledge on a wide variety of topics, including historical events, financial information, socioeconomic data, and geographic data.

We’ve mentioned previously in this series the computational approach to thinking that introducing the Wolfram Language into a classroom environment supports; in a social studies class, this approach allows students to find connections by analyzing real-world data. In the following lesson, I’ll show you how to help students use historical financial data to explore connections between Vietnam War battles and the US economy.

Lesson title: Investigating the US Economy during the Vietnam War
Grades: 9–12
Student goals:
- Logically organize and analyze data
- Represent data through abstractions such as models and simulations
- Increase ability to handle open-ended problems

- Have students choose major battles/offensives of the Vietnam War
- Have students plot the Dow Jones closing prices around the times of the chosen battles
- Lead the students in a discussion to draw possible conclusions and analyze connections between the Vietnam War and US economics

To start the activity, have the students take a look at the date range of the Vietnam War. It’s easy to get the information with the Wolfram Language’s free-form input:

The Wolfram Language's free-form input

Students can then make a timeline plot of the span:

Creating timeline plot

The meat of the lesson is to have students investigate the impact of major battles/offensives of the Vietnam War on the US economy. The first part is to determine the battles that should be used. Here is a sample list of those battles:

  • Battle of Ap Bac (January 2, 1963)
  • Battle of Ia Drang (October 19–November 26, 1965)
  • The Fall of Saigon (April 30, 1975)

There are a variety of ways to generalize the state of the economy; one way is to look at the Dow Jones Industrial Average. Using the free-form natural language input, students can determine the closing prices of the Dow Jones for the dates of the battles.

Once the students have the battles and dates chosen, they’ll need to get the Dow Jones financial data around the time of the battles. Students will use Ctrl+= and type in natural English to return the Dow Jones for a specific date range. The first offensive on the list is the Battle of Ap Bac; this is the date range for about two months before and after the battle. Depending on the results, it may be beneficial to extend the range around the battle date:

Obtaining Dow Jones financial data from time of battles

Again using free-form natural language, have the students create a date object for the date of the battle:

Creating a date object for the date of the battle

Next have the students create a date list plot of the Dow Jones performance around the time of the Battle of Ap Bac. There is an option for DateListPlot called Epilog that essentially generates an additional graphic on top of the plot. The red line indicates the day of the battle. By indicating the exact date or date range of the offensive, it becomes easier to determine if there was a drastic change immediately afterward:

Creating a date list plot with the Dow Jones performance around the time of the battle

Students should repeat the procedure for the Battle of Ia Drang and the Fall of Saigon, as I will show in the following sections.

Battle of Ia Drang

Since the Battle of Ia Drang covers a span of time, students will want to calculate both the beginning and end dates. Have the students save the beginning date in the variable start:

Saving the beginning date as variable start

Store the end date in the variable end:

Store end date in the variable end

Students will use the built-in knowledge in the Wolfram Language to return Dow Jones closing prices from September 1965 to January 1966:

Returning Dow Jones closing prices using the Wolfram Language

Instead of just one red line, students will need two red lines this time to indicate the beginning and end of the battle:

Creating date list plot with Dow Jones performance at time of battle

Fall of Saigon

Again using free-form natural language, have students create a date object for the date of the battle:

Create date object for Fall of Saigon date

Then have students get the closing price of the Dow Jones around the Fall of Saigon. I used March 1975 to July 1975:

Dow Jones closing prices from March 1975 to July 1975

Just like the Battle of Ap Bac, students plot the Dow Jones financial data and use GridLines to mark the specific date of the offensive:

Dow Jones financial data during battle on a data list plot

Investigation and Analysis

The Wolfram Language gives students easy and instant access to financial data and lets them create visualizations with straightforward coding. Once all the plots of the Dow Jones closing prices have been made, have students look at the plots together. Use Column to create a nice stack of the plots:

Using Column to create stack of plots

To develop a hypothesis about the relationship between Vietnam War battles and the US economy, you’d obviously want to explore many battles… not just three.

Prompt students to investigate the effect the battles had on the economy and discuss possible connections:

  • Is there a connection between major offensives and the US economy?
  • Is the Dow Jones a good representative of the US economy?
  • Does the economic effect of the battle depend on when during the Vietnam War it happened?

I hope you enjoyed this lesson and have started thinking about how you can bring programming with the Wolfram Language into your history class.

To see more posts in this series, please click here.

Download this post as a Computable Document Format (CDF) file.

http://blog.wolfram.com/2015/10/08/using-the-wolfram-language-in-the-classroom-history/feed/ 0
Using the Wolfram Language in the Classroom: Chemistry http://blog.wolfram.com/2015/10/07/using-the-wolfram-language-in-the-classroom-chemistry/ http://blog.wolfram.com/2015/10/07/using-the-wolfram-language-in-the-classroom-chemistry/#comments Wed, 07 Oct 2015 14:17:24 +0000 Rob Morris http://blog.internal.wolfram.com/?p=28049 Welcome to day three of the Wolfram Language in the Classroom series. I hope you’ve enjoyed the lessons so far. Today I want to show you how data built into the Wolfram Language can be used in the chemistry classroom. The Wolfram Language has information on over 44,000 chemicals and thus provides a perfect environment for chemistry students to do comparative, data-driven analysis.

The unique advantage of using the Wolfram Language for computational thinking in a chemistry class is that it allows students to analyze curated data to create hypotheses and show correlations in a new way.

Lesson title: Data-Mining Chemical Properties
Grades: 9–12
Student goals:
- Formulate problems in a way that enables the students to use a computer to solve them
- Automate solutions through algorithmic thinking
- Abstract data into a model

- Have students explore chemical properties for single chemicals and groups of chemicals
- Compare physical properties in a group of chemicals to find trends
- Fit a simple model to a dataset

This lesson is intended to be used as a guided exercise for your students. They should follow the steps laid out here and be encouraged to explore ways of changing the code on their own.

To get started, use ChemicalData to produce a list of the chemicals the Wolfram Language has data on. Give this list of chemicals the name allchemicals for easy use later:

List of all chemicals known in the Wolfram Language

You can check out the properties of a chemical by using ChemicalData[] again:

Checking the properties of a chemical using ChemicalData

Get a list of all properties like this:

List of properties

Often chemical properties are not measured or publicly available. In that case, ChemicalData returns Missing[NotAvailable]:

ChemicalData returns chemical properties not measured or publicly available

To create a targeted inquiry, pare down the number of chemicals by taking a subset. For example, restrict the scope to chemicals whose common name ends in “acid”:

Creating a targeted inquiry

Next, get the density of each acid in the group, sort them, and plot them all. Delete any chemicals for which the information is unavailable:

Plotting the density of each acid

Now look for correlations between physical properties of the acids. It might be reasonable to assume that the density of an acid is related to its boiling point. Pull all the known densities and boiling points and plot them together to see if they look correlated. ListPlot will automatically remove any chemical where either property is unknown:

Looking for correlations between physical properties using ListPLot

Well, those don’t look correlated at all! Instead of trying to find correlations by hand, employ some computational thinking methods and use the Wolfram Language to automatically plot every combination of properties, which can then be visually inspected. For brevity in this example, I will use a hand-picked list of common properties, but one could easily use all known properties:

Using the Wolfram Language to plot every combination of properties

Using the Wolfram Language to plot every combination of properties

The graph comparing the boiling points with the melting points seems to show a linear correlation. Quantify that by fitting the data to a linear model:

Fitting data to a linear model

Now show the fitted line and the data together:

Showing the fitted line and data together

With a very small amount of code, you can create plots of multiple datasets to inspect for correlations, rather than trying to pick and construct them by hand. Having found a possible correlation, you are then able to quantify this correlation. Now the next step would be to have the students hypothesize if this correlation is real and why it has the relationship that it does. Using the capabilities of the Wolfram Language, you can move students beyond just looking for facts—you can ask them to interpret and analyze as well.

To see more posts in this series, please click here.

Download this post as a Computable Document Format (CDF) file.

http://blog.wolfram.com/2015/10/07/using-the-wolfram-language-in-the-classroom-chemistry/feed/ 0
Using the Wolfram Language in the Classroom: English http://blog.wolfram.com/2015/10/06/using-the-wolfram-language-in-the-classroom-english/ http://blog.wolfram.com/2015/10/06/using-the-wolfram-language-in-the-classroom-english/#comments Tue, 06 Oct 2015 14:08:52 +0000 Adriana O'Brien http://blog.internal.wolfram.com/?p=28016 It’s day two of the Wolfram Language in the Classroom series, and I’ll be bringing coding into an English class today. For the most part, educators and administrators consider programming a tool only for STEM courses. While coding in the Wolfram Language is excellent for STEM, it is an invaluable tool for many other subject areas as well.

Using the Wolfram Language in an English class supports a computational approach to critical thinking, which allows students to collect and analyze data to become reflective writers. In the following lesson, educators can prompt students to write just a little bit of code to reflect on their written work.

Lesson title: Becoming Reflective Writers
Grades: 6–12
Student goals:
- Formulate problems in a way that enables students to use a computer to help solve those problems
- Logically organize and analyze data
- Discover insights on individual writing styles

- Have students import their essays into the programming environment
- Have students code and analyze the length, average word size, and the Automated Readability Index (ARI) of their writing
- Lead the students in a discussion on insights discovered through their analysis

The first step is to have the students import an essay into either a Mathematica notebook or a cloud notebook. I used a sample ACT essay:

Import an essay into a notebook

An easy first step in the analysis of the essay is to have the students compute the number of words in the essay:

Compute the number of words in an essay

Have the students create a word cloud to visualize the most frequent words. Is there anything surprising about the most frequent words? It seems like in the sample essay, the writer used the words “you,” “to,” “school,” and “that” most often. Depending on the type of essay, it might be worthwhile to have the student rephrase a few sentences that contain the word “you”:

Turning an essay into a WordCloud

To get at specific details of the essay, students can tally the words and sort them in descending order by frequency:

Sorting words in descending order of frequency

Have the students visualize the word frequency in a bar chart. This would be another opportunity to prompt students to reflect on their writing. Do certain words or word phrases appear frequently? Is there a way to rephrase to reduce high word frequencies?

Frequency of words placed in bar chart

There are other text analyses available besides word frequency, such as word length. Compute the mean word length to determine if a student’s words are on average long or short:

Computing the average word length

For older students, educators can introduce the Automated Readability Index (ARI) to determine the approximate grade level of a student’s essay:

Automated Readability Index

The first step is to compute the number of characters:

Compute the number of characters

We’ve already found the number of words in the essay:

Number of words in the essay

Compute the number of sentences:

Number of sentences

Walk the students through creating a function for the ARI:

Creating a function for the ARI

Compute the ARI for the essay:

Computing the ARI for the essay

The final result above indicates that the readability of this essay is nearly grade 6.

Depending on how familiar the students are with programming in the Wolfram Language, educators might want to structure the activity such that all the code is available, and perhaps the students can change a few things here and there. If the students have had an introduction to the Wolfram Language, I would suggest giving them hints on what functions they should use, but let the students come up with the code to accomplish these tasks.

This type of inquiry-based programming allows students to make informed decisions about their writing. With this activity, educators are providing students the opportunity to be reflective writers. I hope you enjoyed this installment of the Wolfram Language in the Classroom series. Stay tuned for tomorrow’s post on integrating Wolfram technologies into a chemistry course.

To see more posts in this series, please click here.

Download this post as a Computable Document Format (CDF) file.

http://blog.wolfram.com/2015/10/06/using-the-wolfram-language-in-the-classroom-english/feed/ 0
Using the Wolfram Language in the Classroom: Math http://blog.wolfram.com/2015/10/05/using-the-wolfram-language-in-the-classroom-math/ http://blog.wolfram.com/2015/10/05/using-the-wolfram-language-in-the-classroom-math/#comments Mon, 05 Oct 2015 14:36:24 +0000 Rob Morris http://blog.internal.wolfram.com/?p=27986 Welcome to the first in a series of posts on using the Wolfram Language in the classroom! Each day this week my colleagues and I will share some of our thoughts about how to use the Wolfram Language in various classroom settings. Each post will focus on a different subject and will provide an example lesson for instructors to use with their students, complete with the appropriate grade levels, goals, and procedures. Our lessons are designed with the principles of computational thinking in mind, and we will highlight specifically how these lessons fit into that paradigm.

Today I’ll discuss a subject the Wolfram Language was born and bred to tackle: math. But since there is so much to do with math in the Wolfram Language, we need to focus on a specific aspect. I want to talk about how to use the Wolfram Language to create exploratory tools that allow students to develop their intuition and curiosity without the pressures of rigorous formalization.

Using the Wolfram Language in a math class supports a computational approach to critical thinking, where students explore mathematical concepts using a computer.

In this lesson I will show you how to create two exploratory tools that can be revisited at various levels of math.

Lesson title: Creating Exploratory Math Tools
Grades: 6–12
Student goals:
- Formulate questions in a way that enables them to be answered with a computer
- Use the Wolfram Language to experiment with math concepts
- Use computer-based tools for experiential math learning

- Create tools to explore polynomials and polygons
- Have students use these tools to develop their intuition

For the first part of the lesson, you will create a tool that your students can use to explore regular polygons. Draw a single polygon using CirclePoints:

Using CirclePoints to draw a single polygon

In contrast to other educational platforms, with the Wolfram Language it’s trivially easy to turn any such expression into an interactive exploration. Use Manipulate to attach a slider to the number of sides of the polygon:

Using Manipulate to add a slide

You can see that as you increase the number of sides, the polygons look more and more like disks. Add a disk in the background for comparison:

Add a disk in the background

Even at the elementary level, this is an engaging tool for students to explore and develop their understanding of polygons and disks. But you can make it an even more powerful tool by thinking about the areas of the polygons.

Luckily, you don’t have to build the code out more in this example because it’s already written for you! The Wolfram Demonstrations Project is an excellent resource for prebuilt exploratory content. You can just download the code from the Demonstration “Approximating Pi with Inscribed Polygons”:

Approximating pi with inscribed polygons

The same concept—approximating circles with multi-sided polygons—can be used as the basis for teaching elementary-school students about shape and high-school students about limits and integration. Students can ask questions such as “How does increasing the number of sides of a polygon affect the area?”, and then use this tool to explore the answer without ever having a formal introduction to the number π.

For the next part of the lesson, you will create a tool to develop intuition about polynomials. Start by plotting a quadratic polynomial:

Plotting a quadratic polynomial

By changing the constant term, the plot shifts up and down the y axis. By changing the coefficient on the quadratic term, the parabola becomes broader or narrower:

Changing the constant term and the coefficient

For most students, this is where intuition about polynomials ends. What happens if one changes the coefficient on the linear term? What if one adds a cubic term? To help students develop their intuition to answer these questions, create a tool that allows them to dynamically change the coefficients of a plotted polynomial:

Dynamically change the coefficients of a plotted polynomial

By adjusting the sliders, students can see how the coefficients affect the shape of the polynomial. But because it never hurts to give students a little extra motivation, you can make this tool more engaging by adding a challenge. Plot a random polynomial and ask the students to slide the sliders until they feel like they’ve sufficiently matched the underlying polynomial. This “gamification” builds intuition and understanding while providing a satisfying brain teaser. As before, you don’t even have to work very hard to create this tool. You can again just go to the Wolfram Demonstrations Project and download the code. In this case, download the notebook for “Polynomial Fitter”:

Polynomial Fitter

These are just two examples of exploratory tools you can create (or download) using the Wolfram Language. Tools like these provide a playground for students to cultivate their intuition outside the classroom, allowing for more effective usage of their time in class. These tools also allow students who don’t feel like they “get” formal math to still develop their conceptual understanding.

To see more posts in this series, please click here.

Download this post as a Computable Document Format (CDF) file.

http://blog.wolfram.com/2015/10/05/using-the-wolfram-language-in-the-classroom-math/feed/ 0
Literary Analysis and the Wolfram Language: Jumping Down a Reading Rabbit Hole http://blog.wolfram.com/2015/10/01/literary-analysis-and-the-wolfram-language-jumping-down-a-reading-rabbit-hole/ http://blog.wolfram.com/2015/10/01/literary-analysis-and-the-wolfram-language-jumping-down-a-reading-rabbit-hole/#comments Thu, 01 Oct 2015 18:56:01 +0000 Peter Barendse http://blog.internal.wolfram.com/?p=27953 As summer wraps up and students are hitting the books once again here in the US, it’s fun to explore how the Wolfram Language can be used in the classroom to analyze texts.

Take the beloved classic Alice in Wonderland by Lewis Carroll as an example. In just a few lines of code, you can create a word cloud from its text, browse its numerous covers, and visualize its emotional content.

Jump right in by creating a WordCloud:

Creating a WordCloud for <em>Alice in Wonderland</em>

WordCloud includes low-information words like “the” and “a”; using DeleteStopwords to eliminate them gives a more meaningful word cloud:

Using DeleteStopwords in WordCloud

Even if you’ve never read Alice in Wonderland, you can get a one-sentence summary from the word cloud: Alice is the star of a story with lots of talking, royalty, and animals.

You can see the covers for different editions of Alice in Wonderland by browsing them at Open Library.

First, fetch the URL:

<em>Alice in Wonderland</em> book covers from Open Library

Then look through the page to find cover image locations and import them.

Uh-oh! These covers are only thumbnails—too small. There is no potion to drink to make them magically larger, but you can fine-tune the code, locating edition-specific pages from the main URL and importing the corresponding full-size cover images:

Importing the full-size cover images

You can browse through the different covers using the thumbnails for the drop-down control:

Using Manipulate to browse through different covers

You can also create a cartoon summary of the emotional content expressed in the sentences of a book. With a summary, you can tell at a glance whether that Shakespeare play you’re reading is a comedy or a tragedy. Or, in this case, find out what’s happening with Alice.

In the output, neutral text is represented by an underscore, positive content by a blue smiley face, and negative content by a red face. With Tooltip, you can hover over a symbol to read its corresponding sentence:

Summary of emotional content using Tooltip

Diving further down the rabbit hole, you can also graph swings of emotion. Here, each positive or negative sentence adds or subtracts from the cumulative emotion, while each neutral one brings the emotion closer to zero:

Graphing swings of emotion

Finally, you can classify the sentences in Alice by "FacebookTopic", which is a useful tool for identifying themes within any book. The output gives the number of sentences with the corresponding sentiment and could likewise be used to generate ideas for a term paper on The Catcher in the Rye or a literary critique of Pride and Prejudice:

Using FacebookTopic to identify themes

We take the six most popular topics and color the data by those topics, leaving everything else gray:

Color coding topics by popularity

Putting these colors on the previous “cumulative emotion” graph allows you to compare topic and emotional content:

Cummulative emotion graph

No matter what books you’re reading—for study or for pleasure—you’ll find new ways to explore them with the Wolfram Language.

Download this post as a Computable Document Format (CDF) file.

http://blog.wolfram.com/2015/10/01/literary-analysis-and-the-wolfram-language-jumping-down-a-reading-rabbit-hole/feed/ 1
Stranded on Mars: Exploring Travel on Mars in The Martian http://blog.wolfram.com/2015/09/24/stranded-on-mars-exploring-travel-on-mars-in-the-martian/ http://blog.wolfram.com/2015/09/24/stranded-on-mars-exploring-travel-on-mars-in-the-martian/#comments Thu, 24 Sep 2015 14:32:12 +0000 Jeffrey Bryant http://blog.internal.wolfram.com/?p=27897 The popular book The Martian by Andy Weir will be released in movie form on October 2. The Martian is about an astronaut, Mark Watney, stranded alone on Mars. The crew of Ares 3, the third manned mission to Mars, thought he had been killed during an evacuation. When the crew left, they took the only planned means of escape and communication with them. The next manned mission to Mars isn’t for four years, so Watney has to face the fact that he must either figure out how to survive for up to four years on Mars or die. The book does a wonderful job of supplying technical details of the conditions and supplies available, as well as of the problems that arise as a result of using things in ways for which they were not designed. The details are great for allowing us to explore the travels of the main character with the Wolfram Language.

It’s at this point I should probably post a warning: SPOILER ALERT! From here on I will be exploring aspects of the story and so will be giving away plot points. If you don’t like those kinds of details, stop here and go read the book… and then come back and read this blog.

Travel and communication with NASA are among the major problems Watney faces. He decides to modify the abandoned mission rover for longer travel and go to the nearest communication site, the Mars Pathfinder landing site. The book tells us the coordinates of Watney’s home base, called a habitat, or HAB for short. I used Mathematica 10.2 (which includes high-resolution tiles of Mars) and GeoGraphics to visualize the area around the Ares 3 HAB:

Using GeoGraphics to visualize the area around the Ares 3 HAB

To put this into a more global perspective, you can change the GeoRange and the GeoProjection:

Using GeoRange and GeoProjection to gain a global perspective

The distance from the HAB to the Mars Pathfinder can be easily computed using the Wolfram Language:

Finding the distance between HAB to the Mars Pathfinder

We can visualize the path Watney takes using GeoGraphics:

Visualisizing the path Watney takes using GeoGraphics

Once Watney has retrieved the Mars Pathfinder and established communication, he makes plans for an escape. Because of the way the Ares missions are planned and executed, the Mars Ascent Vehicle (MAV) is landed long before the arrival of the next crew (the way off the planet). Basically, the Ares 4 crew won’t arrive for four years, but its MAV has already landed. The problem is that the Ares 4 MAV is in a different location on Mars, Schiaparelli Crater.

Schiaparelli Crater

This is quite a long way from the Ares 3 HAB—over 2000 miles. This is much farther than the previous jaunt to get the Mars Pathfinder:

Distance to get to the Mars Pathfinder

Of course, nothing is ever easy. Due to craters, valleys, and other complications, the actual path is not a straight line. One of the first deviations along the way comes from Mawrth Vallis. This is a water-carved valley on Mars that bridges the transition from the relatively flat Acidalia Planitia (upper left in the following graphic) to the more rugged, higher-altitude, and crater-strewn Arabia Terra (lower right in the following graphic):

Mawrth Vallis

Although Mawrth Vallis makes for a less direct route, it’s a more gradual slope, and therefore easier to traverse. We can zoom into Mawrth Vallis by changing the GeoRange:

Mawrth Vallis

In the CDF version of this post (downloadable below), if you click the graphic and press the “.” key on the keyboard you can hover over the graphic to get various latitude/longitude coordinates. In addition, you can click and set down a set of points and trace out a path through Mawrth Vallis. Once the path is laid down, you can do a simple copy and paste to paste the set of points that were just specified. I also rounded the results to 0.01 angular degrees, which is around 1/2 of a pixel in the above graphic. These can be used to create a GeoPath through Mawrth Vallis:

Creating a GeoPath through Mawrth Vallis

Along the way to Schiaparelli Crater, Watney navigates using a number of geographic features, and even names some after himself. For example, he names the area bounded by Becquerel Crater, Trouvelot Crater, and Marth Crater the “Watney Triangle”. In the words of Mark Watney, “I’m calling it the Watney Triangle because after what I’ve been through, #!&% on Mars should be named after me.”

The Watney Triangle

Taking all of the references and features mentioned in the book, we can get a fairly decent picture of the region visited by Watney along his way:

Using references and features mentioned in the book to get a picture of the region visited by Watney

The actual path covered is far from a straight line, so the total distance traveled is longer than the straight-line distance computed earlier. We can combine all the destination points together to estimate the total distance Watney actually had to travel, nearly 300 miles farther than the straight-line distance:

Calculating the total distance Watney traveled

The story doesn’t end there. Once Watney reaches the Ares 4 MAV, he still has to take off and intercept the Hermes, the large spacecraft used to ferry astronauts between Earth and Mars. Due to the use of ion propulsion, the Hermes cannot make sudden changes in its velocity, and due to the abrupt change in plans, Hermes can’t enter orbit. So Watney has to figure out how to take a MAV designed to only reach orbit and get it to go much higher to intercept the Hermes as it makes a close flyby of Mars. The proposed solutions to these problems are almost as scary as the problems themselves. The book was really fun to read. Mark Watney had a lot of challenges to overcome in order to survive on Mars. I will not reveal the ultimate outcome so you have something to look forward to. I just hope I can survive the wait until the movie comes out!

Download this post as a Computable Document Format (CDF) file.

http://blog.wolfram.com/2015/09/24/stranded-on-mars-exploring-travel-on-mars-in-the-martian/feed/ 3
MHacks 6 Brings Hacking to a Higher Level http://blog.wolfram.com/2015/09/23/mhacks-6-brings-hacking-to-a-higher-level/ http://blog.wolfram.com/2015/09/23/mhacks-6-brings-hacking-to-a-higher-level/#comments Wed, 23 Sep 2015 17:20:41 +0000 Wolfram Blog Team http://blog.internal.wolfram.com/?p=27884 MHacks is a hackathon hosted by the University of Michigan every year that brings together a diverse group of students to redefine the modern perception of hackers as criminals or programming experts and to make something amazing. At this year’s MHacks 6, Wolfram was proud to be a sponsor and see our technologies in action in several of the group projects.

Last year’s winners, Olivia Walch and Matt Jacobs, returned with new teammates Sam Oliver and David Renardy as Team Fusion Furniture. Their hack, which tied for first place in Best Use of Wolfram Technology, allows users to turn photos and pictures from their phones into custom, 3D-printed tables and chairs. Team Fusion Furniture used the Wolfram Language and Wolfram Development Platform (formerly known as Wolfram Programming Cloud) to “generate, export, and email the 3D model from the images” and for other back end needs.

Team Fusion Furniture

Tying Fusion Furniture for first place in Best Use of Wolfram Technology was Team SpeakEasy. University of Michigan students Daniel Zhang, Sarthak Bhandari, Tharun Selvakumar, Jason Brown, and Apoorva Gupta created SpeakEasy to use audio analysis to aid public-speaking skills. Using Wolfram Language machine learning functions such as Classify and image analysis, SpeakEasy compares the tone fluctuation and speaking speed of an individual reading a text with the same individual reciting it as a speech. Once the analysis is complete, SpeakEasy outputs a description of the analysis as well as advice on how to improve the speech.

Our mentors with team SpeakEasy

The members of winning teams Fusion Furniture and SpeakEasy were awarded passes to the 2015 Wolfram Technology Conference this coming October. Two other teams, Moooooodify! and FluxDuck, took second and third place in the Wolfram category, winning one-year, developer-level subscriptions to Wolfram Development Platform.

Team Moooooodify Team FluxDuck

Team Moooooodify!, comprised of Tushita Gupta, Aishwarya Premremu, and Ridlu Ruana, created an Android app using the Wolfram Language that tracks moods by analyzing the user’s outgoing texts and Facebook posts for each 24-hour period. Although it currently only identifies “happy” and “sad,” the Moooooodify! team plans to expand the emotional range in the future.

Team members Mark Gee, Mitchell Lee, and Sai Naidu of FluxDuck built an app that determines worthy companies with which to seek employment based on their reputations in the news media. Information scraped from sites like CNN Money is processed with sentiment analysis using the Wolfram Cloud API and Python to rank companies and help job seekers choose employers they would like to work for.

At least five other teams at MHacks made use of Wolfram Development Platform, the Wolfram|Alpha API, and/or the Wolfram Language. A big thanks to the University of Michigan for hosting. This was another great hackathon to attend and sponsor, and we can’t wait for the next one!

Have a hackathon on the horizon? Contact Wolfram to request our participation, or check out the resources on our hackathon page.

http://blog.wolfram.com/2015/09/23/mhacks-6-brings-hacking-to-a-higher-level/feed/ 0
The Coffee “Flavor-Rator” http://blog.wolfram.com/2015/09/21/the-coffee-flavor-rator/ http://blog.wolfram.com/2015/09/21/the-coffee-flavor-rator/#comments Mon, 21 Sep 2015 18:17:47 +0000 Arnoud Buzing http://blog.internal.wolfram.com/?p=27850 I drink too much coffee—it’s one of my few vices. Recently, my favorite espresso machine at the Wolfram Research headquarters in Champaign, Illinois, was replaced with a fancy new combination coffee and espresso maker. The coffee now comes in little pouches of various flavors, ranging from “light and smooth” to “dark and intense”. There even is a “hot chocolate” pouch and a way to make cappuccinos using both a “froth” pouch and an “espresso” pouch. Here is a picture of the new coffee selection:

Coffee flavor display

I noticed a great interest in the new machine, so I decided to create a sort of instant poll to find out which flavors were the most liked (while also saving myself the trouble of trying each flavor individually). To do this I used a number of somewhat-new features in the Wolfram Language and the Wolfram Cloud, specifically deployed web forms and databins. And so the “Flavor-Rator” was created. This post describes all the details you need to know to create a poll like this yourself.

At the core of this instant poll is a databin that holds the flavors and their ratings. The CreateDatabin command creates it. The flavor is always a string, like “Colombia (Medium and Balanced)”, and the rating is always an integer (from 1 to 5, with 5 representing an excellent flavor):

Databin that holds the flavors and their ratings

The databin only needs to be created once. In subsequent coding sessions, you can refer to the resulting databin directly:

Can reuse the databin directly in other coding sessions

Next I defined the coffee flavors, of which there are thirteen (plus the frothing pouch):

Defining the coffee flavors

And I also defined the ratings. Higher numbers mean better coffee:

Define the ratings for the coffee

The flavor poll is implemented as an online form. Its layout and the action taken on the data that is entered is specified via a FormFunction.

This form has two fields, “Flavor” and “Rating”. The syntax {“flavor”,“Flavor”} indicates that the form parameter name is “flavor”, but the form label reads “Flavor”. The full syntax {“flavor”,“Flavor”} ->flavors means that the form will show a pull-down menu with all the given flavors and assign “flavor” to the selected flavor upon the form submission. The syntax for “rating” is similar to that for “flavor”.

The second form function argument defines the action to take on the submitted data. This action does two things: it adds the submitted data to the previously defined databin (using DatabinAdd), and generates a result that shows the average ratings so far (in image/png form to show the nice typeset form of the dataset):

Second form function argument defines the action to take on the submitted data

Finally, I deployed this form function to an object in the cloud. First I created a cloud object named “flavor-rator”:

Created cloud object named flavor-rator

Then I deployed the form function to the cloud object:

Deployed for function to the cloud object

Here is the form as it looks on the web:

Form on the web

That’s it! The form is now ready to be announced to the coffee drinkers in the building. I sent an email to the employee “social” email list, and printed a QR barcode image and placed it near the coffee machine:

QR Barcode


After waiting a day or so for data to accumulate from the coffee drinkers, it was time to analyze the data I’d been given by our coffee-thirsty Wolfram employees. Which coffee flavor is the most popular? Which is most disliked? Which has been rated the most frequently? Let’s find out!

This is the raw data from the databin, converted to a dataset. Every row is one rating for a given flavor from one employee. A few dozen ratings accumulated in about two days’ time.

Raw data from databin
Raw data from databin

You can make this a bit more understandable by grouping the ratings by flavor. That way you can more readily see the rating patterns for each flavor. You can see how Colombia and Dove Hot Chocolate were the most frequently rated flavors. Getting that result is a simple database query:

Grouping ratings by flavor

From there it’s a simple matter of applying Mean to compute the average rating for each flavor:

Using Mean to compute the average rating

Let’s also sort this by rating, from the highest-rated coffee (Sumatra) to the lowest-rated coffee (Espresso Delicato). Clearly Sumatra, Hazelnut, and the Alterra House Blend are the flavors I will need to try out over the next couple of days:

Sort by highest rated coffee first

Now you can get a little fancier by looking at how the ratings are distributed visually, with a histogram plot. Clearly more ratings would be useful to get a solid rating distribution, but there are some things that are of interest to note: the Dove Hot Chocolate (the only non-coffee flavor) is not getting high marks, with only one 4 rating and everything else 3 or lower. And the French Vanilla flavor is the most controversial flavor, having both 1 and 5 ratings:

Ratings as a histogram

Ratings as a histogram

So there it is: with a handful of simple commands (Databin, Dataset, FormFunction, CloudDeploy, CloudObject, GroupBy, and SortBy), I can quickly create a completely custom web rating system and analyze and share the results. By doing all this in the Wolfram Language, I can interactively tweak and improve my prototype design and iterate to a web form that I am happy to put into production. And I can do all this while sipping a cup of Sumatra coffee from the new coffee machine!

Download this post as a Computable Document Format (CDF) file.

http://blog.wolfram.com/2015/09/21/the-coffee-flavor-rator/feed/ 0
The Republican Presidential Debate Clouds: Round 2 http://blog.wolfram.com/2015/09/18/the-republican-presidential-debate-clouds-round-2/ http://blog.wolfram.com/2015/09/18/the-republican-presidential-debate-clouds-round-2/#comments Fri, 18 Sep 2015 20:50:26 +0000 Jonathan Wallace http://blog.internal.wolfram.com/?p=27810 After the first Republican presidential debate, we showed you how the WordCloud function in the Wolfram Language can be used to create compelling visualizations of what the candidates said.

This time around, Alan Joyce and Vitaliy Kaurov have done an even cooler analysis over at Wolfram Community, delving further into what words were used most frequently and what subjects the candidates had in common—and how they set themselves apart.

For example, check out the words uniquely used by each candidate in Wednesday’s debate below.

Jeb Bush WordCloud Ben Carson WordCloud Chris Christie WordCloud Ted Cruz WordCloud Carly Fiorina WordCloud Mike Huckabee WordCloud John Kasich WordCloud Rand Paul WordCloud Marco Rubio WordCloud Donald Trump WordCloud Scott Walker WordCloud

Says Alan, “It’ll be interesting to start watching trends over time, as the campaign season progresses and more debates occur.” We can’t debate that.

http://blog.wolfram.com/2015/09/18/the-republican-presidential-debate-clouds-round-2/feed/ 0
Experts in Action: Live-Coding with Christopher Wolfram http://blog.wolfram.com/2015/09/17/experts-in-action-live-coding-with-christopher-wolfram/ http://blog.wolfram.com/2015/09/17/experts-in-action-live-coding-with-christopher-wolfram/#comments Thu, 17 Sep 2015 18:00:28 +0000 Dana Flinn http://blog.internal.wolfram.com/?p=27745 If you’ve ever hit a roadblock while learning to code, then you know the frustration of trying to find the best resource to help you out. We have good news. We are happy to announce that Christopher Wolfram, son of Wolfram Research’s founder, Stephen Wolfram, will be live-coding on Livecoding.tv. This new Y Combinator–backed coding platform brings programmers together to watch live streams of people coding real products.

Christopher live-coding onstage at Maker Faire

Enhance your coding skills and learn directly from someone with the knowledge and expertise that results from working directly with Stephen Wolfram. Christopher’s presentation will focus on education analytics; users who tune in will see a firsthand demonstration of how to interact with datasets and visualizations in the Wolfram Language. The live streaming is scheduled for Tuesday, September 22 at 7pm CDT.

Livecoding.tv is an educational startup designed to allow developers to stream live videos of themselves coding anything from apps and games to real products. Much like Twitch aspired to revolutionize gaming, Livecoding.tv is eager to transform the way people learn to code. Focused on online learning, it gives coders the ability to watch experienced programmers at work and interact with them. Once the live stream is over, users can play back the video to pick up on anything they might have missed.

Christopher has been programming for half his life and has given a number of public lectures about Mathematica from as young an age as 13. “One of the things I always liked about programming was that there are few limitations on what you can build. With something like, say, carpentry, you are limited by all sorts of practical issues,” says Christopher.

In a presentation he gave at Maker Faire in New York, Christopher demoed connecting Mathematica to an Arduino board and a quadricopter.

Earlier this summer, Stephen Wolfram demonstrated the power and simplicity of the Wolfram Language on Livecoding.tv. The streaming took place on the 27th anniversary of the first release of Mathematica; Wolfram used the theme to have some impromptu fun with Wolfram Language code.

Improve your coding skills and register to watch the livestream September 22 at 7pm CDT. For more information about the event, please click here.

http://blog.wolfram.com/2015/09/17/experts-in-action-live-coding-with-christopher-wolfram/feed/ 0