Anand CV Mallaya

Archive for the ‘math’ Category

Science and rebirth?

In math, science, spirituality on November 30, 2012 at 2:32 pm

I was little worried that I am becoming a pseudo-scientist  This feeling of guilt was burning inside my mind for sometime and wanted to do really scientific approaches in problem solving.

On the cold morning today, I had this interesting thought on rebirth. Normally I will delve in to thoughts for a few hours and then it will remain as a common religious belief. So this time I wanted to do an exercise on this to improve my scientific problem solving skills.

The problem:

Is rebirth scientifically possible?


Let us look at definition of rebirth here. Rebirth is defined here as having the same appearance of a person died before.

Now science tells us that the characteristics of body of a person is defined by mostly the genes. But this is not the only thing that shapes a body. It depends on the environment the person lives. This include the food, the climate etc. To simplify we will define a person as a set of genes. So rebirth in this context is having exactly the same sets of genes that of a previously dead person.


The number of variation or mutation in genes  are vary small. That is if we consider genes as a set of playing cards, the deck of cards are  unchanged. Each individual gets a shuffled set of cards.


This problem can be done only statistically. Let us start some number crunching

Total initial population, P0 = 10000
(Note: there is a hypothesis that entire population today are coming from a small population which survived a global catastrophe in Africa)
Reference : The Human Journey: Migration Routes (

Total genes per person, Gi = ~20600

Maximum genetic difference in the population (assuming all genes of the population are different) Gp=  Gi*P0 = 206,000,000

Total population ever lived till date Pt = 108,000,000,000

Assuming the variation in the gene pool through mutation is negligible over time, total possible unique individuals = Pt/Gp = ~524

So if there is no gene variations happening  there must have existed around 524 exact copies of every individual.
Read the rest of this entry »

God of small things : An approach to simulate simplest organism in a computer

In life, math, science, Technology on October 16, 2012 at 10:50 pm

Recently, scientists at the Stanford group in association with the J. Craig Venter Institute published a paper regarding the successful attempt to simulate a complete organism from its DNA in a computer cluster, for the first time in the history. They simulated a simplest bacterium named Mycoplasma Genitallium, which is capable of replicating inside the simulation. The implication of this is enormous, as this will bridge the gap between engineering and biology and in our quest for solutions to many problems. You can read about the analysis in here. The original paper here

Seven months back, on my sabbatical, I was trying to do the same.

I was trying to simulate a simple bacterium from DNA available public from here. It has only one circular chromosome. I learned about the processes involved in the cell formation from the DNA. DNA is basically the code for two fundamental things happening inside an organism – replication and transcription. Replication is the process of making a copy of the DNA itself and transcription is the process of reading the gene code blocks and generating long chain molecules called Proteins in multiple steps.

DNA transcription

DNA transcription

My work is more inspired by the theory of cellular automata and the Conway’s game of Life. I also considered the concept of fractal to model my organism.

In order to understand the DNA we have to look at it through an evolutionary perspective. If you look at a particular organism or more specifically its genotype and its phenotype, its just a small snapshot of an unbroken chain of repetitive process of replication(the output is a copy of the DNA) and transcription(the output is proteins ). The process started since the beginning of life itself and have undergone innumerable changes(evolution). This in my opinion is a fractal pattern.

Mathematicians have shown before that simple life like structures can be represented by simple set of equation iterated numerous times. A fern for eg. Barnsley fern.

Fractal Fern

Barnsley Fractal Fern

Instead of placing dots in an image as done by the  Barnsley fern equation, the DNA puts complex 3D structures with lot of different physical properties called proteins. This is similar but complex form of Conway’s Game of Life, but much complex. In Game of Life, the cells are actually square cells which can have only one of two states : “dead” or “alive”. From simple rules like ” if a cell is surrounded by at most three living cell, the cell will replicate else it will die”, we can see self sustaining life like activities emerge from the computer screen from a set of original points.

Conway's Game of Life

Bill Gosper’s Glider Gun in action—a variation of Conway’s Game of Life. This image was made by using Life32 v2.15 beta, by Johan G. Bontes. (Photo credit: Wikipedia)

The DNA is the simple set of equations that give raise to complex structures if allowed to repeat enormous time. The structure (phenotype) we see is an emerged form from this process of protein making and other associated process which are perceived as phenotype. For eg. snow flakes are beautiful complex patterns emerge from the simple physical laws.

Snow Flakes

Snow Flakes – Fractal like structures emerging from natural processes. Example of emergence.

The hypothesis is that if we can model basic blocks of  the DNA, which are the Carbon, Hydrogen, Oxygen  and Nitrogen atoms, and simulate all the dynamics between them (the fractal equation) and create conditions similar to a culture medium, the living bacteria will emerge from it! If we can put ultra-fast computers to perform probabilistic calculations and molecular level interaction.

Of-course it will be very difficult for one amateur guy like me to attempt, but I want to abstract many levels and assume certain things taken for granted.

In contrast with the simulation of whole cell by simulating all smaller sub units, which is a top-down approach, my approach is bottom up – simulate the lowest building block accurately and iterate interactions as it will naturally occur based on probability, predicting that life like features will emerge.

I am on sabbatical again and hope to make it happen this time. Visit this blog later to see if I am successful. Or tweet to me @anandcv

Enhanced by Zemanta

Benford’s law applied to Prime numbers

In math on May 27, 2012 at 6:22 pm

Benford’s law is one of the many amazing laws regarding numbers. Benford’s law, also called the first-digit law, states that in lists of numbers from many (but not all) real-life sources of data, the leading digit is distributed in a specific, non-uniform way. It says that in many large data sets, the digit ‘1’  appears as first digit for a significant 30.1% times, ‘2’ for 17.6%, 3 for 12.5%, 4 for 9.5%, 5 for 7.9%, 6 for 6.7%, 7 for 5.8%, 8 for 5.1% and digit 9 for 4.6%. Below is the Benford’s distribution(Image courtesy Wikipedia).

A sequence of decreasing blue bars against a light gray grid background.

It is obvious that the percentage reduces in a power law as the digit grows bigger(power law).

This is observed in many natural accounting data, election data, genomic data etc.

Here is an attempt to look at my favorite list of numbers using this law. Both for fun as well as for exploratory purpose.

I have done the following in a math tool to generate prime numbers less than 1000000 and then counted the first digit of each prime number and plotted in a bar chart. The plot is given below.

Plot of First digit distribution of Prime Numbers
Clearly, though there are somewhat appearance of a power law distribution, it is nowhere near Benford’s distribution.There goes my search for patterns in prime numbers to the next stage.

Chaos theory and the evolution of sexes

In evolution, life, math, science on January 24, 2012 at 9:29 pm

Chaos theory is considered by many modern mathematicians and scientists as one of the  four pillars of modern science. Chaos theory studies the behavior of dynamical systems that are highly sensitive to initial conditions, an effect which is popularly referred to as the butterfly effect. Chaos theory has  applications in multiple scientific disciplines including:  geology, mathematics, microbiology, biology, computer science, economics, engineering, finance, meteorology, philosophy, physics, politics, population dynamics,psychology, and robotics. This article is an examination of the significance of chaos theory  in the evolution of sexes in sexually reproducing species including humans.

Chaos Theory

Chaos theory in simple terms states that dynamical system which are deterministic (having finite numeber of states and depends only on the initial condition of the system) are unpredictable by nature. In real world this has big consequences because many systems in nature are extremely sensitive to initial condition (such as weather,stock markets,chemical reactions etc.) and which makes it very difficult to predict and control.

Bifurcation and strange attractors

One interesting property came from the study of chaotic systems is that there is a phenomenon called strange attractors. Some systems tends to be chaotic with most of input space(called phase space) except certain region of the phase space. The diagram below shows the two attractors of the system represented by the logistic equation x = 4 x (1 – x) [image courtesy] In many of the systems this process tends to be centered around two attractors. And this is called bifurcation process. This phenomenon is of interest and significance in this article. [image courtesy]

Evolution of sexes

Evolution of sexual reproduction and sexes are of great interest among modern biologists and is one of the mysterious area in biological evolution. There are many competing theories trying to explain this process. Here the attempt is to give a mathematical dimension to the search. As we now, through evolution, living organisms takes all possible forms and tactics to survive and propagate. In most of the species, it is striking that the number of sexes are limited to two(male and female). This is either by chance or limited by certain constraints exerted by nature(like mitochondrial efficiency in the nucleus). But the number two gives rise to the question of its relationship with mathematics. Here are some patterns that connect the chaos theory with evolution

  1.  The biological system(morphology) of any organism is dynamical system.
  2.  Evolution process is mostly in the change in DNA.
  3.  Sensitivity of the morphogenesis of organisms to initial conditions(the DNA).
  4.  Sensitivity of the sexual dimorphism of organisms to initial conditions(X,Y chromosome region of the DNA)
  5.  Large number of iterations over time to support bifurcation(the evolutionary timeline is of the order of billions of years).
  6.  The evolutionary process tries to takes all forms(phase space of the life form) based on the change in DNA(initial condition)
  7.  The number of sexes tends to attract to two(strange attractors,bifurcation?).

The figure below show the hypothetical bifurcation of the evolution of x and y chromosomes. Start from a common ancestor of chromosome pair x’x’ the ancestors of x and y sex chromosomes. Assuming there were no sexual dimorphism at this phase and the evolutionary change can be in any direction. But the number of sexes converges to 2 rather than n types able to reproduce with each other leading to xx(female) and xy(male).

bifurcation of sex

hypothetical bifurcation of the evolution of sexes

Put your valuable comments below or discuss it in Quora The chaos theory of evolution:  An interesting article published in in New Scientist discusses similarity of evolution of life and non-linear systems, fractal nature of life and chaos. My own conversation in ideas :

Interesting Reads 

Some articles which are good read for good background of concepts in Evolutionary Biology, related to Sex:

  1. Evolutionary origins of Cooperators and Defectors
  2. Cooperation and the evolution of anisogamy
  3. A chapter from the book The Score by Faye Flam
  4. Sexes redefined @
  5. The chaos theory of evolution

Interesting videos

During further research, I got these resources which are enlightening some aspects of the truth. Reason yourself.

Evolution of Sex

Origin of Sexes

Mathematical Model of Evolution

Chaos theory

Other articles linking to this page

What the heck is a fractal seed?

In life, math, spirituality on July 3, 2011 at 8:06 pm

You may be wondering.  Fractals are geometric shapes that can be split in to parts,each of which are a reduced part of the whole. In other words, geometric shapes showing self similarity and complexity. Yet they are overwhelmingly present everywhere in nature- from shape of the costlines and mountains to the shape of brocoli and fern. Fractals can be made using special recursive mathematical functions.

The seed of the fractal is the pattern defined by the equation which is repeating throughout the fractal. All life on the earth are fractals too. Fractals made of recursive process of procreation. And we make larger fractal patterns like family, community and countries and biosphere. And we are made of smaller fractal patterns – atoms, molecules, cells and organs.

So I am a seed. A recursive pattern. In that sense I am very old. Millions of years old. And I am everywhere. And I am you.

The binary square wave transform

In math on February 2, 2010 at 9:49 am

You may have heard about Fourier Transform. It is a mathematical tool. It converts any wave form as a sum of sine waves with different amplitudes and frequencies. The reverse is also applicable. Any waveform can be made from sum of sine waves of different amplitude and frequencies. I was so much impressed by the idea that all the signals in the world, irrespective of random nature or periodic can be represented as the sum of periodic sine waves.

This love to the Fourier’s theorem guided me to think about an analogous principle related to the binary numbers. Binary numbers can be thought of as a stream of square waves(analogous to sine waves). So a stream of bits like a file, can be thought as an aperiodic signal. So if there exists a theorem that defines the relation between the binary bit sequence and square wave just like analog signals and sine waves, it will be interesting.

updates 5-october-2010

To get a small idea on what I am trying to do:

go to

wait for the java applet to load, and copy the following and click file->import and paste it, click import and watch the applet. Try clcking on different buttons and watch the out put changes.

$ 1 5.0E-6 10.20027730826997 50 5.0 50
R 192 128 144 128 0 2 25.0 5.0 0.0 0.0 0.5
R 192 176 144 176 0 2 50.0 5.0 0.0 0.0 0.5
R 192 224 144 224 0 2 40.0 100.0 0.0 0.0 0.5
R 192 272 144 272 0 2 200.0 5.0 0.0 0.0 0.5
R 192 320 144 320 0 2 400.0 5.0 0.0 0.0 0.5
152 304 224 416 224 0 5 5.0
w 304 128 304 192 0
w 256 176 256 208 0
w 256 208 304 208 0
w 256 272 256 240 0
w 256 240 304 240 0
w 304 256 272 256 0
w 272 256 272 320 0
M 416 224 512 224 0 2.5
s 192 128 304 128 0 0 false
s 192 176 256 176 0 1 false
s 192 224 304 224 0 0 false
s 192 272 256 272 0 0 false
s 192 320 272 320 0 1 false
o 13 64 0 34 5.0 9.765625E-5 0 -1

Recently I’ve collided with this Walsh functions , which is much like what I am intended to do.
Comment here your thoughts on it.