AI-generated fun with vibe coding, math and physics

2025-10-22
6 min read.
In a technical vibe coding project I'm using Grok 4 for both coding and exploring the underlying math and physics. I'm impressed with the results so far.
AI-generated fun with vibe coding, math and physics
Credit: Tesfu Assefa

Generative artificial intelligence (AI) and in particular large language models (LLMs) have become invaluable tools in various fields by processing complex information quickly and offering creative solutions, bridging human intuition with technical precision. In coding, AI and LLMs facilitate a shift from traditional programming to more intuitive methods, while in mathematics and physics research, they can accelerate problem-solving and hypothesis generation.

Vibe coding

Vibe coding represents an emerging style of software development where programmers describe their ideas in casual, natural language rather than writing detailed code from scratch. Instead of focusing on the specific rules and structure of a programming language, developers convey the "vibes" or overall intent of what they want to build. The LLM then generates the corresponding code, complete with explanations and suggestions for improvements.

The term was introduced by AI researcher Andrej Karpathy. "There's a new kind of coding I call 'vibe coding', where you fully give in to the vibes, embrace exponentials, and forget that the code even exists," he said. This approach democratizes coding, making it accessible to both beginners who lack deep technical knowledge and hobbyists with technical knowledge who can't (or prefer not to) dedicate too much time to coding. Vibe coding can also speed up workflows for professional coders by handling repetitive tasks.

An LLM can debug errors or tweak existing programs to make them more efficient, all based on vague prompts like "make this run faster without changing the output." In Karpathy's words, "The hottest new programming language is English."

In vibe coding, the model acts as a collaborative partner, iterating on ideas through back-and-forth conversations. This allows users to focus on high-level design rather than low-level implementation details. However, users must verify the output, as LLMs could introduce errors. Overall, vibe coding with LLMs transforms programming into a more creative, less tedious process, fostering innovation in software creation.

Vibe math and physics

Vibe coding style can be extended to mathematics and physics research (let's call this vibe mathematics and vibe physics). AI can help researchers explore theories and solve equations that might otherwise take weeks or months. AI can manipulate sequences of numbers or symbolic expressions using built-in tools or integrated libraries.

In physics, AI can assist by simulating scenarios or analyzing data from experiments. LLMs also aid in literature reviews by summarizing papers or identifying connections between disparate theories. By processing enormous volumes of scientific text, they uncover patterns that humans might overlook, accelerating discoveries.

While LLMs do not replace human expertise, they enhance it by providing rapid insights and freeing researchers to tackle more ambitious questions. Challenges remain, such as handling cases where training data is sparse, but ongoing advancements in fine-tuning models for specific domains could mitigate these issues. In essence, LLMs serve as tireless assistants, blending computational power with intuitive interaction to push the boundaries of coding, mathematics, and physics forward. As these models evolve, their role will likely expand, making complex endeavors more collaborative and efficient for everyone involved.

There are already examples (see also this X thread) of AI-generated solutions to previously unsolved research problems in mathematics and physics, and it is an easy guess that the list will grow, perhaps with spectacular cases. New claims keep popping up at an increasing pace. Maverick physicist Jack Sarfatti recently claimed that "the big game changer is Elon Musk's Grok... Grok has already created new physics."

Credit: Tesfu Assefa

My experience so far

I've been experimenting with vibe coding, math and physics. Of the user types mentioned above, I'm a hobbyist with technical knowledge who prefers not to dedicate too much time to these things. While I'm a mathematically oriented theoretical physicist by training and I've done a lot of professional software development, these days I see myself as a serious hobbyist who spends some time on these things for pure fun.

First I asked Grok 4 (my favorite AI assistant) to redevelop (from prompts, not from code) some code that I had written a few years ago to compute Stephen Wolfram's one-dimensional elementary cellular automata and their reversible extensions (110R, 37R...) described in "A New Kind of Science." I asked Grok to redevelop existing code because I wanted to check the results. We used Matlab, which is the only coding platform I use these days because past experience tells me that it really saves scientific software development time.

Grok 4 got the computation right the first time, I only had to iterate a few times to get the output in the format I wanted. Then we developed a simple game, a Sudoku-like game based on cellular automata (the reversible 37R). Grok 4 got the game right the first time, I just had to add a couple more options.

Then I embarked on a more complex project. I've always been interested in fractal geometry and the idea that it could have something to do with fundamental physics and the fabric of reality (see my 2024 book "Irrational mechanics"). Some time ago I stumbled upon a paper that suggested fractional calculus - an area of math I new exactly nothing about - could be the "natural" (so to speak) calculus appropriate to fractal phenomena. So I started studying fractional calculus.

I decided to try and improve my understanding of fractional calculus and its intersections with fractal geometry by building examples and test cases.I relied on Grok for both vibe coding and exploring the underlying math and physics.

Grok 4 always generated Matlab code that works. I was quite skeptical at first so I spent a lot of time reading the code and running it in cases where I could check the results against known analytic formulas or published studies. At times I found bugs in the code or wrong results, but Grok rapidly fixed things when I asked it to do so.

Some times running the code revealed subtler issues, but Grok could fix things based on embedded diagnostic code and my qualitative description of what the output looked like. Of course at a certain points things became more complicated due to theoretical subtleties or numeric instabilities, and we had to iterate more.

But I was impressed by Grok's ability to understand what I wanted from prompts that were not always as precise as I thought. And I was very impressed by Grok's encyclopedic knowledge of relevant literature and ability to connect the dots.

See my Github repositories if you want to take a look.

I'm impressed with the results of this hobby project so far. I must emphasize that this is not a Turing test, because this interaction domain is far too narrow and favorable to AI. I guess those AI bots that steal money from credulous people with romance scams and that kind of things lay a better claim to passing the Turing test.

But if I were to consider this as a Turing test, I would have to conclude that Grok 4 passes it with flying colors. It seems able to understand what I don't understand and reword it in a way that I understand. I always ask for intuitive conceptual pictures of technical things, and Grok 4 gives me insightful and at times brilliant pictures.

I can't wait for Grok 5...

Note to self: maybe don't call Grok "it" next time...

#AIApplications

#Calculus

#FractalGeometry

#LargeLanguageModels(LLMs)

#RadicalPhysics



Related Articles


Comments on this article

Before posting or replying to a comment, please review it carefully to avoid any errors. Reason: you are not able to edit or delete your comment on Mindplex, because every interaction is tied to our reputation system. Thanks!