Exploring the Chaos Game: Creating Fractals From Randomness | October 04 2025, 15:32

I read something interesting today. About fractals. If you take any three points that form a triangle, and then a fourth point anywhere, and subsequently throw a dice, the faces of which are assigned to the first three points. Next, you move from the current point towards the point corresponding to the result on the dice and place a new point halfway; this becomes the new current point. After many iterations, the points start to form the Sierpinski triangle – the one shown in the attached picture. Intuitively, you would think the triangle should be fully filled because it involves random movements in three directions from a randomly chosen point, but no. Moreover, it works even if the starting point is inside the future empty triangle (yes, a few points will disrupt the picture, but that’s it). If you start our experiment with five or six points instead of three, different shapes will form – see the attached picture. This graphical method is called the Chaos Game.

By the way, it may seem obvious, but in case you wondered — all the presented figures have zero area.

If you take two triangles and with a probability p move towards random vertices of the first, and with (1-p) towards random vertices of the second, you end up forming a Barnsley fern (picture №2).

I love such things because they seem like magic at first glance 🙂

(It’s a kind of problem from the same class as the synchronization of metronomes)

From Opera to Oblivion: The Fascinating Journey of Lorenzo Da Ponte | September 22 2025, 18:53

We just finished watching Le Nozze di Figaro with Nadezhda in a serialized mode and today we’ll continue with Don Giovanni, also in a serialized mode, because no one has the time. So, both of these operas were written by an American 🙂 I mean the librettos. Turns out, Lorenzo Da Ponte, an Italian librettist, emigrated, naturalized in the U.S., lived here 33 years, taught Italian literature at Columbia University in New York, founded an opera theater in the USA, which became the precursor to the New York Academy of Music and the New York Metropolitan Opera. Really an interesting dude. His real name was Emanuel Conegliano. A Jew by birth, who became a Catholic priest, a friend of Casanova, and a supporter of Rousseau’s ideas. Before moving to the U.S., Da Ponte successfully juggled teaching and a small business, earning not so much from lectures as from owning a brothel for aristocrats which he maintained. In the U.S., he kept a grocery store in New Jersey and tried selling medicines in Pennsylvania. Lorenzo Da Ponte died on August 17, 1838, in humiliating poverty, a few blocks away from the boarded-up building of his theater. His grave in one of the New York cemeteries, which was not marked, eventually got lost. Essentially, the same post-mortem fate befell his friend Mozart.

Navigating Code Generation with AI: Essential Skills for Programmers | August 04 2025, 14:28

I am currently using Gemini extensively for code generation, and I see a skill that programmers need to have to be successful in this field. It’s the ability to quickly read and understand someone else’s code, as well as explain why AI generation needs to be redone and how. For the former, you simply need to know the language very well and read “from the sheet,” because there will be little time to ponder. For the latter, you need to know patterns well and understand where they apply and where they do not. AI will still mess up using patterns inappropriately for a long time.

Moreover, a person will still need to understand “as a whole” 90% of the code generated by AI, and also manage to find time to comprehend each generated line of code. If you relax and miss it, the system may produce even working, but very poorly maintainable code. For instance, there is an unwritten rule that individual files should not contain so much code, and if it grows, you need to refactor, breaking one large into two or three. Sometimes this requires rewriting logic, but this rewriting is always aimed at one task – to simplify maintenance. And AI, while rewriting, also “improves” the code at the same time. And this is quite difficult to prohibit.

In addition, the very concept of LLM implies the limitation of the contextual window. Which gets filled with code very quickly. To create an illusion for the user that everything is working even with a large volume of code, LLMs are able to do preliminary processing, extracting only relevant pieces for processing and setting aside irrelevant ones, so that the relevant ones fit into the actual contextual window. But this process is very unreliable, and once it works, and the second time it turns out that something important was set aside, and as a result, the system did not see the whole picture and generated code, which includes a function very similar to the function set aside, and now we have two almost identical ones.

Besides, currently logic is distributed between the DB and the code. That is, data often controls the code. And data in LLMs simply often do not fit. There is too much of it. In the end, without programmers, current LLM architectures cannot cope. But the requirements for programmers’ qualifications will only increase with LLMs, not decrease. So yes, juniors should be worried, but leads not so much 🙂

Navigating the Cosmos: Newton, Halley, and the Birth of Modern Science | June 03 2025, 03:01

I’m currently re-reading A Short History of Nearly Everything by Bill Bryson. An old book from 2003. For instance, the author celebrates that Pluto was finally recognized as a planet by the IAU. So, there’s this interesting story about scientific startups in the 17th century.

Everyone knows from school that Isaac Newton is the father of classical mechanics and gravity concepts, and authored a fundamental work that underpins all subsequent physical science: “Mathematical Principles of Natural Philosophy,” or simply “Principia.”

There was also Halley—the one after whom the comet was named, and then there was Hooke, who discovered the cell (and Hooke’s law of elasticity and loads of other stuff).

So in 1684, Halley, discussing the problem of planetary orbits with Robert Hooke and Christopher Wren, asked, “What force makes the planets move in elliptical orbits?” Hooke claimed it was a force inversely proportional to the square of the distance, but he could not prove it strictly. Halley went to Cambridge to ask Newton directly—and to his astonishment, Newton said that he had already proven it. Moreover, he promised to send a detailed account. Actually, he got a bit carried away and instead of simply answering the question, he wrote three volumes of “Principia” (and deliberately wrote it in a complicated way to discourage the uninitiated).

As the work on “Principia” was nearly complete, Newton and Hooke disputed over who first discovered the inverse-square law of force, and Newton refused to release the key third volume that made the first two volumes sensible. Thanks only to tense diplomacy and the most generous doses of flattery from Halley, the fussy professor eventually agreed to release the final volume. Without Halley’s interest and prodding, Newton probably would not have formalized his discoveries into a cohesive work.

The Royal Society had promised to publish the work but then declined, citing financial difficulties. The year before, the society had funded a costly flop called “History of Fishes,” and suspected that a book on mathematical principles would hardly stir market excitement.

Halley, whose financial situation was modest, paid for the publication from his own pocket. Newton, as was his habit, contributed nothing. To make matters worse, just then, Halley had taken a position as the society’s clerk, and was informed that the society could no longer pay him the promised salary of 50 pounds a year.

Instead, they decided to pay him with copies of the History of Fishes. The society handed him 50 copies of the same History of Fishes” (apparently intended for fireplace use).

About several hundred copies of “Principia” were released—a rather large print run for such an expensive book, yet the publication aroused no interest from the reading public. The book sold very poorly, and the publishing did not pay off at all. Even in 1739, 53 years after the publication, an inventory check found the Society still had 126 copies left, and these were being sold at huge discounts, given away, or virtually given away for free.

Ironically, one of the most influential texts in the history of humankind was considered virtually a commercial failure at the time.

And it’s funny that since its publication in 1687, there was a calculation error in the text that wasn’t noticed until 1987, 300 years later, by a student, Robert Garisto, a senior at the University of Chicago.

In sentence eight (the book used such numbering) Newton tried to confirm his theory by calculating the mass, the force of gravity at the surface, and the density of known planets. To calculate mass, he needed to know the angle between the line from the center of the Earth to the Sun and the line from a point on the Earth’s surface to the Sun.

Modern measurements give this value as about 8.8 arcseconds (one second is 1/3600 of a degree). Newton thought it was 10.5 seconds, but mysteriously used 11 seconds in the actual equation. This error was discovered by Garisto when he was redoing the calculations as part of a regular class assignment.

This Robert Garisto is now an editor of Physical Review Letters. He recently made headlines a second time when his journal published a scientific paper with 5,154 authors 🙂

Simulated Realities: When Fiction Mirrors Life | May 31 2025, 13:47

Generated people are convinced that everything around them is fake, and that they themselves are made from prompts, yet they do not believe it.

It turned out dystopian.

It would be funny, if we also didn’t believe that we live in a simulation.

Or is it not funny?