Monday, May 13, 2013

Religion and Science

When I first decided to write a blogpost on this topic, the first thought that struck me was "What can I write about religion and science that isn't already articulated by others ?". This was quickly replaced by another thought "If it is so, why majority of people have twisted views about them ?". The answer was pretty simple: In public venues or in mainstream media, people with extreme views are the ones who are most vocal, whereas moderates often seem unconcerned, callous or worse condescending.

Since moderates are often characterized as being tolerant (which is a good thing), let's try to understand what does it really mean to be tolerant. Is it same as being indifferent ? If you are tolerant, should you be vocal about it or is it sufficient to say "you believe what you want to believe, but don't bother me" [12] ? Should it be a choice or a requirement ? Would you be tolerant if you chose not to tolerate the intolerants (often called as terrorists, extremists, fascists, nazi, etc) [1]. Wait, it gets even more complex: Who defines the term "intolerant" ? For Islamic extremists, it's Western world stopping them from enforcing their interpretation of sharia law. For Western world, it's cowardly and inhuman attacks on civilians by these terrorists. For some, it's bible thumpers trying to dictate how they should live their life; for others, it's atheists (or may be liberals), who are ruining their family or moral values. The list goes on and on and is equally applicable in my beloved homeland India and gracious guest country USA (and I suspect every diverse nation in the world). Unfortunately, unlike Karl Popper I don't have a globally applicable answer to these questions [10]. A local answer is to be tolerant in terms of freedom of speech, but keep people responsible for their actions in terms of secular humanitarian laws [2]. Bottom-line: in a civil society, the simplest working principle seems to be that we educate ourselves (enough to be intellectually capable of deciding right from wrong), embrace the diversity, be tolerant of opposing views and let the law judge the people who we feel are intolerant. It might also help if we abandon our cloak of complacency, engage in serious and meaningful debates/discussions and elect representatives who share our thoughts. Before I come back to the original topic, let me explain the dangers of being intolerant: If you chose to accept so-called "little intolerance", you will soon find yourself governed by "little intolerant" elected officials and as history has showed us, they will soon be replaced by "little more intolerant"elected officials (who would win the elections by saying the former aren't intolerant enough) and the cycle will continue.

Since there are different definitions of the same term [3, 4], for sake of this blogpost, let me explain my interpretation of these terms.
1. You are a theist if you believe that God created the world and takes active interest in the world. For example: if you are a theist, in times of trouble you believe that God will intervene to provide you with guidance or in someway affect the outcome. How far and how often God intervenes depends on degree of your theist beliefs.
2. Almost all theists also follow one of many organized religions, which are based on revelations given by prophets or reincarnated Gods. It is important to note few things about organized religions:
  • There is a clear distinction between prophets and ordinary people, former being first-class citizens who are the only people that have access to these revelations.
  • Since revelations are the only mechanism for finding or validating "religious truths", it makes scientific inquiry impossible. This is because as of this day, there is no clear way to distinguish between the revelations of first-class citizens and hallucinations/delusions of ordinary people. This is also true for spirituality. So, religion has a concept of faith which requires you to believe something because the first-class citizens said so [5].
  • These revelations can be categorized into two parts: information about God (and hence the universe) and information about how to conduct ourselves in the world. Often, the former (for simplicity, let's call it knowledge) is used as main reason to stick to the latter (let's call it moral guiding principles or human values) in our day-to-day life. By definition, knowledge is considered to be absolute and universally-applicable [6] whereas the moral guiding principles are treated as relative [7]. The consensus among many intellectuals is that the scientific method is the best available tool for exploring and validating knowledge. For moral guiding principles, people often use either religion or philosophy or spirituality or law or introspection or advice from friends and family [8].
  • Most revelations are described in holy books and are often accompanied by a back story. Many anti-theists criticize the revelations because of validity of the back story rather than applicability of revelations themselves. Some theists believe them to be exact historical account whereas others theists believe them to be embellished so as to get the message through to the general public [9]. In these back stories, there is often mentions of so-called miracles and many use the argument that specification of these miracles is a proof of validity of the revelations and hence God [11]. However, non-reproducibility and often embellished centuries-old second-hand accounts make the likelihood of these miracles highly improbable, if not impossible, and hence they are not accepted as facts by the scientific community.
  • Even though it is often suggested that all religions say the same thing [12], many organized religions are very clear on one particular requirement: "To adhere to religion X, you must ignore teachings of all other religions and consider them to be pagans". So, ipso facto all religions don't say the same thing, it is what we chose to believe to promote tolerance. I, on the other hand, think we should celebrate pluralism and not be afraid of the fact that different religions say different things. The only reason we ever need to be tolerant is coexistence and survival of human race.
  • Many religions are based on the concept of two-world: physical world (where we live) and transcendent world (which is termed as heaven, paradise, etc). Some religions that have concept of rebirth and karma (eg: Buddhism and Hinduism), also have concept of enlightenment (nirvana or moksha), which is often referred to as state of being, rather than a physical location (like heaven). The hidden assumption in two-world philosophy and most religions is that human beings and earth has undivided attention of God and hence has special and central place in this universe. Science makes no such assumption and in fact many scientists believe human race and earth to be a product of a wonderful accident.
3. Science on other hand is based on "scientific method", which Oxford dictionary defines as "a method or procedure that has characterized natural science since the 17th century, consisting in systematic observation, measurement, and experiment, and the formulation, testing, and modification of hypotheses". Since there are already enormous amount on literature on this I won't discuss it in more detail. However, I do have few advices for young scientists:
  • Make sure you understand how to differentiate between science and pseudoscience.
  • Don't be afraid of uncertainty and not knowing everything. It's OK to say "I don't know", you will be surprised how often that phrase is used by renowned scientists.
  • Avoid the urge to be self-centric and to accept something to be fact because you feel it "deep inside" [12]. Also, don't make up stories, that have no scientific bases, to explain things you don't understand.
  • There is no such thing as faith in science. It is replaced by reasoning and experimentation. For example, when you read a research paper or a book, always exercise critical reasoning on it to make sure that the results are plausible. If you think something is fishy, conduct an experiment to validate its result and hypothesis [5]. This is also true when a professor explains you laws of motion or electricity or something else and claims it as science.
  • For reasoning and validation, stick to Occam's razor, i.e. don't just jump to the easiest/quickest answer, instead put effort to find the answer which requires fewest assumptions. For experimentation, at minimal, understand the correlation-causation fallacy and also statistical testing. One particular book that that you can start with is How to Solve it by Polya.
Even though both religion and science started because of human curiosity to explain the universe [13], both employ completely different methods/practices: revelations and scientific method, respectively. To make sense of the debate between them, it is necessary to recognize that these methods are inherently incompatible. So, unless all the parties agrees on a common method for finding and validating facts/truths, I think the whole argument will keep on spiraling itself. So, if a religious person choses to use the scientific method to convince me of the validity of the revelations, I welcome it; if not, I prefer not to engage in the discussion at all.

Just like religious missionaries, let me take a moment to state why you should use scientific inquiry for finding facts and solving problems ;) Look around what scientific inquiry has enabled us to discover and invent: medicines, cars, internet, computers, phones, planes, trains, camera, music players, guitars, paints, bricks, electricity, bulbs, etc. Whether you are a student or a nobel prize winner, a poor person or a millionaire, a prisoner or the president, your experimental findings and ideas will be judged purely on its merit and nothing else ... not on your status or gender or age or or religion or race or caste or nationality. You are allowed to ... no, you are encouraged to come up with new ideas, ask questions, doubt and investigate widely held beliefs. In fact, I urge you to doubt everything in this blogpost, discuss it with your teacher/professor/colleagues/priest/friend/family, read books about both religion and science and come up with your own opinions :)

Let me summarize this blogpost in a sentence: Whether religion or spirituality is inevitable and necessary part of of human life, I don't know; but I am absolutely sure that they don't have place in science classroom or textbook.

References and footnotes:
[1] The paradox of tolerance: http://jefflees.wordpress.com/2010/01/22/the-paradox-of-tolerance/
[2] The legal argument about tolerance gets more complicated if majority decides to collude to deliberately oppress the few, which has happened far too often in the past. However, we won't get into that and let's rely on inherent human goodness and assume that there are constitutional provisions to disallow that.
[3] http://en.wikipedia.org/wiki/God
[4] The Cambridge companion to atheism
[5] Scientists are expected to practice same level of skepticism to the theories of even the most accomplished scientists (be it Newton, Einstein, Darwin, Turing or Feynman), i.e. science does not have authorities, just heroes.
[6] Even though I called knowledge to be absolute and universally-applicable, it was little misleading. Read research journals to find just how many previously accepted theories are replaced by new theories in light of new evidence, which essentially means knowledge and science is ever-evolving. Anyways, I urge you to read about epistemology for understanding the nature and scope of knowledge.
[7] Religious fundamentalists believe "how to conduct yourself" is absolute (i.e. strict adherence to revelations).
[8] Recently, I encountered a person who was against organized religion, but claimed that spirituality is better tool than science for both exploring knowledge and for moral guiding principles. He didn't provide me with any evidence or rationale to support his hypothesis, so I disagree with him on that. It is also important to point out here that Sam Harris suggests that science can also determine human values.
[9]  Irrespective of which is true, one thing I submit to is that they probably were the best collections of ideas of their generations. However, in this age of globalization and democracy, I don't think if they are applicable.
[10] At the international level, with so many dictatorships, monarchy, theocratic governments, territorial disputes and dogmatic/partisan politicians around, it is difficult to come up with one principle that will work every where. Non-intervention (or non-alignment) expects every country to make decision before you stop a genocide (example: EU and Bosnia). Respecting every nation's sovereignty means pulling out your troops from unstable governments (like Iraq and Afghanistan) or countries surrounded by superior military powers (like Kuwait, South Korea, Taiwan or Japan). Think non-violence and Tibet. So, this blogpost is only applicable to citizens of secular nations with access to freedom of speech.
[11] If you believe in miracles, aren't miracles of science (pun intended) equally mind-blowing, for example: flying objects, going to the heaven, create new life, curing the sick, all-knowing oracle, walking on water, being invisible, etc.
[12] Penn Jillette: Why tolerance is condescending ?
[13] Of course, many religious people will disagree with this opinion and will point out that religion exists because God wanted it to exists, not because humans were fishing for answers.

For those people who followed the entire line of argument, I must admit that I deliberately skipped the underlying question about existence of God in non-religious/non-theists, atheist, agnostics settings.

Wednesday, March 27, 2013

Hadoop MapReduce - System's view

Here are videos that I created to explain Hadoop's MapReduce framework from system's perspective. As a disclaimer, this video is at an abstraction that I liked, which means it might not be suitable for general Computer Science audience. If however, you have some experience with Hadoop, you should be fine. I have skipped over lot of Hadoop's features for simplicity and succinctness, like HDFS, Hadoop I/O, setting up/administering Hadoop cluster and writing Hadoop programs (and various high-level languages/tools that use Hadoop).

1. Job Submission at the client side


2. Job submission at the JobTracker side

3. Task Scheduling

4. Task Creation

5. Map execution

6. Reduce execution

Slides: PDF, Keynote

Thursday, March 14, 2013

Video tutorial on reinforcement learning

This video tutorial is based on a talk I gave at my Comp 650 class and hence assumes that the audience knows a little about Markov Decision Processes and Partially Observable Markov Decision Processes. If you are unfamiliar with them, I recommend that you at least read through their wikipedia pages before going through this tutorial. Also, I suggest that you view this video on youtube, because the embedded video given below is cropped.


If you have any suggestions, comments or questions, please feel free to email me :)

PDF slides

Tuesday, December 25, 2012

My views on recent protest in New Delhi

According to 2011 census in India1, there are 586469174 women in India, i.e. 48.46% of India's population and 8.38% of total world's population (which is roughly around the total number of English and Spanish speaking people in the world).

Out of these only 65.46% are literate2 (as compared to 82.14% literacy rate in males), with the definition of literacy being very narrow.

Crimes against women3 include rape (20737 cases in the year 2007), dowry deaths (8093 cases), molestation (38734 cases), sexual harassment (10950 cases) and cruelty by husbands/relatives (75930 cases). To add to that, there is human trafficking (for sexual slavery or domestic servitude), female infanticide, discrimination, acid attacks, lack of health care and forced marriage. The number of rape cases has increased by 80% in 7 years from 2000 and is still increasing. In the year 2011, 26000 rapes were reported4 throughout India; in fact it is the fastest growing crime in India. According to Thomas Reuters Foundation5, India is the fourth most dangerous country in the world for women behind Afghanistan, Congo and Pakistan.

According to many, there are three main reasons behind this:
1. Social taboo:
We Indians (including me) are hypocrites when it comes to dealing with rape survivors6. They are outcasted to protect family's so-called honor and hence most of the rape cases aren't reported or are dropped. Also, in event of such crimes, most of us prefer not to intervene and help the victim (be it eve-teasing, dowry, rape, etc) and her family. This indifference in our attitude provides additional incentives to the rapist to commit such heinous crime.

2. Severity of punishment:
An unenforced law means nothing however stringent they are. So, I don't think severity of punishment acts as a deterrent to rapists. In fact, considering how our law enforcement agencies (both judicial and policing) are, the rapists might not be wrong to think they won't be apprehended at all. With such an alarming increase in rape cases, one might think it's reasonable to support increasing severity in special circumstances7 and especially for repeat offenders. But, the point to note is, in India, rape is punishable up to life imprisonment9 which I think is severe enough. The main problem is that it doesn't get enforced or it takes way too long.

3. Lack of speedy and fair trials with severe punishment to rape shield violators:
There already are provisions for speedy trials10 and rape shields11, but don't get executed due to lack of resources and infrastructure. First, there are 26.3 million pending cases8. Then there aren't enough women officers (I believe there should be an option for the victim to talk directly to women officers in every police chowky, for reporting rape, molestation, etc). Lastly, even though India has one of the strongest rape shield laws, Chaudhry11 says they are routinely violated or reduced to technicality in practice. It is imperative to punish any authority that violates the rape shield.

Let me reiterate my point: an unenforced law will solve nothing. I see the protestors (which btw I salute for their efforts, barring the ones that are doing it for political gains and media attention/ratings) are focusing on the wrong issue: asking for death penalty law for rape.

Why ? Researchers have shown again and again12, certainty and not severity of punishment proves to be true deterrent for the crime. In fact, increasing severity can turn to be counterproductive (i.e. may lead to more false negatives).

Sure, increasing severity might help us, as the society, deal with the shock, but it will do nothing to help improve the safety of women. The law will be passed, authorities will keep on violating rape shield, there will still be little or no resources to handle the case quickly and we shall go to living our life once again forgetting this incident ever happened and at the same time congratulating ourselves for the job well done. If you do truly care about the situation, let's forget the quick fix and do a more difficult thing: Take a step back and dispassionately think how we can solve this problem once and for all. Here is what I could think of:
- Punishment or/and suspension of authority breaking rape shield (or discouraging victims for registering complaints).
- Increase in forensic and judiciary budgets to expedite trials.
- More women cops and psychological experts to help deal with the trauma. Also, create a special department for dealing with these crimes or train existing police officers to deal with such scenarios.
- Incentive programs for improving the female literacy rate.
- Standing up for the crimes against women when we see it, while still keeping our paternal instinct in check so that every women gets to enjoy her liberty.

It took me half a day to write this blogpost and I humbly admit I am missing lot of points. But, I am sure a more experienced panel can come up with better solution if they are not sidelined by politics or their own self-interest.

References:
1. Census of India: http://www.censusindia.gov.in/
2. http://en.wikipedia.org/wiki/2011_census_of_India
3. National Crime Records Bureau: http://ncrb.nic.in/cii2007/cii-2007/1953-2007.pdf
4. http://en.wikipedia.org/wiki/Rape_in_India
5. http://www.trust.org/documents/womens-rights/resources/2011WomenPollResults.pdf
6. http://www.ndtv.com/video/player/news/determined-not-to-hide-her-identity-rape-survivor-bravely-tells-her-story/259248
7. http://en.wikipedia.org/wiki/2012_Delhi_gang_rape_case
8. http://www.hindustantimes.com/News-Feed/india/Nearly-30-million-cases-pending-in-courts/Article1-224578.aspx
9. http://indiankanoon.org/doc/1279834/
10. http://defensewiki.ibj.org/index.php/Right_to_a_Speedy_Trial#India
11. http://www.firstpost.com/living/gurgaon-gang-rape-let-me-tell-you-all-about-this-girl-242185.html
12. http://www.sentencingproject.org/doc/deterrence%20briefing%20.pdf

Sunday, August 12, 2012

Education: whether to skip school or not ?

Couple of days back, one of my friend (Deepak) posted a post, which lead to somewhat heated debate. Before, I go any further, I must admit I have not read the blog writer's (Nikhil's) book and judging from the title "One Size Does Not Fit All: A Student’s Assessment of School", he seems to be radical thinker (as suggested by Deepak). Also, the above mentioned post might have assumed that the reader has already read his book and hence the post itself could be out of context for me.

Personally, I felt the post was just a collage of motivational/self-help pieces, without a direct and measurable theme/message. People don't need cheer-leaders that say "here are pictures/quotes of Einstein, Jobs, Ford ... yaay ... now, go and become like them it"; they need a coach ... a teacher, who gives them a clearly defined way or approach to achieve it ... stating how much effort one needs to put into it and what are pros and cons of following that approach. For example, 10,000 hour rule of Gladwell's Outliers or Allen's GTD. Sure there are gray-areas, situations where people only need motivational speeches and not solutions (for example: Notes to myself) ... and may be the above post could have been intended for exactly that.

Just a side-note (and not directing directly to the author of the post), I think writers of self-help books (or any non-fiction book for that matter), should try to aspire for journalistic integrity ... which means checking facts before you make a statement, validating your propositions and yes, being direct and clear. If you don't have time to research something (for example: if you are writing a time sensitive news article), or are making some assumptions (say, about the audience or the context of the article), add a disclaimer and make a reasonable statement based on Occam's razor. And most importantly, be very critical of the implications of what you write. Sure, you are allowed to be wrong (in few if not all scenarios, for example: if you track scientific research, every once in a while an idea proposed few years back is discarded). In fact there is a mathematical argument, that you cannot prove anything to absolute certainty. But it should at least pass a sniff test of critical thinking: If you make your case to a rational person without any prejudice on that particular subject, is he/she going to dismiss it outright ? An example of totally ridiculous argument that does not pass this sniff test is Zakir Naik on NDTV about Osama bin Laden, which might not be violation of first amendment (i.e. freedom of speech); but clearly can have damaging consequences, especially if audience is ill-informed and trusts the speaker.

Now coming back to the debate (given in the below image ... the first line that is cut off is "Sorry Deepak, I don't see any tangible idea in his blog ... may be i am missing something ... sure, ") with my friend, the sentence in the blog that ticked me off was "Drop the textbooks. Get out and do it":
After this debate/conversation, I felt like I was just a critic, bashing the post and nitpicking on a single possibly unintended sentence, rather than contributing to the subject. Hence, I decided to write this post to give my views on education.

I am doing PhD, so there is going to be bias in support of education. So I ask you to consider the points discussed below with respect to your situation, taking into account my personal bias.

I honestly believe formal education is easiest and fastest way to success (though many students don't feel like that's true due to amount of competition they see around). You can either work really hard during four years of graduation or struggle rest of forty years of your career to compensate for those four years. There are exceptions of course, for example, athletes who prefer/need to horn their skills than study (like Sachin Tendulkar, Usain Bolt), entrepreneurs for whom opportunity cost is higher than education (like Bill Gates, Steve Jobs, Richard Branson) and people who are forced to discontinue their formal education due to certain circumstances (Nobel laureate Doris Lessing). Lot of books and post by these entrepreneurs advocate to try to be these exceptions, but I suggest caution. They are called "exceptions" for a reason; count number of people (either in your locality or in the world) who left their schools versus number of people who attended the schools, and then use your measure of success to classify them as successul or unsuccessful ... you will find your answer :)

So, why do some smart people (like authors of books mentioned in above paragraph) suggest on leaving the schools ? Well, you need to read between the lines. If you have fairly concrete idea of your product/service (along with somewhat reasonable plan) and believe waiting to finish your education will cost you the competitive edge, then it might be a good idea to take a sabbatical and be an entrepreneur. Also, read advices and books on startup, understand the novelty, amount of hard work and dedication required in building a successful startup before you make your decision of leaving the school.

Regarding Sean Parker's advice "skip school, google your education", it doesn't work. Government spends lot of money in educational system (such as deciding curriculum, giving grants, hiring/educating teachers, etc) and it will be a bad idea to not capitalize on it. I would modify his advice: "continue your school, but also google your education". There are lot of websites that give free courses/talks (like coursera, MIT, TedTalks etc), utilize them. Read wikipedia, books (textbooks and other non-course books), research papers, newspapers and blogs, then exercise critical thinking and combine them with advices given by your teacher, to formulate your own opinions/views ... world really needs more informed people. Also, there are lot of classes/camps, that you can attend/audit to supplement your education. For example: I completed PG Diploma course in Embedded Systems from ECIL (a course offered to only graduates) during my second year of engineering at VJTI. Two things I learnt during this experience is (1) even though there are pre-requisites, educators are willing to overlook them if you show enough enthusiasm and determinism; (2) if you chose to break the rules, be ready to put twice the amount of effort your peers are putting. During my four years of engineering, every semester, I always had a parallel course or non-course project that I was working on. This helped me immensely after my graduation. My point is you don't have to succumb to conformity (there are ways to supplement your formal education), and if you really plan to do leave formal education, make sure you are doing it for right reason (and not because you are lazy or because you feel leaving studies will somehow magically make your life easier and especially not because someone cites you a quote from a successful person).

Here is a high level intuition of why formal education seems tedious and boring: Society wants to filter out people who cannot survive the dip. (The dip is a period of long struggle that is necessary to achieve the goal and be differentiated from general public). For example, if PhDs or medicine were not as difficult as they are, there would be abundance of doctors and PhDs, and the elite status they enjoy now would be gone; so the society wants to ensure that these so-called elites really have to struggle before they can be labelled into this category. Sure, there is other reasons too: Some degrees (PhDs, MDs) requires knowing lot of stuff, and hence the long graduation period. You can't become a doctor by just knowing how to apply a bandage or by memorizing prescriptions for common diseases. For sake of this argument, say if a person can, would you want your family member treated by such person ?

That leads to the question of what are rational reasons to quit your studies (other than the case discussed above): If you think (or can forecast that) after surviving the dip, you don't like what's end of it, then it might be a good idea chose a different path. For example: during first year of medical school, if you don't like the life of doctor, it might be a good idea to drop out of medical school and do something that you are really passionate about. But, it is clearly a bad idea to drop out just because you feel medical school is hard or there is too much competition. Similarly, there are also rational reasons to quit PhD, but all of them should be accompanied by careful thinking and introspection. The book also covers other scenarios such as dead-end, where you have no hope of moving ahead and are stuck in routine ... but I don't think education fits into that scenario.

Note, if you believe you have dyslexia, bipolar or any such health issues (either physical or mental), then you need to completely ignore my advices and consult your family and/or therapist, as they will give you better suggestions than this blogpost.