<?xml version="1.0" encoding="UTF-8"?>
<rss  xmlns:atom="http://www.w3.org/2005/Atom" 
      xmlns:media="http://search.yahoo.com/mrss/" 
      xmlns:content="http://purl.org/rss/1.0/modules/content/" 
      xmlns:dc="http://purl.org/dc/elements/1.1/" 
      version="2.0">
<channel>
<title>Maximum Entropy</title>
<link>https://michielstock.github.io/blog/</link>
<atom:link href="https://michielstock.github.io/blog/index.xml" rel="self" type="application/rss+xml"/>
<description>Blog by Michiel Stock on data science, mathematics, computing, and books.</description>
<generator>quarto-1.9.36</generator>
<lastBuildDate>Tue, 23 Dec 2025 00:00:00 GMT</lastBuildDate>
<item>
  <title>Algorithmic Information Dynamics</title>
  <dc:creator>Michiel Stock</dc:creator>
  <link>https://michielstock.github.io/blog/posts/2025/2025-12-23-AID/</link>
  <description><![CDATA[ 





<p>author: Hector Zenil, Narsis Kiani &amp; Jesper Tegner</p>
<p><img src="https://m.media-amazon.com/images/S/compressed.photo.goodreads.com/books/1681108192i/75308279.jpg" class="img-fluid"></p>
<section id="book-summary" class="level2">
<h2 class="anchored" data-anchor-id="book-summary">Book summary</h2>
<p>To explain the world, one needs a causal model. This means that when observing data, a DNA string, a time series, a text, a graph, etc, one has to find the process that can generate this data. Any data-generating model is, in practice, a computer program. For any piece of data, there are an infinite number of programs that can generate it. For example, a source code file containing a print statement that outputs our data does the trick. It is immediately clear that such a program would not satisfy us, nor would it explain the data. Intuitively, when you have a large dataset, which can be generated with a small program or model, it holds a lot of explanatory power. This is the idea behind Occam’s razor: preferring the simplest model for one’s data. Conversely, if it is not possible to find something smaller than just printing your data (meaning the length of your source code is about the length of the data), it might be an indication that your data is “random”. A simple example is the number <img src="https://latex.codecogs.com/png.latex?%5Cpi">, of which a simple program can generate as many digits as one would like, whereas a very long series of die roll outcomes can only be recorded, not computed. This is the idea behind Algorithmic Information Dynamics, the framework that Zenil and co-authors propose for understanding (living) systems. The keyword is compression: reducing data as much as possible with a computer program.</p>
<p>The framework presented in this book is based on algorithmic information theory, rather than statistical information theory, which merely searches for repetitions in the data, rather than general structures. <a href="https://en.wikipedia.org/wiki/Algorithmic_information_theory">Algorithmic information theory</a> (AIT) is a surprisingly simple concept to grasp the main idea, but it has profound implications for computer science, mathematics, physics, biology, and science in general. It builds upon a Turing machine, the mathematical idealization of a computer. Any computer that can run a programming language such as Python can be used for the thought experiment, as it is a good approximation of the mathematical ideal. Any input to a computer is merely a text file (e.g., running a Python script), and there is only a finite number of source code files of a given length (2 to the power of the file size in bits). Rather than executing a specific program, we might run <strong>all</strong> possible source code files in lexicographic order. We start with the shortest file that runs (likely something like a=1) and record the output. Here, we can skip files with syntactic errors, as these are easy to detect. Each program will have an output, which will initially be simple, but once it is long enough to contain for and while loops, the output might be substantially longer than the input source code. It does not take very long programs to generate mathematical constants or things like palindromes. If we run enough programs, anything will be generated, ranging from computer simulations of atomic physics to all of Shakespeare’s works to a rendering of Avatar 4: Earth and Bone. This well-defined process will produce a distribution over all possible data, which we can think of as a universal prior distribution. Whatever we see earlier is simple (generated by short programs), while later outputs are more complex. Though generating a movie will require a complex computer program, the generating program is no doubt vastly shorter than the final movie file. Interestingly, there are only a limited number of short programs (say, of a megabyte), while there are many, many larger files (say, of a Gigabyte). This means that most data files cannot have a short generating program, making them algorithmically random. Every piece of data or media we like is a fleck of structure in a huge beach of randomness.</p>
<p><img src="https://michielstock.github.io/blog/posts/2025/2025-12-23-AID/turing.png" class="img-fluid"></p>
<p>There are two critical remarks about the explanation above, one rather nice and the other not so much. My thought experiment assumed that we run all Python programs; does everything still hold if we use C, Rust, or Julia? What about using a more rigorously defined, but much less enjoyable-to-program, Turing machine? The good news is that yes, it is all (approximately equivalent). The complexity of outputs is the same, whether they are run in Python or some other language, because they are all Turing equivalent and have the same power. This is called the Invariance Theorem. Data that is simple (can be generated by a short input program) in Python will also be simple on any other computing platform. Measured in code length, there will only be a constant conversion factor needed to translate the code from language A to language B. This means that complexity, measured in minimal code length, is something universal.</p>
<p>Now, for the bad news. Running all computer programs up to a certain length might, while not possible in practice, be conceptually feasible by assuming a very large amount of computational resources. Sadly, it cannot even be done in theory, as some of the programs we will encounter might not even run very long; they might run forever and never halt! Though it is possible to sometimes detect whether a program will run forever (for example, it contains <code>while True</code>), in general, the logic might be so complex that it is impossible to determine. This is the famous <a href="https://en.wikipedia.org/wiki/Halting_problem">Halting Problem</a>, which states that no program can determine whether any program will terminate within a finite time or run forever. So, AIT is simple to understand, universal, well-defined, and computationally intractable. Much research is now being conducted on how to use it to solve practical problems.</p>
<p>To put it a bit more rigorously, the Kolmogorov complexity of a string <img src="https://latex.codecogs.com/png.latex?s"> is defined as the shortest program <img src="https://latex.codecogs.com/png.latex?p"> to generate it using a Turing machine <img src="https://latex.codecogs.com/png.latex?U">:</p>
<p><img src="https://latex.codecogs.com/png.latex?K(s):=%20%5Cmin_%7Bp:U(p)=s%7D%20%7Cp%7C%5C,."></p>
<p>Algorithmically random strings then have: <img src="https://latex.codecogs.com/png.latex?K(s)%5Capprox%20%7Cs%7C">. We can link probability (and hence priors) to algorithmic complexity by evaluating random programs in a Monte Carlo style! This is done by randomly generating program strings and evaluating them, yielding the algorithmic probability:</p>
<p><img src="https://latex.codecogs.com/png.latex?m(s)%20:=%5Csum_%7Bp:U(p)=s%7D%20%5Cfrac%7B1%7D%7B2%5E%7B%7Cp%7C%7D%7D%5C,."></p>
<p>Though strings can be generated by programs of many different lengths, the shortest ones will dominate this probability, so we have that</p>
<p><img src="https://latex.codecogs.com/png.latex?K(s)%20%5Capprox-%5Clog%20m(s)%5C,,"></p>
<p>which is called the coding theorem. The difference is merely factor of <img src="https://latex.codecogs.com/png.latex?%5Cmathcal%7BO%7D(1)">.</p>
<p>The authors of Algorithmic Information Dynamics use these ideas to estimate the Kolmogorov complexity of sequences and images. For small datasets, they use the Coding Theory Method (CTM), which is based on the above coding theorem. They run millions of programs (using execution-time thresholds to terminate those that might run forever) to create a database of how frequently each output is obtained. These probabilities can be turned into good estimates of the Kolmogorov complexity. For larger pieces of data (DNA strings or images), they glue these complexities of the smaller pieces together using statistical information theory, using the Block Decomposition Method (BDM) in a divide-and-conquer fashion. Based on CTM, the BDM method is defined as</p>
<p><img src="https://latex.codecogs.com/png.latex?%5Ctext%7BBDM%7D(s)=%20%5Csum_i%5Ctext%7BCTM%7D(s_i)+%5Clog%20n_i"></p>
<p>where we decompose the string <img src="https://latex.codecogs.com/png.latex?s"> into substrings <img src="https://latex.codecogs.com/png.latex?s_i">, where we compute the complexity using CTM and correct for repetitions using <img src="https://latex.codecogs.com/png.latex?n_i"> (we only have to invent a substring once). In other words, a long string is simple if it is made up of simple and repeating substrings!</p>
<p>With a practical way of assessing complexity behind the belt, it is now possible to reason about causality and the generative process of objects. The main idea they use it to break the data up into several pieces (for example, removing a link in a network) and see how this influences the complexity. This can be used to generate causally independent subnetworks into graphs using a perturbation analysis. One could imagine using this to segment genomes to identify evolutionary and functionally distinct regions, or using it to explore images. The strength of this work is that it turns the theoretically sound AIT framework into a practical and powerful tool for analysing data. It is a formal, universal, and practical approach to model discovery, hypothesis testing, and causal analysis. Expanding on this, exploring how it can be used to analyse biology (e.g., finding causal associations, understanding evolution…) could be highly fruitful. I am still not entirely convinced that AIT is the correct way to approach such a problem, as it assumes the existence of a highly complicated object - a Turing machine - as a precondition for generating data. Rather than exploring the space of random programs (which can only be short), it might be more relevant to explore the program space in a more systematic way, as in generative programming and program synthesis. It does seem that finding algorithmic descriptions of complex objects is the way forward.</p>
</section>
<section id="who-is-this-for" class="level2">
<h2 class="anchored" data-anchor-id="who-is-this-for">Who is this for?</h2>
<p>This is a rather technical book. The first parts give a general philosophical overview of the different approaches of science and explain the difference between AIT and statistical information theory well. The remainder builds upon the more extended framework, which is still very novel and might need some iterations to be in its most accessible form.</p>


<!-- -->

</section>

 ]]></description>
  <category>books</category>
  <category>maths</category>
  <category>computing</category>
  <category>data science</category>
  <guid>https://michielstock.github.io/blog/posts/2025/2025-12-23-AID/</guid>
  <pubDate>Tue, 23 Dec 2025 00:00:00 GMT</pubDate>
</item>
<item>
  <title>Lagrangian Mechanics in MTK.jl</title>
  <dc:creator>Michiel Stock</dc:creator>
  <link>https://michielstock.github.io/blog/posts/2025/pendulums/</link>
  <description><![CDATA[ 





<p>This post is a <a href="https://plutojl.org/">Pluto.jl</a> notebook exploring Lagrangian mechanics applied to pendulum systems, using <a href="https://github.com/SciML/ModelingToolkit.jl">ModelingToolkit.jl</a>.</p>
<p><a href="notebook.html" class="btn btn-primary">View the interactive notebook</a></p>


<!-- -->


 ]]></description>
  <category>julia</category>
  <category>maths</category>
  <guid>https://michielstock.github.io/blog/posts/2025/pendulums/</guid>
  <pubDate>Tue, 17 Jun 2025 00:00:00 GMT</pubDate>
</item>
<item>
  <title>Walk on Spheres Algorithm</title>
  <dc:creator>Michiel Stock</dc:creator>
  <link>https://michielstock.github.io/blog/posts/2025/WoS/</link>
  <description><![CDATA[ 





<p>This post is a <a href="https://plutojl.org/">Pluto.jl</a> notebook implementing the Walk on Spheres algorithm, a Monte Carlo method for solving Laplace’s equation without meshing.</p>
<p><a href="notebook.html" class="btn btn-primary">View the interactive notebook</a></p>


<!-- -->


 ]]></description>
  <category>julia</category>
  <category>maths</category>
  <guid>https://michielstock.github.io/blog/posts/2025/WoS/</guid>
  <pubDate>Tue, 27 May 2025 00:00:00 GMT</pubDate>
</item>
<item>
  <title>Modeling and Simulation in Python</title>
  <dc:creator>Michiel Stock</dc:creator>
  <link>https://michielstock.github.io/blog/posts/2023/2023-10-07-ModSim-python/</link>
  <description><![CDATA[ 





<p>author: Alan B. Downey</p>
<p>related books: <a href="../../../../posts/2023/2023-09-20-thinking_in_systems/">Thinking in Systems</a></p>
<p><img src="https://greenteapress.com/wp/wp-content/uploads/2023/05/modsimpy_cover.png" class="img-fluid"></p>
<section id="the-main-takeaway" class="level2">
<h2 class="anchored" data-anchor-id="the-main-takeaway">The main takeaway</h2>
<p>This book introduces the main concepts of modeling and simulation in a practical, hands-on, case study-based fashion using Jupyter notebooks. The author keeps the mathematics to the bare minimum (it only requires a superficial knowledge of derivatives) while having the applications area as broad as possible. It covers first-order differential equations (growth), simple systems (the SIR model and an insulin model) and several second-order systems based on Newton’s second law (rolling toilet paper and throwing a baseball). Most examples are solved using custom ModSim software that uses a finite-step method. The author also introduces other tools, such as solving differential equations in Sympy and root-finding methods for optimization and parameter finding.</p>
</section>
<section id="who-is-this-for" class="level2">
<h2 class="anchored" data-anchor-id="who-is-this-for">Who is this for?</h2>
<p>I found this book while researching how to develop a more practical version of the modeling course I teach (that now only covers ODEs). This book is very introductory and likely won’t appeal to those who have advanced mathematics courses at some point. However, for those who did not, it is a very accessible introduction to modeling that can immediately be used for a wide range of systems. The author also has a lot of notebooks online for the exercises.</p>


<!-- -->

</section>

 ]]></description>
  <category>books</category>
  <category>datascience</category>
  <category>computing</category>
  <guid>https://michielstock.github.io/blog/posts/2023/2023-10-07-ModSim-python/</guid>
  <pubDate>Sat, 07 Oct 2023 00:00:00 GMT</pubDate>
</item>
<item>
  <title>Thinking in Systems: A Primer</title>
  <dc:creator>Michiel Stock</dc:creator>
  <link>https://michielstock.github.io/blog/posts/2023/2023-09-20-thinking_in_systems/</link>
  <description><![CDATA[ 





<p>author: Donella Meadows</p>
<p>related books: <a href="../../../../posts/2022/2022-03-20-how_the_world_really_works/">How the World Really Works</a>, <a href="../../../../posts/2022/2022-01-07-antifragile/">Antifragile: Things That Gain From Disorder</a></p>
<p><img src="https://images-na.ssl-images-amazon.com/images/S/compressed.photo.goodreads.com/books/1390169859i/3828902.jpg" class="img-fluid"></p>
<section id="the-main-take-away" class="level2">
<h2 class="anchored" data-anchor-id="the-main-take-away">The main take-away</h2>
<p>A system is a set of interconnected things in such a way that they produce their own behaviour. Outside forces can influence it, though internal feedback is more likely to drive it — a living cell, a forest or a city are good examples of systems. If we want to understand and manage such systems, it is better to act on the system rather than on external disturbances and perturbations. For example, to keep your garden free from pests, it is better to create enough diversity to provide niches for predators such as ladybugs rather than to try to eradicate them using pesticides directly.</p>
<p>Systems that work well (strong economy, good farmland, productive research group) usually have the following properties: 1. they are resilient and robust to changes; 2. they show a high degree of self-organization; 3. they are hierarchically organized.</p>
<p>When systems fail, there is usually also a system solution. For example, when dealing with the tragedy of the commons, you can change incentives by educating, regulating or privatizing.</p>
</section>
<section id="who-is-this-for" class="level2">
<h2 class="anchored" data-anchor-id="who-is-this-for">Who is this for?</h2>
<p>For all scientists and engineers, the book gives new mental tools to understand the world around you. It is even helpful for investing, policy-making and management. It uses virtually no mathematics, so it is accessible to everyone. A gem!</p>


<!-- -->

</section>

 ]]></description>
  <category>books</category>
  <category>maths</category>
  <category>biology</category>
  <guid>https://michielstock.github.io/blog/posts/2023/2023-09-20-thinking_in_systems/</guid>
  <pubDate>Wed, 20 Sep 2023 00:00:00 GMT</pubDate>
</item>
<item>
  <title>On betting optimally</title>
  <dc:creator>Michiel Stock</dc:creator>
  <link>https://michielstock.github.io/blog/posts/2022/ergodicity/</link>
  <description><![CDATA[ 





<p>This post is a <a href="https://plutojl.org/">Pluto.jl</a> notebook on ergodicity economics — why maximizing expected value can ruin you, and how to bet optimally instead.</p>
<p><a href="notebook.html" class="btn btn-primary">View the interactive notebook</a></p>


<!-- -->


 ]]></description>
  <category>julia</category>
  <category>maths</category>
  <guid>https://michielstock.github.io/blog/posts/2022/ergodicity/</guid>
  <pubDate>Mon, 05 Dec 2022 00:00:00 GMT</pubDate>
</item>
<item>
  <title>The Origins of Evolutionary Innovations</title>
  <dc:creator>Michiel Stock</dc:creator>
  <link>https://michielstock.github.io/blog/posts/2022/2022-10-16-evolinnov/</link>
  <description><![CDATA[ 





<p>author: Andreas Wagner</p>
<p>related books: <a href="https://www.goodreads.com/book/show/52219273-how-innovation-works">How Innovation Works</a>, <a href="https://www.goodreads.com/book/show/163233.Robustness_and_Evolvability_in_Living_Systems">Robustness and Evolvability in Living Systems</a>, <a href="https://www.goodreads.com/book/show/783559.The_Origins_of_Order">The Origins of Order</a>, <a href="../../../../posts/2021/2021-05-10-nonobjective/">Why Greatness Cannot Be Planned</a></p>
<p><img src="https://i.gr-assets.com/images/S/compressed.photo.goodreads.com/books/1347756384l/13073820.jpg" class="img-fluid"></p>
<section id="the-main-takeaway" class="level2">
<h2 class="anchored" data-anchor-id="the-main-takeaway">The main takeaway</h2>
<p>Evolution is one of the most potent forces in the universe, having created everything in the biosphere and, some would argue, was the invisible hand behind all our technological innovations. Variation and selection intuitively explain how phenotypes are optimized to their environment, e.g., an enzyme that becomes more efficient or a bee’s mouthpiece that evolves to match a flower’s shape. However, it is less clear how <em>new</em> phenotypes (e.g.&nbsp;a new enzyme function or a new morphology) arise. Wagner, who previously wrote a brilliant book on robustness and evolution, outlines a theory on the evolution of biological innovations. He mainly studies three prototypical biological systems: gene regulatory networks, metabolic networks and sequences such as RNA and proteins. The implications go far beyond these, reaching higher functions and even the evolution of technology.</p>
<p>The main intuition pump in this work is the <em>genotype network</em>, a graph containing all genotypes connected by a mutation (i.e.&nbsp;that can be reached in a single step) and producing the same phenotype. So moving on this graph network via mutations is <em>neutral</em>; selective forces are blind to it. Wagner goes to great lengths to describe the properties of these graphs, both from a theoretical point of view and based on hundreds of empirical experiments on diverse biological systems. The networks are usually vast, covering large fractions of the genotype space. Different genotype networks are also closely intertwined, allowing for quickly hopping from one phenotype to a new one.</p>
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><img src="https://michielstock.github.io/blog/posts/2022/2022-10-16-evolinnov/genotype_network.jpg" class="img-fluid figure-img"></p>
<figcaption>Cartoon of a genotype network. Colored markers are novel phenotypes.</figcaption>
</figure>
</div>
<p>Genotype networks are exquisite concepts to think about evolution, much more profound than fitness landscapes. The latter only conveys a single, one-dimensional property, fitness, whereas genotype networks paint a picture of many different phenotypes without imposing an ordering. Genotype networks allow the exploration of neutral mutations that can lay the foundation for later beneficial mutations. Wagner outlines the various implications: - Robustness occurs in regions where the genotype network is dense, so mutations are likely to preserve the phenotype. Such regions are found to be highly evolvable. - Recombination allows making large jumps in the genotype network. - Duplication is a way to explore multiple paths in the genotype network simultaneously.</p>
<p>The most profound insight of the book is that evolution is more than mere selection of the fittest. Self-organization is equally important, as this creates the genotype networks that random walks can explore.</p>
</section>
<section id="who-is-this-for" class="level2">
<h2 class="anchored" data-anchor-id="who-is-this-for">Who is this for?</h2>
<p>The Origins of Evolutionary Innovations is denser than a typical popular science book, though a more pleasurable read than a textbook. This book requires a sizeable familiarity with molecular biology, though the main ideas should be accessible to anyone. The theoretical chapters are especially rewarding, as they give a fresh perspective on how to look at evolution.</p>


<!-- -->

</section>

 ]]></description>
  <category>books</category>
  <category>biology</category>
  <guid>https://michielstock.github.io/blog/posts/2022/2022-10-16-evolinnov/</guid>
  <pubDate>Sun, 16 Oct 2022 00:00:00 GMT</pubDate>
</item>
<item>
  <title>Hyperdimensional computing</title>
  <dc:creator>Michiel Stock</dc:creator>
  <link>https://michielstock.github.io/blog/posts/2022/2022-10-04-HDVtutorial/</link>
  <description><![CDATA[ 





<p>This post is a <a href="https://plutojl.org/">Pluto.jl</a> notebook providing a hands-on tutorial on hyperdimensional computing. It covers the core operations (bundling, binding, permutation) and builds up to a simple text classifier.</p>
<p><a href="notebook.html" class="btn btn-primary">View the interactive notebook</a></p>


<!-- -->


 ]]></description>
  <category>julia</category>
  <category>computing</category>
  <guid>https://michielstock.github.io/blog/posts/2022/2022-10-04-HDVtutorial/</guid>
  <pubDate>Tue, 04 Oct 2022 00:00:00 GMT</pubDate>
</item>
<item>
  <title>The Little Book of Stoicism</title>
  <dc:creator>Michiel Stock</dc:creator>
  <link>https://michielstock.github.io/blog/posts/2022/2022-09-22-stoicism/</link>
  <description><![CDATA[ 





<p>author: Jonas Salzgeber</p>
<p>related books: <a href="https://www.goodreads.com/book/show/96884.The_Happiness_Hypothesis">The Happiness Hypothesis</a>, <a href="https://www.goodreads.com/book/show/43566091-lessons-in-stoicism">Lessons on Stoicism</a>, <a href="../../../../posts/2022/2022-01-07-antifragile/">Antifragile: Things That Gain From Disorder</a>, <a href="https://www.goodreads.com/book/show/36556202-the-coddling-of-the-american-mind">The Coddling of the American Mind</a></p>
<p><img src="https://images-na.ssl-images-amazon.com/images/S/compressed.photo.goodreads.com/books/1547979103i/43621841.jpg" class="img-fluid"></p>
<section id="the-main-takeaway" class="level2">
<h2 class="anchored" data-anchor-id="the-main-takeaway">The main takeaway</h2>
<p>The Little Book of Stoicism gives a practical and accessible introduction to stoicism. The first half covers the essential aspects of the stoic principles. To thrive (reaching <em>Eudaimonia</em>): 1. focus only on the aspects you can control; 2. take responsibility for your actions; 3. try to aim to be the very best of yourself. Most people have only a limited sphere of control. Most circumstances are outside our power to change. We can choose how to <em>react</em> to what happens around us.</p>
<p>The book’s second half outlines more than 50 stoic practices and mindsets one can use to deal with daily hardships or be generally happier. They range from routines such as <a href="https://en.wikipedia.org/wiki/Negative_visualization">negative visualisation</a>, voluntary discomfort and a stoic morning routine to mindsets such as considering everything being borrowed from nature, doing good and projecting kindness as strength.</p>
</section>
<section id="who-is-this-for" class="level2">
<h2 class="anchored" data-anchor-id="who-is-this-for">Who is this for?</h2>
<p>Life is hard—stoicism is a practical philosophy for becoming a more resilient, better, and generally happier person. Practising stoicism has helped me immensely with my mental well-being. This book is a very accessible introduction to getting started. It is chiefly a self-help book. For those who want a more formal, though still concise introduction, I can also strongly recommend “Lessons on Stoicism” by John Sellars.</p>


<!-- -->

</section>

 ]]></description>
  <category>books</category>
  <guid>https://michielstock.github.io/blog/posts/2022/2022-09-22-stoicism/</guid>
  <pubDate>Thu, 22 Sep 2022 00:00:00 GMT</pubDate>
</item>
<item>
  <title>A Thousand Brains: A New Theory of Intelligence</title>
  <dc:creator>Michiel Stock</dc:creator>
  <link>https://michielstock.github.io/blog/posts/2022/2022-09-04-1000brains/</link>
  <description><![CDATA[ 





<p>author: Jeff Hawkins</p>
<p>related books: <a href="https://www.goodreads.com/book/show/50884536-models-of-the-mind">Models of the Mind</a></p>
<p><img src="https://images-na.ssl-images-amazon.com/images/S/compressed.photo.goodreads.com/books/1609237769i/54503521.jpg" class="img-fluid"></p>
<section id="the-main-takeaway" class="level2">
<h2 class="anchored" data-anchor-id="the-main-takeaway">The main takeaway</h2>
<p>Every high school student can understand the basics of natural selection and grasp the origin of the diversity of the living world. Hawkins hopes that the secrets of the minds and intelligence (natural and artificial) might be similarly simple enough to be within reach of every interested layperson. <em>A Thousand Brains</em> outlines Hawkins’ theory of the mind.</p>
<p>The main idea is quite simple and seems reasonable with neuroscience. The neocortex consists of about 150,000 columns, where each column is a sensory-motor system. Each column has a similar function: representing part of the external world. These different models are linked using <em>reference frames</em> that connect them spatially, temporally or conceptually. The models are based on these reference frames. Each object or concept is represented by a relatively small number of these columns in a distributed fashion. A voting mechanism creates a consensus interpretation from the individual column results.</p>
<p>The book’s first third outlined the above theory and was quite interesting. The next part deals with what it would mean for artificial intelligence. The final third of the book deals with topics as diverse as memes, climate change, brain uploading and colonizing different planets; all put under the umbrella of “human intelligence”. I found the last chapters a bit unsubstantial. Other authors have treated this topic in much more depth.</p>
<p>The central theory seems to be coherent and supported by data. However, it seems unclear to me what it would mean practically, i.e.&nbsp;whether it can be used to generate some interesting, nontrivial forms of intelligence. For example, Hebbian learning is a theory used successfully in machine learning. Hawkins claims his framework is similar in spirit to Hinton’s <a href="https://medium.com/ai%C2%B3-theory-practice-business/understanding-hintons-capsule-networks-part-i-intuition-b4b559d1159b">capsule networks</a>, which yet have to replace conventional artificial neural networks. I follow the reasoning of Yann LeCun. If you have a relevant theory of intelligence, you should have no problem showing superior performance on various learning tasks.</p>
</section>
<section id="who-is-this-for" class="level2">
<h2 class="anchored" data-anchor-id="who-is-this-for">Who is this for?</h2>
<p>Anyone interested in artificial intelligence and brain science. The book is accessible, though it lacks the technical details (for which Hawkins refers to his papers).</p>


<!-- -->

</section>

 ]]></description>
  <category>books</category>
  <category>biology</category>
  <guid>https://michielstock.github.io/blog/posts/2022/2022-09-04-1000brains/</guid>
  <pubDate>Sun, 04 Sep 2022 00:00:00 GMT</pubDate>
</item>
<item>
  <title>De Wereld Red je Niet Met Minder: Groen denken 2.0</title>
  <dc:creator>Michiel Stock</dc:creator>
  <link>https://michielstock.github.io/blog/posts/2022/2022-08-31-minder/</link>
  <description><![CDATA[ 





<p>auteurs: Jan Deschoolmeester, Thomas Rotthier</p>
<p>gerelateerde boeken: <a href="https://www.goodreads.com/book/show/52219273-how-innovation-works">How Innovation Works</a>, <a href="../../../../posts/2022/2022-03-20-how_the_world_really_works/">How the World Really Works</a>, <a href="https://www.goodreads.com/book/show/35696171-enlightenment-now">Enlightment Now</a>, <a href="https://www.goodreads.com/book/show/23692271-sapiens">Sapiens</a>, <a href="../../../../posts/2019/2019-12-31-wizardsandprophets/">The Wizard and the Prophet</a></p>
<p><img src="https://images-na.ssl-images-amazon.com/images/S/compressed.photo.goodreads.com/books/1655057444i/61275668.jpg" class="img-fluid"></p>
<section id="de-hoofdboodschap" class="level2">
<h2 class="anchored" data-anchor-id="de-hoofdboodschap">De hoofdboodschap</h2>
<p>Vaak stelt men ecologisch handelen gelijk met consuminderen: minder vlees eten, minder verwarmen, zelden of nooit vliegen en vooral: minder mensen op de planeet. Mensen (en vooral deze met een Westerse levensstijl) zijn immers de bron van al het onheil. Groei is iets slechts.</p>
<p>Het <em>ecomodernisme</em>, in Vlaanderen sterk gepromoot door de auteurs Jan Deschoolmeester en Thomas Rotthier, is een alternatieve stroming. Ze vertrekt van economische ontwikkeling en technologische innovatie om uitdagingen zoals klimaat, energie en voedselbevoorrading aan te pakken. De argumentatie is als volgt: door minder te verbruiken kan je (bijvoorbeeld) uitstoot met maar een fractie terug brengen. Enkel een collectieve globale zelfmoord zou deze naar nul terug kunnen brengen. Groei en technologische innovaties daarentegen hebben geen limieten. Het uitrollen van <img src="https://latex.codecogs.com/png.latex?CO_2">-arme energieproductie laat in principe toe netto klimaatneutraal te zijn terwijl carbon capture (indien dit op grote schaal zou werken) het potentieel heeft om netto koolstof uit de lucht te halen. Er is geen limiet aan wat innovatie kan bereiken, Riley omschreef het als de echte <em>Infinite Probability Drive</em>.</p>
<p>In de eerste hoofdstukken van “De Wereld Red Je Niet Met Minder” beschrijven De Schoolmeester en Rotthier hoe de moderne mens altijd al technologie gebruikt heeft om natuur in cultuur om te toveren. Lang verhaal kort, wat jager-verzamelaars kwamen op het lumineuze idee om zelf wat graan te verbouwen en sindsdien nederzettingen, georganiseerde religie, oorlog, overbevolking, industrie, vervuiling en alle puree waar we nu mee zitten. (Toegegeven, er zitten ook goede dingen tussen.) De volgende hoofdstukken overlopen hoe technologie het antwoord kunnen bieden op de grote uitdagingen, van energie en klimaat tot landbouw en voeding. Met veel voorbeelden geven de auteurs een voerzicht van historische technologische successen alsook toekomstig potentieel van wat nu in de kinderschoenen staat.</p>
<p>Het laatste hoofdstuk was voor mij het meest intrigerenste, maar waarschijnlijk ook het meest polarizerendste. In de rentemeesters van de natuur pleiten De Schoolmeester en Rotthier om (bio)technologie zoals gene drives actief in te zetten om de natuur te beschermen en te beheren. Toegegeven, de auteurs beschouwen dit als laatste redmiddel voor bedreigde ecosystemen terwijl intensievere landbouw er voor zorgt dat er meer land vrij komt voor de natuur.</p>
</section>
<section id="mijn-review" class="level2">
<h2 class="anchored" data-anchor-id="mijn-review">Mijn review</h2>
<p>Kernenergie, klimaatsverandering, GMO’s zijn zeer actueel, “De Wereld Red Je Niet Met Minder” weet over elk van deze onderwerpen iets zinnigs te zeggen. Het boek is toegankelijk, informatief en leest als een trein. Wat ikzelf persoonlijk wat miste is een meer globale beschouwing en kritische blik op het vooruitgangsdenken, maar er zijn voldoende andere boeken die hier verder op in gaan.</p>
</section>
<section id="voor-wie" class="level2">
<h2 class="anchored" data-anchor-id="voor-wie">Voor wie?</h2>
<p>“De Wereld Red Je Niet Met Minder” is erg toegankelijk en aangenaam geschreven. Niet iedereen zal van het Ecomodernisme overtuigd zijn maar dit boek is een uitstekend vertrekpunt om er eens kennis mee te maken.</p>
</section>
<section id="mijn-bedenkingen" class="level2">
<h2 class="anchored" data-anchor-id="mijn-bedenkingen">Mijn bedenkingen</h2>
<p>De filosofie van “De Wereld Red Je Niet Met Minder” is gestoeld in het vooruitgangsoptimisme - aanhangers hiervan worden door sommigen <a href="../../../../posts/2019/2019-12-31-wizardsandprophets/">tovenaars</a> genoemd. Deze stelt dat de wereld en samenleving door de boot genomen altijd maar beter wordt, vanzelf bottom-up zonder sturing van buitenaf. Vooral Steven Pinker, Hans Rosling en Ray Kurzweil zijn prominente advocaten hiervan met boeken vol grafieken met stijgende (of dalende, indien slecht) trends.</p>
<p>Groen denken benadrukt vaak de eenheid met de natuur, waarbij natuur vaak als goed en puur gezien wordt en menselijke activiteit slecht en corrumperend. Dit gaat de biologische realiteit voorbij, elk species wil tot de uiterste limieten expanderen. De cyanobacteriën hebben er zich ook niets van aangetrokken toen ze de atmosfeer met (indertijd) giftig gas hebben gepompt. Meeste nieuwe species zijn experimenten die zichzelf om zeep helpen. De tragedie en geluk van <em>Homo sapiens</em> is dat we ons eigen noodlot kunnen zien aankomen, en er naar kunnen handelen.</p>


<!-- -->

</section>

 ]]></description>
  <category>books</category>
  <guid>https://michielstock.github.io/blog/posts/2022/2022-08-31-minder/</guid>
  <pubDate>Wed, 31 Aug 2022 00:00:00 GMT</pubDate>
</item>
<item>
  <title>Transformer: The Deep Chemistry of Life and Death</title>
  <dc:creator>Michiel Stock</dc:creator>
  <link>https://michielstock.github.io/blog/posts/2022/2022-08-17-Transformer/</link>
  <description><![CDATA[ 





<p>author: Nick Lane</p>
<p>related books: <a href="https://www.goodreads.com/book/show/291056.Oxygen">Oxygen</a>, <a href="https://www.goodreads.com/book/show/26530386-the-vital-question">The Vital Question</a>, <a href="https://www.goodreads.com/book/show/39001.Power_Sex_Suicide">Power, Sex, Suicide</a></p>
<p><img src="https://images-na.ssl-images-amazon.com/images/S/compressed.photo.goodreads.com/books/1650681579i/58999183.jpg" class="img-fluid"></p>
<section id="the-main-takeaway" class="level2">
<h2 class="anchored" data-anchor-id="the-main-takeaway">The main takeaway</h2>
<p>A living cell and one that just died have the same DNA. Put differently, both cells have precisely the same information content. Just as the flow of people and goods, rather than the arrangement of the buildings, determines that a city is alive, the fluxes of metabolites and energy characterise a living cell. Modern biology is often solely discussed in terms of information. In “Transformer”, Lane argues that metabolism is at least as important. This viewpoint of “follow the goods” is also emphasised on a completely different scale by Vaclav Smil in <a href="../../../../posts/2022/2022-03-20-how_the_world_really_works/">How the World Really Works</a>.</p>
<p>In my opinion, Nick Lane is the best biology author out there. Lane has an unmatched talent for making seemingly boring topics (Transformer mainly covers the importance of the <a href="https://en.wikipedia.org/wiki/Citric_acid_cycle">Krebs cycle</a>) and making them exciting. Read this work and realise why the citric acid cycle is the answer to Life, the Universe and Everything. Within these pages, Lane depicts the Krebs cycle as the heart of the metabolism, linking it with the origin of life, <img src="https://latex.codecogs.com/png.latex?CO_2"> assimilation, cancer, ageing and even consciousness.</p>
<p>The key insight is that the Krebs cycle links catabolism (degradation of metabolites for energy) and anabolism (synthesis of more complex metabolites for growth). It is a checkpoint for respiration and acts as a hub to start the synthesis of all building blocks of life: carbohydrates, lipids, nucleotides, and amino acids. Cancer cells, for example, promote their anabolic power by mainly using fermentation for energy. This process is known as the <a href="https://en.wikipedia.org/wiki/Warburg_effect_(oncology)">Warburg effect</a>. It can even run in reverse, taking up <img src="https://latex.codecogs.com/png.latex?CO_2"> as an alternative to the Calvin cycle for carbon fixation. Because the Krebs cycle controls reparation, it also regulates the electric potential on the membranes of the mitochondria (the topic of Lanes’ equally brilliant book “The Vital Question”). The last ( speculative though exciting) chapter discusses the emerging biology of electric fields and their relation with consciousness and morphogenesis (see also the work of Michael Levin on <a href="https://ase.tufts.edu/biology/labs/levin/publications/bioelectricity.htm">bioelectricity</a>).</p>
<p>In addition to the pure science, Lane also paints the history of the unravelling of these biochemical processes. It conveys the brilliance and resourcefulness of the pioneers but does not skip the quarrels and small-mindedness.</p>
</section>
<section id="who-is-this-for" class="level2">
<h2 class="anchored" data-anchor-id="who-is-this-for">Who is this for?</h2>
<p>Honestly, not for the faint of heart, as this can be a highly technical popular science book. To follow Lane’s dissemination, you likely need to have followed a course in biochemistry at some point in your life. If you have, you are in for a treat! It is a joy to rediscover a topic previously filed under “dreadfully dull” and realise its profound implications in life and death.</p>


<!-- -->

</section>

 ]]></description>
  <category>books</category>
  <category>biology</category>
  <guid>https://michielstock.github.io/blog/posts/2022/2022-08-17-Transformer/</guid>
  <pubDate>Wed, 17 Aug 2022 00:00:00 GMT</pubDate>
</item>
<item>
  <title>Build: An Unorthodox Guide to Making Things Worth Making</title>
  <dc:creator>Michiel Stock</dc:creator>
  <link>https://michielstock.github.io/blog/posts/2022/2022-07-21-build/</link>
  <description><![CDATA[ 





<p>author: Tony Fadell</p>
<p>related books: <a href="https://www.goodreads.com/book/show/9512985-the-personal-mba">The Personal MBA</a>, <a href="https://www.goodreads.com/book/show/16158498-give-and-take">Give and Take</a>, <a href="https://www.goodreads.com/en/book/show/905743">Advice to a Young Scientist</a>, <a href="https://www.goodreads.com/book/show/26046333-designing-your-life">Designing your Life</a>, <a href="https://www.goodreads.com/book/show/13525945-so-good-they-can-t-ignore-you">So Good They Can’t Ignore You</a>, <a href="../../../../posts/2022/2022-01-07-antifragile/">Antifragile</a></p>
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><img src="https://images-na.ssl-images-amazon.com/images/S/compressed.photo.goodreads.com/books/1652120231i/59696349.jpg" class="img-fluid figure-img"></p>
<figcaption>Cover of Build</figcaption>
</figure>
</div>
<section id="the-main-takeaway" class="level2">
<h2 class="anchored" data-anchor-id="the-main-takeaway">The main takeaway</h2>
<p>Tony Fadell had a career to be envious of: hard- and software designer (co-creator of the iPod and iPhone!), entrepreneur and CEO (founder of Nest, the company that made thermostats sexy), investor etc. Despite such a stellar track record, Fadell admits to making plenty of mistakes, just like the rest of us! Any successful person likely has plenty of mentors before becoming a mentor themself. In <em>Build</em>, Fadell bundles what he considers his most important advice to build a fruitful career. It covers aspects from your first job to how to become a CEO.</p>
<p>The book is subdivided into six sections, each containing several small chapters with tidbits of practical advice. It covers 1. <strong>Build yourself</strong>; where planning your first career should mainly be centred around what you want to <em>learn</em> rather than what you want to earn. Work hard, and work with established leads in your field of choice (“heroes”). I prefer small companies or groups where you can make a difference. 2. <strong>Build your career</strong> how to work in a group, why managing is a distinct skill and how to deal with various types of assholes. It also covers the etiquette of how and when to quit. 3. <strong>Build your product</strong>, good product design focuses on the customer. A successful product reveals and solves a problem your customer might not know they had (“painkillers are better than vitamins”). Your product should have a story that appeals to people’s emotional and rational side. Reaching profitability will always take longer than you think. 4. <strong>Build your business</strong> is just as important as building the product! A good business idea starts with the <em>why</em> (one should care). It covers accepting venture capitalists, work-life balance and coping with a crisis; 5. <strong>Build your team</strong> covers hiring, dealing with the growth of the company and the roles of sales, designers and lawyers. 6. <strong>Be the CEO</strong>; there can be several founders but only one CEO. You must deal with a board, buying and being bought while maintaining company culture. Fadell has some good views on perks (no free massages!), don’t give regular free stuff that becomes an acquired right though the occasional surprise boosts morale. Not all founders have what it takes to become a CEO, and even for successful CEOs, there might be a natural point to step down when you cannot let your company grow anymore, and you’ve effectively become a babysitter. ## Who is this for? This book generally contains good advice for those planning a career in a technical field. Many aspects might also be relevant for an academic profile, e.g.&nbsp;building and managing a group.</p>


<!-- -->

</section>

 ]]></description>
  <category>books</category>
  <category>productivity</category>
  <guid>https://michielstock.github.io/blog/posts/2022/2022-07-21-build/</guid>
  <pubDate>Thu, 21 Jul 2022 00:00:00 GMT</pubDate>
</item>
<item>
  <title>Sum-product networks</title>
  <dc:creator>Michiel Stock</dc:creator>
  <link>https://michielstock.github.io/blog/posts/2022/2022-06-16-SPNs/</link>
  <description><![CDATA[ 





<p>This post is a <a href="https://plutojl.org/">Pluto.jl</a> notebook introducing sum-product networks, powerful probabilistic models where marginalization, conditioning, and sampling are all tractable.</p>
<p><a href="notebook.html" class="btn btn-primary">View the interactive notebook</a></p>


<!-- -->


 ]]></description>
  <category>julia</category>
  <category>maths</category>
  <guid>https://michielstock.github.io/blog/posts/2022/2022-06-16-SPNs/</guid>
  <pubDate>Thu, 16 Jun 2022 00:00:00 GMT</pubDate>
</item>
<item>
  <title>Modelling cocktail shaking</title>
  <dc:creator>Michiel Stock</dc:creator>
  <link>https://michielstock.github.io/blog/posts/2022/cocktails/</link>
  <description><![CDATA[ 





<p>This post is a <a href="https://plutojl.org/">Pluto.jl</a> notebook exploring cocktail shaking with <a href="https://github.com/SciML/ModelingToolkit.jl">ModelingToolkit.jl</a>. It models the thermodynamics of shaking — how ice melts, dilutes, and cools a cocktail, and how that affects perceived sweetness.</p>
<p><a href="notebook.html" class="btn btn-primary">View the interactive notebook</a></p>


<!-- -->


 ]]></description>
  <category>julia</category>
  <guid>https://michielstock.github.io/blog/posts/2022/cocktails/</guid>
  <pubDate>Sat, 30 Apr 2022 00:00:00 GMT</pubDate>
</item>
<item>
  <title>How the World Really Works</title>
  <dc:creator>Michiel Stock</dc:creator>
  <link>https://michielstock.github.io/blog/posts/2022/2022-03-20-how_the_world_really_works/</link>
  <description><![CDATA[ 





<p>author: Vaclav Smil</p>
<p>related books: <a href="../../../../posts/2022/2022-01-07-antifragile/">Antifragile</a>, <a href="../../../../posts/2019/2019-12-31-wizardsandprophets/">The Wizard and the Prophet</a>, <a href="https://www.goodreads.com/book/show/52908942-how-to-avoid-a-climate-disaster">How to Avoid a Climate Disaster</a>, <a href="https://www.goodreads.com/book/show/23692271-sapiens">Sapiens: A Brief History of Humankind</a></p>
<p><img src="https://images-na.ssl-images-amazon.com/images/S/compressed.photo.goodreads.com/books/1641444915i/56587388.jpg" class="img-fluid"></p>
<section id="the-main-takeaway" class="level2">
<h2 class="anchored" data-anchor-id="the-main-takeaway">The main takeaway</h2>
<p>Smil is a self-proclaimed generalist, trying to understand everything in the wide world as thoroughly as his mind allows, from the growth of bacteria to the organisation of cities. “How the World Really Works” tries to paint a complete picture of the world’s complex problems in fewer than 235 pages.</p>
<p>The key to understanding the world is to keep track of the energies, materials and risks involved. In the first chapters, Smil discusses energy production, food production and the main materials of modern life: fertilisers, cement, steel and plastic. These depend on relatively old and established technologies, such as turbines and the Haber-Bosch process. Importantly, they are largely anchored on fossil fuels. For example, a humble tomato requires an ample dose of fossil fuel (nicely visualised by pouring a couple of spoons of sesame oil over sliced tomato). All these production processes are so ingrained in our ways of life it is nearly impossible to decarbonise them.</p>
<p>The following chapters of the book deal with more abstract, though no less topical: globalisation, risk and environment. Again, Smil advocates a dry emphasis on keeping track of the numbers.</p>
<p>“How the World Really Works” outlines what is required for a reasonable standard of living. This involves food in our bellies and a roof over our heads. These commodities require certain quantities of resources and energy, and no foreseeable technology will change that. The book is neither pessimistic (proclaiming environmental collapses) nor optimistic (no singularly).</p>
</section>
<section id="who-is-this-for" class="level2">
<h2 class="anchored" data-anchor-id="who-is-this-for">Who is this for?</h2>
<p>Generalists, who want to understand what is required to keep a couple of billion people reasonably comfortable alive on our planet.</p>


<!-- -->

</section>

 ]]></description>
  <category>books</category>
  <guid>https://michielstock.github.io/blog/posts/2022/2022-03-20-how_the_world_really_works/</guid>
  <pubDate>Sun, 20 Mar 2022 00:00:00 GMT</pubDate>
</item>
<item>
  <title>Mindstorms: Children, Computers, And Powerful Ideas</title>
  <dc:creator>Michiel Stock</dc:creator>
  <link>https://michielstock.github.io/blog/posts/2022/2022-02-01-mindstorms/</link>
  <description><![CDATA[ 





<p>author: Seymour Papert</p>
<p>related books: <a href="https://www.goodreads.com/book/show/44770129-ultralearning">Ultralearning</a>, <a href="https://www.goodreads.com/book/show/42863088-mathematics-for-human-flourishing">Mathematics for Human Flourishing</a></p>
<p><img src="https://images-na.ssl-images-amazon.com/images/S/compressed.photo.goodreads.com/books/1348579820i/703532.jpg" class="img-fluid"></p>
<section id="the-main-takeaway" class="level2">
<h2 class="anchored" data-anchor-id="the-main-takeaway">The main takeaway</h2>
<p>Computers can be a phenomenal tool to improve learning in the classroom! Though written in the eighties, Mindstorms by Seymour Papert feels contemporary. Papert, an AI and education researcher at MIT, believes in using computers to create “<em>microworlds</em>” for teaching. These are tiny self-contained universes where children and students can explore a given concept, say geometry. Most of his case studies relate to experiences using the Logo programming language, which allows people to use simple, human-readable instructions to draw simple graphics, the original <a href="https://en.wikipedia.org/wiki/Turtle_graphics">turtle graphics</a>. Children are free to experiment, create, fail, and debug. The limited complexity serves as a safe haven for children to build confidence in their skills. I particularly liked one anecdote of a girl who initially had a lot of trouble writing programs. The instructor simplified her setup to boost her confidence, enabling her only to draw lines with fixed angles. After a couple of weeks of playing with the possibilities, she found herself suggesting more elegant ways to draw something than her instructor saw. The student became the master.</p>
<p>Interestingly, Papert did not advocate learning children to work with computers because it helps solve practical problems. Instead, he valued programming because it improves how children <em>think</em> about problems. It motivates creativity, shows multiple ways to tackle a problem and forces students to identify and fix errors.</p>
</section>
<section id="who-is-this-for" class="level2">
<h2 class="anchored" data-anchor-id="who-is-this-for">Who is this for?</h2>
<p>Mindstorms is a great inspiring book for teachers, not only for introducing children to programming but as a general case study in discovery-based learning. I even believe there is quite some wisdom for computational researchers as well.</p>


<!-- -->

</section>

 ]]></description>
  <category>books</category>
  <category>computing</category>
  <guid>https://michielstock.github.io/blog/posts/2022/2022-02-01-mindstorms/</guid>
  <pubDate>Tue, 01 Feb 2022 00:00:00 GMT</pubDate>
</item>
<item>
  <title>Antifragile: Things That Gain From Disorder</title>
  <dc:creator>Michiel Stock</dc:creator>
  <link>https://michielstock.github.io/blog/posts/2022/2022-01-07-antifragile/</link>
  <description><![CDATA[ 





<p>author: Nassim Nicholas Taleb</p>
<p>related books: <a href="https://www.goodreads.com/book/show/52219273-how-innovation-works">How Innovation Works</a>, <a href="../../../../posts/2021/2021-05-10-nonobjective/">Why Greatness Cannot Be Planned</a></p>
<p><img src="https://images-na.ssl-images-amazon.com/images/S/compressed.photo.goodreads.com/books/1352422827i/13530973.jpg" class="img-fluid"></p>
<section id="the-main-takeaway" class="level2">
<h2 class="anchored" data-anchor-id="the-main-takeaway">The main takeaway</h2>
<p>I recently read ‘Antifragile’ by Nicholas Taleb. The author discusses how objects, organisms and systems can differ concerning how tolerant they are against stresses, shocks, perturbations and other random external forces. He distinguishes three categories based on how you would send them by the post office. 1. There is the <em>fragile</em>; the stuff labelled “FRAGILE: HANDLE WITH CARE”: Ming vases and crystal wine glasses. 2. Some packages might contain books or kettlebells. You generally don’t have to worry much about dropping them because they are <em>robust</em>. 3. Finally, you have a mysterious third type of packages, the <em>antifragile</em><sup>1</sup>, which improve by stressors. Such packages might carry a label with “SHAKE ME PLEASE!”. What kind of magical things could such packages contain?</p>
<p>Taleb likens fragile things with candles; a puff of wind would extinguish them. A powerful torch would be the robust analogue; it can copy with moderate winds. However, a forest fire would be antifragile; winds would only invigorate it! Many interesting, complex systems are antifragile: a capitalist economy, the scientific process, pandemics, ecosystems, the immune system, <a href="../../../../posts/2021/2021-11-24-democracy/">democracy as envisioned by Klaas Mensaert</a>, living organisms… The key to antifragility is being composed of fragile components that can easily be replaced. Science moves because good ideas substitute bad ones, faulty cells in our body undergo apoptosis and ineffective virus strains become replaced by more effective mutants. Antifragile things seem to be evolved or emerged as opposed to being designed. Recent <a href="https://www.frontiersin.org/articles/10.3389/fevo.2021.650726/full">work</a> discusses how we have had to rethink our definition of “machine” in the area of synthetic biology and artificial intelligence where machines are being evolved.</p>
<p>Crucially, Taleb’s point, as outlined in his earlier books, is that the world is fundamentally unpredictable, the dreaded Black Swans. These include earthquakes, stock market crashes and pandemics. In many cases, we have a depressingly low capacity to influence, predict, or in some cases, even understand our environment. However, one can often control the system that generates the outcomes from the environment (say, your long-term investment returns or the number of exciting research ideas you can bring to fruition). In mathematical terms, one must ensure that the function <img src="https://latex.codecogs.com/png.latex?f"> that generates the outcomes from the random environment <img src="https://latex.codecogs.com/png.latex?X"> is <em><a href="../../../../posts/2018/2018-03-07-ConvexSummary/">convex</a></em>. From <a href="https://en.wikipedia.org/wiki/Jensen%27s_inequality">Jenssen’s inequality</a> it follows that the expected outcome will exceed the outcome of the expected environment:</p>
<p><img src="https://latex.codecogs.com/png.latex?%0A%5Cmathbb%7BE%7D%5Bf(X)%5D%20%5Cge%20f(%5Cmathbb%7BE%7D%5BX%5D)%5C,.%0A"></p>
<p>To take a very simple example, let <img src="https://latex.codecogs.com/png.latex?f(x)%20=%20%5Cmax(0,%20x)">, i.e., we cap our downsize and only take the positive benefits. It is trivial to see that such a system gains from increased randomness; we only retain the benefits without drawbacks!</p>
<p>So, practically, what does it mean? From a productivity standpoint, you have the likes of Cal Newport, who would prefer to live in a lead box, meticulously controlling his signal-to-noise input. Based on the ideas in Antifragile (and the related books shown on top of this post), I think it is smarter to set up a system that gains from a moderate dose of disorder. Tools such a the <a href="../../../../posts/2020/2020-07-23-how-to-take-smart-notes/">smart note-taking principle</a> and <a href="https://maggieappleton.com/basb">Building a Second Brain</a> can help with the information overload and allow new ideas to crystalize.</p>
</section>
<section id="who-is-this-for" class="level2">
<h2 class="anchored" data-anchor-id="who-is-this-for">Who is this for?</h2>
<p>I enjoyed reading this book and found the ideas quite thought-provoking. The appendices were illuminating, as Talebs deduces his theory from simple mathematical principles. Sure, in retrospect, the book’s message is rather simple and obvious, though that is part of the charm, I guess.</p>
<p>Taleb’s writing style is not for everyone. He is probably the most well-read anti-intellectual, never missing a chance to dish out to academics, economists, medical practitioners and other <a href="https://en.wikipedia.org/wiki/Skin_in_the_Game_(book)#Intellectual_Yet_Idiot">IYI</a>s. Taleb manages to appear to be profoundly wise and to be a bubbling vat of frustration at the same time. I was not really put off by his style (I think Talab has a heart at the right place), but I guess it will not be for everyone.</p>
<p>Those who like to think in systems and believe that the most simple solution is often the best will enjoy this book.</p>
<hr>


<!-- -->

</section>


<div id="quarto-appendix" class="default"><section id="footnotes" class="footnotes footnotes-end-of-document"><h2 class="anchored quarto-appendix-heading">Footnotes</h2>

<ol>
<li id="fn1"><p>Taleb coins the term “antifragile” in this book, claiming that there is no antonym for “fragile” as “robust” points neutral property, not the inverse. Others pointed out that “adaptable” would serve perfectly fine.↩︎</p></li>
</ol>
</section></div> ]]></description>
  <category>books</category>
  <guid>https://michielstock.github.io/blog/posts/2022/2022-01-07-antifragile/</guid>
  <pubDate>Fri, 07 Jan 2022 00:00:00 GMT</pubDate>
</item>
<item>
  <title>The Flaws That Kill Our Democracy</title>
  <dc:creator>Michiel Stock</dc:creator>
  <link>https://michielstock.github.io/blog/posts/2021/2021-11-24-democracy/</link>
  <description><![CDATA[ 





<p>author: <a href="https://klaasmensaert.be/">Klaas Mensaert</a></p>
<p>related books: <a href="https://www.goodreads.com/book/show/52219273-how-innovation-works">How Innovation Works</a>, <a href="https://www.goodreads.com/book/show/40696923-blueprint">Blueprint</a>, <a href="https://www.goodreads.com/book/show/13530973-antifragile?ref=nav_sb_ss_1_11">Antifragile</a></p>
<p><img src="https://images-na.ssl-images-amazon.com/images/S/compressed.photo.goodreads.com/books/1580025212i/50651145.jpg" class="img-fluid"></p>
<section id="review" class="level2">
<h2 class="anchored" data-anchor-id="review">Review</h2>
<p>In “The Flaws That Kill Our Democracy”, Mensaert discusses the main issues with our current western democratic system, which inevitably leads to polarization, stagnation and corruption. This book outlines an alternative approach based on smaller, specialized inclusive parties. Borrowing ideas from scientific disciplines such as complex systems theory, Mensaert argues that such a system would be antifragile, which would be more tolerant to external lobbying and influence.</p>
<p>It is a thin booklet yet rich in ideas. I immensely enjoyed the scientific approach to democracy. The last part is, relating to voting, is in my option the least well developed (or rather, it discusses the most complicated problem: finding out what people want!)—food for many stimulating discussions.</p>
</section>
<section id="the-main-takeaway" class="level2">
<h2 class="anchored" data-anchor-id="the-main-takeaway">The main takeaway</h2>
<blockquote class="blockquote">
<p><em>It has been said that democracy is the worst form of government except all the others that have been tried.</em> - Winston Churchill</p>
</blockquote>
<p>With one equal vote for every person, democracy is held as a pillar of enlightenment. As with every system that involves more than two humans, the current implementation exhibits some rampant flaws, from corruption at the top and misinformation and fake news at the bottom. The current state of affairs leaves many people across the political spectrum disillusioned.</p>
<p>In his book, “The Flaws That kill our Democracy”, Klaas Mensaert argues for a scientifically-driven approach towards a better democratic system. A democracy should function similarly to the principles of the scientific system. Here, scientists prose, test and publish falsifiable hypotheses, increasing the amount of knowledge in the world. Likewise, a democratic process should be able to establish what people what to happen. Societies problems (energy, migration, climate change, economy, etc.) are complex. Hence these can only be approached from the bottom up. An example of a similar system that works is capitalism. Capitalism, for all its flaws, can generate value and goods via unimaginable complex supply chains for most of the people who are participating. The wondrous thing is that this capitalism is almost completely self-organizing, composed of independent, selfish actors. A fundamental and desirable property of such systems is that they are antifragile: external stresses, errors and attacks do not weaken them; it makes them stronger. Taleb, who coined the term, argues that systems can only be antifragile if their subcomponents themselves are fragile. A capitalistic economy, composed of numerous companies that can go out of business, can be antifragile. Living organisms composed of delicate living cells with constant turnover are <a href="https://www.goodreads.com/book/show/13530973-antifragile?ref=nav_sb_ss_1_11">Antifragile</a>. The current political system with its large political parties that are too big to fail is <em>not</em> antifragile.</p>
<p>Mensaert argues that in most Western countries, political parties are far too big and far too static. In “<a href="https://www.goodreads.com/book/show/53408081-het-dna-van-vlaanderen-wat-willen-de-vlamingen-cht?ac=1">Het DNA van Vlaanderen</a>”, De Vadder writes that the most remarkable thing that can be said about most Flemish parties is that they are still there after that many years. The most extreme case is likely in the USA, where two old parties completely dominate the political landscape. Such power structures work corruptions and stagnation in hand. Worse, as parties need to profile themselves, this inevitably leads to polarization, making compromises hard.</p>
<p>The book proposes a more decentralized system where many smaller and volatile parties populate the political landscape. This can be realized by two components: specialization and inclusiveness. Specialization means that parties do not need to focus on every single issue but specific problems. An advantage of more focused parties is that their representatives can have more targeted expertise. In addition to specialized parties, the system also needs to be inclusive, meaning it is possible to join or vote on multiple political parties. in this system, a citizen, the freedom to combine parties, leads to a combinatorial explosion of options, meaning that the representation can be as diverse as the voters. In <a href="https://www.goodreads.com/book/show/52219273-how-innovation-works">How Innovation Works</a>, Ridley praises the recombination of existing ideas, a concept that could here be incorporated in democracy.</p>
<p>The final part of the book relates to voting. Two tools are discussed here: allowing symmetric voting (i.e., allowing people to express a positive, negative or neutral attitude towards a proposition) and voting aggregations to correct for popularity. By allowing a negative or neutral stance, one can measure how polarizing an issue is. I think this part is the most difficult to implement. The field of preference aggregation is complex and riddled with paradoxes. In all likelihood, it will be hard to design a voting system that is both simple, results sensible outcomes and cannot be gamed.</p>
<p>Here is an example of how I interpreted the ideas of the book. Energy is a hot-button issue now in Belgium, where the green party favours renewables. In contrast, the right-wing party pushes nuclear energy (it is easy to imagine a parallel universe where the opposite would be true). Views on energy are currently linked to the party, complete with all other ideological baggage. In practice, however, opinions are much more diverse. The Ecomodernism movement claims the need for a party that embraces technology and a growing economy and an environmental sense. However, ‘Het DNA van Vlaanderen’ claims, based on an extensive survey on peoples political preferences, that a party targeted to such people would not enjoy broad support (Flanders has a strong right-left axis both socially and economically). In the world of Mensaert, energy is determined by specialized parties, which can freely be mixed and matched with parties that cater to other issues such as economy and migration.</p>
</section>
<section id="who-is-this-for" class="level2">
<h2 class="anchored" data-anchor-id="who-is-this-for">Who is this for?</h2>
<p>Systems thinkers who would like to see the democratic system fixed.</p>


<!-- -->

</section>

 ]]></description>
  <category>books</category>
  <category>society</category>
  <guid>https://michielstock.github.io/blog/posts/2021/2021-11-24-democracy/</guid>
  <pubDate>Wed, 24 Nov 2021 00:00:00 GMT</pubDate>
</item>
<item>
  <title>Newton fractal in Julia using Symbolics.jl</title>
  <dc:creator>Michiel Stock</dc:creator>
  <link>https://michielstock.github.io/blog/posts/2021/2021-10-17-fractal/</link>
  <description><![CDATA[ 





<p>The <a href="https://www.youtube.com/watch?v=-RdOwhmqP5s">most recent video</a> of 3blue1brown covered Newton fractals, a family of fractal curves that are obtained by applying Newton’s method to complex numbers. Since I am covering Newton’s method in my optimization course this week, it might be an entertaining illustration to play around with this topic.</p>
<section id="newtons-method" class="level2">
<h2 class="anchored" data-anchor-id="newtons-method">Newton’s method</h2>
<p>Newton’s method is a <em>root-finding</em> algorithm. We can use it to find roots of a function <img src="https://latex.codecogs.com/png.latex?f">, i.e., inputs <img src="https://latex.codecogs.com/png.latex?x"> for which it holds that <img src="https://latex.codecogs.com/png.latex?f(x)=0">.</p>
<p>When executing Newton’s method, we start with an initial <img src="https://latex.codecogs.com/png.latex?x"> and iteratively apply the following rule till convergence:</p>
<p><img src="https://latex.codecogs.com/png.latex?%0Ax%20%5Cmapsto%20x%20-%20%5Cfrac%7Bf(x)%7D%7Bf'(x)%7D%5C,.%0A"></p>
<p>This rule can be derived by taking the first-order Taylor approximation of <img src="https://latex.codecogs.com/png.latex?f(x+h)"> in <img src="https://latex.codecogs.com/png.latex?x"> and solving for the step <img src="https://latex.codecogs.com/png.latex?h"> that sets the approximation to zero.</p>
<p>Let us apply this to a simple function!</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb1" style="background: #f1f3f5;"><pre class="sourceCode julia code-with-copy"><code class="sourceCode julia"><span id="cb1-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">f</span>(x) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> x<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">^</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>;</span></code></pre></div></div>
<p>For most functions, we can compute its derivative, and hence Newton update, easily enough. However, let us be lazy and use this opportunity to use Julia’s new CAS <code>Symbolics.jl</code>. We write a function that takes a function as an input and computes the map above:</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb2" style="background: #f1f3f5;"><pre class="sourceCode julia code-with-copy"><code class="sourceCode julia"><span id="cb2-1"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">using</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">Symbolics</span></span>
<span id="cb2-2"></span>
<span id="cb2-3"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">function</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">get_map</span>(f)</span>
<span id="cb2-4">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># define variable</span></span>
<span id="cb2-5">    <span class="pp" style="color: #AD0000;
background-color: null;
font-style: inherit;">@variables</span> x</span>
<span id="cb2-6">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># define derivative operator</span></span>
<span id="cb2-7">    Dx <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">Differential</span>(x)</span>
<span id="cb2-8">    map <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> x <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">f</span>(x) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">Dx</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">f</span>(x)) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> expand_derivatives</span>
<span id="cb2-9">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># now we expand and compile to a Julia function</span></span>
<span id="cb2-10">    update_expr <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">build_function</span>(map, x)</span>
<span id="cb2-11">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">eval</span>(update_expr)</span>
<span id="cb2-12"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">end</span></span>
<span id="cb2-13"></span>
<span id="cb2-14">update <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">get_map</span>(f)</span></code></pre></div></div>
<p>Yes! We get a new function: the update map! Let us try it on a value <img src="https://latex.codecogs.com/png.latex?x=2"></p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb3" style="background: #f1f3f5;"><pre class="sourceCode julia code-with-copy"><code class="sourceCode julia"><span id="cb3-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">update</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span>)  <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># apply map once</span></span></code></pre></div></div>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb4" style="background: #f1f3f5;"><pre class="sourceCode julia code-with-copy"><code class="sourceCode julia"><span id="cb4-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">update</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">update</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span>))  <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># apply map twice</span></span></code></pre></div></div>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb5" style="background: #f1f3f5;"><pre class="sourceCode julia code-with-copy"><code class="sourceCode julia"><span id="cb5-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">update</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">update</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">update</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span>)))  <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># apply map thrice</span></span></code></pre></div></div>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb6" style="background: #f1f3f5;"><pre class="sourceCode julia code-with-copy"><code class="sourceCode julia"><span id="cb6-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">update</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">update</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">update</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">update</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span>))))  <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># apply map four times</span></span></code></pre></div></div>
<p>We see that after a couple of steps, the Newton method converges to the root <img src="https://latex.codecogs.com/png.latex?x=1">.</p>
<p>For our convenience, let us define a function that applies this map <img src="https://latex.codecogs.com/png.latex?n"> times.</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb7" style="background: #f1f3f5;"><pre class="sourceCode julia code-with-copy"><code class="sourceCode julia"><span id="cb7-1"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">function</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">applyiteratively</span>(x, update; n<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span>)</span>
<span id="cb7-2">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> i <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span>n</span>
<span id="cb7-3">        x <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">update</span>(x)</span>
<span id="cb7-4">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">end</span></span>
<span id="cb7-5">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> x</span>
<span id="cb7-6"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">end</span></span>
<span id="cb7-7"></span>
<span id="cb7-8"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">applyiteratively</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span>, update)  <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># apply 100 times</span></span></code></pre></div></div>
</section>
<section id="complex-roots" class="level2">
<h2 class="anchored" data-anchor-id="complex-roots">Complex roots</h2>
<p>Astute readers might have noticed that <img src="https://latex.codecogs.com/png.latex?x%5E3-1"> has three roots: one real (<img src="https://latex.codecogs.com/png.latex?x=1">) and two complex ones (<img src="https://latex.codecogs.com/png.latex?x=-1/2+%5Csqrt%7B3%7Di/2"> and <img src="https://latex.codecogs.com/png.latex?x=-1/2-%5Csqrt%7B3%7Di/2">). Would our method also work with complex inputs?</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb8" style="background: #f1f3f5;"><pre class="sourceCode julia code-with-copy"><code class="sourceCode julia"><span id="cb8-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">applyiteratively</span>(<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0im</span>, update)</span></code></pre></div></div>
<p>We see that this converges to a different (complex) root! Other values might converge to different roots!</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb9" style="background: #f1f3f5;"><pre class="sourceCode julia code-with-copy"><code class="sourceCode julia"><span id="cb9-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">applyiteratively</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0im</span>, update)</span></code></pre></div></div>
</section>
<section id="the-newton-fractal" class="level2">
<h2 class="anchored" data-anchor-id="the-newton-fractal">The Newton fractal</h2>
<p>Imagine that we try this process for many complex numbers in an interval. Depending on the initial starting input, we end up in a different root. By colouring the results according to the root we end up in, we obtain the <em>Newton fractal</em>.</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb10" style="background: #f1f3f5;"><pre class="sourceCode julia code-with-copy"><code class="sourceCode julia"><span id="cb10-1">lower <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2im</span></span>
<span id="cb10-2">upper <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2im</span></span>
<span id="cb10-3"></span>
<span id="cb10-4">step <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5e-2</span></span>
<span id="cb10-5"></span>
<span id="cb10-6"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># generate a range of complex values</span></span>
<span id="cb10-7">Z0 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [a<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span>b<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span><span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">im</span> for b <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">real</span>(lower)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span>step<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">real</span>(upper),</span>
<span id="cb10-8">                    a <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">imag</span>(lower)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span>step<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">imag</span>(upper)]</span>
<span id="cb10-9"></span>
<span id="cb10-10"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># apply the update 100 times</span></span>
<span id="cb10-11">Z100 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">applyiteratively</span>.(Z0, update);</span></code></pre></div></div>
<p>This results in a large complex matrix. We might define a colourmap for complex numbers as done <a href="https://vqm.uni-graz.at/pages/colormap.html">here</a>, though plotting the angle of the complex number in polar coordinates suffices.</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb11" style="background: #f1f3f5;"><pre class="sourceCode julia code-with-copy"><code class="sourceCode julia"><span id="cb11-1"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">using</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">Plots</span></span>
<span id="cb11-2"></span>
<span id="cb11-3"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">heatmap</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">angle</span>.(Z100), colorbar<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">false</span>, color<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=:</span>rainbow, ticks<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">false</span>)</span></code></pre></div></div>
<p>Below are some other examples.</p>
<p><img src="https://latex.codecogs.com/png.latex?%0Af(x)%20=%20x%5E8%20+%2015x%5E4%20-16%0A"></p>
<p><img src="https://latex.codecogs.com/png.latex?%0Af(x)%20=%20%5Ccosh(x)%20-%201%0A"></p>


<!-- -->

</section>

 ]]></description>
  <category>computing</category>
  <category>maths</category>
  <guid>https://michielstock.github.io/blog/posts/2021/2021-10-17-fractal/</guid>
  <pubDate>Sun, 17 Oct 2021 00:00:00 GMT</pubDate>
</item>
</channel>
</rss>
