Hill Climbing in real life

Fifteen years back, I enrolled for a course on Artificial Intelligence as part of my B.Tech. programme at IIT Madras. It was well before stuff like “machine learning” and “data science” became big, and the course was mostly devoted to heuristics. Incidentally, that term, we had to pick between this course and one on Artificial Neural Networks (I guess nowadays that one is more popular given the hype about Deep Learning?), which meant that I didn’t learn about neural networks until last year or so.

A little googling tells me that Deepak Khemani, who taught us AI in 2002, has put up his lectures online, as part of the NPTEL programme. The first one is here:

In fact, the whole course is available here.

Anyways, one of the classes of problems we dealt with in the course was “search”. Basically, how does a computer “search” for the solution to a problem within a large “search space”?

One of the simplest heuristic is what has come to be known as “hill climbing” (too lazy to look through all of Khemani’s lectures and find where he’s spoken about this). I love computer science because a lot of computer scientists like to describe ideas in terms of intuitive metaphors. Hill climbing is definitely one such!

Let me explain it from the point of view of my weekend vacation in Edinburgh. One of my friends who had lived there a long time back recommended that I hike up this volcanic hill in the city called “Arthur’s Peak“.

On Saturday evening, I left my wife and daughter and wife’s parents (who I had travelled with) in our AirBnB and walked across town (some 3-4 km) to reach Holyrood Palace, from where Arthur’s Seat became visible. This is what I saw: 

Basically, what you see is the side of a hill, and if you see closely, there are people walking up the sides. So what you guess is that you need to make your way to the bottom of the hill and then just climb.

But then you make your way to the base of the hill and see several paths leading up. Which one do you take? You take the path that seems steepest, believing that’s the one that will take you to the top quickest. And so you take a step along that path. And then see which direction to go to climb up steepest. Take another step. Rinse. Repeat. Until you reach a point where you can no longer find a way up. Hopefully that’s the peak.

Most of the time, you are likely to end up on the top of a smaller rock. In any case, this is the hill climbing algorithm.

So back to my story. I reached the base of the hill and set off on the steepest marked path.

I puffed and panted, but I kept going. It was rather windy that day, and it was threatening to rain. I held my folded umbrella and camera tight, and went on. I got beautiful views of Edinburgh city, and captured some of them on camera. And after a while, I got tired, and decided to call my wife using Facetime.

In any case, it appeared that I had a long way to go, given the rocks that went upwards just to my left (I was using a modified version of hill climbing in that I used only marked paths. As I was to rediscover the following day, I have a fear of heights). And I told that to my wife. And then suddenly the climb got easier. And before I knew it I was descending. And soon enough I was at the bottom all over again!

And then I saw the peak. Basically what I had been climbing all along was not the main hill at all! It was a “side hill”, which I later learnt is called the “Salisbury Crags”. I got down to the middle of the two hills, and stared at the valley there. I realised that was a “saddle point”, and hungry and tired and not wanting to get soaked in rain, I made my way out, hailed a cab and went home.

I wasn’t done yet. Determined to climb the “real peak”, I returned the next morning. Again I walked all the way to the base of the hill, and started my climb at the saddle point. It was a tough climb – while there were rough steps in some places, in others there was none. I kept climbing a few steps at a time, taking short breaks.

One such break happened to be too long, though, and gave me enough time to look down and feel scared. For a long time now I’ve had a massive fear of heights. Panic hit. I was afraid of going too close to the edge and falling off the hill. I decided to play it safe and turn back.

I came down and walked across the valley you see in the last picture above. Energised, I had another go. From what was possibly a relatively easier direction. But I was too tired. And I had to get back to the apartment and check out that morning. So I gave up once again.

I still have unfinished business in Edinburgh!


Shopping offline can be underwhelming

Maybe to compensate for the amount I’ve been buying on Amazon over the last few days (mostly baby stuff), I set off on Sunday to buy some stuff offline. And it was a most disappointing experience.

The biggest problem was the lack of choice and availability and inventory. I first went to a Levi’s showroom to buy a pair of jeans, having ripped three of them in the course of the last year (thanks to squatting I’m guessing).

I asked for comfort fit jeans and was shown a pair. Was rather underwhelming and I asked for more. Turned out that was the only pair of comfort fit jeans in the store.

And then I was looking to buy a pair of shorts. At least three stores on Jayanagar 11th Main Road were visited, only to be told none of them stocked shorts (Levi’s, Wills Lifestyle, Woodlands). I might have cribbed about lack of effective categorisation in online shopping but it’s a more acute problem offline, given the transaction cost of going to a store.

On Jayanagar 11th Main Road, for example, you have brand stores of every conceivable brand, but few stores have chosen to differentiate themselves by what they sell, rather than what brand. So you lack stores that specialise in shorts, or T-shirts, and so on.

For a while now I’ve been looking for a new pair of spectacles (hate my current frame, so I end up wearing contact lenses even when I don’t want to). GKB offered some choice, but nothing spectacular. SR Gopal Rao said they didn’t have large size frames, and had no clue when they’d arrive.

And there ended my shopping trip. The only things I’d been successful buying was a packet of freshly made rusks from a bakery (feel damn lucky most bakeries in Bangalore have in-house kitchen where they bake stuff fresh) and some medicines.

When your demands run into the so-called “long tail”, I guess nowadays online is the best bet. So I’ll possibly buy another pair of jeans online, having bought one pair from Korra and returned a pair to Amazon. I don’t normally buy clothes online, but on other tabs of my browser I’m checking out shorts on Amazon.

Oh, and I must mention Lenskart, who might end up getting an order for a pair of spectacles. They’ve set up what I call “experience centres” where you can check out their range of frames and try them on. Orders are fulfilled through their online store, since prescription glasses cannot be sold over the counter anyway (since the glasses need to be ground). I strongly believe that this is how retail will shape out in the future.

Working women, maternity and all that

As I write this, my wife is at work. Though her official gainful fulltime employment starts only a few months later (her employers have deferred her joining date thanks to the baby), she is continuing with her work as Marriage Broker Auntie (which she is now pivoting into something like a “Love Training School“).

In fact, our daughter was barely a week old when my wife decided to get back to business, in her quest to get more people “settled down” and “find partners” (she even brokered a deal from her hospital bed as they tried to induce labour in her). And so I’ve been able to observe, at reasonably close quarters, what it’s like to work while having a tiny baby.

Some times, you think it just doesn’t matter. That she works mainly from home means that she’s always with the baby. There are always sufficiently long periods of time when the baby sleeps when she can do her emails and writing. While sleep is definitely disturbed (by at least two hour-long feeding sessions each night), that she doesn’t engage in other strenuous work means she can handle the work stress.

But then there are the minor irritants. Meetings are a no-no, for example, since she can’t go out, and it doesn’t always make sense to call business acquaintances home. She’s been trying to substitute it with Skype/Facetime calls, but the challenge has been in terms of timing.

Given that some of the people she works with are fairly busy, she needs to pre-schedule calls, and with the baby’s feeding and sleeping schedule being rather uncertain, this is not an easy task. And then there is the problem of having someone take care of the baby during the call, which means the call has to take place at a time when I’m at home.

And so she is on a Skype call now. As she went in for the call, she asked me to handle the baby until it was done, promising that it would be a short call. As it usually happens in such situations, Abheri decided to start crying some two minutes after Priyanka went in for the call.

I tried all my usual tricks. I lay her down on my chest, a technique that usually comforts her in no time, but to no avail (I’ve read about the merits of skin-to-skin contact with the baby but given up on it after she decided to eat my chest hair). I then tried this face-down neck-hold (that I’ve nicknamed “choke slam”), which again usually works in calming her. Again no luck.

Then I smelt shit and thought she was crying because she needed a change of diapers. That didn’t help either. Rocking and singing and swaying and talking – all usually have an immediate effect but none whatsoever today. It was obvious that Abheri was hungry.

So I had to call emergency. Thankfully Priyanka’s Skype call is voice only (or maybe she switched, since she typically prefers video), so she managed to take a little break from the call to take Abheri from my hands. She (Abheri) immediately calmed down – food wasn’t far away.

Priyanka is still on her call, cradling Abheri with one hand against her breast, as Abheri feeds. And Priyanka continues to work.

Major level up in respect for her to see her work this way.

And major envy as well – that she can hold the baby and simultaneously work – nearly four weeks in and I’ve still not mastered the art of holding the baby with one hand, so I can’t work while carrying her!

PS: As for the new law that increases maternity leave, I’m sceptical, since I believe that full-time employment is something that will soon be history. More importantly, the law raises the cost of hiring women, so I’m not sure it will have its intended consequences. Read Priyanka’s excellent analysis here.

Holy Week and Ganesha Chaturthi

Over the last one week, ever since I stepped foot in Còrdoba last Friday, I’ve been exposed to Semana Santa (Holy Week) processions of different sorts, shapes, and sizes. Most of these have been observed in Sevilla and Malaga, which I visited for three days each earlier this week, and one small one in Còrdoba.

Based on my reading about this phenomenon (sometimes when stuck in traffic jams caused due to such processions), I understand that each such procession is undertaken by a “fraternity” and goes through the city before ending up at the fraternity’s church.

There are basically two floats that are carried – one depicting the Passion of Christ (with a statue of Christ carrying a cross, and a few others. The first such float I saw I wasn’t sure if it was a statue of Christ or an actor playing the role) and a more sober one with Mary and some candles. Then there is a bunch of people wearing some conical caps that cover their heads (with holes for eyes) who march along with the floats. And there is also a marching band (which played fairly robust tunes in Malaga, though the tunes I heard in Sevilla were more sober) according to which the float marches.

Walking just ahead of one such procession in Malaga (which finally ended up close to the apartment where we were staying), the similarities between these processions and the Ganesha Chaturthi processions back in India were hard to miss.

There were a few important differences – the Ganesha Chaturthi processions happen AFTER the festival, as the idols are immersed in water bodies, while the Semana Santa processions happen in the lead-up to Easter. More importantly, most Ganesha Chaturthi processions use motorised means (such as tractors and trucks) to move the idols, while Semana Santa floats are actually carried by large groups of volunteers (thus necessitating the band, to whose tunes they march).

The similarities are hard to miss – in both cases, there are large numbers of fraternities or groups that organise their own processions, and different groups organise their processions on different days. The processions go along predetermined routes through residential localities, whose residents come out to pay obeisance to the processions.

Most fascinatingly, as the Semana Santa made slow progress (given that floats are heavy and carried by humans, frequent stops are imperative) behind us, we noticed something markedly similar to what would happen with processions in India. Each time the procession stopped, some incense would be lit (like camphor in India), and bells would be rung (identical to the Indian case). And then a short rest and the procession would move on.

It is incredible how different religions in different locations have co-evolved and come to influence each other over time. In a way, this reinforces my belief that religion and religious practices are memes.

Football in the rain

The weather in Barcelona had been excellent for the last couple of weeks. While it wasn’t warm (most days had required me to wear a rather heavy jacket), it was pleasant and sunny, with hardly any rain. For whatever reason, the rain gods had to choose today, when we had tickets to watch Barcelona play Arsenal in the Champions League, to pour down.

I had made a dash to a nearby supermarket to pick up light raincoats earlier this evening. In hindsight, I can attest that Quechua Rain Cut is a brilliant product and does its job. Among the best raincoats I’ve used. Very effective and light, and can be worn over other warm clothes!

Rain meant we had to take the bus to the stadium rather than walk (it’s 2km from home), and rain also meant that bus made painful and slow progress, dropping us near the Camp Nou some 15 minutes before kickoff. And then there was the lack of queueing at security check outside the stadium (made worse by the pouring rain).

Before the game I’d checked if backpacks would be allowed at the stadium and various forums had mentioned in the affirmative. As it turned out, they weren’t allowing them in today, which meant we had to drop my wife’s (fairly expensive) backpack at the gate before we got in. It was just before kickoff that we took our seats.

Rather, I took my assigned seat while my wife randomly occupied the empty seat next to mine, hoping to exchange it with her seat (which was one row in front) when the rightful occupant arrived. As it transpired, the rightful occupant never arrived (perhaps he was a season ticket holder deterred by the rain, else I can’t imagine someone letting go of a €150 ticket. I plan to do a post on season ticket pricing when back from vacation. Context is Hull City revamping their season ticket system. Interestingly the other seat adjacent to mine was also vacant! In fact, there were quite a few empty seats at the stadium).

There was this nice anecdote which can be used in economics classes on externalities – given that it was raining, it meant that people had an incentive to hold up an umbrella while sitting, but that would mean those in the rows behind would be inconvenienced – a negative externality. Usually, nudges and shouts did the trick to lower the umbrellas, but some umbrella men were steadfast.

Anyway, despite being in the third tier of stands, the view of the pitch was top class (apart from the occasional intrusive umbrella) and we soon got adjusted to the drizzle. The players weren’t that well adjusted, though, for they constantly kept slipping on the turf.

Photo taken at half time
Photo taken at half time. The messy hair can be explained by the hood of the raincoat

Interestingly, the noise levels weren’t too high – when Barcelona scored, celebration was rather muted. There were no shouts of Vis?a Catalunya at 17 minutes 14 seconds (this had been rather vociferous the last time I was at the Camp Nou, but that was in the run up to the (later cancelled) secession referendum) – but that could be because that was exactly around the time Neymar scored.

Though there is another possible reason people didn’t celebrate too loudly – I belive people had gotten into certain positions that helped them beat the rain (like I’d pulled my raincoat forward and over my knees to protect my thighs from getting wet), and heavy celebration would disturb these positions. There was the usual drum band behind the south goal, but the crowd was otherwise rather quiet (the away stand directly behind us was an exception, though!).

Anticipating an exodus, we had decided to leave as soon as the clock opposite us struck 42 in the second half. As it happened, Barcelona scored their third goal just as we were about to disappear into the stands. The early exit helped – there was a bus right outside the stadium that would drop us next to home, and we managed to find seats on that.

Oh, and the backpack that we had abruptly discarded near the gate when we went in was still in the exact position where we’d left it, and we gleefully picked it up on our way out. Quite impressive for a city that is known for its high rate of petty crime (which I’ve been victim to. I lost my spare phone on the day I landed last month, between getting off the cab from the airport and getting into my apartment building!)!


The Geo-Politics of Multiculturalism

My wife Priyanka‘s business school takes much pride in its multiculturalism, with students from some 60 different countries in her class of nearly 300. And on one year every day, they choose to celebrate this multiculturalism, and what better way to celebrate multiculturalism (or anything  else for that matter) than to get drunk together?

And so we had this party, not very creatively called “Multi Culti”, last evening where people from 34 countries/groups of countries had set up stalls to showcase the food and drink of their respective countries/groups. This binge eating/drinking session sandwiched a “cultural program” where a lesser number of countries/groups sang and danced, again in an attempts to showcase their cultures.

Most of the food was excellent, and most of the drink was, too. The quality of drinks on offer is borne out by the fact that despite having at least a dozen drinks of a dozen varieties last night, I was up and about without a hangover by 7 this morning – that can’t happen unless the liquor is of high quality (oh, I skipped the Old Monk on offer at the Indian stall)!

While being in business school together means you leave behind national differences (and find other axes on which you RG each other), there were some subtle (and some not-so-subtle) instances of geopolitics on display at last night’s event. I must mention that this blogpost was constructed while I was watching the “cultural program” that was sandwiched by the eating and drinking.

The most obvious display of geopolitical tension was by the Catalans, who allegedly wanted a stall for themselves, but weren’t allowed to have one by the Spaniards. So they set up this “pirate ship” (perhaps as a nod to Barcelona being Spain’s main trading port during the middle ages) which was a cart that was pulled around the area. Other secessionist movements didn’t display much creativity, though – Quebecians were happy to be part of the Canadian stall, and I’m not sure if there are any Scots in the program.

And then there was the setup of the stalls (note that these are my personal pertinent observations, and I might be drawing spurious correlations here). Mostly neighbouring countries were near each other. Japan was next to Korea. Germany next to Austria (I’m assuming it was Austria given the stack of Red Bulls). Brazil and Argentina facing each other. France next to Italy.

But some pairs, it seemed evident, were being deliberately kept away. Republic of China’s (there’s a surprisingly large contingent from there in the MBA program) stall, for example, was kept as far as possible from the People’s Republic of China’s stall. Food in the two stalls looked similar, and it’s possible I didn’t take anything from PRC since I’d eaten similar looking stuff at RoC’s stall. The shots on offer at RoC were legendary, though. Some rice wine with 38% alcohol content. Did at least 3 shots there.

The other geographical separation, possibly due to possible tensions, was a pity though. I love eating falafel wrapped in hummus and pita bread. The layout and choices by teams, however, meant they were far away from each other.

On one side of the venue was the Israeli stall, with pita bread and hummus and some incredibly delicious Israeli spice (forgot what it was called). The Israelis didn’t have falafel, though (they instead had sausages – possibly a nod to the Ashkenazi heritage). For that you’d to go to the other side where the Arab stall was located! The Arabs also had Baklava, and if I’m not wrong, also offered liquor (I kept grabbing Baklava whenever I went near that stall, and didn’t bother about anything else).

Which brings us to country groupings. 300 people from 60 countries means some countries don’t have enough of a quorum to put up a show, so you had them banding into groups to put up a collective show. The Arabs were one such collective (I’m not sure of the countries that went into that collective, but it was funny to see a guy with a red-and-white checked headscarf dance next to a guy in a Fez during their “cultural performance”). The entire continent of Africa was another (they had this little quiz where you’d to identify a randomly chosen country on the map of Africa, for which you’d get a “dessert shot”, which was bloody delicious).

Finally, a note about the “cultural program”. Most countries stuck to national stereotypes, which I think is a good thing in such context. Most of the crowd is pissed drunk anyway, and what they want is a high energy program they can connect with.

So the Indians did well with three Punjabi acts (couldn’t recognise any of the songs). Spaniards danced to Macarena. Germans danced wearing Angela Merkel masks. An Argentine wore a Maradona mask (a lot of Argentines were in Albiceleste jerseys. One wore a Boca Juniors jersey) while doing the tango. PRC and RoC put up contrasting shows. RoC did a high energy generic dance routine. PRC had an inflatable dragon and did a more “traditional” dance.

My personal favourite was the British performance, though. They chose three well-known songs by three well-known bands (Britain’s contribution to music is an immense source of soft power for them). Four of them dressed up like Queen (fake moustaches and all) to enact a part of Bohemian Rhapsody. Five guys in drag (this was most hilarious and impressive) danced to If you wanna be my lover by the Spice Girls. And the whole crowd sang along and swayed as four guys in Beatles masks performed to Hey Jude (with masks being such a thing at the festival, I’m really really annoyed that there were no Modi masks. All the Indian contingent had was Kejriwal-style Gandhi caps. Most anti-national, I must tell you :P).


Kadlekai Parshe

This afternoon I visited the Kadlekai Parshe (groundnut fair) with the in-laws. It was the second time I was visiting the fair, and the first time during daylight (the last time was in 2011, with the wife, and I remember getting incredibly pained with the vuvuzelas all kids seemed to be blowing then). Some pertinent observations:

  1. Considering that it was a groundnut fair, an activity that all visitors could be expected to indulge in would be to buy groundnuts and eat them as they walked through the fair. Eating groundnuts has the externality of skins, and there weren’t enough dustbins to effectively dispose of the skins.
  2. As you might expect in a fair where you have a large number of shops selling pretty much the same goods, prices were largely the same. A litre of raw groundnuts (yes, that’s how whole groundnuts are measured and sold in Bangalore) cost Rs. 25 in most roadside shops, while a litre of roasted groundnuts cost Rs. 30.
  3. We ended up buying groundnuts from several shops, and the quality varied widely, though the price didn’t. Some had too many “buDDes” (groundnuts with underdeveloped nuts), some were not roasted well enough, some were roasted too much and so on. Yet, price didn’t vary by much. This is puzzling since it was possible to sample a couple of groundnuts before making the decision to buy.
  4. There were a lot of people and most of the road space was taken up by pedestrians. Yet, there were vehicles plying (well at a slower rate), leading to traffic jams all around. A better solution might have been to turn the stretch of Bull Temple Road between haLLi mane and Kamat Bugle Rock pedestrian only. Would’ve ensured greater safety and possibly faster traffic flows on alternate routes.
  5. In terms of food, there was a large number of chaat carts, carts selling slices of a kind of thick (15 inches diameter) edible root, carts selling potato chips (which looked quite good and reminded me of Prague where I remember buying similar chips at St. Wenceslas’s Square), etc. Being noon, none of them seemed to be doing much business. Hopefully they’d’ve had better luck in the evening
  6. Stalls were licensed, as I happened to see a license number on a “stall” (basically groundnuts heaped on the ground) selling groundnuts. This is a good move. We need full time licensing of city food carts.
  7. The entire stretch of BP Wadia Road bewteen Bugle Rock Park and BMS College for Women was occupied by Lambani tribespeople selling plaster of paris figurines. Again, around noon, not much business, but enough attention to block traffic on that road.
  8. There was a massive crowd going into the Big Ganesha and Big Bull temples. We steered clear and stuck to the peanuts.
  9. There were a few people with DSLRs clicking away (I was one of those on my last visit). No groups though.

It seems like a fairly fun event. With better management (traffic, dustbins) it can be even better.