Denial and Ostrich Algorithm

A few days ago, my friend and I were discussing denial. What is denial? Denial, if you don’t know, is completely avoiding a situation or ignoring the inevitable and believing that it is not there. Now, what do you think about denial? Obviously, you will think that it is not a trait worth cultivating. But what if I told you that in many situations utter and unreasonable denial is the best strategy by far, constantly ignoring the inevitable like it will never happen. Surprised? Well you should, as from the very beginning we are told to tackle problems upfront and never to avoid it and it is the right decision in most cases, but unfortunately not all.

Can you think of one case where denial is the best strategy? In fact, the best one is essential for our function and embedded so well in our psyche that it is hard to identify it. Any guess? Well, it is the denial of death. Without denial, every man (and woman) on the earth will be thinking about death, which is inevitable, and what to do about it. The reason we don’t do that and are able to engage in perfunctory activities is that we are constantly ignoring that fact. We know we are going to die, but most of the time in our subconscious we like to believe that we will leave forever. This denial lets us function, discover, invent and succeed.

Many of you may find the example of death too extreme, as death is inevitable and it does not seem that we can solve it ever (don’t confuse the denial of death here with the desire of elongated life, with fear of death it doesn’t matter whether you die in a year, hundred years, thousand years or at the doom of mankind). But what about the problems which are very much evitable and can be avoided with careful planning? Is it ever better to avoid them? Matter of fact, it is in some cases, and that brings us to Ostrich Algorithm.

Ostrich burying its head in the sand

This is a good strategy, Seriously!

Ostrich Algorithm is more of an approach than an actual algorithm as it suggests doing nothing. It is the most popular approach for tackling deadlock* in many computer systems. The name is derived from the bird ‘Ostrich’ which is believed (however, wrongly) to bury its head in sand when a threat approaches. (Actually, the poor bird is checking its eggs, which it lays under the ground; when it buries its head as you might have seen in many pictures). In Ostrich approach of deadlock prevention, the computer assumes that deadlock will never occur, although it may very well occur and can crash the system. However, in most of the computer system, the chance of such deadlock is negligible, while constantly checking for deadlocks and preventing them can slow the system down. People don’t care if their computer crashes, once a year and they had to press the reset button. For most of us, system crashes multiple times in a year and mostly not due to deadlock. However, the same cannot be told for ‘Nuclear Reactor Controller’, their reliability take place over performance and ingenious deadlock prevention techniques must be used.

After all his discussion, if you still don’t want to believe that in many cases denial is good, then you are in the state of denial; but if that encourages you to tackle any problem upfront and makes you enthusiastic, remain in that denial, for denial is good.

*In computer science deadlock refers to the situation where two processes are waiting for resources held by each other. E.g.  process A is holding resource x and waiting for resource y, while process B is holding y and waiting for x. Both the processes are stuck in a perpetual waiting. This also applies to more than two processes.

Math, you son of a b….!

Math, as we know, is the foundation of many fields of science and technology. Math is there at physics, it is there at chemistry, at economics, at computer science and plenty of other things. I am a big fan of math. In fact, I adore math for its contribution in bettering our lives and for providing mental stimulation for those who are willing. Although I have my share of complaints about math.

First, when I was young in my naiveté I thought math was about numbers, like addition, multiplication and stuff like that. And fortunately, at that time, the math I was learning conformed to that. But as I progressed further I was disabused from my belief. Soon I was acquainted with problems like differentiate ‘4ex(1 + ln x)(sin x) + c‘ . Dude, it’s not math!! It’s just random symbols going through an imaginary process and coming out as something different, but equally useless.

Another complaint is math’s obsession with proofs. If a great mind like Einstein or a genius like Schrodinger says that, “Look, I have done my research and it looks like E=mc2 or ‘this ridiculously difficult differential equation with an infinite number of solutions’ is true.” My reply would be, “Great! I believe you, man”. But instead, he would say, “It looks like E=mc2 is true, and I AM GONNA PROVE THAT”. And I can only say that, “What I have ever done to you to treat me so mercilessly”.


Schrödinger equation, ‘I am gonna prove this’

And yes, I would not be so upset if those proofs were honest, simple, ‘God-fearing’ proofs. But they are not, mathematical proofs are deceitful and sometimes even mean. A great example is ‘proof by contradiction’, I had a sudden realization of it when I was watching one of the videos on YouTube channel ‘Numberphile‘. In this convoluted and treacherous thing assumes that the statement we want to prove is false, then shows that we were wrong to assume that it was false; so it must be true. This kind of chicanery is nothing to be proud of and should be banned for the good of math.

I am writing this all for benefit of math and even more benefit millions of students who felt the wrath of this evil math every day. Beware, math if they will revolt it would be the bloodiest revolution ever.

Note: This post is meant to be funny, I do not seriously believe in the points made. There is no doubt that math has made our life infinitely better and proofs as well as the use of symbols to represent entities are an essential part of it and there is nothing wrong with that. Maybe if it weren’t for math I wouldn’t be typing this post as there would be no computer or the Internet either.


The thing I hate about Indian Television

First of all, I must clarify that I am not very much familiar with Indian Television shows, I have watched very few shows and most of them accompanying someone or at family gatherings. I have not watched a single episode of C.I.D. or Shaktiman, which is a rare quality to find in someone of my age. Although I will still make my point and will make it firmly, because these are the things I have seen in every single show I watched, without an exception. Now first thing first, there is a reason behind my non-acquaintance with Indian TV shows, and it is that I don’t like them at all. There are many reasons behind it– most of the shows are cheap opera with utter disregard for the storyline as well as production quality; reality TV doesn’t look real; comedies are cheap, tasteless and many times vulgar; kid’s shows are rubbish with poor animations etc. But above all this the thing I hate most about it is its brazen disregard for audiences’ time. We watch TV to get entertained and once in a while get a message or get enriched. We pay for that, we even watch commercial, so that shows have enough budget to produce quality stuff. In return, all I expect is a sincere program with only the audience in mind. But they do not do that, they show a minutes worth content in 10 minutes only to make the show longer and worst of that all are the promotions these shows do. You can’t watch a popular show for five episode at stretch without some celebrities promoting their film, mingling with the story. Come on, how someone can tolerate that; I say that it is cheating, fraud, chicanery. Hello, I have f**king paid for the show, and you are showing me someone promoting, it’s like commercial even during the show. Totally unacceptable. The sad thing is people still watch it, unaware of the fact they are fleeced out of their time and money.

OverFlow or Flaw?

Have you ever ran out of hard disk space? No, then you are lying. Every single human being (of our age) has ran out on hard disk space. And when it happens either you delete some unnecessary things (you often find a lot of them) to free space or if you got bucks buy a new hard disk. But what happens when carefully designed protocols and standards run out space or we can say reach their limit. Billions are invested in them and millions of people are using them, so you cannot replace them overnight (and in some cases ever). Let’s see about four of such cases.

1. FAT32

Did you ever had that annoying error when I you try to copy a large file to your USB stick or memory card? It says ‘The file ‘xxxxxx’ is too large for destination file system’. And you are like, ‘what the heck? The pen drive (memory stick) is 16 gigs in size and the file is just like 4.5 or 5 Gb.’ And what you do next is, as it always been, getting super annoyed and asking to an invisible computer overload as Joey* did in ‘Friends’, “Why? Computer, Why? Why are you doing this to me?” And yes, I agree that it is the right thing to do. Now what if I told you that you had to go through this mental anguish because top minds at Microsoft couldn’t see ten years in future. Okay, no one can see future, but when one is designing a file system, one must estimate and accommodate the future needs. The file system most USB stick use is called FAT32 (File Allocation Table 32bit) and it was introduced by Microsoft in 1996 for Windows 95. With a 32 bit Address the largest file it can accommodate is 4 GB and largest partition size is 2 TB. Maybe 4Gb was a large file in 1996, but only after 9 years game called GTA San Andreas was larger than 4 GB. So, their file system can’t accommodate something that can be used commonly by users after 10 years. Although this file system is replaced by NTFS for most Windows based computers it is still used widely in memory sticks and memory cards. You can format your USB drive with NTFS, but then there can be compatibility issue with other devices, especially smartphone OTG connections as I have noticed. There is also exFAT which solves this problem and will mount on smartphones, but it won’t work with Windows XP if it is not updated. Therefore, if you own a 16 GB memory stick which you want to be able to store large files and work with your phone, so you format it with exFAT and then at the college you plug it into a Windows XP which is not updated since like the beginning of time and boom…you are screwed.

2. IPv4

You hadn’t seen this problem on your computer and if you are not a techy you probably haven’t heard about it. But this problem is much bigger than the one we previously described. As you have guessed it is related to the Internet. IPv4 stand for Internet Protocol version 4 and IP address is the address assigned to every device and website connected to the internet. The routers use this address to guide your data to the correct server and same way guides the data server sends to your device. It looks like fairly efficient system, what is the problem then? The problem is that we have ran out of IPv4 addresses. As ‘computerphile’ puts it ‘Internet is full’, there is no room for anything new. You will think that “Well, I see a new site popping out every day”. This is done with many little tricks such as recycling IPs and using NAT. Actually, your device’s IP is not dedicated IP, a new IP is assigned to you by your ISP every time you connect to Internet. A static IP is luxury these days. All this problems are occurring because IPv4 uses a 32 bit address which can accommodate about 4 billion addresses. And with millions of websites, lots of online services, defense departments running their servers and a smartphone in every hand, these addresses have ran out. Who is to blame for this serious shortage of IP addresses and providing a topic for debate to techies for years? (IPv4 vs. IPv6 debate is a decade old and is still hot) IPv4 was designed in 1981 and first deployed on ARPANET (predecessor of Internet) in 1983. Maybe 4 billion was a large number then with just thousands of computer attached to it at that time. But after 30 years the protocol reached its limit is, as I see, a failure in part of the protocol design and deployment. In fact world’s population was about 4.5 billion at that time and was rapidly growing. The protocol designers certainly didn’t had a vision of computer in every hand or idea that it will last this long, but still a small mistake at that time is giving a hard time to many organizations and people. The solution to this problem is IPv6 which uses 128 bit address, which means 2128 unique address this are gazillions (3.4 * 1038 to be exact, enough if each person is assigned a billion billion) of addresses and are unlikely to run out. The problem is there is so much infrastructure that works on IPv4 and so much investment made on it that IPv4 is unlikely to phase out any time soon (or ever, as some expert believe). The future of Internet is as a hybrid network.

3. Unix Time

One can defend the FAT32 and IPv4 situation by saying that it is very hard to predict how computing world will grow and what will come next and it was even more difficult in those years were computing world was growing exponentially in its capabilities (Moore’s Law). But these excuse would not work here as this situation did not involve any more future prediction that ‘I will probably still alive in 2038 or many people alive today will be still alive in 2038 or many computers (servers mostly) we are using today will be still in use in 2038’. Have you ever wondered even when you completely switch off your computer and turn it on again it still shows the right time, even if not connected to Internet. This is managed by a counter powered by a tiny electric cell on your motherboard. This counter is incremented by one every second and it is ticking that way since 1970 (which is 0, negative numbers can be used to denote date as back as 1901). The problem is that the 32 bit (again 32? What’s wrong with 32 bit ) data structure Unix operating system uses to access this time runs out in 2038, when it happens it will reset to zero and it would be a chaos. But what is UNIX? I have not used it. I have not seen it. I have never heard of it. Why are we worrying about such operating system? Many of you will ask. The bad news is Unix is the mother of all modern operating system a whole class of operating system called ‘Unix-like OS’, so not only Unix but Windows (Not Unix-Like but still uses 32 bit time stamp), Mac OS X (which is basically Unix), Linux (Free alternative to Unix), Android and many other operating systems uses this 32 bit time stamp. So we are talking about most of computers in the world. Second, 2038 seems far away, why are we worrying about that? We will figure something out by that time, right. Wrong, this time stamp is ubiquitous and used extensively in embedded system (which cannot be reprogramed). Furthermore, it is used so widely that changing it to 64 bit would create massive code incapability. Lastly, it cannot wait for 2038 for all programs, programs that use future dates need it be fixed earlier. Like, for a program which uses dates from 20 years in future needs it fixed by 2018. The good thing is expert are worried and already working on it, but as some experts say there will still be some systems using 32 bit time even in 2038. The solution to this problem is 64 bit time stamp which will cover us through year 292,277,026,596, which is far greater than lifetime of the earth. Think, if they have used 64 bit time-stamp (or 48 bit, though it would be odd) from the beginning there would be no such problem. But at that time with 8 and 16 bit computing 32 seemed good enough and 64 was something too large.

4. Y2K Problem

This problem is even more ridiculous than the previous one. However, it has already passed and didn’t cause much trouble, but it is worth remembering. Many computers from the 1980’s used only two digits to store the year part of the date. Which meant that it would reach limit ’99’ in the year 1999, and consider 2000 as 00. You may feel what big deal, I always use only two digits for dates and never confuse 2015 with 1915 or 1815 or 0015. And I won’t be bothered if the computer showed me 00 as year instead of 2000. But, unfortunately computer can’t understand it will surely confuse 2000 with 0000. Actually, when computing elapsed time between dates, computers subtracts dates in a predefined way. If a bank computer is programmed to subtract date of deposit from current date with to calculate interest, with year set to 00 it will subtract 99 (which is the date of deposit) from 00(which it thinks is current date). It will be a negative number. As per the formula of interest, you will be paying a negative interest and that also of 99 years! Next thing is that you are bankrupt. It is ironical that best minds of the world couldn’t see what was inevitable in a decade. What they would have said to a CEO of a multibillion-dollar bank, “Mr. CEO, this is a machine we are selling you for tens of thousands of dollars. It is reliable and will manage accounts worth billions of dollars. And yes last thing, it will fail after 15 years, while tearing your entire system apart”.


*Joey is a beloved character of all-time favorite TV series ‘Friends’

Reviving the blog

It has been quite a time, seven and half month to be exact, since I last posted something on this blog. To be political I had taken a hiatus from blogging for a while. To be blunt and honest the blog was dead for 7 months. However, even though I hadn’t posted anything on the blog for a long time it doesn’t mean that I haven’t written anything during that time. I have been writing my personal log fairly regularly during this months as I have done before. Actually, only a few selected items from my personal log (which contains anything that comes into my mind) goes into my web log (which is this Blog). In the following days, I will keep posting some of the writings from that time as well as anything new I write.

Delhi 2015: David vs. Goliath

David Vs. Goliath

For some days I have been following the elections in Delhi, as rest of the country is. I have been interested in this more than, any other elections, all of them swept by BJP. And why I am interested in this one so much? First, because there is a serious competition here for BJP, and second is the nature of the competitor. Generally, I am a BJP supporter, even before the rise of Modi, I rooted for BJP. But this time, in this particular election I root for AAP. Why? Because, when David stands in the way of Goliath, with the sling-shot as his only weapon, against the panoply of Goliath’s, it’s hard to not to revere David. The initial opinion poll and now as I am writing it, exit polls suggests the majority for AAP. If they under the leadership of Arvind Kejriwal, can do that; beat the Shah and Modi led BJP, it would be phenomenal. It would really be David’s victory over Goliath repeated; and BJP—with this Modi wave, the consecutive victories in other state and in the center and with 120 MPs and several union ministers, including Prime Minister Narendra Modi himself for their campaign—is no lesser a foe than Goliath. It doesn’t matter, whether philosophically you agree with David or not, for me at least it doesn’t. (Anyway in our countries politics, it sometimes becomes difficult to point out the ideology of particular parties and almost impossible for particular politicians.) It’s just fascinating to see a party established 2 years ago, bringing a well-established party in its prime to its knees. BJP has spared no efforts including bringing clean faced Kiran Bedi, to counter Kejriwal. Interestingly, this time this dominant and confident party was following Kejriwal; playing the game by his rules. One can argue that it has happened before, they have made a government in the previous election (and it didn’t work well); so why so much fuss about it. But this time it is different, at that time the incumbent party, Congress was falling into abyss, and BJP was still rising to its paragon. Now the situation has changed, Congress has reached the bottom of the chasm and BJP is at its Apotheosis. I have not studied, but I am pretty sure that at no time in past BJP was as powerful as it is now and reigned over the so much area it’s ruling now. And if one can beat that, with a fraction of resources compared to the big guy, he is a Hero, irrespective of his ideology.

Note: David was king of Israel, as per Bible, when he was teenager boy he beat the giant Palestinian soldier Goliath, who was considered invincible. The metaphor of David and Goliath is quite common depicting the fight between large and tiny, and it has nothing to do with goodness of David or evil of Goliath as in the original Biblical story.

Being an Engineer

Today is engineer’s day and all of us are celebrating our degrees. But this makes me think and should make every pass out think, what makes us an engineer? Does a formal degree, or four years of college or knowledge of C, Java or PHP makes us engineer? No, they certainly not.

Who is an engineer?

This takes me to another question ‘what an engineer does?’ a doctor treats unhealthy human beings, an architect designs buildings, and a sweeper cleans the floor. (However, it is possible that some of the individuals in these respective professions will disagree with me).  But what an engineer does, does he designs machines, or calculates loads of the building, or creates software, or mixes alloys, or studies complex structures of proteins. All these very unrelated tasks are done by various kinds of engineers. So is the word engineer a vague generalization for different occupations? Work of graduate in computer applications looks much similar to computer engineer, then of a mechanical or civil engineer. Although, the latter are called engineers, but the former is not. Isn’t it inane? No, it’s not, if you know the definition of an engineer. Which says, “An engineer is a professional practitioner of engineering, concerned with applying scientific knowledge, mathematics, and ingenuity to develop solutions for technical, societal and commercial problems”. Here the important words are “develops solutions for problems”. In short, we engineers are problem solvers. The problem can be ‘to provide an online ticket reservation for 10 million people’ or a simple question asked in GATE exam. Whatever a scale or size of the problem, whatever are available tools, whatever time is allocated to the problem and whatever your role in the solution, as an engineer, your aim should be to solve the problem in the most efficient manner.  Another thing if you have noticed, is the deliberate exclusion of the word ‘past experience or practical knowledge’ in the definition. Experience, as to any professional also helps an engineer, but is not the real credit of an engineer. It may be the biggest credit of a craftsman, but not of a scientist.

Engineer: Scientist or Craftsman?

What is the difference between an engineer and a craftsman? Craftsmen have practical knowledge, experience, and skill. They also make something. The difference is a craftsman does, what he had known by experience or by training, he does not know core principles or science working in his own creation. On the other hand, an engineer knows that. An engineer is half scientist half craftsman. Craftsman because he creates something of practical application, but scientist because his approach is of a scientist. So, if as an engineer if one focuses only on experience in certain technology, he or she will be a top class craftsman of that technology, but will be no longer an engineer.

Great engineers through history

Great Engineers through History

What one should expect from oneself as an engineer?

The comment was ‘GATE score is not important, practical knowledge is’. What do we think of ourselves as engineers? What an engineer should know? Does a person with a lot of practical experience and knowledge of PHP or Java or.NET, becomes a computer engineer. I hardly think so. So, what have I learned in the past 4 years, the syntax of C, Java or PHP? The concepts of OO? How to find the shortest path between two nodes in a graph? How philosophers should dine or how a thief should fill his knapsack? Well, I learned all of that as they are the robust tools or the ‘scientific knowledge’ which is needed to solve problems. But the primary purpose was not to study all those things. The purpose is to develop reasoning, to learn how to solve any problem that is thrown at your face. As an engineer, I should be able to solve any problem, whether it’s a complicated installation of an OS in 40 pc or a repairing an Air-conditioner. At least, I should perform better than my past self, which was not an engineer.

Engineering is an attitude

During the four years of my engineering study, I often heard from our teachers and others that “you should learn the latest technology”, or “We will teach you the latest technology with all its features”, but not once I heard “you should learn how to learn and adopt any technology, whether new or existing throughout your career”. And as new technology hits our field so often, that the word ‘latest’ in former sentences ridicules itself. So remember, engineering is not about knowing a technology or a craft and doing it rest of your life, but about finding new challenges and overcoming them with all the knowledge and resources you have. We are explorers, problem killers, the engines of the modern world and pillars of technological advancements. We are the intellectual descendants of Archimedes, Hero of Alexandria, Leonardo da Vinci, Charles Babbage, Nikola Tesla, the Wright brothers and Alan Turing. So get the right attitude and be proud being an engineer.

— * ‘Dinning philosopher problem’ and ‘Knapsack problem’ are studied abundantly in computer science to imitate actual computing situation.

American Hypocrisy

As 4th of July, the birthday of the most powerful and influential nation of our time passes by, I can’t resist but to write something about the American way of life. Buy America, I mean the country that sits above those nations of Brazil and Mexico and below our beloved Canada, and has influenced the world more than any country in past century politically, economically and culturally. If a question is raised that what is the most prominent characteristic of that nation you can answer it as hypocrisy. An American TV series named South Park, on their 100th episode on the theme of the Iraq war and its protests showed that a character, and not any character a particularly nasty one, goes back in time and learns from Ben Franklin himself that one hand, we will go to war and on another we will support its protesters. Well, it is a comedy series, but the point really is notable. I think throughout history, the hypocrisy of America can be hardly matched by any other country. (Well, I have limited knowledge of history)

The US has engaged in more war in last 100 years than any other country, although they call themselves peace lovers and ‘peacekeepers’. The US believes in open press and transparent administration, but they have more secrets than any other (all other combined) country in the world. They have literally got a ‘Fort’ress for that purpose!!!! The US believes in freedom of expression at its extreme, but communism was an exception till now. Robert J Oppenheimer suffered a lot, only because his wife and brother had a leaning towards communism. They believe in science and many great scientists of our time have come from the US, but over half of its citizens do not believe in evolution even today. They call themselves secular, but 51% percent American said that they would not vote for an atheist (non-believer of God). They believe in system, but haven’t accepted the Metric system! ;p

But there is also good things about this hypocrisy, one of them is you can ridicule American hypocrisy on American television. However, what do you blame the US for, you won’t be crushed by force. And there is something kind of glamorous about American hypocrisy, which is not found elsewhere. At last, whether it is Beauty, Hustle, Gangster or Pie we love it when it is American, then why not Hypocrisy?

Is technology making us idiots ?

Albert Einstein Quote

A proof that technology has made us idiots.

This post is in accordance to an earlier note  (here post Are They Destroying us ? as this piece come from my personal log ) by me ‘Are they destroying us ?’. There I quoted Einstein as the originator of the quote “I fear the day that technology will surpass our human interaction. The world will have a generation of idiots.” However I was a little bit skeptic about this quote and its meaning, I didn’t gave much thought to it (this quote was viral on social media). But when I searched that quote in Google (so I don’t have to write it!!). An interesting fact came out, that Einstein probably never said something like that. Other thing pointed out was that however it looks great this quote is actually inane(see this link). In the context it is popularize is actually more silly, they show half a dozen picture were cellphone has taken priority over the human sitting next (like a date, or a dinner) and saying that the day Einstein feared has come. Now let me say that most of the people most of the time do chatting on cell, so ultimately it’s only a different kind of human interaction. And though if we accept that here technology has taken precedence over human interaction, how the hack chatting (or surfing) on phone make you idiot and listening to your girlfriend’s boring talk make you Einstein ??? Actually, fundamental thing that clicks me is our excessive reliance on technology. Before you have to do many task which required knowledge and smartness, which are now taken care by technology (like, a dozen spelling mistakes as I write this). Technology has also served as excellent distraction from the meaningful things (for me at least it has). But it has also given plenty meaningful things in return. Now if people are attracted more toward the idiotic one than the meaningful one than it means that they always wanted to be idiots, there is one trait of technology it doesn’t give what is right, it gives what people want (a penicillin and a nuclear bomb both are gift of technology).

I also found a good thought from yahoo answer that, Just because something in the future is different and future people don’t know how to do the things we do now, doesn’t mean their idiots, just means they have found other means to do the same thing, or this thing is not needed anymore.


At the end of the day

What proves the quote itself (that we are generation of idiots) is the fact that something silly and incorrect became so popular and everyone accepted it without giving a thought on it.

1 2 3