Tuesday 25 April 2017

Preparation of exam.

Preparation Notes - Hell lot of Math and Algorithms; very helpful.

Note : These notes are made during my preparation for my exams. They might be crude and may not be in their best form of presentation. Read at your own risk.


Subject : IC 021 - Computational Techniques in Control Engineering

Professor : Dr. A Ramakalyan.

Difficulty : Runs to Heavens and goes around it times.

Books:
1. B N Datta’s Numerical Methods for Linear Control Systems. - referenced as [1]
2. Gilbert Strang’s Linear ALgebra and it’s applications. - referenced as [2]
3. S Kumaresen’s Linear Algebra - A Geometric Approach. - referenced as [3]


1. Computing [1]

  1. There are many ways of doing this, one of the very popular one is the Taylor Series method.
    We simply expand as per the Taylor series.
    Hence, can be written as,

    • The drawbacks to this method are that a large number of terms is needed for convergence, and even when convergence occurs, the answer can be totally wrong.
  2. Hence, I will now get into the Pade’s Scaling and Squaring algorithm for this task.
    Suppose that, is a power series presented as,

    Then the Pade’s Scaling and Squaring Algorithm, given an approximation of as ,

    The and are chosen such that the terms containing are cancelled out in . The order of Pade’s approximation is . The ratio is unique and the coefficients and always exist.

    Similarly, Pade’s approximation for is given by,

    Where,

    and

    • It can be shown (Exercise 5.16) that if p and q are large, or if A is a matrix having all its eigenvalues with negative real parts, then is nonsingular.
    • The difficulty of Round off errors in Pade’s method can be controlled by Scaling and squaring.
    • Since is same as , the idea is it to find out in terms of powers of so that can be computed accurately and then find with repetitive squaring.
    • This method has favorable numerical properties when .

      Let be chosen such that , then Moler and Van Loan(1978) have shown that there exists an such that ,

      Where , with

      Given an error tolerance of we should choose such that

      The Algorithm is as follows:
      Input : ,
      Output : with

      Step 1: Choose such that , set .
      Step 2: Choose and smallest non-negative integer satisfying,

      Step 3: Set
      Step 4: For do

      Step 5: Solve for : .
      Step 6: For do,
    • The algorithm requires about flops.
    • The algorithm is numerically stable when A is normal. When A is non-normal, an analysis of the stability property becomes difficult, because, in this case e a may grow before it decays during the squaring process; which is known as “hump” phenomenon.
      Example at Page 143 of [1]
  3. We have another effective method called the Matrix decomposition method uses the Real Schur form to do so.

    Let be transformed to a real Schur matric using an orthogonal similarity transformation:

    Then,

    Note that is upper-triangular.

    The algorithm is:
    Step 1: Transform to using the iteration algorithm.

    Step 2: Compute :
    for do,

    end.

    for do
    for do
    set

    end
    end
    Step 3: Now we have then we compute


2.Lyapunov Stability theorem: [1]

Lyapunov Stability theorem,
The system :

is asymptotically stable , for any symmetric positive definite matrix , there exists a unique symmetric positive definite matrix satisfying the equation:


Kronecker Product and Lyapunov:

For example,
if

and,

Then, the Kronecker product will look like,

It is evident that,

Now, we formulate the using the Kronecker product. Note that is negative semi-definite. is positive definite and symmetric.

Vectorisation of a matrix Stack all elements of
the matrix into one column.

Going directly to the final answer,

Verify it once.

If is stable then has unique solution.


Schur method of Lyapunov:
Method proposed by Bartels and Stewart. It is based on the reduction of to .

Step 1: Reduce the problem.
For,

is reduced to,

Where,
, and .

Step 2: Solution of the reduced form.
Let,


and
Assume that the columns through have been computed, and consider the following two cases,

Case 1: . Then is determined by solving the quasi-triangular system,

If, in particular, R is upper triangular, that is there are no “Schur bumps” on the diagonal, then each , can be obtained
by solving an upper triangular system as follows:


Case 2: this shows a Schur Bump.

Example at Page 274


If doesn’t have Eigen Values in the Limit circle , we modify as,

Use this in the Discrete Lyapunov which is given by,

The resulting equation is,

You will get a similar equation to that of the normal Lyapunov equation.


3. Modified QR algorithms:[4]

  1. Modified Gram-Schmidt method:
    for

    end

    for

    -for

    -end
    end
    It requires operations.
    Practice example from the above link

  2. Original algorithm of QR decomposition:
    Aim is to write matrix in terms of .
    Here, is an orthogonal matrix with orthonormal columns; and is an upper-triangular matrix.

    Now, we take an example,

    We will first find , and as the three orthonormal vectors using the GS-strategy.
    Now, we will define , and as,

    We define a partial basis as which will be updated at each step.

    For the first step,
    we find as,

    similarly, we find as follows,

    Now, we update ,

    Now, we find as follows,

    Hence, the partial basis is,

This partial basis is the orthogonal set, hence we now make it orthonoamal,

Hence,
norm of first column,
Similarly,

and

Hence, the orthonormal is,

Now, we have, and ; we now find ; which by theory has to be upper-triangular,

Make up the algorithm from the above steps.


4. Condition Number:[5]

As a rule of thumb, if the condition number , then you may lose up to digits of accuracy on top of what would be lost to the numerical method due to loss of precision from arithmetic methods.

A problem with a low condition number is said to be well-conditioned, while a problem with a high condition number is said to be ill-conditioned. The condition number is a property of the problem.

Condition number is mathematically defined as,

We define the -norm as follows,
For a matrix

The -norm is,


So, for a given matrix,

We get,

Hence,

and,

Therefore,

Thus, the matrix (or system) is ill-conditioned.


The question paper that came for this exam was pretty sadistic.
Give it a try, if you can and tell me how awesome it feels. I will score around 30/50.

Sunday 23 April 2017

a FAILED mathematical approach into the search for the E.T.


Are we alone?

Scientists have been searching for another form of intelligent life for decades now. We have searched and have failed, we have the evidence and yet do not understand what they are.
Numerous Physicists, Astronomers, Conspiracy theorists and even common man ( :p ) have spent most or a significant time of their lives looking into the big blue sky and asking the question, “Am I alone?”
This sounds highly unlikely that we are the ONLY intelligent form of life in this huge universe.
I don’t care if the probability of any life in this universe, other than us, is , until and unless it is not , I want to keep looking.
There have been so many things, let us take the Nazka lines of Peru. There are usually called Geoglyphs. These took a lot of time to come in light, Pedro Cieza de León mistook them as trail marks; some people mistook them as irrigation lines.
It was not until the days of flights and aeroplanes, when people saw these clearly; that is when they understood that these were not trail marks or anything. These were signs and drawings.
The one I like the most is as follows:



Now, what I ask is,
- How did they make these?
- Who did they make these for?
Unfortunately, these answers are not yet answered.

Some archeologists and geologists studied these lines and the results are shocking. These are not just lines with some nonsensical scribbling; these are made to last for a long time. Let alone the design; the methodology of design is scientific too. An excerpt from wikipedia is says the following,
On the ground, most of the lines are formed by a shallow trench with a
depth between 10 and 15 cm (4 and 6 in). Such trenches were made by
removing the reddish-brown iron oxide-coated pebbles that cover the
surface of the Nazca Desert. When this gravel is removed, the
light-colored clay earth which is exposed in the bottom of the trench
produces lines which contrast sharply in color and tone with the
surrounding land surface. This sublayer contains high amounts of lime
which, with the morning mist, hardens to form a protective layer that
shields the lines from winds, thereby preventing erosion.


Are these just drawings after all?
These are maps, some theorists say. Don’t believe them? have a look at the image below.


commercial photography locations

One of my favorite conspiracy theory is by Erich von Däniken, it is called the Cargo Cult
Erich von Däniken’s theory is the most famous approach to solve the
mystery of Nazca. He had the idea that long time ago visitors from
other stars visited the earth and naturally Nazca. At this place they
landed, during the landing stones was blown away by the power of
rocket propulsion. By approaching more the power was increasing and
the cleaned band broader. In this way the first trapezes emerged.
Later the Aliens disappeared and left confused people. Like in the
modern cargo cults they tried to call the Gods back by drawing lines,
figures and trapezes. Never Däniken said the formations was made by
Aliens. He discovered the GGF/Mandala/Zodiac and the mirror -
Formation and compares them with modern VASIS or PAPI-Signs.
To read more please visit : Conspiracy theories of Nazca Lines.

Mathematics:

There is a mathematical formula by American Astronomer and Astrophysicist Frank Drake [3]. He is hugely regarded as the father of modern SETI(Search for extraterrestrial intelligence).
The criticism related to Drake’s equation is not about the correctness of the equation itself, but about the highly ambiguous estimations of the various variable used in the equation.
The equation is as follows,

Here,
= the number of civilizations in our galaxy with which communication might be possible (i.e. which are on our current past light cone);
= the average rate of star formation in our galaxy
= the fraction of those stars that have planets
= the average number of planets that can potentially support life per star that has planets
= the fraction of planets that could support life that actually develop life at some point
= the fraction of planets with life that actually go on to develop intelligent life (civilizations)
= the fraction of civilizations that develop a technology that releases detectable signs of their existence into space
= the length of time for which such civilizations release detectable signals into space
For people wondering what is a light cone, here is a picture. This is
a gloried way of looking into the dynamics of time.


In special and general relativity, a light cone is the path that a flash of light, emanating from a single event (localized to a single point in space and a single moment in time) and traveling in all directions, would take through spacetime


Criticism:

  1. One major setback of this equation is that it takes no account of the cosmological developmental phases and time, the value of would heavily rely on the speed of cosmological development[1].
  2. There is no derivation or methodology of how this equation came into being; which suggests that it is just a stab in the dark.
  3. The factor determines habitability; how in the fuck’s world do you find that? Oxygen and Water makes Earth habitable for humans; and probably in some planet , Nitrogen and Alcohol makes it habitable [2].

Here is a beautiful image about Drake’s equation,


Conclusion:

  1. This is a very badly written equation; not because it is wrong. But, because it has no methodology involved. Looks like couple of fresh college graduates wrote this while having some really potent weed.
    2.Drake’s equation is therefore a Fermi Paradox.
The Fermi paradox or Fermi’s paradox, named after physicist Enrico
Fermi, is the apparent contradiction between the lack of evidence and
high probability estimates, e.g., those given by the Drake equation,
for the existence of extraterrestrial civilizations.

An interesting coming from xkcd[3], it added another term which is the amount of bull shit you are gonna buy from the the drake equation.




Cheers!

Monday 10 April 2017

Euler - Riemann Zeta Function.

“Madam, I have just come from a country where people are hanged if
they talk.” ― Leonhard Euler
The Riemann Zeta function, denoted as is a function of a complex variable that analytically continues the sum of the Dirichlet Series, [1]

The entire blog will be divided into the following parts:
  1. What is Analytic Continuation?
  2. What is Dirichlet Series?
  3. Recurrence relation between Bernoulli Numbers.
  4. Relationship between Bernoulli, Riemann and Euler.

1.

Before we talk about Analytic continuation, we will have to know what an Analytic function is.

There are multiple ways of defining the Analytic functions[2]. The one that I find most comfortable is given below:
: A function is said to be analytic in a region of the complex plane if has a derivative at each point of and if is single valued.

For better understanding, I will extend an example,
: Consider = , determine if the given function is analytic or not.
: We will use the Cauchy-Riemann equations.
For a given,
Now we have the following definitions,

Now, according to the Cauchy-Riemann Equation, any is an analytic function, iff,
Now, for the given ,

Hence, the relations are,

It is clear that,

Therefore, the given is not an analytic function.

Analytic continuation is a pretty simple concept to understand really.
: Say is an analytic function defined over a non-empty open subset of the complex plane . If is a larger open subset of , containing , and is an analytic function defined on such that,

In other words, Analytic continuation is the method of extending the domain of an analytic function. [3]

For some cool examples on Analytic continuation refer Virginia Tech’s paper here [4].

2.

Dirichlet Series[5] is any series of general form,

Now, with a slight modification,

We get,

For a function defined as,

is the Riemann Zeta function.

3.

Definitions,[6]

Therefore, is given as,

More generally,

for ,

or equivalently,

The above relation is symbolically written as,

On expansion, all -th powers of , must be written as and treated as Bernoulli Numbers.
The expansion is done on the basis of Binomial Theorem, which statest that,

Therefore, for ,

Therefore, for , after expanding for we have,


4.

Euler found a formula which easily defined the **even-numbered zeta**functions as follows[7]:

Interestingly, , so there is no counter-part for and yet a value of exists. Well, that is beyond my scope of this blog.
Cheers!

Tuesday 4 April 2017

Collatz Conjecture - a study.

God does not care about our mathematical difficulties. He integrates empirically. - Einstein.
In Mathematics, we often come across Conjectures. A conjecture is a conclusion or proposition based on incomplete information, for which no proof has been found[1].
Collatz Conjecture is named after Lothar Collatz [2]. The conjecture is also known as the conjecture.
Now, let us see how it works, it is, in fact very simple, no , no , no etc.
For any given positive integer ,

If we keep repeating this process,
We use the Half Or Triple Plus One acronymed to .
So, for any given positive number, say , we do the following steps:
15 is odd 15 3+1=4646 is even
23 is odd 233+1=703510653160
80402010516842
You get the idea now. In this blogpost, I will explore various aspects of the Collatz Conjecture. A loose structure of the blog is going to be,
  1. Collatz for Negative numbers.
  2. Collatz for Fractions.
  3. Collatz for Irrational Numbers.
  4. Collatz for Prime numbers and pattern recognition (if any) in the number of steps it needs for different scenarios to reach to one.
  5. What is the possible approach for the proof of collatz conjecture?
  6. Difficult and beautiful.


1.

I don’t understand why do they have the condition, in the conjecture. Let’s look at an example and see what happens when Collatz conjecture is applied to number, when .

For, , let us do the collatz conjecture,
-5 is odd -5 3+1 -14 is even -7 is odd -20 is even -10 is even -5 is odd -5 3+1 -14 is even -7 is odd -20 is even -10 is even -5

So, there it is.
If we use the Collatz conjecture to negative numbers, we get oscillating values and they even eventually set to the starting number itself.

Modified Collatz Conjecture:


These are called “Cycles” that exist for negative numbers and probably also for positive numbers. There is no form of proof, that says that there is absolutely no positive number that gives rise to a similar situation.

2.

For this section, we define something called Number-decimals.
Although, we already know that Even, Odd or Prime are only defined for whole numbers.
: Even-Number-decimal are defined as terminating fractions, say that are converted to decimals, say . Then we remove the decimal point from the number to get .
(If you find this definition to be strange, please comment below and mail me with a possible modification)

Now, if , then is an Even-Number-decimal and if , then then is an Odd-Number-decimal
So, it is pretty clear that the conjecture behaves the same in this scenario.

For example, take , which when converted to decimals comes as . Now, we run the algorithm on to get 1. Similarly for other fractions as well.


In the above approach, we considered fractions as decimal numbers, that is only how we can use the Collatz Conjecture on fractions; that too only if the decimal is terminating in nature. Fractions such as (), , etc. cannot be used in the Collatz conjecture for fractions.

3.

Collatz conjecture for irrational numbers is same as saying that we apply Collatz Conjecture to non-terminating decimals.
Just like , as mentioned above cannot work for Collatz; irrational numbers won’t work too.
For revision purpose, an irrational number is defined as a number that cannot be determined as the ratio of two integers. For illustration, , however, , no exact way of saying this.

4.

Collatz for primes will behave the same, that is my guess. Let’s have a look at it.


Let’s take all the primes from , namely, .

We are sure that all of them will reach eventually. I want to analyze that, in how many steps do they reach and if there is any correlation.

For this, I wrote a small script in R. The code is as follows:
collatz_numbers <- function(n, list_col=c()) {
  if(n==1) return(c(list_col, 1));
  collatz(ifelse(n%%2==0, n/2, 3*n +1), c(list_col, n))} 

We shall define the number of steps taken by the number to reach as .

So,
collatz_number(2)=1 ( = 1)
collatz_number(3)=3, 10, 5, 16, 8, 4, 2, 1 ( = 8)
collatz_number(5)=5, 16, 8, 4, 2, 1( = 6)
collatz_number(7)=7, 22, 11, 34, 17, 52, 26, 13, 40, 20, 10, 5, 16, 8, 4, 2, 1( = 16)
collatz_number(11) =11, 34, 17, 52, 26, 13, 40, 20, 10, 5, 16, 8, 4, 2, 1 ( = 15)
collatz_number(13)=13, 40, 20, 10, 5, 16, 8, 4, 2, 1 ( = 10)
collatz_number(17)=17, 52, 26, 13, 40, 20, 10, 5, 16, 8, 4, 2, 1( = 13)
collatz_number(19)=19, 58, 29, 88, 44, 22, 11, 34, 17, 52, 26, 13, 40, 20, 10, 5, 16, 8, 4, 2, 1( = 21)
If we plot the numbers versus the number of steps it took to get to , we get the following plot,

Which is an increasing series, as per the Wikipedia article[1], have a look at this [3] to have a more clear idea.
The picture below also agrees to our finding,

One interesting observation is how HUGE numbers appear in the sequence. For that, I thoughtlessly try numbers out on my function,
collatz_number(20) = 20 10 5 16 8 4 2 1.
collatz_number(21)=21 64 32 16 8 4 2 1
collatz_number(22)=22 11 34 17 52 26 13 40 20 10 5 16 8 4 2 1
collatz_number(23)=23 70 35 106 53 160 80 40 20 10 5 16 8 4 2 1
collatz_number(24)=24 12 6 3 10 5 16 8 4 2 1
collatz_number(25)=25 76 38 19 58 29 88 44 22 11 34 17 52 26 13 40 20 10 5 16 8 4 2 1
collatz_number(26)=26 13 40 20 10 5 16 8 4 2 1
collatz_number(27)=27 82 41 124 62 31 94 47 142 71 214 107 322 161 484 242 121 364 182 91 274 137 412 206 103 310 155 466 233 700 350 175 526 263 790 395 1186 593 1780 890 445 1336 668 334 167 502 251 754 377 1132 566 283 850 425 1276 638 319 958 479 1438 719 2158 1079 3238 1619 4858 2429 7288 3644 1822 911 2734 1367 4102 2051 6154 3077 9232 4616 2308 1154 577 1732 866 433 1300 650 325 976 488 244 122 61 184 92 46 23 70 35 106 53 160 80 40 20 10 5 16 8 4 2 1
collatz_number(28)=28 14 7 22 11 34 17 52 26 13 40 20 10 5 16 8 4 2 1

All the largest numbers in the sequence are made bold. We can clearly see their chaotic nature, but there is never really any chaos, we just don’t look from a broad enough perspective.


5.

I have failed pathetically, at finding a proper proof for the the conjecture. However, I have some points that could be the lines on which someone could work for proving the conjecture. I will mention them in bullet points,
  • The first task is to show that for all positive numbers, there is not a single number that gives rise to a cycle (to know what is a “cycle”, read section 1).
  • Understanding the behavior of steps with increasing or decreasing numbers.
  • Understanding that is usually the universal way of converting any number into an Even number, so I guess, he played the CLEVER trick there.
  • Looking at even and odd as and and finding if they follow a particular pattern. Further, we can convert these Binary strings to Hexadecimal strings and see if there is a possibility of a Collatz conjecture in Alphabetical domain. [Original idea by Pragyaditya Das].

6.

Collatz conjecture is very nice, if you haven’t seen it already, let me point it out to you.

No matter how many time we do and to a system; if we semi-periodically keep pulling from the system; it will eventually lead to .

Collatz conjecture is the simplest mathematical open-problem available; you can explain all your non-math, non-science or non-engineering friends about it; hell! they might even give a noob try to prove it even.


Cheers! with a sad end…