December 25, 2016

Habitats in Space : Our Second Home

If not on Earth, where else can humans beings be? Not as a traveller in a spacecraft or as a one-off tourist on the Moon but as an immigrant, or a colonizer who sets up a permanent residency for multiple generations. Given our current knowledge of physics and the state of propulsion technology, we really do not have the ability to travel to other stars in a reasonable amount of time, so our search for that second home for humanity is restricted to our own solar system. Where do we start?


photo credit Tittat427

There are two divergent points of view on where to locate such an extraterrestrial colony. Some believe that the colony should be located on a natural body like a planet, satellite or an asteroid while others think that the best bet would be an artificial structure in orbit around a planet or in space. There are pros and cons for both. What is common to both approaches is the realisation that any environment outside the terrestrial biosphere that we currently inhabit is inhospitable if not actually hostile to all kinds of known lifeforms, including humans. The availability of a magnetosphere that shields us from cosmic radiation, of liquid water that is fundamental to our biology and of an atmosphere that supplies us with oxygen for metabolism is essential but unfortunately there is no place where all of this is readily available. So wherever we go, we would need to create this environment artificially. Question is, where is it that this can be done with the least effort or at lowest cost.


The obvious place to think of is our Moon because it is closest and we have already been there. But because it is so deficient both in water -- with just traces of this precious liquid found by India’s Chandrayaan -- as well as in gaseous oxygen and nitrogen, that it is not thought to be worth exploring. The only real value of the Moon is as a source of minerals that can be mined and more importantly lifted off the surface relatively inexpensively because of the low gravity compared to Earth.


Mars on the the other hand is a more Earth-like location. The physical terrain is very similar to our rocky arid deserts and while no liquid water is present today, there are huge ice caps in the polar region that if melted can provide all the water that we would ever need. What is nice is that because the axis of rotation of Mars is tilted just like that of Earth, there are regular seasons and while winter temperature at the poles can be as low -150O C, summer temperatures near the equator reach a comfortable 35O C. The atmosphere is thin and the air pressure on the surface is about 0.6% of what we have on Earth. But since most of this is carbon dioxide, there is a good possibility of using terrestrial plants to use sunlight and gradually convert carbon dioxide into precious oxygen that both plants and animals can use. Melting the polar ice caps to release water and gradually converting carbon dioxide into oxygen could be the first steps towards terraforming Mars and creating an Earth like environment. After water and oxygen, the third challenge is the lack of a global magnetic field that would shield residents from cosmic rays but the existence of umbrella shaped auroras in some areas show the promise of local magnetic shields that could prove useful. But in areas bereft of such protection, thick walls or living underground would solve the problem.


While Mars may look like a good place to pitch our extraterrestrial camp, there are three other possible locations.


Titan, the largest satellite of Saturn, is a world where liquid hydrocarbons play the role that water plays on Earth. Titan has a dense atmosphere consisting largely of nitrogen and it rains hydrocarbons, like liquid methane, every now and then. This leads to the  formation of liquid methane lakes near the poles. The climate, along with the winds and the rain, creates surface features very similar to Earth with dunes, lakes, rivers, deltas and oceans that are dominated by seasonal weather patterns. Titan is cold, very cold and far away from the sun and so solar energy may not be a feasible solution. But it has water ice and if the energy potential of the vast quantity of methane -- and that is a big IF  -- can be unlocked with the help of oxygen extracted from water then we have one of  largest sources of hydrocarbon energy in the solar system. Again, even if we do not go to live here, Titan could be be source of energy, like the Middle East on Earth, that could be extracted and transported to other worlds inexpensively, because of Titan’s low gravity.


Next stop is Enceladus, a small rocky world covered with water ice that orbits Saturn. But what is interesting in Enceladus is that even though surface temperatures are far below freezing, there exists beneath the thick ice shell, vast oceans of liquid water that are kept warm by the tidal effects of Saturn’s immense gravity. In fact, so hot is the interior that plumes of salty water are regularly seen to erupt out of the surface in a manner similar to geothermal geysers on Earth. These salt-water plumes also contain nitrogen, as ammonia, and organic molecules like methane, propane, acetylene and formaldehyde that prove the existence of  hydrothermal activity and potential energy resources. In fact, the presence of these products also signal the possible existence of life forms similar to those found on Earth.


Our third and final stop on this current tour of possible locations for our second home is Europa, another ice and rocky satellite that orbits Jupiter. Europa too has a vast, subterranean ocean of liquid water warmed by the immense tidal effects of Jupiter’s gravity and it ejects plumes of water spray similar to the kind found on Enceladus. There are two other features that make Europa possibly one of the most habitable locations both for terrestrial as well as non-terrestrial life forms. First it has a magnetic field caused either by a nickel-iron core or a subterranean pool of salty, liquid water that forms a subsurface conductive layer. Second, it has an atmosphere, which though thin and tenuous consists primarily of oxygen!  This is of immense value for any human colony that may be located there. Because of all these factors, Europa has emerged as one of the most likely locations in our Solar System for potential habitability.


Mars, Titan, Enceladus and Europa all seem to have the basic ingredients necessary to support human life but given the lack of an Earth-like environment, man will have to create an independent structural unit with controlled, ecological life support systems that are isolated from the local environment. If this be the case, why build this structure on a planet or a satellite? Why not build the structure in space itself?  This is the logic behind the design of space habitats that could either be in orbit around planets or around Lagrangian points -- gravity wells where the gravitational attraction of two large astronomical bodies tend to, kind of, cancel each other out. These could be huge structures, many kilometers long and shaped like a cylinder or a torus that spin on an axis to generate the sensation of gravity. Powered by an abundance of solar energy and sustained by recycling materials on a mini-planetary scale, these structures could be sustained by advanced agricultural techniques based on greenhouse and hydroponic technology. Many of these technologies already exist but the biggest challenge would be to source the construction materials. Carrying them from Earth would be impossibly expensive but a more feasible approach would be to mine them from other, low gravity locations. That is where robots will come in very handy because they can be made to mine and transport materials from inhospitable worlds.


Now that we have some options for our second home, some of us will ask the question -- why on Earth, pun intended, would we want to go there? One reason of course could be the deterioration of the political and ecological environment, that may make Earth uninhabitable. There is also the finite, non-zero probability of some incredible accident that may wipe out life on Earth. But perhaps the most biggest compulsion would be man’s curiosity. 200,000 years ago, primitive man walked out of Africa and spread out all over the world. Later on, people from south India crossed the Bay of Bengal to colonise south east Asia and Europeans spilled out into America and then Australia. Each such excursion led to vast increase in exploitable resources. However in each case, in each society, there would have been sceptics who would have wondered why?  But then there must have been others who said “Why not?” and it is the latter who would eventually prevail!

So would be the case for man in space. Why Not?


this article originally appeared in Swarajya, the magazine that reads India right

November 28, 2016

Engineering India for the Space Age

Elon Musk may have suddenly become the glamourous mascot of a new, post Apollo, space age but the fact remains that the destiny of mankind is among the stars. While many people will keep on trying to salvage what remains of spaceship Earth from the environmental, social and political scourges that threaten it, it is but inevitable that a significant, space faring community will emerge that will seek to live and work outside the planet -- like European emigrants going to America. Are we in India ready for this? Will we just watch and cheer while others depart? -- as it was in 1969 when man went to the Moon? Or should we as nation participate in these great voyages?

credit : gwydion1982
Astronomers tell us that there must be, thousands of habitable, earthlike planets in orbit around various stars in our galaxy. Unfortunately, the distance between stars is so great that we have no means yet, not even theoretical ideas, on how to build spacecraft that will be fast enough to travel to another solar system in the lifetime of a human being. But travel within our own solar system is  possible with technology available today. So to be realistic, let us focus on our own solar neighbourhood.

In a recent paper in Universe Today, Nancy Atkinson has identified Mars, Europa and Titan, two satellites of Saturn and Enceladus, a satellite of Jupiter as possible destinations based on the availability of a solid surface, the presence of an atmosphere to protect against cosmic rays, the existence of water and hydrocarbons and a temperature range that supports liquids. There may or may not be pre-existing life in these worlds but the environment can certainly support the carbon based life forms that we are familiar with. More importantly, we already have the rockets and spaceships that can take us to these destinations in a reasonable amount of time. But going there is only a one part of the story -- a story that is being written with great enthusiasm by NASA, ISRO, SpaceX, Blue Origin and other companies. What do we do when we get there?

In the early years of the 15th century, the Chinese government sent out flotillas -- the Zheng He fleets -- to impress people around the world with the size and power of their ships and the glory of the Chinese empire. At the same time, Portuguese and Spanish sailors, with far smaller ships, also set sail but their aim was to create outposts from where they could carry out trade and commerce. The Chinese ships achieved little even though they were far superior to the European ships but as we know from history, it was the latter that ended up ruling the world -- both politically as well as economically. Space voyages tomorrow would do well to keep in mind that it is not enough to just go there. We need to create habitable colonies where humans can stay and plan for the next part of their journey.

Unfortunately, none of the feasible destinations that we have identified can natively support human life as we know it. The first thing that we need to have is a Hab, a habitat, that we human beings can live in. This Hab must be as large as a big house or a perhaps a small township that has its own oxygen rich atmosphere hermetically sealed against the alien atmosphere of the outside world. But a Hab as big as we need cannot be built on Earth and transported to the colony, it needs to be built there. So before we have a Hab as big as we want, we need a Fab -- a fabrication facility -- at the location, that will be used to build components of the Hab.

The Fab, would in turn have three pre-requisites. First it would need a source of energy and while nuclear power carried from Earth would be the initial source, it would eventually need to have gigantic solar cells to harvest sunlight, however weak it may be, and provide sustainable energy. The huge hydrocarbon deposits on Titan could also be used if we can get a source of oxygen to burn them. The second second requirement of  the Fab would be raw materials to build the Hab and also the solar cells to power both the Fab and the Hab. Again, this raw material cannot be transported from Earth but would have to be mined near the Fab / Hab complex itself. The third facility in the Fab would be autonomous manufacturing facilities -- or what we refer to as smart robots..

Human beings with their fragile lives and the need to protect them from accidental death means that it would be far simpler and inexpensive to use robots as much as possible for all mining and manufacturing activities. This is one area where Indian companies may wish to focus on if they want to remain relevant as mankind ventures out into the vastness of space. Space or not, robotic manufacturing has already become a key feature of the terrestrial economy and unless Indian companies adopt to this technology in a big, big way the Make-In-India concept would be rendered irrelevant. However the focus should not just be on using robots but on building robots as well -- robots must become the centrepiece of India’s capital goods industry. This will create a stable platform on which space faring robots can be built.

Robots have sensors to detect cues from the environment, actuators to move and control materials and other machines and all this is held in place by artificial intelligence (AI) software. This same AI, that is the basis of the autonomous, self driving cars pioneered by Google and developed by Tesla should now be extended to autonomous equipment for mining and material handling that would be essential to feed the Fab at the space colony. This presents another window of opportunity for Indian engineering companies to place a toe-hold in the line-up for the space race. Manufacturers of earthmoving equipment must start exploring ways and means to adapt their products for autonomous operations in different worlds. The first step would be of course to build autonomous products for terrestrial operations and once we have a level of confidence in the technology, we can seek to adapt them for space. For example, seabed mining with autonomous submarines could become a model for mining operations on Enceladus that has huge water oceans under a layer of clean white ice.

Autonomous mining is not science fiction. The Mine of the Future initiative of Rio Tinto and the Next Generation Mining program of BHP have both started working on autonomous mining equipment and multiple Chinese companies are also in the fray. In India too, we must start working on these technologies, not just in preparation for their eventual deployment in space but for benefits that will accrue in the terrestrial economy, today.

Once the minerals have been mined, we would need to convert them into building materials that will allow us to create a series of increasingly bigger and more sophisticated Habs. Materials that are easy to work with and yet good enough to protect human lives from the harshness of the extra terrestrial environment would need to be designed along with the capability for autonomous manufacture and fabrication. This calls for new thinking in materials science and in construction technology that can be automated easily with smart robots.

The final component of any space colony is the farm to grow food. In the movie Martian, which demonstrated some very feasible technologies necessary for a human to survive on Mars, we saw the protagonist growing potatoes in a fairly hostile environment. In a recent experiment at the Wageningen University and Research Centre, “scientists have managed to harvest 10 crops, including tomatoes, peas, and rye, from soil that mimics the conditions on Mars”. Farmbot, a precision farming DIY robot built with off-the-shelf components like Arduino and Raspberry Pi and based on traditional CNC machine tool guidance technology, could be a good model for autonomous farming under tightly controlled environments.

Rockets and spaceships are necessary but not sufficient in our quest for new homesteads beyond Earth. A broad consortium of engineering companies is necessary to provide R:U:M  रोटी, ऊर्जा और मकान -- food, energy and habitat -- on extraterrestrial locations and to build the capital equipment capable of autonomous mining, mineral processing, fabrication and assembly. A community that plans to go to space will need to dream, design and demonstrate these technology capabilities here on Earth. Since these technologies have a direct impact on the current terrestrial economy there is a strong business case for investing in such dual-use products right now. Expertise acquired in these areas is not only good for business today but will also provide the platform for that big leap into space.

A national convention on “Engineering India for the Space Age” would be a good launch pad for  the national goal to become a space faring nation in the next 50 years.

This article was originally published in Swarajya.

November 24, 2016

Smart-wallets to facilitate demonetisation

The demon of demonetisation has scared the living daylights out of India’s cash-based economy. Whether the aam-aadmi is indeed suffering or whether the quantity of black money unearthed justifies the collateral discomfort is best debated on the sterile but bloody timelines of social media, but what we need right now is a way to facilitate payments -- small, ad-hoc payments -- that keep the engines of commerce running. Can technology play a role here?

It certainly can. Let us see how.

First we need to popularise software, app-based wallets like SBI Buddy and PayTM with which people can transfer money to each other merely on the basis of their phone numbers. While prima facie these are good options there are some drawbacks. First these are closed-systems, which means that one can only transfer money to someone who already has an identical wallet software. This means, for example, that a person can transfer money from his SBI buddy to someone who has SBI Buddy but not to someone who has PayTM. This is troublesome but can be overcome by transferring money directly to someone’s bank account but this invites a transaction fee -- 1% for PayTM and an incredible 3% for SBI Buddy. Obviously this is too high a transaction fee and cannot be accepted.

One solution that is already available in India is the Universal Payment Interface (UPI). UPI is not a software but a set of protocols -- let us think of them as specification of plugs -- that allow any software wallet to connect to ( or “plug”-into) any bank and transfer money in a safe and secure manner. See this Swarajya article to know more about it. With UPI,  anyone can transfer money to anyone else irrespective of the bank that is used by the other party. This is like NEFT or RTGS but from a mobile phone and for small amounts of money.  A host of Indian banks have already enabled UPI in their mobile banking software but unfortunately the big daddy of them all -- State Bank of India -- has still not made its software compatible with the UPI specifications. The technology is not at all difficult and it already exists. If the government can convince the SBI to fall in line, then, with its vast network and crores and crores of customers, the UPI platform will cross the tipping point and help make it the default money transfer platform in India.

What stops us? Nothing but the will do so …

image "borrowed" from YouthApps


The other significant technology that we can leverage is Point of Sale (PoS) machines that can be used by anyone with credit or debit cards to accept payment. We already understand that sales of such machines are increasing very fast but there is a both a cost and a time factor involved. These machines cost money and need time to build and ship.

What if we had a software App that one could download and use on an Android / IOS phone or tablet? All that this App would need to do would be accept the card details, including the CVV and the subsequent OTP that the payer would get from his bank on SMS and transfer the value to a designated account. Again this is nothing new. Any eCommerce App -- like MakeMyTrip or Flipkart or BookMyShow is doing the same. The only difference would be that the money will be credited to the bank account of the person who has installed the App, not to the account of the company that builds it!

Square is such an App that is already available but it does not work with Indian bank accounts. Given that the basic architecture of the product is already known, it should not take any time for an Indian company to build the same.

Most of these technology solutions are already available -- all that we need is a small task force of people from RBI, SBI, IBA, NPCI, the Finance Ministry, the Ministry of Electronics and Information Technology, NASSCOM and the CII to sit down and create a roadmap for their implementation in the country. If this can be done on a war footing, we can have an unified solution available in less than a month. But for it to happen, this behemoth must made to move and to do so it needs a push from the Prime Minister himself.

Sceptics would of course crib that such technology solutions will cater only to the elite in the cities and leave the poor in the lurch. That is wrong. The extremely poor people are in any case not impacted because they do not deal with ₹500 or ₹1000 notes. What is happening is that traders and shopkeepers are not able to sell or transact and this is having an impact on the daily labourers they employ. Traders and shopkeeper in the country can surely afford to have a smartphone and it is almost certain that a large number of them already do. The rest of them will certainly get one if they need to run their business.

The final argument is that our traders and shopkeepers want to deal with cash because they do not want to leave an audit trail that can be picked up by the taxman. But now that the die has been cast and they realise that neither they,  nor their competitors, have an option, they will, willy nilly, have to  get onto the digital bandwagon. Because the only other option left for them would be to NOT sell -- and instead, sit, twiddle their thumbs, sulk and curse Modi for unleashing this scourge on them.


A slightly different version of this article was published in Swarajya in the aftermath of the Demonetisation drive unleashed on country.

November 19, 2016

K-means Clustering with SQL

Ever since I started my career in software and IT as a database administrator, I have had a great fascination, if not love, for the SQL language. I also know that there are many in the software fraternity (and sorority) who share my comfort with using SQL. Even after moving into the current enthusiasm, or should I call it a fad, with data analytics, I see that there exists many who prefer the ease and convenience of SQL even in big data.

For example, Hadoop had to hide the complexity of its Map-Reduce magic behind HIVE. Spark offers SparkSQL. In an earlier post, I had shown how SQL can be used for scoring Data Mining models developed with R through the PMML route.

In this post, we show how K-means clustering, a very common and widely used data mining activity can be done with SQL, using a technique adopted from Joni Salonen's blog post. The following codes were executed in MySQL.

First we create the tables :

drop table if exists km_data;      -- contains initial data, only 2 dimensions
drop table if exists km_clusters;  -- contains the final clusters centres
drop table if exists km_steps;     -- shows intermediate steps
create table km_data (id int primary key, cluster_id int, x1 float, x2 float);
create table km_clusters (id int auto_increment primary key, x1 float, x2 float);
create table km_steps (id int, x1 float, x2 float);


Then we create a stored procedure to implement the K-means algorithm

drop procedure if exists kmeans;
DELIMITER //
CREATE PROCEDURE kmeans(v_K int)
BEGIN
TRUNCATE km_clusters;
truncate km_steps;

-- initialize cluster centers
INSERT INTO km_clusters (x1, x2) SELECT x1, x2 FROM km_data LIMIT v_K;
REPEAT
    insert into km_steps select * from km_clusters;
    -- assign clusters to data points
    UPDATE km_data d SET cluster_id = (SELECT id FROM km_clusters c 
        ORDER BY POW(d.x1-c.x1,2)+POW(d.x2-c.x2,2) ASC LIMIT 1);
    -- calculate new cluster center
    UPDATE km_clusters C, (SELECT cluster_id, 
        AVG(x1) AS x1, AVG(x2) AS x2 
        FROM km_data GROUP BY cluster_id) D 
  SET C.x1=D.x1, C.x2=D.x2 WHERE C.id=D.cluster_id;
UNTIL ROW_COUNT() = 0 END REPEAT;
END//

This procedure updates tables without a WHERE condition. This is not allowed in the default "Safe Update" mode of MySQL. Go to Preferences -> SQL Queries and uncheck the "Safe Updates" option. Otherwise this procedure will give an error.

Next we load some sample data :

truncate km_data;
insert into km_data (id, cluster_id,x1,x2) values (1,0,185,72);
insert into km_data (id, cluster_id,x1,x2) values (2,0,170,56);
insert into km_data (id, cluster_id,x1,x2) values (3,0,168,60);
insert into km_data (id, cluster_id,x1,x2) values (4,0,179,68);
insert into km_data (id, cluster_id,x1,x2) values (5,0,182,72);
insert into km_data (id, cluster_id,x1,x2) values (6,0,188,77);

insert into km_data (id, cluster_id,x1,x2) values (7,0,180,71);
insert into km_data (id, cluster_id,x1,x2) values (8,0,180,70);
insert into km_data (id, cluster_id,x1,x2) values (9,0,183,84);
insert into km_data (id, cluster_id,x1,x2) values (10,0,180,88);
insert into km_data (id, cluster_id,x1,x2) values (11,0,180,67);
insert into km_data (id, cluster_id,x1,x2) values (12,0,177,76);


Finally we call procedure  with the parameter = 2, the expected number of clusters

call kmeans(2);


That is it! As simple as that ..

Of course, one may always wonder why anyone would use SQL for this when R and Python offers possible better functions, but then one sometimes does things just for the heck of it and that is what we have done here.

November 02, 2016

Thriving on the Chaos [Monkey]

As a long time foot-soldier in India’s software industry, I had often wondered why is it that India’s big brand IT companies with literally lakhs of software developers could never, ever come out with a single blockbuster product like Whatsapp, or Skype. It could not be that Indians were dumb -- after all our very own Sabeer Bhatia from BITS Pilani had created Hotmail, precursor to Yahoo and Gmail, but why was it that he had to go the Silicon Valley to be able to do it? What is there in the air and water of California that it causes products to sprout in every other company there?

Chaos Monkeys by Antonio Garcia Martinez (Penguin Randomhouse 2016) talks about the factors, the issues, that seethe in this cauldron of chaotic creativity -- issues that managers in Indian software companies, thrashing around in business-as-usual, BAU, challenges of bench, attrition and utilisation will never know. This 500 page corporate thriller takes the reader right into the frontlines of Silicon Valley as it narrates how the author quits an old economy job at Goldman Sachs in New York to join a start-up in California, quits the start-up to start his own start-up, which he then sells to Twitter, while bailing himself out to join Facebook and then gets sacked after falling foul of Zuckerberg’s inner circle of cronies even though he had delivered an excellent product -- and all this in just five years, 2008 - 2013.

Chaos Monkeys stands out from the general run-of-the-mill management books because it contains nuggets of hard facts and searing insights embedded in the actual story of software product development. For example, “What’s it take to do startups? It certainly isn’t intelligence .. It certainly isn’t technical skill .. It’s not unique product or market vision … [It’s] First, the ability  to monomaniacally and obsessively focus one thing … at the expense of everything else [including family ]… Second, the ability to take and endure an endless amount of shit.”

Martinez has a way of pulling back the covers to reveal how the legends of Silicon Valley are no different from many old-world ancients and in this, two examples stand out. First, as he listens to Zuckerberg rallying his troops before the Facebook IPO, he realises that “The People’s Republic of Facebook is no different from National Socialism, .. , Bolshevism, Islamic State, Crusades … because it depends on the founders, or revolutionaries narcissistic will to power and the mass man’s desire to be a part of something bigger than himself”. What is worse is that like medieval serfs, employees cannot walk away from the tech industry because they are bound by chains of loans to an expensive lifestyle that is unaffordable elsewhere. Second, both Facebook and Goldman Sachs, the two companies where he spent the most time, “would always aim to create monopoly pricing power and maintain information asymmetry rather than drive true innovation. If [they] played with the outside world, it was always played with the loaded dice.”

In August two partners from Y Combinator (YC) touched down in Bangalore to take a look at start-ups here. This is the same company that helped propel the author’s start-up right from the idea stage, through seed funding, defending against hostile court cases to its eventual “sale” to Facebook and Twitter as described in very great detail in this book. Those who have an interest in the start-up ecosystem in India will find this book to be an invaluable manual on how companies like YC operate and one that guides them the past the treacherous shoals and rapids. Software professionals in India who have only seen giant companies like Infosys and TCS delivering back end services with hordes of, what is unkindly referred to as, white-collar coolies, will understand what it means and what it takes to deliver high value, high margin products.

Since the author’s product was all about online ads, another important takeaway from this book is a detailed explanation of how online advertisements are created, targeted, auctioned and delivered on the internet. Eventually, it is these ads, that pay for all the free goodies that we get from the giant internet companies and the process is not fundamentally different from the trading of securities that the traditional economy is so familiar with.

Net-net, a book that is dense in detail and yet a pleasure to read. If you have an interest in the new age economy based on the internet, suggest that  you grab a copy and read it. It will be well worth the time.

This book review had originally appeared in Swarajya, the magazine that reads India right

October 23, 2016

Pokémon Go and the Ghostly Metaphor

Pokémon Go is a relatively new computer game that has, since July 2016, taken the world by storm. As far as its rules go, it is not really different from computer games that have been around for the last twenty years -- the player goes around locating and collecting objects of interest to earn game points. But the real impact is the introduction of an all new level of technology whose potential is yet to be understood by most of us. Unlike every other computer game that you can play from the comfort of a desk or a couch, Pokémon Go needs you to walk around the neighbourhood with your smartphone and “catch Pokémons”. The catch here is that the game merges the virtual reality of Pokémons with the physical reality of the neighbourhood Google Map. Since the game is aware of your location, you need to walk down actual roads, turn past, or enter, actual buildings and then, and only then, will you “see” the Pokémon in your smartphone. If you turn on the smartphone camera, the game cleverly superimposes the hypothetical Pokémon that you want to catch on the actual image that the camera is showing so that it seems as if the Pokémon is really in the room or on the road. This is augmented reality -- where the “virtual” is superimposed on the “real” in a way that makes it difficult to distinguish one from the other.

image from gizmodo

Augmented reality is not new. Digital data has been superimposed on physical images in heads-up displays used by fighter aircraft pilots. But this is the first time that this technology has come down to the mass usage level through an inexpensive smartphone. Pokémon Go has the potential to be what the spreadsheet was to computers in general and the Mosaic browser was to the world wide web -- a path breaking “killer application” that suddenly leads to a sudden jump in the usage of a particular technology. Other than the obvious benefit of forcing players to actually exercise their bodies, Pokémon Go has opened up new opportunities for doing business. For example, physical locations like shopping malls and restaurants can be quickly populated by virtual Pokémons to lure footfalls and customers. Again virtual characters can “appear” in thinly populated physical locations during an emergency to guide people towards areas of safety.

As a game, Pokémon Go may be a bit of an anticlimax and a smartphone camera is not a very sophisticated display device. But together, they show us the potential of what is possible when we have a convergence between the real and the virtual. Massively Multiplayer Online Role Playing Games (MMORPG) like World of Warcraft and Final Fantasy create fantastic virtual worlds where thousands of players “play” and interact with each other while executing quests that lead to goals and rewards. Players, represented by avatars in these games, move through computer generated landscapes, communicate, trade or fight with other avatars to acquire benefits. Earlier these games used to be played on regular computer screens with keyboards and joysticks. But now we have virtual reality (VR) headsets ranging from the inexpensive Google Cardboard that works with any Android phone, through more sophisticated products like Microsoft Hololens, Oculus Rift,  to dedicated gaming devices like the Sony Playstation VR. Using a range of physical sensors, these devices track the movement and position of the user’s body and change the visual perspective so realistically that the mind is fooled into believing that the events are happening in real life and not in the display of a computer.

Going forward in the direction pioneered by Pokémon Go, all these games can and might superimpose the real physical landscape, and people, into the virtual, computer-generated landscape -- or perhaps the other way around. At the Developer Forum in August 2016, Intel unveiled Alloy, a standalone VR device, that if placed on the head will completely isolate the wearer from the physical world and instead, immerse him in the virtual. In parallel,  Microsoft is working with Intel to create the capability of generating three dimensional holograms that will be visible in the physical world using Hololens and Windows 10.  This would mean for example, a player with a VR headset will meet and interact with a virtual character in a real room while other real people in the room will see nothing since they do not have the VR headset. An augmented reality movie will allow a user to see the actors running around the locations set in publicly accessible physical location like the Taj Mahal. The possibilities are endless.

All this is possible with technology that is already available today. But let us now take a leap of imagination and see what could be happening next. Today’s virtual reality devices are big clunky devices, somewhat like binoculars or helmets. They fit in front of the eye or on the head to eliminate the physical world and replace it instead with the virtual world. In augmented reality, the real world will also be allowed to creep into the field of view and will be merged seamlessly with the virtual so that as we discussed earlier, virtual objects will appear in a real setting and real objects will appear in a virtual setting. This is where the mind will start getting confused -- what is real and what is virtual? At the moment this question can be resolved very easily if the person simply takes off the headset. Immediately the virtual will disappear and only the real will be left behind.

But what if he cannot or does not wish to remove the headset?

What if the headset is reduced to the size of a normal pair of spectacles, as in Google Glass, or even smaller to the size of contact lens that is implanted on the cornea of the eye? For such a person, the dividing line between the real and the virtual will disappear completely and he will never know what is real and what is virtual. This is very similar to driving a car whose windshield, and windows, are replaced with a computer screen that shows the “outer world”. Initially the outer world will be real world streets, buildings and cars as captured in realtime by cameras but then the screens can display a desert or jungle and the driver would think that he was indeed driving in some other terrain. In fact the illusion would hold even if  the car did not move but only the images change. But what would be most interesting, or confusing for the driver, would be if we could augment the physical reality of streets & buildings with virtual images of non-existent cars that are whizzing past. With sounds and vibrations being built in, reality will become a confusing continuum stretching from the physical world through the augmented world and then to the virtual world. No one will know where one ends and the other begins.

Spectacles, contact lenses and in-ear hearing aids have already become an intrinsic extension of our bodies and act as an intermediary between our brain and the external world of sensory data. What if these were to become so ubiquitous and smart so that we forget that they exist and are modulating the data that our brain processes to understand the “reality” of the external world?

Would we still know what is physically real and what is virtually real? Which leads us to the next, bigger question -- what indeed is “really” real?

Sankara’s Advaita Vedanta posits that nothing is real, the world is an illusion, an error that we make in our perception -- no different from the virtual image that we might see through a Microsoft Hololens! Some of us might baulk at this repudiation of objective, tangible reality and insist on evidence of the existence of alternate worlds. However, as argued by the author in “Logic to  Magic” in the September 2016 issue of Swarajya, the world of “science” itself is swinging around to look at additional dimensions where other worlds may exist. So there is nothing wrong in exploring worlds that may lie beyond the only one that we are familiar with.

Once we accept that real and virtual worlds might exist with each other and the human mind may not be able to delineate where one ends and the other begins ghosts, spirits and other astral bodies may suddenly become less difficult to accept. After all, these non-physical, non-”real” entities are no different from the Pokémons that the game software inserts into the camera,  between us and our perception of physical reality. In the case of the Pokémon Go game, we know that there is a software and a camera in the smartphone but in the case of ghosts we are currently clueless.

What if that software had an analogue in the DNA sequence in our genome that affects our ability to perceive?  What if the camera had been a “contact lens” implanted in our eye at birth? Would we ever know that the Pokémon, or the ghost, doesn’t “really” exist?

P.S. See this Forbes article on an amazing product called Magic Leap that extends the idea discussed in this post.


This article was originally published in Swarajya, the magazine that reads India right

September 27, 2016

Cryptocurrency at Cypher2016

I was invited to Cypher 2016 - India's biggest Data Science conference organised by Analytics India Magazine at Bangalore where I spoke on Bitcoins, Blockchains and Cryptocurrency.

Here is the slidedeck ( please see in full screen )




and here are the videos -- -- -- --

September 21, 2016

From Logic to Magic -- In Search of the Real

Better standards of living, that many parts of the world enjoy, are often traced back to the renaissance in Europe that freed man from blind bondage to belief and allowed him to fly free on the wings of rational inquiry. These standards of course are defined in terms of material comfort -- food, clothing, shelter, safety and finally the leisure to explore the arts and the sciences. This leads to technical and administrative competence and the emergence of good governance that in turn, loops back to create even higher standards of living. While every society desires this virtuous cycle, those that have aggressively adopted a scientific approach were the ones that have been successful in overcoming or converting others to their point of view. Spiralling out of Europe and reaching out into the depths of America, Africa, Asia and Australia, it has been the triumph of the rational way -- based on facts, axioms, logic and reason -- that delivers material comfort to the population.


borrowed from
 http://www.brucesmithcreative.com/When-Hawking-met-Daniels
But is there an alternative? A narrative that seeks to look past the last 500 years of rational science and instead, perceives the universe through intuition and imagination? The Sanskrit word for philosophy is darshan, the sight, the perception of the truth as seen through the mind’s eye of the Vedic seer! But any attempt to subscribe to such a Vedantic vision of the world is immediately criticised as being an anti-scientific, irrational regression into saffron stupidity. Where is the proof? So first, let us get that out of the way  …


Kurt Gödel was a mathematician, a colleague, confidante and contemporary of Albert Einstein at the Institute of Advanced Studies at Princeton. He is remembered for his famous Theory of Incompleteness that showed that any collection of consistent statements will have at least one statement that is true but not provable. Thus provability is a weaker notion than truth. Gödel’s Theorem knocks out the philosophical foundations of the edifice modern mathematics, carefully crafted by Euclid with his axioms and proofs. Gödel showed how his theorem was applicable to mathematics in general and arithmetic in particular. This implies that if there are statements that are true but not provable even in a science as well structured as arithmetic, then there should be no difficulty in accepting the same in more complex, subjective philosophical systems. Lack of proof is no more an excuse to deny the truth of what is otherwise intuitively obvious!


Now that the need for a proof is out of the way, let us explore some interesting ideas ..


Sankaracharya,  who churned out the philosophy of Advaita Vedanta from the ocean of the Vedas and the Upanishads and created the most popular philosophical basis of Hinduism, states that the physical world is an illusion -- Brahma satyam jagat mithya, jivo brahmaiva naparah. Prima facie, this sounds absurd. How can the world that I see -- and touch, feel, experience -- around me be not real? Even if we ignore our senses, we have equipment in our laboratories that can record enough evidence from deep inside atoms to the outer edges of the galaxy and the universe.


But consider virtual worlds. Of the kind described in the movie Matrix or experienced in online games like World of Warcraft  and now being rendered through virtual reality devices like Oculus Rift, Samsung Gear and Microsoft Hololens? Technology can blur the boundary between the real and the virtual but we may still claim the satisfaction of knowing that, in principle and in theory, it is possible to distinguish one from the other. But this satisfaction is short lived. Nick Bostrom, of Oxford University, in a paper published in 2003 puts forward the simulation hypothesis that argues quite convincingly that it is not impossible that the world that we inhabit is indeed a simulation (or “Sim”) that is being run on a digital computer in the multiverse. So the physical universe that we know it today becomes one of the many “Sims” in the multiverse operating at a higher dimension or plane of existence. Recently, Elon Musk has echoed a similar thought.


What exactly are these higher planes and dimensions? The normal reality that we are familiar with admits of three dimensions in space to which Einstein added a fourth dimension in time. String Theory, a descendent from the hoary lineage of Relativity, Quantum Mechanics and the Standard Model of particle physics has made it quite respectable to consider the universe to have 10 or even 26 dimensions that are curled up, or crushed into the four that we know. A 3D structure can be reduced to a 2D photograph (for the engineer, the  plan and elevation!) that in turn can be rolled up into a thin, 1D tube. Information is lost when dimensions are reduced and may be recovered when the original dimensions are unrolled. Edwin Abott’s 1884 novella, Flatland, a satire on 19th century social issues that spanned across 1D, 2D & 3D worlds, was one of the first modern texts that explored the mathematical novelty that crops up in multi-dimensional String Theory today.


Unlike Relativity and Quantum Mechanics, String Theory is not yet proven and it is unlikely to be, in the near future but that does not make it untouchable in academic circles. So is the case with the simulation hypothesis that opens the doors to the multiverse. The illusory world of Maya that Sankara posits is indeed no different either.


Sankara talks about the primacy of the Brahman, the primordial, conscious sentience that is the only reality of the universe. Sentience and its close cousin intelligence is a function of information exchange and information science can play an interesting role in exploring this area. For example, life as we know it is a manifestation of the information stored in the genetic code. The medium of storage, the DNA molecule, is physical and degradable but the personality, the spirit, the Atman, that is encoded in the gene is transcendental, immortal and transferrable. You can destroy a paper book but not forget the classic story that was written on it! The story is independent of the physical book. From this perspective, the idea of an immortal Atman that evolves across multiple physical incarnations until it achieves identity with the Brahman certainly sounds feasible, much to the chagrin of the dyed-in-the-wool rationalist.


That information is the key to a fundamental understanding of the real world is a hot new topic in current physics. According to the MIT Technology Review “Some physicists are convinced that the properties of information do not come from the behaviour of information carriers such as photons and electrons but the other way round. They think that information itself is the ghostly bedrock on which our universe is built”. Based on the work of Erik Verlinde, of the University of Amsterdam, who showed that the Laws of Gravity can be derived from the Laws of Thermodynamics, Jae-Weon Lee of Jungwon University, South Korea has shown how gravity can be related to quantum information. Of course, the information that they talk about is not the kind stored in books and  computer disks but are defined in terms of symbols, sequences, probabilities and eventually entropy.


Information plays a key role in the description of both the cognizant intelligence that lies at the heart of reality as well as the physical depiction of this reality. Information is both the spirit as well as the body that is temporarily attached to it. Access to this information is the key to experience sat-chit-anand, the real and conscious bliss, that pervades and defines existence. Ekam Satya, vipra bahuda vadanti - Truth is one but many are the paths to it. Traditional science with its emphasis experimental rigour and rationality is certainly a useful tool but the direct experience, born of meditation and leading to enlightenment is an equally viable way to reach the same goal.


The Nasadiya Sukta of the Rig Veda 10:129 asks
But, after all, who knows, and who can say
Whence it all came, and how creation happened?


To which the classic textbook on Physics by Resnick and Halliday answers with a quote from the English poet W.B.Yeats saying that “the world is full of magical things patiently waiting for our wits to grow sharper”. Implicit in this statement is the fundamental premise of science that the world is understandable. The alternate premise is that the world is experienceable. Before the Mahabharata war, Krishna is seen trying to convert Arjun to his point of view. But after the first ten chapters of the Bhagavad Gita, Krishna realises that his logic has failed. Then he invokes the magic of a direct experience of the Divine, the Vishwaroop Darshan, in chapter eleven to show Arjun the reality and convince him to pick up his weapons again.

Logic and magic, reason and intuition, are two sides of the same coin that buys a ticket for the train that runs from darkness to light, from the illusion to the real.
--------------------------------------------------------------------------------------------------------------------------
this post was originally published in Swarajya, the magazine that reads India Right

August 22, 2016

Two Cheers, Not Three for Economic Liberalisation

1989 was a watershed year for both the world in general and me in particular.

I had just finished my PhD from the University of Texas at Dallas and had decided to break the jinx of the X+1 syndrome and return to India. Those who have been a part of the desi community in the US in the last century would recollect this strange yearning of those who had finally arrived in the US, not just physically, but metaphorically as well, to give it all up and return to India. Nostalgia for home, sprinkled with a sense of guilt for having abandoned it, competed with la dolce vita, the good life, that America held out to the F-1 visa community of graduate students and it was always that the good life that won out. Most of F1 crowd would eventually get the Green Card, permanent immigrant status, and then become US citizens but they would always keep alive the delusion that next year, X+1, they will wind it all up and move back to India. It was a delusion because India was still stuck in socialist quicksand, where the cost of a new car was twenty five times the monthly salary of a fresh IIT B.Tech, while the corresponding factor in the US was three or four! Did I feel a turn in the wind? Did I suspect that things in India could change for the better? Perhaps I did or perhaps I was just foolish, but armed with a large hearted offer from Tata Steel I decided to pack up and return.

On the way back, my wife and I decided to use the $2200 windfall that I had just got by selling my Mazda 626 car to buy two tickets for a 15 day tour through Europe with the travel company Globus Gateway. Europe of course meant western Europe because the Iron Curtain of communism ensured that eastern borders could not be crossed very easily. Even within western Europe, we had to obtain seven separate visas for the countries that we would pass through. Nevertheless we eventually arrived at Paris on Bastille Day to realise that the world was celebrating 200 years of the the French Revolution. But little did we know that three months later, while we would safely be in Jamshedpur by then, the world would see the spectacular fall of something that is closer to us in history -- the Berlin Wall.

The aftershocks of the fall of the Berlin Wall reverberated throughout the world and in a way led to the fall of India’s Soviet-era socialist economic model in 1991. Indians finally had the chance to participate in the global economy and today, the 2015 IIT graduate with his Rs 15 lakh placement package can finally think of a new car with only four months of his salary -- just as it was in the US in 1989! Some may of course wonder whether a new car is all that important for a fresh graduate but that is another question that can be debated elsewhere.

This summer, my wife and I were back in Europe, with our son, and with no Iron Curtain in the way, we decided to go through the great cities of Eastern Europe. Did I see anything different? Not really. As a tourist you visit palaces and churches, ride trams, take cruises and eat, drink in pubs and bars that have not really changed over the years. But the real change  that I felt was in me -- and by extension, in other Indians. This was a direct outcome of the economic reforms that were kicked off in 1991 by the beleaguered Government of India in a desperate attempt to stave off the socialism inspired bankruptcy.

So what were these changes that I felt ?

First was economic freedom. I had grown up in a upper middle class family in Calcutta, studied in a renowned school and were financially well off but my father could never dream of a family vacation in Europe! That was for “big businessmen like Tata, Birla”. This has changed. The emergent middle class in India can now think big as well, not just in terms of vacations but in most of the good things in life. No longer do we wait for our relatives to come back from foreign lands and hand out shampoo and soap!

What is more important is that our currency is recognised internationally. Before 1991 the rupee was worthless outside India. Getting “foreign exchange” for even the most mundane and legitimate purposes, like paying for the application fees for a US university, was a titanic struggle with forms to be filled in triplicate. Any foreign exchange in cash or cash equivalent travellers cheques had to entered in the passport for subsequent scrutiny by vulturesque customs officers. Given the restrictions on getting foreign exchange and the meagre amounts that could be obtained -- unless of course you had the right connections -- travelling abroad was difficult. You had to think thrice before eating out at anything more expensive than a McDonald’s restaurant. But now our own Indian credit cards, issued by our own Indian banks are readily accepted anywhere around the world and this was a very pleasant surprise for me. Conditioned as I have been to moving around with limited amounts of dollars, and keeping track of every cent that I was spending, the fact that I could access an ATM and withdraw euros, zlotys, forints and karunas directly from my rupee savings bank account in India was something that took me quite some time to get accustomed to.

The next big change is in telecommunications. I had grown up in an India where a phone was a luxury and one had to wait for years to get a connection. STD was unknown and trunk calls -- with variations like lightning calls and person-to-person calls, were hideously expensive. Long distance calls within US were quite reasonable but calling India from the US was frightful and one had to pay nearly US$ 5/ min for calls and that too when it was night in India. The first time I saw a fax -- it used to be called ZapMail -- was when the Swiss embassy suddenly wanted a copy of our air ticket before issuing a visa.  Back in India, calling up my mother in Calcutta from Jamshedpur involved visiting a post office, standing in queue and paying Rs 100 in advance before the call could even be attempted. Mind you, it was attempted, not guaranteed to connect! Outside cities, telephones were impossible. I remember the wedding of a friend of mine where we accompanied the groom from Jamshedpur to Bokaro via Purulia and when faced with a sudden emergency, we could not make any kind of call until we had actually reached our destination.

This of course has changed beyond recognition. First, thanks to private players and wireless technology, getting a phone in India is just one KYC compliance away. Then you have VoIP technology like WhatsApp and Google Voice and when this is coupled to free WiFi services available at each and every hotel and restaurant in Europe, we were in constant touch with friends and family at virtually no cost.

Consumer goods, currency controls and communications -- ever since the heady days since 1991, all this changed for the better in India, but what has not? Many things, including our attitude towards corruption and criminals in public life but perhaps what is most obvious is India’s travel and transport infrastructure. While private airlines and app-based cabs cater to the requirements of the well heeled traveller, the common man is still at the mercy of inadequate and overcrowded public transport systems. In my current visit to Europe nothing showed this up more than the usage of trams in inner city transport.


Calcutta has a history of trams going back to 1902 and has the oldest running electric trams in Asia. But thanks to a combination of unfortunate incidents, including but not limited to the destruction of a large number of rolling stock by the communists in the 1960s, the tram system is gasping for breath. Unimaginative planning, incompetent operations, venal politics and inevitable corruption has come together to destroy an elegant, inexpensive and non-polluting form of transportation. As a big fan of trams in Calcutta, I have often been told that trams are obsolete and are an anachronism in a modern city. But this year in city after city, in Berlin, Warsaw, Krakow, Brno, Budapest, Vienna and Prague we saw how modern and sophisticated trams have been integrated with buses and even river boats to create an affordable and efficient public transport system. Why can we not build the roads and railways that this country so desperately needs?


What is lacking in India is neither technology nor capital but the ability, or perhaps the willingness, to put things together and craft an elegant solution that addresses basic infrastructural requirements. The economic reforms of 1991 may have uncorked the bottle of stifling socialism and released the genie but the genie is yet to master the magic that will create the right management structures not only for transportation but also for schools, hospitals, municipalities, courts of law, law enforcement, tax collection and in fact for the entire infrastructure of governance and public services.

The reforms of 1991 might have vindicated my 1989 decision to return to India because in purely economic terms, India today offers opportunities to achieve and maintain a standard of living that is comparable to what was possible in the United States. But what the reforms have left incomplete is the corresponding changes in governance procedures. With people and their mindset remaining the same, the only way to upgrade this infrastructure of governance is perhaps to reduce the discretionary role of humans and move over to a more systems driven approach to governance. As argued by this author in the May 2015 issue of this magazine, we need to leverage technology and modern management techniques to the hilt and use them to overcome deficiencies caused by people. Unless this happens and it happens very quickly, future generations of Indians will once again think of India as not a good place to go, or even return, to but perhaps just a great place to have come from.

And till then, it is only two cheers for economic liberalisation!
----------------------------------------------------------------------------------------
This article was originally published in Swarajyamag - the Magazine that reads India right

July 21, 2016

The Second Book on the Third Wave

Steve Case is such a big fan of Alvin Toffler’s 1980 classic, The Third Wave, that when he pens his own memoirs he gives it the same title. In his seminal work, Toffler had identified three distinct waves in the evolution of human society as the world moved from agriculture, through industry to become a post-industrial information driven society. Steve divides Toffler’s third wave -- the information phase -- into three sub-waves and then examines the third of this third in greater detail.

In addition to being his memoirs, that chronicle the rise and fall of America Online, the company that really got Americans hooked to the internet, there are two other distinct themes that Steve has woven into this easy to read book. First he wants to be mentor and cheerleader for the entrepreneur who has an idea to change the world and does not know how to go about it. The second, and this is pet theme, is the distinction between the first, second and third waves, or sub-waves, of the internet driven economy that dominates the world today.

For Steve, the first wave, in which he and his company AOL played a very significant role, was all about the setting up of the infrastructure of the internet and world wide web. This wave collapsed in the dot com bust and was followed by the second wave of applications -- Google for search, Facebook  for social media, WhatsApp for communications, Amazon for commerce. The key difference between the first and the second wave was that the second was driven by individuals, or small groups, using cutting edge technology while the first wave was not so much about innovative technology as about clever collaborations and partnerships. Steve admits it as such when he says that “AOL was not alone in believing in the idea of the Internet but we outhustled and outexecuted our competitors. The big companies like IBM and GE, should have prevailed, but they didn’t. Their lack of agility and entrepreneurial passion and culture hobbled them.”

The third wave will finally see the internet delivering on its promise of universal connectivity that it’s evangelists have been talking about since it’s early days. IoT -- the Internet of Things -- will connect every device from the car, to the toaster, the smartphone to the refrigerator, the powerplant to the electric switch through the internet and deliver innovative, useful services seamlessly. Steve believes that this connectivity will be so ubiquitous that the phrase internet enabled device will be as irrelevant as, say, an electricity enabled washing machine. Being connected to the internet will be the default and not a novelty or a USP. This will also ensure that third wave companies, and applications, will not create new or unusual business opportunities but will streamline and make more efficient, existing mainstream businesses like healthcare, education and agriculture that form the backbone of the global economy today.

Steve believes that the key and crucial differentiator for the third wave companies will be, like the first wave once again, partnerships. Unlike Elon Musk or Jeff Bezos, Steve is no champion for new or groundbreaking technology. Instead he believes that the success of the third wave entrepreneur will lie in stitching together a network of alliances and partnerships across three kinds of entities, namely, technology creators, mainstream businesses and government agencies. Knowwho will take precedence over knowhow. Unlike most technophiles, Steve believes that government can and must be trusted and, however difficult it may be, the entrepreneur must walk that extra mile to take government along if he wants to succeed. Entrepreneurs in India would, I am sure, wholeheartedly go along with this sentiment since they know very well that in India managing the government is more important than technology or management systems.

As an extension of his recurring belief in the value of partnerships --  “If you want to go quickly, go alone, if you want to go far, go together” -- Steve has a team of professionals from West Wing Writers to sieve through his speeches, distill out the wisdom and package it into this nice book. But as in anything created by a committee, the result, while being faultless to a point, lacks the brilliance of original ideas or the elegance of literary craftsmanship! Entrepreneurs however will see in Steve an image of their days of struggle, learn about the importance of networking and partnering with government and be motivated to jump into the third wave of the digital society that is already cresting around us today.


Originally published in the August 2016 issue of Swarajya, the magazine that reads India right!