Computer Programming and Data Analysis for Dummies

4/30/24 Pratt School of Engineering

A new CEE class explores how a ChatGPT plugin removes entry barriers to the Wolfram family of data analysis tools for students in any discipline

Zbigniew J. Kabala
Computer Programming and Data Analysis for Dummies

Zbigniew Kabala still remembers the first time he brought home a Texas Instruments calculator. The year was 1976, and the concept of a commercial handheld calculator was still only a few years old. Living in Poland at the time, Kabala had picked up the fancy new piece of technology while traveling and couldn’t wait to put it to use.

Up until then, for all human history, calculating the square root or logarithm of a number was a pain. It required looking up their values in bulky tables (available only in libraries) or a long sequence of steps and a lot of calculations by hand, eating up time and paper on a regular basis. With the advent of the Texas Instruments SR10 pocket LED calculator, however, all that work and sweat equity could then be done instantaneously at the push of a button.

“Wolfram ChatGPT is now doing the same thing for computer programming,” said Kabala, associate professor of civil and environmental engineering, who joined Duke’s faculty in 1994. “By marrying the abilities of a large language model (LLM) with a powerful computer language, you can approximate some of the abilities of a human brain.”

By marrying the abilities of a large language model (LLM) with a powerful computer language, you can approximate some of the abilities of a human brain.

Zbigniew J. Kabala Associate Professor of Civil and Environmental Engineering

The marriage combines the creative power of LLMs, which have no logic built into them, with the logical power of Wolfram Language (Mathematica) and Wolfram Alpha. It’s as though, Kabala says, Wolfram GPT were endowed with both a left and a right brain.

The specific marriage that Kabala is talking about is a ChatGPT plugin provided by Wolfram Research, a longtime leader in computational technology. Wolfram launched its first version of its flagship program Mathematica (now Wolfram Language) in 1988, which has ever since been a mainstay in the arsenal of STEM students for its built-in libraries for many areas of technical computing including machine learning, statistics, data analysis, visualizations, plotting functions, and much more.

This semester’s class of Computational Thinking & Programming with AI.

While extremely powerful, Mathematica comes with a steep learning curve, as using it requires students to master an entirely new language. Similar to computer programming languages like C++ or Python, the Wolfram Language is a large set of specific commands and syntax that must be used in specific ways with zero errors to unlock the underlying software’s computational abilities. While the high-level Wolfram Language is easier to learn than low-level programming languages because its codes are shorter and thus easier to debug, learning Wolfram Language still requires serious time commitment and perseverance.

But not anymore, because almost instantaneously mastering language is precisely what large language models like ChatGPT are created for.

By asking the Wolfram GPT in plain English to develop code for a problem, students are immediately exposed to the syntax (grammar) of the programming language without the necessity of looking up its rules and documentation, a major source of frustration in the past. Being exposed to mostly good code generated by Wolfram GPT allows students to assimilate the computer language effortlessly, in a process analogous to learning a foreign language through immersion.

“In fact, the Wolfram ChatGPT plugin allows you to learn how to program without learning how to program,” Kabala said. “All of the programming is delegated to Wolfram ChatGPT.”

This ability opens an entirely new world to students without any programming experience whatsoever. To help students from all disciplines across Duke begin exploring these possibilities, Kabala launched a new class called Computational Thinking & Programming with AI, temporarily labeled CEE 690. An interesting demonstration of the power provided by this concept can be seen in one of the class’s first homework assignments.

Early in the semester, students were given an introductory online textbook to the Wolfram Language. The assignment: Pick any 10 homework questions from the entire book, offer them to Wolfram GPT, and see if you can stump it. For example, a problem might ask to create a code that can generate a pie graph based on a specific set of equations with slider bars that can visualize the results for different inputs for different variables.

If you’ve never used Wolfram tools before, learning the language to be able to analyze research results can be a real barrier and give students a hard time. The ability of the Wolfram-ChatGPT plugin to just do it—and do it very well in real-time—is just astounding.

Ryan Parks Ph.D. Student in Earth and Climate Sciences

With just a little knowledge of how Wolfram ChatGPT likes its questions to be asked, students found they could finish most any problem in a matter of minutes. And the program provided the code it wrote to make it work.

“It’s amazing how well you can visualize questions and get the precise graphs you want,” said Zella (Hanyu) Zhao, a master of engineering student in electrical and computer engineering. “If you just asked regular ChatGPT for a similar graph, it would generate something cartoonish that wouldn’t be helpful for an academic study. But with the connection to OpenAI API, Wolfram makes it easy.”

“If you’ve never used Wolfram tools before, learning the language to be able to analyze research results can be a real barrier and give students a hard time,” said Ryan Parks, a Ph.D. student in earth and climate sciences in the Nicholas School of the Environment. “I’ve tried putting in some of my own water quality data and asking it to produce various visualizations of this data, and the ability of the Wolfram-ChatGPT plugin to just do it—and do it very well in real-time—is just astounding.”

A 3D plot graph’s construction is made easy through commands given to Wolfram GPT.

Through the course, students explore the abilities and the limitations of Wolfram GPT. When they find a problem that the large language model can’t easily solve, they work together to figure out why. Through a series of trials and errors, they learn how best to pose their requests to the command prompt and what types of problems are best suited to the approach, i.e., they learn “prompt engineering,” a new term that is barely one year old.

Open to graduate and undergraduate students alike, the class is also open to any student from any department across the university. With the low barrier to entry, given that Wolfram ChatGPT takes care of all of the actual programming work, Kabala is excited to see how disciplines from outside of the traditional STEM fields can make use of these new abilities.

To illustrate this point, Zbigniew Kabala invited his son, Jakub Kabala, associate professor of history and digital studies at Davidson College, to give some guest lectures. In his previous work, Jakub used the Wolfram Language to analyze word frequency distributions in medieval Latin texts from the 12th century. Through this approach, he was able to show with reasonable certainty that two anonymous authors—one writing of the Crusades in Italy and the other writing of the medieval Polish kingdom in central Europe—were actually one and the same.

Exploring how prompt engineering with Wolfram GPT could recreate the older processes is brand new. I don’t think it’s ever been tried before.

Jakub Kabala Associate Professor of History and Digital Studies, Davidson College

“My guest lectures show the different ways computational approaches have been applied to humanities questions,” said Jakub, who now teaches “Programming in the Humanities,” a gateway course into computer science at Davidson. “But I didn’t have large language models when I did my analysis. Exploring how prompt engineering with Wolfram GPT could recreate the older processes is brand new. I don’t think it’s ever been tried before.”

Besides work on authorship attribution, Jakub says that computational methods have also been applied to other problems in the humanities such as completing ancient inscriptions that have been damaged over time, performing facial recognition on poorly legible coins discovered archaeologically, or tracing the decline of the cognitive abilities of an author across the span of their career.

Both Kabalas and their students agree: The combination of large language models with computer programming is a game changer akin to calculator and computing revolutions of the past. With such an easy entry point and wide range of potential applications, the sky is truly the limit for what people can accomplish with it—as long as they are adventurous enough to try.

Even though the course is currently called CEE 690, it’s open to all majors, and it can really facilitate the future of your career.

Zella (Hanyu) Zhao Master of Engineering in Electrical and Computer Engineering Student

“This class encourages asking big questions that you probably wouldn’t normally ask because of limited skills or technical expertise in a given subject,” Parks said. “This class emboldens students to really explore what they’re interested in without being riddled by the barriers of idiosyncratic technical expertise.”

“Even though the course is currently called CEE 690, it’s open to all majors, and it can really facilitate the future of your career,” added Zhao. “Plus, Professor Kabala is super nice and friendly and helpful. I recommend that everyone takes it.”

But note for any students looking to follow Zhao’s advice, if looking to take this course in the future, it will be renumbered for its second run.

AI in Education at Duke

Explore more opportunities

Related News