Maths, machine learning, brute force and elegance

Back when I was at the International Maths Olympiad Training Camp in Mumbai in 1999, the biggest insult one could hurl at a peer was to describe the latter’s solution to a problem as being a “brute force solution”. Brute force solutions, which were often ungainly, laboured and unintuitive were supposed to be the last resort, to be used only if one were thoroughly unable to implement an “elegant solution” to the problem.

Mathematicians love and value elegance. While they might be comfortable with esoteric formulae and the Greek alphabet, they are always on the lookout for solutions that are, at least to the trained eye, intuitive to perceive and understand. Among other things, it is the belief that it is much easier to get an intuitive understanding for an elegant solution.

When all the parts of the solution seem to fit so well into each other, with no loose ends, it is far easier to accept the solution as being correct (even if you don’t understand it fully). Brute force solutions, on the other hand, inevitably leave loose ends and appreciating them can be a fairly massive task, even to trained mathematicians.

In the conventional view, though, non-mathematicians don’t have much fondness for elegance. A solution is a solution, and a problem solved is a problem solved.

With the coming of big data and increased computational power, however, the tables are getting turned. In this case, the more mathematical people, who are more likely to appreciate “machine learning” algorithms recommend “leaving it to the system” – to unleash the brute force of computational power at the problem so that the “best model” can be found, and later implemented.

And in this case, it is the “half-blood mathematicians” like me, who are aware of complex algorithms but are unsure of letting the system take over stuff end-to-end, who bat for elegance – to look at data, massage it, analyse it and then find that one simple method or transformation that can throw immense light on the problem, effectively solving it!

The world moves in strange ways.

Brute force and elegant fight scenes

About a month back I happened to watch some random Kannada movie playing on TV starring wifebeater Darshan (it was called “Boss”, I think). It seemed like yet another of those typical masala flicks, with twin brothers and a weeping mother and lots of rowdies and corporate rivalry and all that. Overall it was a mostly sad movie but for me the biggest turn-off was the final fight-scene that takes place in some warehouse.

Ever since I was a kid, I’ve been a big fan of action movies. After we got our VCP, I remember going up to the videotape rental store close to home every Saturday evening and asking for “some fighting movie”. I didn’t care at all for the story or the lack of  it in any movie I saw. All I cared about was for “action”. After I had whetted my initial appetite for “fighting movies” by watching a bunch of Shankarnag action flicks (CBI Shankar, the Sangliana movies, etc.) my father started bringing home James Bond movies. I remember watching You Only Live Twice and Moonraker back then. I remember watching The Spy Who Loved Me, too, but there was a problem with the tape so I wasn’t able to watch it fully.

Coming back to Darshan and Boss, the turn-off about the fight scene was that it was an unbelievable “brute force” scene. The hero, a rather muscular sort of guy, singlehandedly beats up a whole bunch of bad guys. And it’s not even in the traditional form where the bad guys come one by one. They all come together and attack him and he repels them all simultaneously by means of sheer superhuman muscular strength. There was absolutely no fun in watching it. It was a similar story with the Puneet Rajkumar starrer Jackie, which I saw on TV last weekend. Though it was a rather well-made movie with a nice (and unusual) storyline, it again suffered from the problem of a superhuman hero who would overpower bad guys by means of muscular strength.

Earlier today I happened to watch the “Indian James Bond movie” Goadalli CID 999 starring Dr. Rajkumar. A rather poor attempt to make a “James Bond style” movie in Kannada, with a rather lame plot and underground hideouts involving automatic doors and the likes. The redeeming feature of the movie, though, was the fight scenes, especially the ones with Narasimharaju (who plays CID 888, 999’s sidekick). Clearly recognizing that this fellow didn’t have any means of brawn to beat up the bad guys, the fight scenes were “elegant”, where the good guy uses his brain rather than muscular strength in order to overpower the villains. So you have a gun that fires ten seconds after the trigger is pulled, and you have the good guy getting the bad guys to shoot each other, and things like that. It was a joy to watch.

The unfortunate trend in recent Kannada movies, though, is to make a superpower hero who simply beats the bad guys, which completely takes the joy out of fight scenes. That clever movement to deflect a punch, the use of easily available props to get away from the bad guys, setting bad guys against each other, stuff like this is completely missing from these movies. One reason could be that directors are not imaginative enough to put more care into fight scenes to make them enjoyable (though this is doubtful given that the general quality of Kannada movies in the last 5 years is better than that of earlier movies). The other reason has to do with the actors who play these roles. Perhaps they want to build up a superhero kind of image among their fans, one in which they can do no wrong and are supremely powerful. And a scene where they have to rely more on their intelligence and trickery to win a fight might go against this kind of an image they want to cultivate. Whatever it is, it only goes to remove entertainment value from a fight which could have been a joy to watch.

My all time favourite movie fight scene is from the “original” Don, featuring Amitabh Bachchan. The centre of attraction in this scene is this little red diary which contains all the information about the bad guys, and the good and bad guys are fighting for it. In the mix are a bunch of kids, the heroine, a paralyzed stuntman and of course the hero. The good guys play “monkey” with the diary, and in the process beat up the bad guys. It is an absolute joy to watch and for me that was the high point of the movie. Sadly, they don’t make movies like that any more.