Wednesday, October 10, 2012

Balance

I'm a big fan of the now cancelled series Scrubs. I'm a bit like the main character, so I'll start with a line he said at the end of an episode. It's meant to make a point, so don't take any literal meanings out of it :)
JD says, no one understands the importance of sex better than someone who isn't having any. Similarly, I feel that no one understands the importance of balance better than someone who doesn't have one.

Now since I'm done with the titillating opening, lets get down to business. Every natural system in this world has opposing forces, and it may seem like it strives to achieve a balance. I'm not an expert, and there are 2 opposing lines of thought on that, but you may consider this balance a choice of a higher power, or a freak of coincidence that's one of the infinitely many possibilities that have an interesting residual in our universe, and on this planet. The overall fact remains that this leads to an important observation, that balance is essential for something bigger to emerge out of simpler forces.

Some people confuse this balance to be stable. In reality, no interesting system we know about has a stable balance, or in more technical terms, a stable equilibrium. They manifest as unstable equilibria, with small ranges of stability that our world seems to reside in. In fact, as someone who writes simulations, that's the region we strive to achieve, and trust me, it's pretty hard to achieve.

This analogy carries over to our lives and our minds too. A balance is important, not just for ephemeral things like happiness, but even for basic sanity and survival. Your body and mind do not take kindly to extreme conditions. But again, it'd be naive to assume there isn't wiggle room. In that vein, I've spent long parts of my life oscillating between excesses of work and fun. A side note, oscillations are interesting manifestations of turbulence in physical systems, but differentiating actual ones from spurious implementation induced strokes is very hard work.

Honestly, I'm in a field that spends a lot of time and money teaching their members about work-life balance, and then go right off expecting you to ignore it. After looking at the recent incidents in the world, I'm starting to believe this problem isn't just localized to computer science. Over the past month, I read multiple headlines along the lines of disgruntled person goes to a public place and shoots a bunch of people. In one notable exception, the person responsible even survived, and is enjoying media coverage of his now red hair. Maybe it's just me or the effect of media focus, but I feel that the incidence of such events is on the rise. Again, I'm not an expert, but some reasoning suggests that there's a reason for these extreme actions. Every assailant in these cases had extreme cases of stress, having either lost jobs, or  hope in their PhDs. So you can see why it hits a little close to home, I'm in the 5th year of the latter myself.

People are likely to suggest that these are outliers, resultants of some other extreme actions along with an inordinate response. Coincidentally  simulation folk are very familiar with these too, these are indicative of a case where that unstable equilibrium suddenly loses the second word, and becomes just unstable. That happens because some of the underlying forces and assumptions that made things balance, are violated, resulting in an increasing oscillation leading to blowup. In laymen terms, that means that what was keeping you sane, just stops, because your brain just can't balance the forces exerted on you anymore.

Like any decent scientist, I'm inclined to offer an explanation, so let me start with something that I heard a while before I came to USA. I was always told that Indian people here are lonely. After coming here, I realized that's not the case, it's just that the primary model of society is nuclear families and individuals, the latter slowly becoming the dominant set. In my opinion that is the primary cause of this increasingly extreme outbursts of stress.

So, in the early 20th century, right up till the 70s, the primary model of existence was families. People lived in big families, and had a large set of cousins they knew about. Well, ok, maybe not in the cities, but at least in towns. And this model still exists largely in most Asian countries, where these sort of outbursts are not as common. But the fact remains families were, and still are, major balancing forces in our lives. Then somewhere down the line, the baby boomer generation came. They moved out, did great things. Slowly and steadily, that model became the norm, and we started to ignore families, to express individualism. Before you get the idea that I'm trying to prophesize the importance of families, I'm not. I'm simply offering a line of reasoning, and I don't intend the choice of one over the other. So, getting back, individualism prompted people to do great things, since removing family commitments from our lives opens up a lot of extra time and motivation, since the primary focus of our life is work. But, there is no such thing as a free lunch. Earlier generations still had the support of the family they left behind, that foundation. Increasingly however, that foundation is getting eroded, because extended families and people you cared about are becoming an ever smaller set of people. These people help you snap out of depressing thoughts festering in your brain, lines of thought that are better left alone. Social isolation makes you delve exactly into these lines of thought, except, a lot of people don't have any tether at all, meaning they can drown in them. The result is what you see in the headlines, because depression/stress and anger never make for a good combination. I've seen people shoot others over trivial car accidents, so don't underestimate the power of that deadly cocktail.

Granted I took some liberties with rigor, that line of reasoning should hold, so I'll move on to the other part of my discussion. Unstable equilibria, turbulence, they're very interesting phenomena. They may oscillate wildly, and seemingly randomly, but there's always a pattern. The economic issues straining society are becoming ever more prominent. With general public unrest in a lot of places, the chances of a spark igniting this tinderbox are huge. And if you think the natural state of society is stability, well, you didn't really get the point. It's well established that physical systems prefer higher entropy, or more simply put, more variations and chaos. Add weapons to that equation, and the results aren't going to be pretty.

Before you start thinking I'm going to recommend buying gold and making basements to stock supplies and weapons to defend against the coming apocalypse, let me point out that I'm not Glenn Beck. All I'm saying is that increasing volatility is making our society unstable, and the only reliable force we know of is family. So it only makes sense to try and return to that model, at least until we can come up with a better one. What's obvious, is that the current path is becoming untenable, and something needs to be done. The world is heading towards a realignment, and such transitions are never peaceful or painless, lets hope me and you come out of it in one piece. 

Sunday, July 8, 2012

Art, music and games

It's been a long time since I wrote my last entry, suffice it to say it's been a helluva ride. And since in the next year I'm going to be trying to graduate with a PhD, I'm not sure what my frequency of posting will be, so lets give this a shot.

In all honesty, I've always been a mediocre gamer, delving into different games sometimes, but never so good as to hold delusions of earning my livelihood through them, or boast about my skills. In the past month, finally being relatively free motivated me to try once again. Oh that relatively is so loaded a word. I played the usuals, Crysis, Modern Warfare, even the new Max Payne. Ignoring the fact that I ran through these games like a 100m dash (that's the way I do things, the black plague way), I didn't quite like them as much as their predecessors, with the possible exception of Crysis. Don't get me wrong, games have become quite breathtaking, especially if you have the right hardware. But they've lost some of their soul, so to speak. Visual brilliance has taken precedence over other aspects. But I know there'll be some who'll point out that my sample set's quite skewed to make that call. And I agree. The next game I played, was the one that made Bioware famous, Mass Effect. And damn was I surprised. I'm a guy who started playing games when they were designed for things with much less compute power than your not-smart phone. I've played SpaceWar, when it was still new, and that's been a badge of honor of sorts. They made me take up computers as a serious hobby, but that's a whole other story. Speaking of stories though, games have always been very linear, checkpoint oriented cause any other kind of story or choice would be prohibitive to code up. Plus, they were never very complex, only basic shells to assist the protagonist in blowing things up. Mass Effect seems to be the other kind. Yes, there's still a lot of blowing things up, but there are actual choices, ones that make a difference in how your game progresses. Story controls the game, rather than the other way around. Lovers of RPGs, don't take offense, but anything that just helps your character gain points doesn't really count. I expect the hordes of WOW (that's World of Warcraft to you non-gamers) followers to take immense offense to that line, but I'm saying it as I see it. Heck by the end of the game, it had handled complex issues like homosexual relationships, relationships in general, life, death, and a bunch of other things with great sensitivity and panache. That's something you don't usually expect from a bunch of geeky coders looking for aliasing lines at 1080p.

All of which seems to suggest that games are maturing, dare I say, as an art form. Mass Effect is a statement if there ever was one, and the tree or graph like elements in its story where what you choose to do actually makes a difference, is very new, at least to me. I'm sure there are other games which are doing a similar job, maybe even better. The icing on the cake was a background track at the end by Clint Mansell (http://youtu.be/WE8Rhmy8v0E). I'm a big fan of the guy, very few people have the talent to make such haunting music with very little. If you listen to this one, it only has a piano and a string quartet playing. If you don't know who he is, try seeing the movie Requiem for a Dream. I still haven't, but that track speaks louder than most pieces of art I've seen (http://youtu.be/hKLpJtvzlEI). Honestly, as a grad student of limited means, this game offered more value for money than any movie or book I've seen in the recent past.

People talk a lot about art evolving and experiments being done with new visual media. I've been to very weird installations which I couldn't make any sense of, but which a lot of people praised immensely. It might be time to consider games as an art form, but only if it's taken out of control of resolution jocks who only care about getting 60fps at highest quality settings. That's an insult to what a game's supposed to be. The resolution, visual quality serves to immerse you in a virtual world, much like CGI is supposed to do for movies. When it's used as a crutch and made a major selling point, it's stupid. Yes I know you're thinking Michael Bay and Transformers and laughing, but there are other offenders too, even Apple sometimes (http://www.thedailybeast.com/articles/2012/06/15/5-reasons-i-hate-my-new-macbook-pro-a-geek-s-critique.html) (yeah I'm a little prone to Apple bashing). Graphics is and always has been an enabler, not an end, and unfortunately that's what some people would like it to be. But overall, games are getting better and more interesting, at least the non-iPhone kind. And that's where I have a bigger problem with Apple and iPhone gaming. It encourages those same toy like games where you grind your finger against the screen. No depth, just mindless droning. Sure, instead of carpal tunnel, you'll get something else. But if iPhone gaming becomes the norm, it'll kill this rising art form, and that's something I have a problem with, cause it'll kill something that's been more than 2 decades in the making. 

Thursday, March 8, 2012

An ode to rebuttals, writing in general, and to things unsaid


There are some things that need to be said,
But the words escape me,
The thoughts are there in my head
But the verses escape me

... to be continued

Wednesday, March 7, 2012

Talaash


This verse is actually in Hindi, transliterated

Kis zameen ko dhoondhta hai tu
Kis aasmaan ki talaash hai
Sab to hai, bas yahin, tere saamne
Aankhein phere rehta hai kyun

Thanks to Google's transliterate tool, here's it written in Hindi:

किस  ज़मीन  को  ढूंढता  है  तू
किस  आसमान  की  तलाश  है
सब  तो  है , बस  यहीं , तेरे  सामने
आँखें  फेरे  रहता  है  क्यूँ

Tuesday, August 16, 2011

Emergence of chaos

It's been a long long time since I wrote one of these, but reading James Gleick's book Chaos got me thinking about all that is going on these days and how much you can apply it to them, albeit in an abstract manner, since I obviously lack the mathematical skills to model it accurately.

Let me start off by introducing this one equation that started a lot of it, the Logistic Difference Equation. It may sound complicated, but all it says is that x_next = alpha * x * (1-x), where x is anything you're modeling. What many scientists found was that choosing different values of alpha can lead to wildly varying behaviors, behaviors which are actually observed in diverse fields such as weather, populations, economics etc. I'll give one small example of populations, that if alpha is small, populations remain constant, or decline, but if alpha rises above a certain threshold, it can rise explosively. Now this is a very simplistic model, but it shows what "non-linearities", i.e. functions that are not a straight line, are capable of.

Why it applies in the current context is because of the attempt to control a number of highly undesirable developments happening these days. The economy is going to hell, education is starting to suffer in a number of notable countries (I know that more than most :P). As a result or otherwise, politics is becoming much more extreme. Since the USA is too easy an example, I'll take my home country, India. Currently, a notable gentleman by the name of Anna Hazare is leading a crusade to wipe out corruption from India, starting with the government. While some may applaud, and others may scoff, my interest for the time being is to see if his approach is viable or not. For a thorough critique of his methods, try reading Greatbong's blog post about it. So Anna's idea for rooting out corruption is to create a body above all others, whose members are not elected, but nominated from the notable members of society. This body, headed by a "Lokpal" would bring forth charges against officials and try them. Now, most engineers would notice the lack of feedback in the system, meaning the system would function wonderfully if we assume the members of this board to be unaffected ghosts bereft of all feeling and earthly connections, i.e. those who cannot be swayed by us common, corrupt folk. However, if an error enters the system, e.g. a corrupt person becoming a Lokpal, can have drastic consequences, since it's very hard for the system to filter out this error. Herein lies the nonlinearity and the scope for drastic and dictatorial repercussions. Like the logistic difference equation, specific values of alpha make this an amazing system, some bad ones have the possibility of making this a mistake of Nazi proportions...

The same idea applies to economics, since this idea owes much of its origins to economics. Markets, the US economy and consequently the dollar are suffering like an enemy of Chuck Norris/Rajnikant. People are quite upset about this brouhaha and want something to be done, what this something should be varies considerably from person to person. The core of the problem is, and still remains, that the US economy does not make enough money to finance the expenditures of its people. Like it or not, that's the plain simple truth, don't believe me, look at the labels on anything sold in the USA and see what percentage is actually made there. Made in the USA is a very rare label to see these days. The one thing that's held the US up is the dollar, since being the world's reserve currency, no one wants to see it depreciate, in spite of rampant injections of fresh dollars. This is one of the reasons that USA has been able to recover atleast partially from the housing bust while other like Greece have not, as borrowing is a lot easier when you can print the payments without seeming loss of value. To those who might not understand this, just imagine a supply-demand system, where the supply of any commodity becomes almost unlimited, what would happen to its price. Truth be told, smaller scale vibrations like this have happened in the world economy in the past, it's just that things could be brought back under control much easier than today, cause the world's economy was simply in much better shape. This time it's so bad, because the USA is stretching the limits of its borrowing power (again, like it or not, it's the truth, see China's reactions, they're the biggest debt provider to the USA), and its people are not yet ready to accept that their spending is beyond their means. Similar situations unfortunately exist in a lot of the developed world. So this time the nonlinearity could be brought to heel, or could spiral out of control.

Why I keep harping about this nonlinearity is cause I work on simulations, and know that like an experimental simulation code, the point where your simulation becomes unstable and explodes is usually preceded by small oscillations in either direction, i.e. the situation becomes better, then worse, then better, then even worse and so on. These oscillations increase in amplitude and at a critical point, take over the system and every bit of expected behavior is overturned. Unfortunately for us, very little is understood about such systems, yet all of nature, physics, and even human behavior is completely non-linear. We have managed so far by approximating these, since our "alpha's" have been small, but it seems like we're quickly getting to the point where these oscillations could escalate into chaos. After all, doomsday prophecies don't always have to mean that the world ends literally...

Monday, April 25, 2011

The dance of politics, faith, and EXPTIME problems

It's been a while since I last posted, cause I've been keeping busy in other things. Now that I have a deadline coming up, my natural inclinations to shirk work are rising again. This post begins with a rather frightening thing I've noticed about news coverage in USA and the amount of debating that goes on about lots of issues. It seems like everyone has an opinion about everything, and are hardly interested in any other points of view. Though I don't claim to know the subtleties of any of these issues, the lack of interest in an actual debate annoys me no end, even though I can see the reasoning and vested interests in avoiding actual debate.

Finding correct answers to anything but the most trivial questions is a hard problem. I can give a quite few reasons for this, causality, complexity of the problem (watch my new TV favorite NUMBERS for a very hand-wavy explanation of what I mean here :) ). Tracing things back to computer science, my bread and butter, "hard" problems are usually considered in a class of NP problems. These are problems to which solutions cannot be computed by any known method in time proportional to a polynomial function of the input size. In layman's terms, this is a class of problems to which computing an answer is hard, using regular computers in any sane amount of time. This is why your online transactions are safe, cause you can't factor numbers into their prime factors easily. But the interesting part in this class is that the solution can be verified in polynomial time, i.e. easily. For example, if you know a possible factorization of a number, say 20 as 2x2x5, you can check it simply by multiplying them. Now CS has only reached these problems till now.

Coming back to political debates and arguments, you'll see that even though you may find a solution by some definition, actually proving it to be a correct solution is not possible easily. In fact whether a solution exists is not know apriori. To me at least, and for life as it is, these problems are much more interesting. After a little searching, I found out that these problems are called EXPTIME algorithms. Obviously, this claim of mine is not exactly true, but what I'm trying to say is that solutions to these problems can be found and verified in exponential time, a.k.a. very long time in layman terms, but still possible. For the time being lets assume my definition of this class of problems is accurately represented by EXPTIME, but it's more likely the EXPSPACE class (look at the wiki pages for these if you're interested). My point is simply that these are the most encompassing of all problem classes I could find.

Now, even with NP problems, algorithms only attempt to produce an approximately correct solution, since an exact algorithm can only be computed once P=NP is proven. Till then, the only known algorithm for these is pure brute force. This can be understood by trying to get out of a maze by going through every possible path. Since, in reality there are means of finding out if you're going horribly wrong (like towards a waiting minotaur), you can prune your search "tree", which is the basis of most AI methods like the ones used by Chess playing computers like Deep Blue. The thing is that for finding solutions to generalized problems, knowing when a solution is correct is really hard too, so we must rely on some intuition or develop some approximation to model the problem. The real world analogue to this is faith, i.e. when something is so complex that understanding it goes beyond one's limit of knowledge, one starts to make assumptions and trust the assertions made by someone. The gap in science and religion stems from this very fact, since science keeps encroaching on religion and magic. I quite liked the explanation given in a trailer to the upcoming Thor movie, which said that his world was one where science and magic merged, as everything could be proven by science, so everything was magical yet scientific. Coming back, faith is a sanity check employed by most problem solving machines in nature, due to the inability of any mind to model anything in its entirety.

For the CS inclined and otherwise, it's important to look at this in terms of a tree. Any brute force search is visualized as going from the root of a tree to a specific leaf which is our correct answer. We must choose a branch at every decision making step. Faith is like turning a blind eye to certain branches, saying those are off limits and our desired leaf can't possibly be on one of them. The scientific method, and to an extent an actual debate, is quite the opposite, it must traverse every possible branch unless proven to be wrong. A lot of this also works from a bottom-up philosophy, by saying we want to reach this leaf, so lets make assumptions along the way down to the root to get us here. The alternate is a top-down approach, where you want to find the leaf by traversing branches. While faith will claim assumptions as it assumes the leaf to be paramount, logic tries to find the "right" leaf by finding reasons to choose each branch to be correct.

If any of that made any sense to you, it's easy to see that faith and logic can rarely agree. Thus it is so very important to understand why we're trusting something or someone. Blind faith is like going through a maze with a blindfold on, you may think you can get out with your amazing senses, but it's likely you'll hit the minotaur, and your glorious life will come to an abrupt end. Even so, a large populace will never adopt a purely logical approach because certain effects cannot be modeled by pure logic, without using probability and statistics, which as we all know, everyone hates cause you can use them to prove pretty much anything. True nirvana can only be attained by realizing that there is no "correct", there's only entropy maximization. So unless you want to expend a lot of effort to fight randomness, the only option is to mostly accept things that don't make sense, and fight your small battles against it, hoping that like a butterfly flapping its wings, your feeble pokes at randomness can actually curtail and guide it.

Thursday, September 2, 2010

Borobudur

If you haven't heard of it before, I wouldn't blame you. Do a google search on it, and you'll find out more. Borobudur is an ancient relic, a building that pictorially depicts the life of Buddha, and his journey to enlightenment. The building is multi-storeyed, and as you go around all the floors on your way to the top, you see Buddha progressing on his journey to enlightenment, when you reach the top, you've seen his story, and symbolically atleast, attained enlightenment. The interesting feature of the building is that you cannot see any floors above you, but you can always see the floors below you, an expression of the causality in life, and a reminder to always remember where you're coming from. Ever since I learnt about the place, I've wanted to see it, and hopefully someday I will.

The second building I find fascinating isn't something you can see in one location at all. Technically, it doesn't exist at all, out of a computer i.e. If you've played civilization, you'll know the building I'm talking about. The intro video to the game revolves around this building as it's constructed and shows a fast forwarded progression through the ages as the building evolves over time. However, we always only see the facet of the building that represents the current age.

Those of you who've read my posts before know this is about to get hairy, so here goes. I was thinking about maturity, personality, and how we grow mentally over time. Language lets us put binary tags on people, like whether they're mature or not, and the like. However, something I realised recently, is that our maturity really is scenario dependent, i.e. the same person could be very mature about one thing, and yet wholly immature with regards to another. My reference to the virtual building is a pointer to that, that we are like a building under construction, and each facet to it proceeds rather independently of the other. They can pull each other up or down, but that's about it. The independence alludes to the fact that each part can be built very differently, and can have varying levels of stability. People can react very differently to different things, their behaviour is somewhat consistent when the transition between situations is smooth, but when shocked, the variation is quite stark. Even more importantly, the stability, let's us try different things. If we are stable and confident about a part of our self, we're much more relaxed in trying out different things, cause we're well grounded in that and know we can cope with whatever new thing gets thrown at us. You'll always find that the people most adamant about a stance, are the ones who're too dependent on it, or too scared as to what will happen if they're proven wrong. These are the ones who'll fight tooth and nail for it, while the more relaxed, more mature ones will stand by. Not to be confused, the ones who have no stance at all, will do so as well, but merely out of the fact that they have no maturity on it at all. It is similar to window cleaners cleaning using a swing. You need a certain amount of strength to hang one, and so not all buildings can take it. As a kid, I was always taught to not fight but listen, cause when you listen you can understand the other point, and to an extent, it helps you ground your own ideas in more sound arguments. As they say, only fools rush in.

I may have mentioned the part about Borobudur before, that it's easy to see how obvious the right answer was later, the gift of hindsight, as they say. But more important is the patience part, waiting and progressing when the end is not nigh. Agreed life doesn't always, if ever progress linearly, but it's a useful trait nonetheless to have, one I believe is the hardest to acquire, not that I have, yet :)

This post is a realization of the fact that no building is ever truly finished, and that outside veneer doesn't say anything about what's inside, and that even though it may feel like we've reached the top and stuck our hand out as far as it may go, there're more floors above and still further you can go on that ledge (figuratively of course, please not literally), and the fact that the ground seems so far below, is a good indication that you've progressed a lot, but there're still other floors to go to, and other parts of the building to complete, lest you forget about them. That's all for the building puns for tonight folks!