Mirroring my article on Chennai 36 – The Alumni Blog of IITM

Recently, I wrote an article to Chennai36 which is a blog maintained by the Alumni Association of IITM. The article was about my opinions on how to apply to graduate school for an undergrad at IITM. In this post, I am mirroring that article on this blog.

The original article can be found here.

—————————————————————————————————-

The Grad Guru : Karthik Abinav at University of Maryland, College Park

Note : Whenever I mean grad school, I am going to be referring to a PhD program. Though most of this advice also applies to MS programs, you should bear in mind that my focus is on PhD program. Since, I do not have much knowledge about the MS programs, I will not comment much about them in this article.

1.  Please tell us about yourself, the university you are studying at, the research field you are working on, and the scope it has to offer after an MS or PhD. Also tell us about a typical day in the life of a postgraduate student.

I recently started my PhD in Computer Science at University of Maryland at College Park. I am broadly interested in theoretical computer science. At a high level, this area deals with the mathematical formalism for many of the fundamental computer science problems. The direct application of the work in this area is primarily in computer science, but not limited to it. Due to its extreme mathematical nature, most problems are abstracted sufficiently, to be applicable in a variety of other fields. Some of the common fields where work in this area is used are Economics, Operations Research, Computational Biology, etc. In terms of a researcher in this field, you have multiple options after a PhD. The most obvious choice is academia, either as a research scientist at one of the research labs in industry or a professor at one of the universities. But, due to the versatility of this subject, you can work at a number of other places, which at first do not seem related. For example, a quant researcher at a financial service is one such place. The kind of ideas required in those places requires a strong training in mathematics and computer science. Theoretical computer science is one way, which gives those particular skills to a researcher. Without going into great detail I would list down some places where one could join if one is not too keen on academia. Places such as Google, eBay, Amazon, etc. which does a so-called “Product oriented research” is yet another great place where a PhD in theoretical computer science can be of great help. In recent days, with computational biology relying heavily on techniques from computer science, a career as a computational biologist at industry is yet another lucrative option. With both the industry and academia moving at such a fast pace these days, one should also account for the options, which do not exist as of now, but will be a real option when one graduates.
A typical day in the life of a grad student varies widely on what stage of a PhD one is in. For example, most universities have some form of course requirement to be completed in the first few years. Hence, a significant part of the first couple of years is spent doing graduate coursework. In my particular case, I spend about 8 hours a week attending classes and doing related work. Since, I serve as a teaching assistant, I spend another 7-8 hours teaching classes, holding office hours and grading. I spend about 15 hours doing research in the form of thinking about problems, reading relevant materials, attending talks etc. Since, these activities are amortized over a week, one can scale it appropriately to get an idea about the workload per day. The most important lesson I have started to learn is that a high amount of self-discipline is required, as a grad student, to get all the work done. If you want to give your fullest towards your research, classes and yet have a life outside the university, it is highly critical that you make a strict schedule and stick to it. This is yet another important skill you learn in pursuit of a PhD.

2.  When did you decide to apply for further studies? What are the necessary skills, according to you, a person should develop in order to make himself cut out for research and not just getting a good Grad school?

My decision to apply to grad school was somewhere in third year, where I felt I might like the process of doing research. My first sparks came from thinking about problems from class work and the idea of figuring out solutions after toiling with it for a while. A typical “undergrad attitude”(which I admit, I too had at that point) is to believe that solving hard problems from a course work is in fact a great indicator about liking research. But in reality, doing research involves a lot more activities (sometimes mundane) and one should ensure they like the whole package before diving into it. I tried my hands at some simple research problems at institute and during my internship in summer. What struck me most about these experiences was the fact that I actually liked almost all of the associated activities along with solving problems. Critical thinking, evaluating multiple solutions, collaborating with other researchers, effective communication, a lot of writing, are some, among the many associated activities accompanying doing research. I realized that I would like to have these skills and would also enjoy the process of developing them. So for anyone considering research, I would suggest they try out working on some research problem. The only way to know if you like running a marathon is by running a marathon. No amount of short sprints will prepare you for a marathon.

3.  How did you make the choice between placements and applying? Aren’t people who are working on projects and making their resume good enough to apply to Grad school less preferred by recruiters?

Though I had pretty much made up my mind to go to grad school, I went through the placement process nonetheless. In Computer Science, a lot of companies in the industry work on exciting stuff. They tackle problems that are challenging and the skill set required to be a competitive candidate there has a large overlap with skill set required to be a researcher. Hence, the conflict of “preparing a resume for grad school” is not too evident. However, one downside of going through both is the preparation process for the interviews alongside with preparing your grad school application. The interview process for most of these companies requires a focused practice, without which you would not stand a chance. This to me is the most important factor when considering both applying to grad school and going through the placement process. You need to put in double the effort and time than usual. However, if one is considering grad school against a so-called “non-core” company, then that’s a different ball game. I would suspect, in such cases one should make a clear decision upfront and prepare accordingly. But since, I never had to make such a decision, I may not be the right person to comment about it.

4.  Is a high CGPA required for applying? How do you derive the motivation to study and get high grades in subjects not at all related to your research interests? Is it all lost for people below the ‘astronomical’ 9 point CGPA? How can they make up for not crossing the barrier? Does pursuing Honors add weight to his/her Grad school application?

A high CGPA is neither a necessary nor a sufficient condition when it comes to grad school. It is just one of the factors among the many factors that decides admission to grad school. But, this should not be interpreted as; having a low CGPA doesn’t hurt your chances. A good CGPA always helps, although the principle of higher the better is not necessarily correct. Similarly, a low CGPA doesn’t mean all is lost. But you have to make up with sufficient quality research to compensate for low CGPA.
Very few people would have a research interest fixed in mind early in undergraduate. So, the concept of a course not aligning with one’s research interest does not make much sense. In fact, these courses are the one that would give you first sparks about which research area might suit you. In my opinion, every course has something to offer and one should look to gain these things out of every course. Also, as with any other aspect in life, the good and the bad always come together. If getting a good CGPA means higher chances of an admit to grad school and getting an admit to grad school means that much to you, you would definitely find the motivation to study hard for it. Also, the ‘astronomical’ 9-point CGPA is more of an artificial thing in my opinion. As I said before, CGPA is not the only factor and hence one should also do some quality research to increase one’s chances. It also helps one fully realize if a career in research is a right path for one.
Honors program (at least in Computer Science) gives you the flexibility of taking more graduate electives. This particularly helps if you are unsure about what area excites you the most. But, if you would rather like to explore that by doing more research and fewer courses, then honors program doesn’t necessarily add more value. For most parts of grad school, you should show potential of a good researcher. Hence, doing more research is the best way to convince the committee that you are cut out for research. If you would like to seek these experiences from graduate level electives or otherwise is a choice that is personal to you.

5.  How relevant are extra-curricular and Positions of Responsibility? If any, what position did you hold, and how did it help you?

With respect to direct impact on application, extra-curricular/positions of responsibility have almost no effect. They are looking for promising researchers and they want just about that. It does not really matter if you were a Shaastra Core or a Saarang Pro-show Coordinator, since those things aren’t going to give evidence about whether you will be a good researcher. But, this doesn’t mean one should not try their hands at them. They should do so only for personal pleasures and shouldn’t look at them as an investment, which would eventually reap some direct returns in terms of grad school applications. Among many things, they teach you a lot of life skills, which you will otherwise never learn from classroom. In my particular case, I remember doing some webops/mobops activities during Shaastra, Saarang, and placements. I did them since, at that time they seemed challenging and nice to me. The biggest thing that helped me from those experiences was that I got to make a lot of friends with many of the smart people in insti.

6.  Can you tell us about the other schools you applied to ? Did you have alternate options? How did you select between them? How do we gauge the authenticity of world rankings of a university and to which extent are they reliable? 

I applied to about 10 schools overall with a mix of Computer Science and Operations Research programs. I had to make a decision between University of Michigan and University of Maryland, and ended up choosing University of Maryland. Personally, my criteria included a mix of department, potential advisors with whom I would work with, strength of the allied departments like Electrical Engineering, Math, etc., location of the university and proximity to the closest city. A lot of people underestimate the last factor. In my opinion, that is as important a factor as, choosing whom you work with. Grad school is a long journey spanning for at least half a decade. I personally didn’t prefer to work at an isolated college town located in the middle of nowhere, with the travel to the nearest city requiring an hour’s flight journey.
Another method for selection that seems to work quite well is to identify some of the top conferences in your field of research. You can see who are the researchers that are publishing consistently and look at the universities they are associated with. This will also give you a good idea about the strength of these places. Finally, you should also mail current grad students working at those places and find out more specific details about the places. Each of this process involves a lot of work, but unfortunately, there is no shorter alternative. Ultimately, you are looking at where you would want to spend your next five or so years. You might as well put in the effort in making sure it’s the best fit for you.
World rankings are an extremely tricky topic that makes a lot of people uncomfortable. One way to interpret them is by not looking at them as an absolute number but as a range. Does the university rank in the top 5, top 15 etc. Beyond that, it is hard to distinguish various universities, because for most parts they are all similar. Also, most of the rankings lag the reality by almost 3-5 years. Also, within academia, since professors move around a lot, it is hard to assign the strength of a university with a single number. Hence, the best way is to speak to your professors and find out what is happening in the universities, who are the people currently doing good research etc. Academia is a closely-knit circle, and usually professors in your department are the experts when it comes to choosing universities. In my particular case, I am extremely thankful to Prof. Jayalal Sarma, who helped me, and three of my batch mates in choosing the right places to apply to. He spent a considerable amount of time researching about the work people are doing currently. Without that, it would have been extremely hard for us to come to a good list of places.

7.  How did you identify your recos? What matters in LORs, the proximity with the referee or his stature in the research field? What is the relevance of SOPs, and how does one write ‘the perfect SOP? Does an exchange program help?How important are recos, SOPs, CGPA, GRE score, projects/internships, publications etc. in relative percentage of weightage? 

Usually, a good recommender is someone who knows you well on a professional basis, can vouch for your skills, commitment and has particular instances he can cite in the letter. Stature in the research field is a criterion to consider, but that should come after all the above holds true. An average letter or a letter without any details, from a top-notch researcher does more harm than good. Good way to identify who are your suitable recommenders is to talk with professors whom you think you have either worked with well enough or done some quality research with and see what they feel about you. Most professors are open about their opinions and would say they would not recommend you or not recommend you well enough, if they do not have a strong opinion about you. Your internships also come in handy here. You would most likely have worked closely with researchers during that time and if they were impressed with your work, would give you strong recommendations. Also, a recommendation from a manager in the industry is not so strong as compared to a researcher in academia. Some universities explicitly place restrictions on having at most one recommendation from outside academia.
Statement of Purpose is a one-and-half to two-page document explaining why you are a suitable and strong candidate for the program. It is the place where you can talk about goals, motivations and some of the technical and non-technical skills you have accumulated during your undergraduate. The best way to write a so-called ‘perfect SoP’ is to be honest about one and clearly write out one’s motivations, strengths and goals in general. You can look at SoP as an advertisement for a product. A bad advertisement is surely going to repel customers away from the product. A good SoP, would give your product the first look it deserves. But, beyond that it’s the quality of the product that ultimately decides its popularity in the market. Similarly, beyond that initial attention, it’s the other components in your application that will ultimately decide if you would be admitted.
Though there is no magical formula for how admission works, but for most parts, I feel, the following ordering holds true:
Letter of Recommendation >top-tier publications / research experience > CGPA > SoP, GRE, others
Since, most of academia works by word of mouth, a good recommendation from one person is more than enough to sway the decision in your favor. Similarly, one bad recommendation is enough to ensure your application being rejected.

8.  Does work experience hold any importance, if yes, is it not advisable to work for a couple of years and then apply to Grad schools?

Work experience is a tricky situation to consider when considering grad school. Many people, especially in the US, come to grad school after working for a while. They seem to have a better idea about the importance of their research as opposed to many people straight out of undergrad. On the other hand, when it comes to reaching one’s full potential, most people believe the earlier you start; the more chances you have on reaching your full potential. Hence, in conclusion, there is no correct answer, and depends on a case-to-case basis. But, if you think you do not have sufficient research experience, or do not yet know if you can commit yourself fully for a PhD, working, as a research assistant is one nice option. This gives you a flavor of research and also strengthens your application to grad school. You can search for research assistant opportunities at a number of places, including IITM, IISc, etc. Here again, your professor will be your best guide who can direct you to the right people.

9.  What are the research internship avenues a student can look at? Could you please share with us your list of internships/projects and also the ones you are aware about? How did it help you? When is an ideal time to apply, and how does one go about it? Are students expected to do projects in the same field of research as they are applying, as they might not have decided on their topic of interest before actually working on it? How important is a foreign research internship, and how does it weigh as compared to an industrial internship?

There are a number of avenues to seek research experience as an undergrad. There is no place like home; hence working on a research problem with one of your professors is a great way to step into research. There would surely be a course or two that would have excited you and you would want to explore further. Speaking up with the professor and letting him know that you are interested is a great first step.
Other places for internships include programs like DAAD, MITACS, SN Bose program, etc. Most of these flyers are circulated around throughout the institute and one should definitely check these options. These programs are usually highly structured to help undergrads get a concrete problem to work on. The program usually has a number of hosts participating, who have a specific problem in mind. These are problems chosen such that, it is approachable by an undergrad, can be completed in the given timeframe of summer and possibly lead to a good publication. In many cases, students are also open to suggest the own problems they would like to work with and most researchers are open to working on those problems.
Some other opportunities are research labs such as IBM, Microsoft Research, etc. For most parts, they have a similar model as to working at a university, where the host mentor has a specific problem in mind and you go ahead and work on it.
Most of the application process happens between September to January before the summer. The best way to search for internships is to keep a lookout for interesting opportunities that are circulated by the department branch counselors. It is also a nice idea to talk to a professor you know and see if he has some ideas about where you could spend the summer. A “foreign” internship is not that important; what is important is you work on some research problem. Since, your ultimate goal is to see if you like research and apply with the required credentials to a good grad school, it is really important you work on research. As to where exactly you seek these opportunities is not so important. An industrial internship is not so relevant, especially if you plan to apply to grad school. With respect to computer science, most industrial internships are software engineer positions and you are expected to write code for software. They are equally challenging and fun, but they do not help prepare you for grad school.

10.  Please tell us about the funding options for a Grad school? Did you apply for scholarships? Who is eligible for them? Is working part time over there a way to meet tuition fees/etc.? How much does one generally have to spend from his own pocket (savings/loans)? What is the cost of living for married research scholars, approximately?

Since, in the entire article I have been referring to grad school as a PhD program, almost all grad students are completely funded by the department in the form of RA, TA, department fellowship, etc. The funds given by various departments vary according to the location, cost of living, the amount of funds the department receives, etc. Nobody ever becomes rich by attending grad school, but the funding is sufficient for a comfortable living. These funding sources usually also cover the tuition and give a monthly stipend for covering living expenses.
Besides, there are a number of external fellowships one has access to. I will give some details with respect to the universities in the United States. In computer science, there are fellowships such as Google PhD fellowships, Microsoft PhD fellowships, Facebook PhD fellowships,etc. that are open to international students. Though most of these fellowships are only eligible for grad students in later years of their studies. If you are a citizen of the US or a permanent resident, then you have a wider access to fellowships. One such extremely popular fellowship is the National Science Foundation Fellowship. Usually, one has to apply to this before joining grad school and no later than two years into grad school. This usually covers tuition, provides stipend for fours years of your study in the program. Hence, if you are eligible, it is a highly prestigious fellowship to apply to, irrespective of your other funding sources.
All in all, funding is not a major concern for most PhD programs in Computer Science. You will not have to end up taking student loans or borrowing money from others. As far as married research scholars are concerned, its slightly more tricky, but still manageable. If both the members have some form of income, then one can easily manage with the funding available in grad school. In case, the family depends on a single source of income, it is still manageable, but one has to live a frugal life.

11.  Students fear that, later, they might realize that they have no interest in the research field they have chosen, and hence hesitate to commit such a long duration of their lifetime. What do you suggest should one do/think in such a case? Also, how to choose among MS, PhD and an MS+PhD integrated program?

Just to clarify things upfront, in the US most schools have an MS program and a PhD program, which by default is an MS+PhD program. What this means is that you will get an MS “on the way” to your PhD. Some schools explicitly force you to finish MS requirements within a stipulated time and earn the degree while some other give you liberty till the time you finish your PhD to earn the requirements and hence the MS degree. If I am not wrong, very few schools have a PhD program where they do not give you an MS, if you choose to drop out at a later stage.
It is indeed a valid concern, but that is not something to really worry about. You should be more concerned about whether or not you like doing research in general. A lot of people switch areas at various points in their career. In some sense, a PhD prepares you to work on a new area by overcoming the steep learning curve as quickly as possible. Hence, if at any stage of your PhD, you lose the spark you had for your area, you can still switch to an interesting area (as long as its not too far away from your original area) and continue research in that area. In fact, most graduate schools recommend first year PhD students to keep an open mind and explore areas before fixing upon an area. Hence, in summary, the only question is whether you wish to commit such a long time towards research or not. Do not fret too much whether you would have the sustained enthusiasm for a single topic you have in mind before joining grad school. You can always find interesting problems to work on as long as you like the process of doing research.

To choose between a MS and a PhD program, there are multiple criteria. Firstly, most MS programs are based on courses. Your objective is to finish a set of courses and may be a short project. On the other hand, primary purpose of a PhD is to make you an independent researcher. You do take courses, but they are just to help you supplement your research. Your focus would always be on doing good research. Hence, if one has an idea about what one would want to accomplish, then the choice to be made is almost obvious. Sometimes, people may wonder if doing a MS first would good them a better idea about if they are cut for a PhD or not. This is not true in most cases, since the primary purpose of a MS degree is different. The only way to know if you like research is to do research.

12.  Did you consider the options offered in other countries, says Germany/ Australia/ Singapore/ France/ Canada? If yes, can you please discuss the pros and cons of choosing them over graduation in the ‘famous’ school in States, in terms of fees and cost of living, quality of research and education, scope of jobs after graduating from those schools and the quality of life in those countries, as you see it?

I didn’t apply to any schools outside the United States. Though there are some schools in Europe and Canada, for example, which are comparable to a top university at the US. It just was my personal choice to not apply to any schools there. Both in Canada and in Europe, I believe one has to first apply to a MS program, complete the requirements and only then apply to a PhD program. Unlike the US they may not offer a direct PhD program. If anything, this just increases the total time spent in MS+PhD program. Since, I didn’t go through the specifics of the universities and weigh pros and cons in greater detail at those places, I may not be able to comment much about the cost of living, quality of research etc.

13.  What work do you plan to do after you finish your doctoral, and where do you see yourself after 5-10 years?

I am still undecided about a particular career path. Broadly, it would be in the domain of a researcher, but as to whether it is in academia or in industry or elsewhere is something I do not have a clue about right now. Partly, this is because of multiple factors that affect one’s decision. For example, one of the major factors is the limited amount of positions in the job market for academia. Roughly about one in every ten of the graduating PhD student can realistically expect to find a position in academia. Other major factors include preference for teaching vs. doing only research, contributing to product research against intellectual pleasure, etc.

Installation of PhoneGap on Debian system

I have recently been developing an application for IOS using phonegap. I was extremely fascinated by the simplicity of its usage. In this post, I will guide through a step-by-step procedure to setup phone gap on a Debian system.

Setting Up PhoneGap application on a local system

You will come across the term Cordova often when one talks about PhoneGap. Please note that for most purposes, both are essentially interchangeable. Here, I will give instructions to setup cordova on a Linux Debian system. You can make appropriate modifications for your operating system.

The first step is to install the latest version of cordova on your system. The installation using the Command-Line Interface is extremely straight forward.

1) Install NodeJS on your system from their website.

2) Run the following to install cordova

sudo npm install -g cordova

3) Once cordova is installed, now create a new project. To do that run the following command

sudo cordova create photoFilter com.photoFilter.filter photoFilter

Note: I am calling my example application as photoFilter.

This will create folder called photoFilter in the current directory. The important files to note here are the config.xml file and the www folder. The config.xml file is where you will mention the plugins you are going to use, the various permissions needed for the application, etc. The www folder is the root folder for your HTML, CSS and JS files. If you read the phonegap features, the key feature that lets you develop applications quickly is that you can use web technologies to create a web application. Hence, the entire development of the application will happen using HTML, CSS and JS.

4) We will now add the required platforms on which we wish to deploy the phonegap application on. In this example, I am going to run this application on an android device. Hence, I will just add the android platform. Note, you need to install the android SDK from the android site before performing this step. I will assume that the required SDK is installed on your system.

cd photoFilter
cordova platform add android

Note: The common error while running this command is that your Android SDK may not be set in the PATH variable. Set the appropriate paths and re-try this command. You will now have a folder called android within the platforms folder of your application.

You are now all set to start development of the application.

 

A Trekking Expedition through the Chandrakhani Pass Part 2

This post is the continuation of the Part 1 of the experience. To read Part 1 please click here.

Day 5- Behali(8300 ft) to Waching(9300 ft)

This was probably the easiest stretch of the trek. We had an estimated time of 3 hours to cover about 5 kms. We had a couple of problems before starting off from Behali. Firstly, one of the participant Ananth had his shoe sole come off. In spite of inquiring around, we couldn’t find an extra pair of shoes for him. So, he just performed a temporary hack by using some glue and rope. The second issue was another participant Prateek fell ill and had high fever. He consumed a lot of paracetamol to help him trek for the remaining journey. After we left Behali, we got to see some glacial left overs on the way. This was our first encounter with ice. After trekking for about two hours upwards, we reached a flat land where we halted for lunch. We were running well ahead of schedule and hence, decided to take a break of atleast 2.5 hours. One particular sport unites everyone in India. And that is the game of cricket. We managed to get a bat and a ball from a local there. The flat land also had a stretch of grass removed. Using that as the pitch, we started playing cricket there. For most of us, it was the highest point at which we have played this game.

cricket

 

After playing about 5-6 matches of gully cricket, we were quite satisfied and hence, got the enthusiasm to move ahead. After about another half hour of trek upwards, we reached the much awaited camp site at Waching.

This site was again on a completely sloping land. This was also the first campsite where we had no pre-built toilets. Although women still had a pre-built toilet spot, for men it was answering nature’s call in nature’s style. Since, the entire area was on sloping lands, one had to perform a mini-trek to even find a good spot to answer the call. This added to the beauty of this campsite. The other distinctive feature of this campsite was that, at this spot we were completely surrounded by snow-capped mountains on all the sides. A view outside the tent looked like the picture below.

waching

 

This naturally meant that the nights became extremely cold. One needed to wear gloves and scarf to keep one completely warm. Since, we had an extremely easy trek for the day, everyone had full energy to perform camp fire. We all got together and sang a lot of famous hindi songs. This was also the point where a bit of thrill started creeping in. We were told that the next two days were the most tiring parts of the trek. Also, it would be the days where we would be encountering snow and hail storm. With a hope of enjoying ourselves fully, we went to bed that day night.

The next day morning, Ananth found an extra pair of boots in the camp leader’s tent. With his permission, he took that and now all the equipment related issues seemed to be resolved. But, illness never seemed to stop spreading. The next morning, another girl Preeti also fell ill with high fever. Hence, two people in the group had to do the tougher parts of the trek with fever and cold. But, the motivation in the group was strong that, they eventually completed the trek without giving up.

 

Day 6- Waching(9300 ft) to Nagroni(10,000 ft)

As we were told, moving from Waching to Nagroni was the start of the tougher parts of the trek. In the words of Mr. Chauhan, it was the “semi-finals” of our trek. The hype created by him was aptly justified since major part of the day’s trek was climbing steep slopes. This drained out our energy very quickly. Also, at some spots in the the journey there was ice patches. This was exciting for most of us since that was what we had been hoping throughout the trek. Fortunately for us, the weather had been good so far in the trek. Apparently, for some groups which came before us, the waching campsite was completely immersed in snow and the entire path from there on was a path on snow. Thankfully for us, we just encountered patches of ice, while the majority of the path was grass and sand.

 

It took us a complete 6 hours to finish about 3.5 km of trek for the day. This was mainly due to the steep slope on which we were making the climb. After huffing and puffing, by about 4 PM in the afternoon, we reached the highest campsite of our trek – Nagroni campsite. This campsite was situated at about 10,000 ft and was completely surrounded by majestic Himalayan ranges. The view from this campsite was picturesque.

Nagroni

 

The sheer beauty of the scenery around and the sight of snow-capped mountains nearby pumped up the enthusiasm in all of us. We had an early dinner and an early camp fire, since we had to leave early the next day morning. We were asked to get up by 3 AM and be ready to leave for the next day’s trek by 5 AM. So, by about 7:30 PM we winded up our camp fire(which turned out to be a game of dumb charades) and went into our tents. Almost everyone was waiting for the next day to come. It was the day when we would cross the Chandrakhani pass. And in words of Mr. Chauhan, it was our “finals”.

Day 7 – Nagroni(10,000ft) through the Chandrakhani Pass(12,500 ft) to Nau Tapru(9700 ft)

We promptly woke up by about 3AM in the morning. The moment I walked out of the tent and saw the sky, I saw a beautiful white ring cut across the sky. It was the Milky Way galaxy which was clearly visible in the clear skies of Nagroni camp. The early morning wake was suddenly worth it. With due credits for the photo to Mr. Vijai Kanth Panthayil from CP-29, the sky looked something similar to this

milky_way

By about 5:30 AM all of us assembled, performed the customary head count and left for the day’s trek. The day’s schedule was an hectic one. We were to trek for about 17km through snow and it was estimated to take us till evening 6 PM to complete the trek. With high hopes and immense motivation we started off our journey towards the Chandrakhani pass. Within about half hour of the journey, it started raining heavily making the rocks and the path quite slippery. Soon about an hour later, we hit the first fully snow covered path in the journey. From there on, it was just snow-snow everywhere.

The paths turned to be tricky and adverse. With rain continuously pouring down, it made the paths more and more slippery. At some spots, the ice just caved in. In one of the points, I ended up going knee down into ice, since the layer just caved in. This was an awesome experience. The road winded and and upward slope was quite steep. With help from each other, we slowly made our journey upwards.

At one point along this path, there was slippery mud and snow through which we had to make our trek. I had a momentary slip at this point and by far that was the most scariest moment. With the support of a nearby rock, I gained back my posture and I continued the trek ahead. At this point, the rain had already taken the form of snow and hail-storm. It was the first time I had experience soft pieces of ice falling down on my shoulders. After about another half hour of steep ascent we reached the entrance of Chandrakhani pass.

Enroute_Chandrakhani

 

Yet another thrilling experience was awaiting us here. There was strong cross winds blowing across since we had reached the top-most point. There was a narrow path of snow on the sloping edge of the mountain. We had the support of a rope for the first 30m or so, beyond which one had to use hands to catch the sloping side of the mountain and walk ahead. The non-mountain side of the path sloped down towards foothills at about 6000ft. Hence, a small slip meant we would go rolling down the slope. This was the moment where we had immense adrenaline rush. We slowly clamped onto the ice with one hand and moved ahead on the narrow path of ice. We had to make a complete circle around the Chandrakhani pass in this manner. The scenes at this point were something which is not describable in any amount of words. And since the trek at this point was quite hard, it was almost impossible to take a picture of this spot. The 10 or so minutes crossing this path was a feeling which made the 5 days of climb, worth the effort.

Since one had to touch snow continuously for about ten minutes, lack of gloves only meant one thing – frost bite. One of the group members Irfan, unfortunately didn’t wear enough protective clothing while crossing the path. Midway through, his hand and legs went numb and he started getting symptoms of Hypothermia. Thankfully, one of the Sherpa noticed it and immediately carried him to the nearest flat spot. He then gave first-aid treatment in the form of transferring body heat. And later, took him downwards towards base camp where the temperatures were comparatively higher. This incident momentarily disturbed some of us since we had never seen such a body condition before.

Once past the pass, the journey now was downhill. We had to walk long distances on ice on flat land and get to an appropriate spot where we could do ice sliding. Ice sliding is a method to descend through ice mountains at a quick pace. It is extremely fun activity and the best part is that doing it wrong will not cause any kind of injury. We walked for about 2 km on ice before we halted for lunch. After lunch, we experienced the longest slide of the trek. This was everyone’s first slide and almost everybody made a mistake. Hence, the postures the body went into while sliding and while halting were extremely funny and we all had a good laugh seeing others slide. The first slide was the biggest of them all. In the photograph below, we started the slide from a part above the topmost visible point and slid down all the way till where people are standing.

BigSlide

Ice sliding re-energized everyone again. Till before this, almost everyone was tired of the ice. The snow started getting into my boots and hence, made my socks wet. I had three pairs of socks on me and the snow managed to get all of them wet. After about 4 such slides at various points, and long walks through flat ice, we could see a canteen in our sight. The frustrating part about walking on ice was that every time you walk normally as you would walk on normal land, you would slip and fall. You needed to groove your feet strongly in ice before taking the next step. Hence, it consumed almost thrice as much energy as walking on normal land. And all the slipping down and falling started to get frustrating after a certain point. It was like a new-born baby learning to walk. Once, we reached the canteen, we were invited with hot maggi, omlette and tea. It was extremely comforting and soothing for the body. We still had about 2 hours of trek remaining for the day from that point. Hence, the break was extremely essential.

After the canteen, we continued our journey ahead. This time there were patches of normal land in between snow and this gave indication of descent. We got the opportunity to perform 2 more ice sliding. Since, we were now accustomed to this act, the sherpas made us go in groups of three to speed things up. By about 6:30, we reached our campsite for the night, the Nau Tapru campsite. After walking through the ice for the entire day, this camp felt like heaven. There was no ice and we were feeling slightly warm! Not a single person had any energy left in him to conduct camp fire. We quickly had our dinner, put our clothes to dry and went off to sleep.

Day 8 – Nau Tapru(9700ft) to SeoBagh Base Camp

This was the last day of the trek and we had already achieved the main purpose – going through the Chandrakhani Pass. It was now time for descending back to base camp. This happened in two phases- First descend on foot till Naggar, HP. And then take a car/bus from there to the base camp near Kullu, HP. The first phase was not as hard the previous day’s trek, but challenging nonetheless. The descent was extremely steep. The path was a mixture of grassland and rocks which made the descent comfortable on the legs. But, the sheer distance and tiredness from the entire trek so far made all of us just want to get back to flat land. I was tired of standing on sloping terrain and wanted to give some comfort to my knees and back by walking on plain lands. The descent by foot was for about 3.5 hours. We had frequent breaks in between. We kept chatting about random stuff and cracking jokes along the way. The one good thing about this trek was that we made a lot of good friends during the process. Everyone shared the same frustration and pain and this helped in getting people closer. The camp fires every night also bridged the gap between us and we were now quite close to each other.

After about 3.5 hours, we came in sight with civilized life. We hired cars to SeoBagh and in batches of about 10 left towards the camp. The journey was for about 2 hours and when we finally reached the spot we were familiar with we screamed our guts out. We had finally completed the trek successfully and were back to place where we had electricity and sheltered toilets !

During the night’s camp fire we were invited individually and were given a certificate of completion by Mr. Chauhan. Our group of 19 had booked bus for 10PM the same night. So soon after camp fire, we took one last group photo. We then exchanged goodbyes and left the base camp towards Delhi. The trek had helped us make a lot of new friends and bidding good bye so soon seemed a difficult task. Since we were among the first ones to leave, the remaining people gave us a grand send off which made us miss the place even more !

Final_Group_Photo

 

 

I would like to thank Abhishek, Sachin, Surya and Vishal for the photographs used in this post. I would also like to thank Mr. Vijai Kanth Panthayil from group CP-29 for the special photograph of the Milky Galaxy.

 

 

A Trekking Expedition through the Chandrakhani Pass Part 1

This is my first non-technical post on my blog. I going to describe my experiences of the trek through the Chandrakhani pass. This trek was organised by the Youth Hostels Association of India. The post is divided into two parts – The experiences of the first few days in the first post and the experiences of the remaining days in the second post.

chandrakhani     Group Photo

 

We were a group of 19 people from IIT Madras who set off on our last group trip before graduating from college. The 7 days that followed was filled with fun, adventure and excitement. I will describe a day-by-day account of the entire trek in this post.

 

Day 0 – Reporting Day

This day was reserved for the participants to arrive at the Seobagh Base Camp near Kullu. This base camp, at any given time, housed 5 groups of trekkers. This is where the orientation and the initial activities took place. This place is about 4 km from center of Kullu town. Plenty of buses ply from Kullu to this camp. We arrived on the morning of May 23, 2014 from Delhi. The journey past Chandigarh, through the hill section, is exotic and is in itself a great scenic treat. After being mesmerized by the beauty of the journey thus far, we just couldn’t contain our excitement when we saw this.

seobagh_bse

Day 0 was a day for participants to arrive and settle down. We did the registration at the desk, got our tent and deposited luggage there. After some rest, some people in the group went to buy woolen clothes and other equipments for the trek from Kullu. Meanwhile, the rest of us played our favourite card game ‘Literature’ or in short ‘Lit’. Note, playing cards is not allowed in YHAI camps; but since this was our first time and we weren’t aware of the rules, we continued playing. The day ended without much drama.

 

Day 1 – Acclimatization Walk

Day 1 started with a morning 5 o clock whistle for jogging and exercises. Apart from some rare days, where I had the enthusiasm to go for a jog in college, I am not a person who does body exercise regularly. We were asked to jog for about half a kilometer in the cold morning of Kullu. And then about an hour of stretching, bending and other type of exercises. Following this, we went to see-off the group that left for their trek to higher camp that day. YHAI has this tradition of new groups forming a guard of honor to the group that leaves to higher camps and wish them good luck. After having breakfast, we left for our acclimatization walk. We pack the ruck sack given to us with as much weight as possible and then climb a small hill nearby. Once we climb some distance, we get to a really scenic waterfall with cold waters from the glaciers flowing down. This is where the entire group is formally introduced to each other. Every person, gives a small introduction about himself – much like the college ‘interaction’ sessions, only odd thing being, this session is much more polite. Since, these were the early parts of the trekking expedition, people were amused by the waterfalls. We spent more than an hour at the place and clicked a lot of photographs.

waterfall

 

In the evening of Day 1, we were given an orientation and introduced to one Mr. Parvinder Singh Chauhan. He is supposedly a big person in the YHAI community. He spoke to us about the various other expeditions organized by YHAI in Dalhousie, Goa, etc. Finally, he gave a glimpse of the route we were going to trek through in the coming days. He gave a near-exhaustive list of problems that could arise and some possible ways to tackle them. Fortunately, we didn’t face even ten percent of those during the actual trek. In the night, we had a “camp fire”. This is yet another unique concept of this trek. Every night, all the participants assemble together and perform music, dance, eloquition, etc. This is a way to get the participants of the program even closer. At the base camp, the group that finished its Day 1 of the program performs. Hence, this was our group’s night to perform. We had some splendid performances from various group members. The group of 19, performed “Why this Kolaveri Di? ” which later got us the name “kolaveri boys”, among many other names. We had some good dance and music performance by other members in the group as well. We also, had the group that returned from their trek share their journey with us. This group had one of the toughest weather conditions at Chandrakhani pass. So their experience gave us a slightly tougher picture of the trek than what we eventually encountered. The Day came to an end, with the end of Camp Fire.

Day 2- Rappelling and Rock Climbing

As usual, the day began with the 5 o clock whistle for morning jog and stretching exercises. After seeing off the group going to higher camp, we prepared ourselves to go for rappelling session. As a part of warming up sessions, YHAI organised rappelling and rock climbing sessions for the participants. We went to a nearby hill spot where two guides taught us the basics of rappelling. For people who have done it before, this was a smaller and less exciting version. But, for first-timers this was an awesome experience in itself. I was scared of heights and when I went near the rock, down which we had to rappel, I felt weak in my knees. But once I started descending, the experience felt very good. I was extremely fascinated by the entire rope and the safety process that I stayed by helping people get off the rope once they finished rappelling, for the entire time.

 

After lunch, we went to our next activity, which was rock climbing. For people who have done any kind of trekking before, this exercise was a mere joke. It was a fairly sturdy rock with lot of grooves. With about 2-3 steps, one could finish the climb. I had previously done wall climbing in Bangalore. Hence, I left without actually completing this exercise. It was getting slightly late and I had still a lot of packing left for the next day’s trip to higher camp. Once we reached the base camp, we were asked to deposit the extra luggage we have and keep only the items which we were talking to higher camps. The volunteers in the camp helped people estimate how much weight they will be able to carry throughout the trek. This process took about an hour until everyone was satisfied that they are taking enough items and the volunteers were satisfied that people aren’t carrying too much weight. The day ended with another Camp Fire. All of us were eagerly waiting for the next day to come. The day when we actually started our trek to higher camps.

 

Day 3 – From SeoBagh(3500 ft) to Yosgow(7900ft)

Finally, the day of actual trekking had come. On this day we were to move to our first higher camp at Yosgow. This campsite was situated at a height of 7900 ft. This campsite was on the way to a very well-known village in Himachal Pradesh, Malana. This village is very well known for its Marijuana production. Our journey to Yosgow was split into two parts- First a bus journey from SeoBagh to Malana Hydorelectric power plant; Second, walk from this Hydroelectric power plant to the campsite.

We assembled in the grounds of SeoBagh base camp waiting to go through the guard of honour formed by other participants. Walking through this while others clapping and cheering gave an extreme sense of thrill. It was, as though, we were going on to achieve something extremely incredible. The YHAI members gave us candies and biscuits along with packed lunch for the day’s trek. We got onto the bus and played Antakshari the entire journey. They roads were extremely narrow and there were many blind corner turns. The bus driver was an experienced person and maneuvered the vehicle like a pro. The scenery was exquisite and the greenery was just unbelievable. After about two and half hours of journey, we reached the Malana Dam. This dam was situated at a height of 6000 ft. We assembled here, took a group picture and shouted our customary set of slogans to motivate ourselves.

1) “CP 28 can we make it, CP 28 haan bhai haan”

2) “DJ for gen sec, Pokku Pokku”

3) “Laal Salaam! Laal Saalam! Laal Saalam!”

group_pic_at_malana_dam

 

YHAI had assigned a local person from Malana village as a guide for us. He showed us the path and we walked along that way. For the next one and half hour or so, the path was motorable and we had no trouble walking through it. It was a road with constant ascent, hence, quite a few of them started losing breath. But soon, people got accustomed to the terrain and were feeling comfortable. We passed through tunnels and bridges along the way. Finally, we halted at a small stream for having our lunch, which was packed and given to us by the YHAI volunteers at SeoBagh base camp. The path soon became a bunch of rocks and we had to slowly step on rocks and continue the journey. The place had unimaginable amount greenery all around. There was a variety of flora and fauna around. The only one I could observe was the marijuana leaves. Besides this, there were other kinds of plants and insects, but unfortunately I have very little knowledge in this domain.

By evening 3 o clock, we reached our campsite at Yosgow. The camp was located on a small flat area of a sloping land. It was perfect for 5 tents and some sitting area. This was surrounded by farms which belonged to the Malana village. Hence, we were told to strictly not step onto any of them. Even for answering nature calls, there were designated spots covered with tent walls. We were asked to go only to those places.  At every camp, we were given a fixed set of drinks in a particular order. On arrival, we were given a welcome drink. Usually, it was one of the ‘Kissan Squash’ drinks mixed and kept before we arrive. We were then served tea followed by soup. Any kind of tiredness during the trek will immediately vanish on having these drinks. The most amazing thing was that, the quality was maintained throughout at all higher camps. We had our dinner and sat down to have our first camp fire away from base camp. Praveen and Suraj were kind enough to explain some star-gazing fundamentals to the group. The clear skies and lack of any obstruction served as a perfect place to look at the various constellations. Star-gazing and discussing about it was such a great experience. It reminded me of the following comic strip from Calvin and Hobbes

calvin-hobbes-star-gazing

After a great discussion on stars and constellations we went off to sleep and thus, ended the Day.

Day 4- Yosgow(7900ft) to Behali(8300 ft)

This was the day when we would pass through the Malana village. This village has a weird history associated with it. People of this village believe that they were descendants of the Great Alexander. They regard everyone who come to their village as inferior. Hence, they don’t let strangers touch their walls and houses. They have boards out there which state -” Photographs or Touching will attract a penalty of 2500 Rupees”. Apart from this, this village is well-known for its marijuana cultivation. This village produces one of Himachal Pradesh’s finest marijuana. In fact, a lot of it is exported to all parts of the country. Having such a history associated with this village, the volunteers at Yosgow camp gave us clear instructions and asked us to stick to the guide when we were crossing this village.

The journey started with a steep ascent on the rocks towards the entrance of the Malana village. This part was tiring and most people took a lot of breaks on the way. This path was also open towards the non-mountain side. Hence, it gave opportunity to do a lot of classy photography. The scenery was perfect for a desktop wallpaper like photo.

malana

 

We took a brief halt just before entering the Malana village to ensure that everyone has indeed switched off their cameras and other recording devices. Malana village, in every sense, was a typical Indian village. There was garbage strewn all over. The cattle were reared in almost every household. The droppings of goats and sheep left a distinct bad smell throughout. There were children running and playing and some elderly men sitting under a tree and playing cards. There were lots of people smoking in the village but not a single one of them was tobacco. I guess being a major cultivator of marijuana has its own good effects! In about 20 minutes we passed through the village. We were relieved in many ways. Firstly, no more restrictions on touching the walls etc. And secondly, the streets of villages smelled horrible with the garbage and the animal droppings.

Once we got past Malana, it was a road downwards for about half hour. Once again, we stopped near a stream to have our lunch. To our happiness, this time there was a small tent which made Maggi and Omlette. They also sold biscuits and cool drinks. This place turned out to be heaven since we had some variety other than the packed food. Almost everyone had maggi and omlette along with their lunch. At this point there were heavy rains and the place got cold real quick. The distinct feature about these places is that once sunlight is cut, the temperature drops real fast. Direct sunlight is the only source of heat. Standing in the shade of another object for about 5 minutes is enough to bring the chillness back.

We proceeded ahead in the rains towards our base camp. The path was slightly slippery due to the rains and at some points it was unmade. There was a reservoir that was being built in this region and hence, the path was bad. With the help of one another, people slowly made past this and proceeded towards the campsite. The walk was long and hard and at about 4:30 we got the first glimpses of our campsite. And in another 40 minutes we finally reached the campsite. As a custom, we shouted “Fire, Fire, Camp Fire” as soon as we reached the camp.

This campsite was the most scenic in my opinion. The campsite was situated by a fast flowing stream. Towards one side was the majestic view of the Himalayas. Towards the other side was the construction of the big reservoir. The winds in this campsite were particularly strong due to the presence of the stream. This made the nights very cold. The series of drinks we received on reaching and the exotic scenery compensated for all the fatigue during the day.

Behali_camp

 

The description of the remaining days will be continued in the next part of this post. At this point, I would like to thank Abhishek, Surya, Sachin and Vishal for the photographs used in this post.

Euler Totient Function

In this post I will explain yet another simple number theoretic function, called the Euler Totient Function. This is a simple function which is used indirectly in many problems in programming contests. The function  is denoted as phi(n).  phi(n) basically gives the number of integers greater than 0 and lesser than n+1 which are co-prime to the integer n. In other words, it is the cardinality of the set

S = { a: 1<a<n , gcd(a,n) = 1 }. To calculate this function, we will use a straight forward brute force approach. With a simple analysis, we can show

that the running time of this algorithm is O(sqrt(n)).


- Start with an estimate of the totient function as n
- Iterate for i from 2 to sqrt(n)
- If i | n , we know that all factors of i less than equal
  to n will have gcd with n as atleast i. Hence, they can
 never be in the set S. Hence remove them from the result.
- While i|n, divide n by i.
- After the iteration of i from 2 to sqrt(n),
   if n is a number greater than 1, remove all
   its multiples less than n also from the result

The analysis of this code is similar to  the analysis for prime factorization. Essentially at the core of the algorithm, we are finding prime factors of n and removing all its multiples. Hence the numbers left are the ones that are co-prime to n.

Hence, both correctness and the running time analysis follows from the prime factorization algorithm.

Link to a java implementation.

Number Theoretic Algorithms – Factorization

In the following series of posts, I will write about some of the number theoretic algorithms that one encounters in most of competitive programming. These are fundamental algorithms which most computer scientist should know.

In this post I will post an algorithm and a corresponding JAVA code to perform prime factorization of a give number.

The algorithm to perform prime factorization is a very trivial algorithm and mostly encountered by everyone atleast once in their high school.


- Iterate for i from 2 to sqrt(n)
- While i|n, divide n by i. Report i as a prime factor of n
- After the iteration of i from 2 to sqrt(n),
   if n is a number greater than 1, report that also as a prime factor

The key observation is that, this algorithm runs in O(square root (n) ).

We are able to iterate only upto sqrt(n) since, we can claim one of the following:

1) n is a prime number

or

2) If n has a prime factor p greater than sqrt(n), then there exists a corresponding prime factor p’ lesser than or equal to sqrt(n), such that

p*p’ = n

If (1) doesn’t hold, it implies that n is a composite number. And Let us assume (2) doesnt hold.

This implies for a prime p such that p|n, there is no p’ <= sqrt(n) such that p’|n.

In particular n/p > sqrt(n) . And since p>sqrt(n)

=> 1/p < 1/sqrt(n)

=> n/p <n/sqrt(n) = sqrt(n).

This provides the contradiction. Hence the claim above proves the correctness of the algorithm.

Link to a JAVA implementation of the above factorization.

Floyd-Warshall ‘s All Pair Shortest Path Algorithm

In the previous two posts, I explained two different algorithms to find the shortest path in the graph. In this post I will define another very simple yet important problem in Graph Theory. Its called the “All Pair Shortest Path” problem.

Given a graph G, as a set of vertices V and directed weighted edges E, the aim of the problem is to find the cost of shortest path between every pair of vertices. Cost of a shortest path is defined as the sum of the edge weights in the shortest paths.

At first sight this problem might look really hard to approach. But the following theorem will make this one of the easiest to approach and especially code it.

Theroem:

If A represents the adjacency matrix of the graph, then for an integer k<=|V| , the (i,j) entry in the matrix A^k , gives the shortest path of length atmost k, between i and j in the original graph.

This above theorem can be easily proved using induction on k. I will leave that as a simple exercise.

From the theorem, all that is left to find is the matrix A^n.

A trivial way to compute this would be to do ‘n’ matrix multiplications. This would take a complexity of O(|V|^4).

Instead, Floyd and Warshall gave a Dynamic Programming based approach.

for k from 1 to n:
    for i from 1 to n:
        for j from 1 to n:
            A[i][j] = min(A[i][j],A[i][k]+A[k][j])

The above algorithm has a very simple intuition. The shortest path from i to j can be either the current value, or sum of shortest path from (i,k) and shortest path from (k,j). Instead of calculating this value repeatedly, we will use a dynamic programming approach and calculate once and store it.

The above algorithm has 3 loop each running for O(|V|) time. Hence the overall complexity is O(|V|^3).

A java implementation of the above algorithm can be found here.