A scientifically flavored alternative to 15-112. Counts anywhere 15-112 does as a prerequisite.
Offered as 02-120 (undergraduate) and 02-601 (graduate). The undergraduate course is the main focus of this page.
Learn to program by solving real scientific problems. Instead of abstract exercises, you’ll simulate galaxy collisions, build evolutionary trees, model chemical reactions, and predict elections. By the end, you won’t just know how to code. You’ll know how to build real, correct projects from scratch that answer real scientific questions.
Programming for Scientists is powered by Programming for Lovers, a free online course that teaches programming fundamentals through real scientific problems. The complete curriculum, including high-quality recorded videos for every module, is already available and reaching thousands of learners around the world.
As a student in Programming for Scientists, you’ll use this entire curriculum to learn the fundamentals of programming before and during the course. That foundation is what makes everything else possible.
AI is changing everything about how we write code. This course doesn’t just allow AI. It teaches you how to become a power user.
Once you have a foundation in programming, you can pair-program with AI tools like Claude to go from an idea to a working project in under an hour. Not by copying and pasting, but by understanding what you’re building well enough to direct the process. This course teaches you the fundamentals and the AI skills together, so that by the end, you’ll be able to build things that would have taken weeks just a few years ago.
This is one of the most valuable skills you can develop right now, no matter your field.
Every project in this course connects to a real problem in science. Here’s a sample of what you’ll create.
Galaxy Collision. Simulate two galaxies colliding using the Barnes-Hut algorithm for efficient gravitational computation.
Three-Body Problem. Simulate gravitational forces to explore chaotic orbital dynamics.
Boids Flocking. Model emergent behavior by simulating flocks of birds following simple local rules.
Cellular Automata. Build self-replicating structures and explore how simple rules give rise to stunning complexity.
Turing Patterns. Simulate reaction-diffusion systems to generate the patterns found on animal skins and seashells.
Sandpile Model. Watch a simple process produce fractal-like patterns through self-organized criticality.
You’ll also build evolutionary trees to track COVID-19 variants, simulate presidential elections from polling data, create chemical reaction simulators with parallel programming, and much more.
For every student who completes the course, I donate $50 to a charity chosen by the class, to address the major inequities in computer science.
In 2025, 28 students chose Girls Who Code. That was $1,400.
This year, let’s go bigger.
“It’s the most interesting and helpful programming course I’ve ever taken. Phillip demonstrated the materials in a very clear and inspiring way which helped us have a good understanding.”
“[I have] taken a few ‘intro to programming’ courses, really think this is the way programming should be taught to anyone looking to start programming.”
“Class has been so much fun. I’ve definitely never been taught programming in such a novel but effective way.”
“I really enjoyed the passion behind each lesson, and especially the contextualization as to how we should use these skills for good.”
“Dr. Phillip Compeau is hands down the best professor that I have ever had. I really appreciate his passion for teaching. He is brilliant at tying things together. He leaves no loose ends. If I ever find anything that I am half as passionate about as he is about his work, and half as good at it, I know I’ll fare well in life.”
“Phillip is one of the best professors I’ve had. He was part of the reason I chose to come to CMU, and I’m now all the happier I did.”
Programming for Scientists is taught by Phillip Compeau, a Simon Award winner with 10+ years of experience teaching programming to students at every level at CMU, from high schoolers to graduate students. The course has consistent 4.9+ FCEs.
Students work individually or in teams to build substantial projects, culminating in essays describing their scientific work. Here are some standout projects from previous semesters. With AI-powered development now part of the course, expect future projects to be even more ambitious.
Project authors: Tyler Katz, Darin Boyes, Minhyek Jeon, and Shivank Sadasivan.
group5gomol_109412_10543509_GoMol-Final-Essay-1Project authors: Jonathan Potter, Andrew Lutsky, Rohit Nandakumar, and Shashank Katiyar.
group10crabmasters_109433_10543049_P4S-Project-Final-Report-1Project authors: Lilin Huang, Tianyue Zhang, and Wenduo Cheng.
huanglilin_98864_8988870_Programming-Project-2Project authors: Sarah Baalbaki, Dylan Estep, William Hsu, and Tanxin Qiao.
baalbakisarah_96114_8988050_Final-Paper-1Project authors: Arth Banka, Riti Bhatia, Sanchitha Kuthethoor, Sumeet Kothare
group2abinitiostructureprediction_126524_12100936_PfS_Group2_FinalReportProject authors: Claude An, Luci Lu, and Shiyu Wang
groupboops_125884_12099696_final_report_v0.4