The Root Cause: In Search Of A Core Explanation


Photo by Tamara Gak on Unsplash

© Andrey Cheremskoy, 2022-07-30

What did cause this?

Not once when faced with a problem we tend to come to a superficial conclusions that may be far away from the underling causes of the issue. This can be seen in almost any human endeavor, particularly in scientific research, in engineering, such as software programming or electronics, in medicine etc. Hence, comes the need for finding a root cause of the problem which allows to come up with a core explanation of the phenomenon at play.

There are a number of ways to uncover a root cause of the problem, for example there is a Root Cause Analysis (RCA) techniques that provide heuristics of how to search for a possible root cause or causes of the issue at hand. Ishikawa diagrams also known as fishbone diagrams is one such example of using root cause analysis that is used to uncover potential causes of certain events and it is used in industry for quality control.

Some examples

As it was mentioned root cause analysis is very useful in engineering, such as hardware development and software programming. In these fields it’s rarely the case that a systems that was implemented works for the first time it is used. Probably, you’ve heard about the phrase Smoke Testing, which is used in IT world, but it comes from electrical engineering. And it is not a coincidence that it mentions smoke, since it’s almost always the case that a system will behave in an erratic manner when used for the first time.

For example, software programmers are known to use Debugging Tools in search for defects in software, which are informally known as bugs. And Quality Control engineers, or software testers find and report these bugs as a way of living. The same is true about hardware, where even a small part, such as resistor that goes awry can cause a whole module to fail in unexpected manner.

When root cause can be misleading?

It is then reasonable to ask whether the existing root cause is the only one possible to explain the issue? This is a good question. It happens that sometimes due to an existing status quo among experts we may tend to think that the root cause is known very well and there is no need to look for it any longer. This is a dangerous situation and it happened a lot throughout human history when experts insisted that there is no other root cause and hence there is no need to search for one.

For example, physicists in the end of 19th century believed that there is nothing new left to discover in physics and what’s left are small unresolved phenomena, but then came the mystery of the black body radiation which was a door into quantum mechanics physics of 20th century.

Another example is from medicine. It was long accepted that the root causes of obesity were the larger number of consumed calories over expanded ones and a lack of exercises, while we now know that a true root cause was a high level of insulin hormone, which was caused by frequent meals and high consumption of processed food, particularly sugar.


In summary, it is important not only to strive to find the root cause of an issue it is also important to check whether an existing explanation of the phenomenon is the one that explains all available evidence in the best possible way.


Reading hundreds of books makes you a different person

This post is a summary of the hard copies of the books I read and recommend to read if you have similar interest as I do.

Exceptionally good books about Apollo Lunar Program

  1. Flight – Chris Kraft
  2. Left Brains for the Right Stuff – Hugh Blair-Smith
  3. Sunburst and Luminary – Don Eylse
  4. Apollo 8 – Jeffery Kluger
  5. Apollo 13 – Jim Lovell and Jeffery Kluger
  6. and much more here

Exceptionally good books about Deep Space Exploration

  1. Interstellar Age – Jim Bell
  2. Chasing New Horizons – Alan Stern and David Grinspoon
  3. Mars Rover Curiosity – Rob Manning
  4. The Right Kind of Crazy – Adam Steltzner
  5. and much more here

Exceptionally good books about Aviation

  1. Skunk Works – Ben R. Rich
  2. Have Blue and the F-117: Evolution of the “Stealth Fighter” – Albertt C. Piccirillo and David C. Aronstein
  3. The Power To Fly – Brian H. Rowe
  4. Herman The German – Gerhard Neumann
  5. and much more here

  1. The beginning of Infinity – David Deutsch
  2. The Music of the Primes – Marcus du Sautoy
  3. Prime Obsession – John Derbyshire
  4. Unknown Quantity – John Derbyshire
  5. Infinite Powers – Steven Strogatz
  6. The Joy of x – Steven Strogatz
  7. and much here and here and here

Exceptionally good books about Neuroscience

  1. Mind and The Cosmic Order – Charles Pinter
  2. On Intelligence – Jeff Hawkins

Chasing New Horizons is the book you’ve never heard about

Have you ever heard about New Horizons spacecraft? Did you know that it flew by dwarf planet Pluto in 2015, which was never been done before? Did you know that in 2018 it visited a Kuiper Belt Object Ultima Thule, now officially known as Arrokoth? If you answered no to any of these questions and you are interested in deep space exploration then you may find this post interesting.

The post is a short review of the book Chasing New Horizons : inside the epic first mission to Pluto. If you already read other books on the subject, then this one could resemble to you The Interstellar Age by Jim Bell or The Right Kind of Crazy by Adam Steltzner. If not, then buckle up and lift off!

Back in 2015 Pluto was still a dwarf planet that little was known about except its orbit, its approximate mass and volume, and composition of its atmosphere. No space mission had visited it before, though one of the Voyager probes was planned to visit it, but it didn’t happen. In 2015 with a flyby of the New Horizons spacecraft, Pluto has revealed its secrets and new exciting data became available to scientists and a larger audience.

The book Chasing New Horizons is all about telling the story of how this flyby became a reality and how dedication and perseverance of a group of relentless planetary scientists, engineers and space enthusiasts put their careers on a line to make this happen. It was written by Dr. Alan Stern who was a Principal Investigator (PI) behind New Horizons mission and Dr. David Grinspoon, an astrobiologist, who also took part in the mission. It tells the story of how the mission was conceived back in late 80’s of the previous century, how it took about 27 years from an idea to its implementation and what obstacles the team had to overcome to make it a reality.

What I liked about the book

As I’ve already mentioned in my other post, I find the that the most interesting books are books written not by journalists, but by actual scientists, engineers, project managers and others, who were there, who made the decisions, who first hand experienced what happened before their own eyes.

This book stands out in comparison to similar ones about space, since it is able to engage readers in an exciting story of exploration of new horizons despite the hurdles emerging almost daily along the way, that would prevent other people from proceeding forward. I like how the NASA’s inner politics, engineering tradeoffs and solutions to emerging problems were described in detail in the book. This way a reader gets a better context of how the events unfolded and why.

Significant part of the books is also dedicated to describing day-to-day activities, such as mission planning, spacecraft housekeeping that were carried out to support the ongoing New Horizons journey to Pluto. By providing these details authors made it feel like you actually were there in mission control room observing what had happened in a real time.

All in all, books like this make you appreciate what we people are capable of when we are driven by high goals of exploration, knowledge advancement and pure joy of adventures. And such books make you crave for more.


When math powers algorithms it’s entertaining

I think that I already wrote previously that a couple of years ago I bought the Elements of Programming book by Alexander Stepanov and Paul McJones. The issue was that the book content was hard for me to grasp at the time. I can hardly say that I now understand it better, but now I got where the rationale for that book came from and why it was written the way it was. It turns out the Alexander Stepanov as a mathematician was influenced deeply by Abstract Algebra, Group Theory and Number Theory. The elements of these fields of mathematics can be traced in the Elements of Programming clearly. For example, chapter 5 is called Ordered Algebraic Structures and it mentions among other things semigroup, monoid and group, which are elements in Group Theory. Overall, the book is structured somewhat like Euclid’s Elements, since the book starts from definitions, that are later used to build gradually upon in other chapters of the book.

Which brings me to the main topic of this post. By the way, the post is about a different book Alexander Stepanov wrote with Daniel Rose and that book was created by refining the notes for the Four Algorithmic Journeys course that Stepanov taught in 2012 at A9 company (subsidiary of Amazon). The course is available in YouTube and it consists of three parts each having a number of videos and the Epilogue part.

I highly recommend to watch it to anyone who is curious about programming, mathematics and science in general. The course is entertaining and it talks about how programming, or more exactly algorithms that are used in programming, are based on algorithms that were already known thousands of years ago in Egypt, Babylon etc. Alexander Stepanov has a peculiar way of lecturing and I find this way of presentation funny. The slides for the course and the notes that were aggregated in the Three Algorithmic Journeys book draft are freely available at Alexander Stepanov’s site.

So the book which I want to mention is From Mathematics to Generic Programming which was published in 2014 and is a reworked version of the Three Algorithmic Journeys draft. This is how Daniel Rose describes this in the Authors’ Note of the book.

The book you are about to read is based on notes from an “Algorithmic Journeys” course taught by Alex Stepanov at during 2012. But as Alex and I worked together to transform the material into book form, we realized that there was a stronger story we could tell, one that centered on generic programming and its mathematical foundations. This led to a major reorganization of the topics, and removal of the entire section on set theory and logic, which did not seem to be part of the same story. At the same time, we added and removed details to create a more coherent reading experience and to make the material more accessible to less mathematically advanced readers.

My verdict

As authors mentioned the book is geared towards Generic Programming, but I recommend to read both of them in parallel, since each one complements the other. I think that the Three Algorithmic Journeys is even better than the From Mathematics to Generic Programming (FM2GP). First, it’s free and second, ironically, it’s more generic than the FM2GP book.

Unboxing inventions and innovations

Photo by Kelli McClintock on Unsplash

It seems like there is hardly a person who didn’t hear the phrase “Thinking outside of the box”. As Wikipedia entry says it’s “a metaphor that means to think differently, unconventionally, or from a new perspective.” While it sounds good in theory, it is unclear what one should do to think unconventionally, differently, creatively etc. Only demanding from someone to think outside of the box, doesn’t provide clear guidance on how to achieve this goal.

The same issue happens in education, when a student is taught any subject that requires thinking beyond what was taught in a lesson or a lecture. There are people who can do better than others in such situations and we tend to label them as creative, smart and sometimes genius. But the psychological research into what makes experts experts, for example done by Anders K. Ericsson et al, shows that this has to do more with the way an expert practiced, and not the innate cognitive abilities.

So what makes us creative and can it be taught and learned? The short answer is yes and the rest of this post will try to justify this answer. The question of creative thinking is relevant in most fields of daily life where problems arise and when there is no obvious way of how to solve them. Here we go into realm of innovation and invention. There are many definitions of these two terms, so let me quote one from Merriam-Webster on the difference between invention and innovation

What is the difference between innovation and invention?
The words innovation and invention overlap semantically but are really quite distinct.

Invention can refer to a type of musical composition, a falsehood, a discovery, or any product of the imagination. The sense of invention most likely to be confused with innovation is “a device, contrivance, or process originated after study and experiment,” usually something which has not previously been in existence.

Innovation, for its part, can refer to something new or to a change made to an existing product, idea, or field. One might say that the first telephone was an invention, the first cellular telephone either an invention or an innovation, and the first smartphone an innovation.

Chuck Swoboda, in his The Innovator’s Spirit book also provides detentions for an innovation and an invention that will be discussed in this post and they are

An invention, by definition, is something new—something that’s never been seen before. An innovation, on the other hand, especially a disruptive one, is something new that also creates enormous value by addressing an important problem.

While I do not have any objection to his definition of an innovation, I don’t agree with the definition of an invention. Saying that invention “is something new that’s never been seen before” is too vague a definition to be practical. It takes a quick look into submitted patents to see that there are lots of similar, if not outright identical patents issued for inventions. Which means the definition of invention being something never seen before fails to capture this. Also by the same token invention “being something new” fails too.

But it turns out there is quite precise definition, that exits since 1956, of a technical invention, which was provided by Genrich Altshuller and Rafael Schapiro in a paper About the Psychology of Inventive Creativity (available in Russian) published in Psychology Issues, No. 6, 1956. – p. 37-49. In the paper they mentioned that as a technical system evolves there could arise contradictory requirements between parts of the system. For example, lots of people use mobile phones to browse the internet. To be able to comfortably see the content on the screen of the phone, the screen should be as big as possible, but this requirement clashes (contradicts) with the size of the mobile phone, which should be small enough to be able to hold it comfortably in a hand or carry it in a pocket.

Altshuller and Shapiro defined the invention as a resolution of the contradictory requirements between parts of the system, without having to trade off requirements to achieve the solution. This definition of invention allows to talk precisely about what can be thought as invention and what can’t. Generally speaking, contradictory requirements can be resolved in space, time or structure. For example, returning to the mobile phone example, to resolve the contradiction in structure of the phone, between the size of the screen and the size of the phone there is a functionality that was introduced in mobile phones that allows to screencast the video and audio from a phone to a TV screen using Wi-Fi radio signal. YouTube application on Android phones supports this functionality.

Altshuller wrote a number of books on the subject of creative thinking, particularly books that developed the Theory of Inventive Problem Solving (abbreviated as TRIZ in Russian). In these books the ideas about a contradiction, an invention and an algorithmic approach (ARIZ) to how to invent by solving contradictions in technical problems are elaborated. To name just a few books in chronological order, written by Altshuller

  • How to learn to invent (“Как научиться изобретать”), 1961
  • Algorithm of Invention(“АЛГОРИТМ изобретения”), 1969
  • Creativity as an Exact Science: Theory of Inventive Problem Solving (“ТВОРЧЕСТВО как точная наука: Теория решения изобретательских задач”), 1979

What is important to mention about the books is that they contain systematic, detailed and step by step explanations of how to invent using an algorithm. Lots of examples and exercises for self-study included in them. The books by Altshuller somewhat resemble in their content and in a way of presenting the material books written by George Polya.

Polya being a productive mathematician was also interested in how to convey his ideas in a way that could be easily understood by other people. To this end he wrote a number of books directed to pupils, students, teachers and general audience.

For example, his book How To Solve it first published in 1945 is a step by step instruction set on how to approach mathematical problems in a systematic way, using heuristics that mathematicians accumulated doing math for thousands of years. It very much resembles to me the structure and approach taken in Altshuller’s How to learn to event. Later, Polya wrote two additional books on how mathematicians think and how they arrive to mathematical theories. Each of the books consist of two volumes and they are

What is interesting to mention is that the books written by Polya and Altshuller more than fifty years ago contained very insightful ideas and heuristics to tackle math and inventive problems. But today it’s still difficult to find a widespread adoption of these ideas in education, industry or elsewhere. For example, The Princeton Companion to Applied Mathematics book from 2015 mentions only a rudimentary number of math Tricks and Techniques in the chapter I, Introduction to Applied Mathematics, on pages 39-40, out of 1031 pages.

As well as the general ideas and principles described in
this article, applied mathematicians have at their disposal
their own bags of tricks and techniques, which
they bring into play when experience suggests they
might be useful. Some will work only on very specific
problems. Others might be nonrigorous but able to give
useful insight. George Pólya is quoted as saying, “A
trick used three times becomes a standard technique.”
Here are a few examples of tricks and techniques that
prove useful on many different occasions, along with a
very simple example in each case.

– Use symmetry…
– Add and subtract a term, or multiply and divide by a term….
– Consider special cases…
– Transform the problem…
– Proof by contradiction…
– Going into the complex plane…

As a summary, if you are curious whether it’s possible to learn how to be more creative, inventive or, in general, approach problems in a systematic way, then check the books by Genrich Altshuller and George Polya. They may provide you with just the tools that you were looking for, but didn’t know where to find.

Prime time for Riemann Hypothesis

Books that make you think

I already had a post where I mentioned Reimann Hypothesis after reading The Music of The Primes by Marcus du Sautoy. As far as I recall, I liked the book a lot. It was written for a wide audience and was an easy read. Later, I accidentally found another book on the subject that was intended for more mathematically inclined readers, namely, Prime Obsession by John Derbyshire. Having been fascinated by the subject of prime numbers, the prime number theorem it was a short way to other similar books, such as Prime Number and the Riemann Hypothesis by Barry Mazur and William Stein. Then smoothly transitioning to A Study of Bernhard Riemann’s 1895 Paper by Terrence P. Murphy. Just to conclude with H.M. Edwards Riemann Zeta Function. By the way, the order in which I mentioned the books more or less conveys the mastery of mathematics required to be able to understand what’s going on in them. Which means that two last books require substantial background in calculus and complex analysis. But it’s doable if you have time and prime obsession.

Easy to not-so-easy books

I’d like to provide more details about the books above which I personally read end-to-end and also about ones that I bought, but haven’t finished yet, or only skimmed through.

Actually, I’d rather start with a short description of what the Reimann Hypothesis is by citing the Millennium Problems web site that describes a number of 21st century math problems that can bring you 1,000,000 USD for solving any of them.

So the Riemann Hypothesis is

Source: Millennium Problems

Some numbers have the special property that they cannot be expressed as the product of two smaller numbers, e.g., 2, 3, 5, 7, etc. Such numbers are called prime numbers, and they play an important role, both in pure mathematics and its applications. The distribution of such prime numbers among all natural numbers does not follow any regular pattern.  However, the German mathematician G.F.B. Riemann (1826 – 1866) observed that the frequency of prime numbers is very closely related to the behavior of an elaborate function
    ζ(s) = 1 + 1/2s + 1/3s + 1/4s + …
called the Riemann Zeta function. The Riemann hypothesis asserts that all interesting solutions of the equation
    ζ(s) = 0
lie on a certain vertical straight line.
This has been checked for the first 10,000,000,000,000 solutions. A proof that it is true for every interesting solution would shed light on many of the mysteries surrounding the distribution of prime numbers.

Having said that now let’s look at the books.

The Music of The Primes

The book was written by Marcus du Sautoy in 2003. As I mentioned, the book does not require a degree in mathematics to be able to understands what it’s talking about. The material in it is interesting and engaging. In addition to covering, The Prime Number Theorem and Reimann Hypothesis it also covers other topics related to prime numbers usage, like cryptography. It can be a good starting point into a long journey with prime numbers.

Prime Numbers and the Riemann Hypothesis

The book was written by Barry Mazur and William Stein in 2016. It has four parts, where first part intended for a wide audience, and each consecutive part presuppose gradually increasing knowledge of math to be able to grasp the content. What’s interesting about this book that it sheds light on some interesting connections between Riemann Hypothesis and Fourie Transform, which electrical engineers can relate to. Also the book is quite short.

Prime Obsession

The book is written by John Derbyshire in 2003 (same year when Marcus du Sautoy wrote his book). This book has two parts: The Prime Number Theorem and The Riemann Hypothesis, but it goes into nitty gritty details of both of them and don’t allow a reader relax too much. Following the content of the book could require some math background and at times some calculations to be sure that one gets proper understanding of what’s going on. Personally, out of all the books I mention in this post I find this one the most engaging.

A Study of Bernhard Riemann’s 1859 Paper

The book is written by Terrence P. Murthy in 2020. It is one of the two most technical books on the subject that requires substantial background in mathematics. The book provides Riemann’s 1859 paper in full in English and then systematically goes and provide proofs for all relevant parts of Riemann’s paper in subsequent chapters (except for the Riemann Hypothesis itself :). I think Terrence Murphy summarizes who this book is intended for in his own words the best:

Who Is This Book For?
If you are reading this, chances are you have developed a keen interest in the Reimann Hypothesis. Maybe you read John Derbyshire’s excellent book Prime Obsession. Or perhaps you read that the Riemann Hypothesis is one of the seven Millennium Prize Problems, with a $1 million prize for its proof.
To advance your knowledge substantially beyond Derbyshire’s book, you must have (or develop) a good understanding of the field of complex analysis (we will describe that as knowledge at the “hobbyist” level). So, this book is probably not for you unless you are at least at the hobbyist level.

Riemann Zeta Function

The book was written by H.M. Edwards in 1974. I’d rather describe it by continuing the citation from the previous book by Terrence P. Murthy:

After developing an interest in the Riemann Hypothesis, the first stopping point for many is Edwards’ excellent book Riemann’s Zeta Function. The Edwards book provides a wealth of information and insight on the zeta function, the Prime Number Theorem and the Riemann Hypothesis. And that brings us to the next group of people who do not need this book. If you eat, sleep and breath complex analysis, we will say you are at the “guru” level. In that case, the Edwards book will be easy reading and will provide you with the information you need to substantially advance your knowledge of Riemann’s Paper and the Riemann Hypothesis.

As you may tell, “guru” level in math is required to fully digest this book. So it want be easy to say the least.

A good introductory paper on the subject

If you are interested in a short, but engaging introduction into what are Prime Number Theorem and the Riemann Hypothesis I recommend to read Don Zagier’s The First 50 Millions Prime Numbers paper, published in New Mathematical Intelligencer (1977) 1-19.

If you know Russian you can read the same paper that was published in Russian only in 1984 in the Uspekhi Matematicheskikh Nauk journal.

Parting words

All in all, these five books can take a good chunk of a full year to work through or possibly even more, especially the last two. So what are you waiting for? Life is too short to waste it on watching TV series or YouTube nonsense. The treasures of math and deeper understanding of the world are awaiting for ones who know where to look for.

Errata for the Thinking Better book and some commentary

This post is a continuation of the previous one about Thinking Better book (ISBN-13 ‏: ‎978-1541600362) by Marcus du Sautoy published in North America by Basic Books.

It seems like I was too eager to praise the book after reading just a few dozens of pages. Even though, on average the book is interesting to read, there were a number of things that could make the content of the Thinking Better even better. For example, having more diagrams accompanying the explanations for various concepts could be helpful. Having footnotes to provide more details or sources for cited papers could be helpful too etc.


Having found a number of possible mistakes in the book I was sure that notifying Basic Books publishing about them would be valuable and they’d be happy to review and, if required, correct the content of the book. But since I’ve sent an email to the customer support there, I didn’t hear back. Below comes the table of potential issues that I was able to find while reading the book.

Page #Actual contentSuggested contentComments
p.107However, I’m going to give Eratosthenes high marks for his calculation for the circumference of the earth because it is inspired.However, I’m going to give Eratosthenes high marks for his calculation of the circumference of the earth because it is inspiring.This seems like a spelling mistake.
p. 129It will also be to do with the nature of the rock, if the rock is very non-friable and firm.It will also have to do with the nature of the rock, if the rock is very non-friable and firm.This seems like a spelling mistake.
p. 149Figure 5.9. Feynman diagram of the interaction between an electron and a positron

The right diagram of electron-positron scattering can be found at the link below
Bhabha scattering.
You can tell it by the sign above ‘e’. Electron has ‘e-’, while positron ‘e+’.
The diagram in the book is for interaction between an electron and an electron namely,
Møller scattering

Some other suggestions

The suggestions below are based on my experience with reading dozens of popular-science books on mathematics, physics neuroscience and biology.

Diagram and Figures

The book has a number of diagrams in each chapter. Though most of them are helpful, some are not. The main issue I see with the diagrams in the book is that even though they are numbered, just like in the table above, that number isn’t referenced in the body of the book. This makes it hard to related the diagram to the content where it was mentioned.

There are places that I would add diagrams to clarify the content, since without having a diagram it is difficult to imagine what the text represent. Or it takes quite some time to understand author’s intent. For example, Figure 3.2. Six pyramids make a cuboid on page 84, is very confusing to say the least (no diagram is shown in my post due to copyright issues).

One additional example is when the sieve of Eratosthenes was mentioned on page 106. Usually, this method is visualized by a diagram, which helps a lot in understanding it. For a good visual example refer to the chapter 7 in the Prime Obsession book by John Derbyshire. Also check Wikipedia article about the sieve of Eratosthenes.

Missing footnotes or notes

I agree that not all popular science books have footnotes or notes, but this particular book mentions a number of other books, papers and authors. Having footnotes or notes at the end of the book could have been beneficial to a curious reader. One of the papers cited in the book, had the names of the authors incorrect. For example, in the chapter 9, on page 261 it is written

Two mathematicians Duncan Watts and Steve Strogatz, discovered the secret, which they published in a paper in Nature in 1998.

The paper was Collective dynamics of ‘small-world’ networksNature 393, 440–442 (1998). And the authors were Duncan Watts and Steven Strogatz.

Missing bibliography

There are no references in the book. Bibliography is also not a mandatory part of popular science books, but in most of the ones I read it was there and helped find similar books on the subject or get more details about specific topics mentioned in the book.

Too harsh a criticism?

All in all, despite the drawbacks I mentioned above the book was worth reading. I think my criticism has to do with that fact that the Music of The Primes book, also written by Marucs du Satouy in 2003 didn’t have most of the issue I brought in this post.

What the hack is Rule 30? Cellular Automata Explained


If you ask the same question, what is this Rule 30, then you are not alone. This rule is related to one-dimensional Cellular Automata introduced by Stephen Wolfram in 1983 and later described in his A New Kind Of Science book. Even though, I skimmed through this book previously, I was never able to understand what was it all about. It had some neat diagrams, but I didn’t try to understand how the diagrams were generated. This changed a day ago when I watched an interesting interview that Lex Fridman had with Stephen Wolfram, where they discussed among other things Rule 30, which was the one that Wolfram described first. This rule is capable of generating a complex behavior even though the rule itself is very simple to define.

Elementary Cellular Automaton

The Elementary Cellular Automaton consists of a one-dimensional array of cells that can be in just two sates, namely, black or white color. The cellular automaton starts from initial state, and then transition to the next state based on a certain function. The next state of the automaton is calculated based on the color of current cell and its left and right neighbors’ colors. By the way, that transition function, gives its name to the cellular automaton rule, just like Rule 30.

Rule 30 transition function

Current Sate111110101100011010001000
Next state00011110

Where, for example, the binary digits ‘111’ in the first column indicate the black color of the left, current and right cells, and the values, ‘0’ or ‘1’ indicate what will be the color of the current cell in the next state (iteration) of the automaton. If we write down all the the binary values of the next state together as a single 8 digit binary number, which is 00011110 and convert it to a decimal number we get 30, and hence the name of the Rule 30. In a Boolean form this transition function is

(left, current, right) -> left XOR (current OR right)

We’ll use this function later in the C++ implementation of the Rule 30.

This is how the output from Rule 30 looks like after 20 and 100 steps respectively.

source: WolframAlpha

How to generate Rule 30?

It is easy to implement the Rule 30 using a 64 bit integer in C++. The only drawback is that we can get only 32 steps with the implementation below taken from Wikipedia.

Note: If this is a little bit to much for you now, then skip to the next part where we’ll use WolframAlpha to program it for us.

In the code below a 64 bit integer is used to generate an initial state using a bit mask in line 6. Then the outer for loop generates 32 steps of the Rule 30 by applying the transition function in line 19. The inner loop generates the black (using character ‘1’) and white (using character ‘-‘) colors using state bit mask.

#include <stdint.h>
#include <iostream>

int main() {
 // This is our bit mask with the 32 bit set to '1' for initial state
  uint64_t state = 1u << 31;

  for (int i = 0 ; i < 32 ; i++) {

    for (int j = sizeof(uint64_t) * 8 - 1 ; j  >=  0 ; j--) {
      // Here we decide what should be the color of the current cell based on the current state bit mask.
     // Bitwise operator is used to accomplish this efficiently
      std::cout << char(state  >>  j & 1 ? '1' : '-');
    std::cout << '\n';
    // This is just the (left, current, right) -> left XOR (current OR right) functioned mentioned previously
   // Bitwise operators  are used to accomplish this efficiently
    state = (state >> 1) ^ (state | state << 1);

It is possible to run this code in the online C++ compile. Just click on the link and then click on the green Run button at the top of the screen. The result looks similar to below.

The full output for 32 steps looks like this


Compare the image above to the one generated using WolframAlpha symbolic language in the Wolfram Notebook.

Using WolframAlpha to generate Rule 30

WolframAlpha is a computational knowledge engine developed by Wolfram Research. It is embedded in Mathematica symbolic language and it has a declarative programming style. Which means that you specify what you want to be done instead of how it should be done.

For example, to generate Rule 30 and visualize it one simple writes

ArrayPlot[CellularAutomaton[30, {{1},0}, 64]]

where CellularAutomaton function generates 64 states of the automaton, starting with a one black cell in accordance with the Rule 30 generation function, and ArrayPlot function prints the result.

And the output is

Please follow the this link to the Wolfram Notebook where the various Elementary Cellular Automata Rules are generated.


Playing with cellular automat rules seems like an interesting game to play, plus doing it using WolframAlpha language is a piece of cake.

The Fabric of Reality : 24 years later

The Fabric Of Reality, the first book by David Deutsch, was written back in 1997. It have been twenty four years since then and it is interesting to see how the book feels to be read in 2021. Yes, you are right 24 years has passed since then. Even though this was the first book David Deutsch wrote, the first book I read was his second. It was The Beginning of Infinity that I read and found it very insightful that caused me to check other books David Deutsch wrote.

The Fabric of Reality describes four strands:

the quantum physics of the multiverse, Popperian epistemology, the Darwin-Dawkins theory of evolution and a strengthened version of Turing’s theory of universal computation.

The Fabric of Reality, p. 366

It provides a unified approach of how the world could be explained and apprehended. The book uses the Popperian explanation based approach to scientific understanding of the world. The first chapters of the book provide a reader with a gentle introduction why the Inductivism is a dead end as a scientific approach and then transitions to showing the benefits of using explanation based view of scientific discovery.

Since, I first read The Beginning of Infinity which was written in 2011 it was nice to know that it builds on the previous book and expands on some of its topics, literary, that science is about providing explanations to why things are the way they are, instead of claiming that science is about inferring theories from data observed in experiments.

In my opinion, two of the more interesting parts were about the objective existence of the multiverse, which is the only feasible explanation of the interference of particles in two slit experiment, and the universal image generator and universal virtual-reality generator. Back in 1997 computers were quite slow in comparison to what we got nowadays. Graphical Processing Units (GPU) as we know them now were non-existent, but nevertheless David Deutsch described his thoughts on the subject of virtual realty in such a way that it is still refreshing to read it when Oculus Rift – VR Headset and Microsoft HoloLense are here.

David Deutsch’s take on that mathematics is not some abstract subject detached from reality, but to the contrary a filed of study that is about physically existing entities at first sounds daring. But if you think about it you’ll see that we and mathematicians live in a physical world, and think using physically existing brains that are responsible for us to have thoughts and intuitions about mathematical objects, and imagination in general.

The book is not that easy to read, especially the chapters about spacetime and time travel, which were quite convoluted at times. Nevertheless, the book is worth reading, since it provides ample food for thoughts and have some daring unification of theories that on the surface seem not connected.

If you follow David Deutsch’s activities you could have known that some theories described in the book made it into Constructor Theory that David Deutsch and Chiara Marletto developing for about a decade. Particularly, the chapter about The Nature of Mathematics talks about a proof being a physical process or a type of computation.

Constructor theory expresses physical laws exclusively in terms of what physical transformations, or tasks, are possible versus which are impossible, and why. By allowing such counterfactual statements into fundamental physics, it allows new physical laws to be expressed, for instance those of the constructor theory of information.


All in all, The Fabric of Realty book still feels like a contemporary book. Its content is still fresh and worth reading. The book is quite independent from its successor The Beginning of Infinity, but both are sources for interesting and insightful ideas and worth your time.

Infinite Powers to explain

This post continues a series of post were I provide my thoughts on books that I deem worth reading.

This time it is the Infinite Powers book by Steven Strogatz that takes the reader into a realm of taming infinity to grasp nature’s secrets. The title of the book ambiguously plays on a method of using power series to approximate curves and powers which such a method, when exercised skillfully, brought to humankind. The book artfully describes how deferential and integral calculus was developed from Archimedes efforts to measure quadrature of curves through Descartes and Fermat, culminating in calculus invented by Isaac Newton in England and Gottfried Wilhelm Leibniz in Germany working independently. Lots of examples are provided showing how calculus is essential in many of inventions that are an important part of the modern civilization, be it GPS navigation, microwave ovens or the development of effective treatments to viruses induced diseases.

The power of insight

What I liked about the book is how the author is capable of explaining mathematical concepts, that usually require a solid mathematical background, mostly using analogies and down to earth explanations. Though, what I also liked that a mathematically inclined readers were not ignored, since what could, possibly, explained using proper mathematical notation was described as such. It is difficult to appreciate the beauty of calculus without using the mathematical symbols standing for derivative (differentials) and integral, that are so familiar to many people. I should say any person who studied at school should be familiar with them, and if not, the book provides a gentle and very intuitive explanation of what derivative stands for and why it is required, the same goes for integral.

As an example of a good explanation, I want to emphasize a Pizza Proof that is used to find an area of a circle. Since I recalled the formula for it being A = pi * R2, it was very interesting to see how the Pizza Proof showed clearly that A = R*C/2, where R is a radius of a circle and C its length. I think since school time I was curious where the power of two came in the area formula that I remembered. So, using the Pizza Proof result and substituting the C in it with the known formula for the length of the circle which is C = pi * 2R (which derivation was also explained in the book ) we get A = pi * R2. It was a nice insight, first one of many that the book provided.

I also liked how the method used by Fermat to find the maximum value of a curve, using a smart approach of double intersection, provides a correct result similar to what using derivatives would give. Another example, that was also insightful showed how the concept of derivative and curve interpolation could be used to find patterns in the seasonal changes of day length compared to the rate of change of day length, which both could be approximated by a sinusoidal function with a quarter cycle shift (pi/4 phase shift).

One can’t explain math without using it

Importantly, the concept of derivative was developed and shown very clearly using proper mathematical notation which should be clear even to readers coming from non-mathematical background, since the explanations gradually and systematically build up from simple to more advanced, as a reader progresses through the book (which means that the book should be read continuously). Then the concept of integral is shown quite remarkably well and the two concepts combined to showcase the Fundamental Theorem of Calculus about the duality of derivatives and integrals.

As I always mention, this book passes the test of providing references to other resources on the subject, like original papers of Newton or The Archimedes Palimpsest, which I was unaware of before reading the book.


It could be that reading Infinite Powers would provide your with appreciation of how calculus is essential in our day to day life and understanding of the world around us. And, maybe, show why mathematics could be beautiful in its own way and also applicable and useful, which could be an unexpected revelation to some.

Other resources