Fads, India and Innovations


Let’s get straight to the point. Here is what I am going to say:

That is a fad across software industry in general. That is ok, in a way. In fact, here is what serious people had to say about it :

screen-shot-2016-11-08-at-11-01-52-pm

Unless software firms decidedly throw this sort of management out of the park, no real innovation can from them.

Nowadays, it is an extreme fad to talk about innovation in India,
in software firms. That is definitely NOT ok.

It is a shame that the country of 1.2 billion did not innovate anything in software
for past 20 years or so. Thus, people are comparing work what is equivalent to
fixing car’s denting and painting with building Formula 1 engines.
That is utter fad. Let’s see how to produce some formula 1 Engines :

Japan produced Ruby, Russia and East Europe – let’s not even talk about it,
Switzerland : Scala, Netherlands – Python…

Only thing India innovated even in this era of tech  is how to segregate their population on their ontological caste system, and matrimonial websites with business rules to match caste:

Screen Shot 2016-11-05 at 9.23.47 PM.png

Only in India This is Possible, Create A Company Based on Caste Matching – SuperHit Too…

that, is sincere innovation, right? A data population form, and then India put a caste into it.

But Indians can put caste anywhere. When Sindhu got the silver in Olympics, the most searched question in India for Sindhu in google search was : “which caste Sindhu belongs to?”.  That is the most innovative way google has been (ab)used in the last 10 years, I am afraid. Perhaps Google would give India a special option on it’s search : “I feel like I am in the same caste as _ “.

Now, coming back to Innovation, it is not something that is :
1. Cheap
2. Easy
3. Something that can be balanced between work and life
4. Glossy trumpeting thing
5. Like swimming – that one can teach people.

There are very notable exceptions. There is this paper Primes is in P. Outlandishly amazing that is.See it here. That is the last serious monumental work done on Computer Science – and the first  (hoping against hope of many to come ) from India.
Another : probably first in a couple of decade , in Nature, which is published by all Indian Authors and all of them are from India. That is Kudos, and that is innovation. It surely sounds and tastes like one.

So yes, there are people, there are serious minds at work, BUT they don’t really get press, any press.

In India, serious people are too shy to take stand for themselves.
Thus, these innovators are not even at the helm of the Indian tech Industry.
India does not tolerate deviation from the norm, it’s whole system pushes you down the
roads of mediocrity. However, once excellence gets pushed outside India,  after that, every Indian practically worships them : take Viki for example.

Real Innovation is not easy like “oh let’s have a Hackathon” .

And you certainly do not need to innovate to make money.
Consider a fast food joint – Hyderabad’s famous Gokul’s chat,  there is no innovation really, but they are making a HUGE amount of money.
That also, because it has *Quality*, a thing surprisingly missing from almost any Indian tech firms, save 2/3.

My first mentor, manager and lead, Sai used say :

You would be a worker ant,  almost all of you would be a worker ant.

And he was from IIM-A, and folks he was talking to,  were IIT toppers and other toppers from grade A colleges in India.

You will almost never find any original piece of sugar cube, ever. But you should go and pick those pieces and follow,  like a good worker that is. Perhaps, you can find a nice better way of carrying sugar cubes. Even there is innovation.

He was correct. Innovation is and was never easy.

That is how innovation used to come, took 30 people, 5 years research to
change the Office menu into the Ribbon UI. That is NOT Cheap. That IS Innovation.
Show me the money folks, show me the money. Given none of the tech business,
has any business to follow up on India….

stddev

Less than 1% of the Any Population amounts to Anything – Gaussian Curve

By definition, only 1% of the human populace are innovative, and by same definition,
only 1% of these people will ever innovate something, because others simply lack that fire
in them.

Life simply tend to mean only one thing for the innovators – to  make a mark. Thus, for
these people, there is no life, only work – which people do remember after they die.

 

24th_ramanujan_manu_294879f

Ramanujan’s Lost Notebook – That is What Success Means

Steve Jobs was one innovator. Alan Turing another, Von Neumann obviously is there,
probably the greatest innovator of all time, if at all standing only next to Newton in terms of impact.
Here is what Von Neumann is known for ( below ) compare this to Einstein ( more below ) :

 

jvn

Von Neumann’s Contribution

e

Einstein’s Contribution

If you are not Von Neumann, you can not have a life, if you choose to try to innovate.None in this current world is Von Neumann.
Well, I have seen partner engineers in Microsoft, who actually dream of code whole night,  just to woke up at 3 AM to solve unsolved problems, all by themselves.
Yes, they are rich, and very rich, but then conventional life – happiness – no, they don’t have it. They want to win, and be remembered not to die happy.

 

They simply have no time, because unlike us, they know their time is limited on Earth.
They can either relax, or run. They choose to run. They dream of change the world every day. If you have 30 patents, and still hungry, you are the one people should follow. We did follow those.  We only dream of changing the world once. We are not those.
Is innovation easy? No. Albert Einstein was convinced that there will never be any
analytical solution to his field equations. He was proven wrong 2 times, once by Schwarzschild,  from whom the Black Hole radius is derived ( you probably saw Interstellar )

1414078159494_wps_10_interstellar_black__hole_

Black Hole Radius : Innovated by a Military Man – who actually Died in the War

and another  the Godel Rotating universe. Einstein was proven wrong. Both are innovations. Issac Newton invented the whole variational calculus in a good nights work out. Einstein, deduced his field equations over 9 years of personal misery. Lemaître,

the father of Big Bang Cosmology worked hard as he was preaching as a Catholic Priest.
Their work was their life. That is not easy. There is no easy way to innovate.
No Kingly way to learn to fail and learn to succeed.

Forget Rome, even Windows, even AWS, even Google search engine was not build in a day.
How many of the people actually know that the Google Page Ranking actually follows a nice theorem from Dynamical System theory? Those are serious stuff beyond hello world what  people are actually writing.

“Everyone can innovate” does not actually mean anyone actually can innovate. But, a great innovator can simply come from anywhere. Understand and appreciate it.

Thus, it would actually be wise to find out who has the traits of an innovator, which starts at sacrificing a lifetime  perhaps to find only failures, determined – focused and with never say never again attitude. Unless one is searching for the traits, you would never find an innovator. Remember Ramanujan and Hardy,  and remember Davy and Faraday, and then Einstein and Satyen Bose. They do not certainly like to being ridiculed for having a lack of life. Thus :

If you are not an innovator, you can not certainly find another one.

Open question to all the people in Indian tech management, were you innovative enough?  What did you innovate, and when did you innovate last that you believe you are  actually capable of finding another innovator in someone else? 

  1. India has a people of 1.3 billion.
  2. We should be having one hundred thirty thousand innovators, by now.
  3. Where are they? Whose failure that is?

That is the introspection the so called leaders of Indian software industries had to answer.

P.S. Conducting utter nonsensical seminars and meeting about innovations – is not going to crack it. Preach only what you practiced. You stayed a clerk, and you can only find another clerk. And almost surely you can not find another Ramanujan or Einstein.

 

Leave a comment

Deep Learning, The Story of Epicycles Repeating?


Prelude.

It is obvious that I do not know anything. That statement is probabilistically true, given the knowledge that is to be is a set ( obviously uncountable ) and my knowledge is obviously is countable (finite). I do not even have any degree to talk about computation in general, clearly a B.E. does not count. My job is typing in software like a clerk and thus, none should actually take me seriously.  This post is not my job, it is just a lament.

Theory of Epicycles.

There was an era, where people do actually believe that the earth is fixed, and sun is rotating around the earth. So was all the other planets. This is known as geocentric model. And, it beautifully worked. Till, people figured out there are issues. There were motions which could not be described, mars would go to a direction and then apparently for no reason changed it’s direction in the sky and change it again. Thus the theory of epicycles was born to the most scholastic mind. Now, after thousands of years, we know, for certain, they were plain wrong ( is it? Not entirely sure – see more on Occam’s Razor ).

To the Point : Onto Computation & Machine Learning

Is there a point to it? Yes. Einstein disliked Quantum Physics. Because, there is no mechanism to it, and it is mambo jumbo. It does not really ask what is happening inside, and replace it with observables. The same pattern exhibited by Ptolemians, thousands of years ago. But, a bigger badder folks are into it now. The folk of Machine Learning. Apart from the very front runners and the very starters of the machine learning ( then called A.I) none bothered to check what computers can actually do or rather they are doing.  For those, who are late into the game of understanding, by Church Turing thesis , a standard computer can not exceed  the disabilities of a Turing Machine. That invariably means, nothing running on a computer or computer alike ( any combination of  Neural Networks ) will suffer from the same disability as that of a Turing Machine. Hyercomputation  is not possible with NN(Neural Network)s. They would suffer the same fate as that is a TM (Turing Machine). But, none of the machine learning folks seem to be bothered about the TM nature of actual computation. They are much bothered about applying non applicable continuum mathematics ( read arithmetic on Real ) when they don’t even care that the algorithm  they are so much glorifying can not even run on a real computer. TMs work only on Natural Numbers.

The Halting Problem

When a computation ends in a Turing machine? When given an input, it halts. It is well known that the set of inputs for which a Turing machine halt is a null set. Worse, even for all integers, the set on which a Turing machine would halt still has no density. The summary, TM’s almost surely, never halts. So, when it does not halt, if you inspect the tape of the turing machine, from computation to computation, how does it look like?

A Tape of a Turing machine comprise of symbols, drawn from a finite set. That is called the alphabet of the Turing Machine, loosely. Now, given finite symbols exists, each symbol can be taken to be as a digit, and immediately Godelization becomes possible. Thus, at each step of computation, the tape of the TM can be taken as nothing but representing a number. Hence, a TM going through computation looks like :

T1 -> T2 -> T3 ->T4 …

And that generates the sequence of numbers. That is the sequence.  They are all natural numbers, or rather, if you use our formulation, they are all Rational numbers between 0 to 1 ( imagine there is a decimal point in the left end of the Tape of the Turing Machine ).

Thus, the question is, when TM does not halt, what is the behaviour that is exhibited by the sequence of numbers, appearing on the tape of the TM?  We have proven that the sequence of numbers showcases chaos.  But where machine learning jumps in?

The Machine Learning Problem

Can a program can learn? *Learn* here means, can a program, given input, produce another program, that satisfactorily generates solution to some very specific problem?

Sorry, this is too vague. But two things are certain. A program, trying to create another program which is the result of the computation. Thus, like any other computation, the TM’s tape has the result as the program. Thus, the program we are so much after, gets generated as nothing but a string of symbols or rather a rational number on the tape of the *learning TM*.  Hence, the step by step running of even any machine learning algorithm would generate similar sequences like the earlier :

L1 -> L2 -> L3 -> L4 …

So, when we say, the learning algorithm *converge* what do we mean? The convergence can mean, any of the following :

  1. On this space, the algorithm is producing sequences which are converging like an ordinary metric space with a distance metric |Li – Lj| treating L’s like rational numbers.
  2. On the recognition space. This is non trivial, and axiomatically one needs to define a metric for closeness criterion. A suitable metric can be Noga metric, which says ratio of successful classification to total sample size. That is a joke. The point is, the success criterion on the recognition space has no real meaning on the TM’s tape space and vice versa.

But any error minimisation would now directly hurts the sequence in the L (TM’s tape ) space. Distant points in the L space can be very close in the recognition space. Distant point in the recognition space can be very close in the L space. That, and this, is a typical hallmark of chaos, or rather what is called, the mapping between L to Recognition space, is chaotic. But let’s drop that. That is too much impractical math. Let’s do some borderline practical and then very practical basic computation.

Cantor Set and Deep Learning

There is this nice thing called Cantor Set.  You take any line segment, and then select the first 1/3 rd, then reject the next 1/3rd and then select the last 1/3rd again.

400px-cantor_set_binary_tree-svg

Now think like this, Cantor Set is actually doing primitive deep, very deeeeeeeep learning. The basic computation blocks are 2, accept ([0,1/3] , [2/3,1]  )  and reject (1/3,2/3) . Purely dumb, but then it recursively performs the same computation again and again over partial inputs. It is wonderful, that it took thousands of years to imagine this for mankind, and worse that even after looking at it, thousands of smart guys, none saw the similarity between this and computation done till infinity. That is a shame for the Computer Science. The space, or rather the computed result of the Cantor Set Computation is Cantor Set, and is a Fractal.  It converges, to a …. news flash : Fractal.

The initial condition are : of course, 1/3 , and tri partition. If you change it, the resulting fractal would be absolutely different than the Cantor Set, albeit having same criterion, same characteristics.  It can be easy shown that given a finite set of selection and rejection logic, when recursively applied to infinity, the set isolated would be Cantor like, a fractal.

Thus, arbitrary back propagation, which is equivalent to a loop running and fixing itself again and again – generates and isolates, a fractal like structure, if the day is bad for it. By invoking density and measure theory, one can easily argue and prove that almost surely any recursive, till infinity computation would only isolate fractals. There are no fixes but stopping at whim. But there is no guarantee that by that time, the system was already in the path to the chaos or not. By increasing more layers, by fixing more errors, only chaos they are ever going to get. The system thus learned, would catastrophically fail to recognise  simple other inputs, and only a local fix would remove that failure. Because you are not at continuum any more, you are in the realm of discrete, and no matter how much one likes continuum mathematics, those are not computable, ever.  They are not counter intuitive, they are what they are. Like every function is almost surely discrete, like every continuous function is almost surely non differentiable, almost every machine learning method must isolate fractals, deep learning, more so due to it’s nature.  That is why those counter intuitive properties were shown long back in the field of vision, and is appearing more and more in the field of deep learning.

Epilogue

I am not going to defend the viewpoint, ever again, nor when it emerges victorious I would claim that we said so. Human achievements are meaningless in the temple of the Truth. There is a proverb: It is fine to make a person awake when they are actually sleeping. It is impossible to make a person awake when he is simply posing as sleeping. Accepting this viewpoint, at the heart of the computation would be taken as computational catastrophe, the simple, step by step, deterministic approach to reality is breaking down into chaos, literally. Thus, none would accept it, ever. But then, as the final line of Count of Monte Cristo goes: “The only thing humans can do, is to wait.” Einstein said “there is no reason to save the truth using sword.” We, from the second oldest civilisation of  the world taught from the very first days of our life : “Truth Will be Victorious” . And the same taught us : “There is no lie, only lesser Truth.” In that note, I would conclude: “Jato dharmah, tatoh jayah.” as Gandhari did not grant Duyodhana’s boon.

1 Comment

Aching Heart


From here, again . This is the great song from movie Madhumati.

Aching Heart

My aching heart is paining and beating just for you
These eyes won’t have their rest till they summon you
Till they summon you o o o
Till they summon you…

This garden without you is just but a cover
Petals wont spread unless you would come over,
It won’t open unless you would come over
O please come over…
O please come over…

My aching heart is paining and beating just for you
These eyes won’t even have their rest till they summon you
The beating heart of mine always has this saying
Yours am I and as would I be forever remaining…
Yours am I and as would I be forever remaining…

The story of my life is what I want with you to share
Tis the love of yours for that only I breathe here
Only for the love of yours I breathe here …
Only for the love of yours I breathe here …

My aching heart is paining and beating just for you
These eyes won’t have their rest till they summon you
The beating heart of mine always has this saying
Yours am I and as would I be forever remaining…
Yours am I and as would I be forever remaining…

The smile on your face makes the world lose meaning
Where am I and my heart is where for which I have no reasoning
For which I have no reasoning ….
For which I have no reasoning ….

My aching heart is paining and beating just for you
These eyes won’t have their rest till they summon you
The beating heart of mine always has this saying
Yours am I and as would I be forever remaining…
Yours am I and as would I be forever remaining…

— Nabarun Mondal ( translation , tone preserved )

Leave a comment

Forgotten Footsteps


Actual one is by Tagore, can be found here. Here is my translation. My friend used to tell me that there is this whole pot of emotion in every human. When it fills up, then it overflows and becomes poetry. Perhaps it is.

 

I won’t be striding on this road forever,
Cause I won’t be here across this pier,
My businesses closed, my debts repaid,
Cease to visit this place, I would,
While someone gazing along the stars for good
But me, none should remember.

My lute resides in dust cover,
Wild grasses taken my apartment over,
With thorny bushes my garden sharing a bond,
Dark algae infesting my pond,
If anyone gaze along the stars for me, none would remember.

That flute will sound the same,
While none remembering my name,
Days will pass as they do forever
Boats being loaded from each pier,
Cattle will graze, with shepherds in the maze
But someone gazing along the stars for me, none would remember.

Beware of not finding me in the morning.
Still it would be me, with each game turning,
Using a new alias, and a body
I will continue to come and go, ever ready
Perhaps I myself will gaze along the stars for this me, and even I won’t remember.

 

Leave a comment

Dancing in a range


This is about the times when one increments and decrements an index variable, but does not want to get it out of bounds.


/*

I want to keep the index between 0 to 10 say :

*/

index = index + 1;

if ( index > 9) index  = 9 ;

The problem is, there is an if Generally, if’s are kind of bad.

A better alternative can be ( albeit hard to get ) :


index = index + 1;

index =   ( index / 10 )*9 + index % 10 

The result is pretty neat !

Leave a comment

Disabling Maven gpg plugin


This is a problem that is faced by almost everyone, and there are tons of stuff available – a search does it :

Disable Sign Maven

But a better and a cleaner way is to do this in properties section of the POM file:

<gpg.skip>true</gpg.skip>

Leave a comment

Coding Stupidity : the *standard* java coding


It is of some importance that people figures out good code from bad code. It looks like people do not even understand the notion of  the difference between if ( x == true ) and if ( x ). Clearly they never studied Microprocessors or rather did not even study anything. But they are todays *super star* developers.

Thus – a small sharing about what and how it happens. We will start with the stupid code first :

Screen Shot 2015-05-02 at 12.01.50 am

What code gets generated when one compiles this?

Screen Shot 2015-05-02 at 12.02.07 am

Now if we modify the code to make it less stupid – what gets generated ?

Screen Shot 2015-05-02 at 12.03.07 am

This :

Screen Shot 2015-05-02 at 12.03.15 am

See any difference?  I bet you have. One is one line less. WHY? Because some very stupid developer decided to write crap code.  JVM is beautiful. Beauty of Java depends on the power of the IDE.

Summary : do not do x == true or x == false . That would only decrease performance for the same code. But who cares ?

1 Comment

FizzBuzz


https://en.wikipedia.org/wiki/Fizz_buzz ; the issue is http://c2.com/cgi/wiki?FizzBuzzTest ;
It is found that the most optimal also, which still uses some form of conditional is hash.
That is method3. Both method1, method2 are same of cost.
method3 is also the fastest in real time, you can test it with time to see.

def method_1():
    i = 1
    cmp = 0
    while i <= 100:
        if i % 5 == 0 :
            cmp += 1
            if i % 3 == 0:
                cmp += 1
                #print('FizzBuzz')
            else:
                cmp += 1
                #print('Buzz')
        elif i % 3 == 0 :
            cmp += 2
            #print('Fizz')
        else:
            cmp += 2
            #print(i)
        i += 1
    print(cmp)

def method_2():
    i = 1
    cmp = 0
    while i <= 100:
        if i % 3 == 0 :
            cmp += 1
            if i % 5 == 0:
                cmp += 1
                #print('FizzBuzz')
            else:
                cmp += 1
                #print('Fizz')
        elif i % 5 == 0 :
            cmp += 2
            #print('Buzz')
        else:
            cmp += 2
            #print(i)
        i += 1
    print(cmp)

def method_3():

    message = dict()
    message[0] = 'FizzBuzz'
    message[3] = 'Fizz'
    message[5] = 'Buzz'
    message[6] = 'Fizz'
    message[9] = 'Fizz'
    message[10] = 'Buzz'
    message[12] = 'Fizz'

    i = 1
    cmp = 0
    while i <= 100:
        r = i % 15
        if r in message:
            cmp += 1
            #print(message[i])
        else:
            cmp += 1
            #print(i)
        i += 1
    print(cmp)


def main():
    i = 0
    while i < 100000:
        method_1()
        #method_2()
        #method_3()
        i += 1
    pass


if __name__ == '__main__':
    main()

Leave a comment

A stupid word game – scrabbles?


I am sure you guys have know the game of jumbled up words.
For example, someone gives you Bonrw and you need to say : Brown!
Suppose I tell you to write a program to do it. It can be done in the hard way or the easy way.
The hard way is to permutate the word – and then get a match.

But there is a better way, what if we sort the all the words in a dictionary  letter by letter and then use that sorted word as a key? Then we can easily solve the  problem by this?


def create_hash(some_file='/BigPackages/dictionary.txt'):
    dict_file = open(some_file)
    my_dict = dict()
    for line in dict_file:
        line = line.strip()
        arr = sorted(line)
        key = ''.join(arr)
        if key not in my_dict:
            my_dict[key] = [line]
        else:
            my_dict[key].append(line)
    return my_dict
    pass


def improvise(word):
    final_words = []
    char_array = list(word)

    return final_words


def main():
    eng_dict = create_hash()
    while True:
        word = raw_input("Enter your word: ")   # Python 2.x
        trial_key = ''.join(sorted(word))
        if trial_key in eng_dict:
            print (eng_dict[trial_key])
        else:
            print('No Dictionary Match! BUT I would now permutate!')
            words = improvise(word)
            print(words)
    pass

if __name__ == '__main__':
    main()

Leave a comment

The next higher permutation problem


We start with a problem : Given an integer find the next highest integer having the same digits.
Or, in essence – find the next highest permutation. How to do so?
We note that the whole notion of permutation acts this way.
You need to traverse the integer from the least significant digit to the highest.

If you can see that anywhere you can have a number (digit ) at place (C-1) smaller than the current number ( digit ) (C) – you know you can create a higher permutation.

But which one? Now take a look around the right side of that current number.
Can we see find a smallest number which is bigger than the number at C-1 place?

If we can find, then we swap that number with the number at C-1, and then from location C sort the right side of the number treating it as array of digits.

That is all there is.

/*************************

  Big mystery of the universe is next highest permutation
  We solve it here. Just for the sake of fun.
  I do not care if this is un-optimal - it does the work
  The sorting can be easily improved by counting sort, 
  but let's not get there

**************************/
#include <stdio.h>
#include <string.h>

// pointless to malloc?
char buf[64];

// We all know what it is
void swap(char* ptr, int i, int j){
	char c = ptr[i];
	ptr[i] = ptr[j];
	ptr[j] = c;
}

// Also we know what this does - sort from position from
void sort ( char* ptr, int from , int len ){
	for ( int i = from ; i < len; i++ ){
		for ( int j = i + 1; j < len; j++ ){
			if  ( ptr[i] > ptr[j] ){
				swap(ptr,i,j);
			}
		}
	}
}

// This is interesting, finds the next highest digit of 'gt' from position 'me'.
int find_next_highest(char* ptr, char gt , int me, int len){
	int index = me;
	char nh = ptr[me];

	for ( int i = me+1; i < len; i++){
		if ( gt < ptr[i] && nh > ptr[i] ){
			nh = ptr[i];
			index = i ;
		}
	}
	return index;
}
char* get_next_permutation(const char* sn){
	sprintf(buf, "%s",sn);
	int len = strlen(buf);
	for ( int i = len -1 ; i >0 ; i--){
		if ( buf[i] > buf[i-1] ){ // Now we need to do something 
			// find the one which needs to be swapped 
			int index = find_next_highest( buf, buf[i-1], i, len);
			// swap it 
			swap( buf, i-1, index );
			// now sort the right side to generate the absolute min on that 
			sort( buf , i, len );
			// I am done after this 
			break;
		}
	}
	return buf;

}

int main(int argc, const char** argv){
	char* ptr = get_next_permutation(argv[1]);
	printf("%s\n", ptr);
	return 0;
}


2 Comments

Design a site like this with WordPress.com
Get started