<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/">
  <channel>
    <title>computer-science on S Anand</title>
    <link>https://www.s-anand.net/blog/tag/computer-science/</link>
    <description>Recent content in computer-science on S Anand</description>
    <generator>Hugo -- 0.164.0</generator>
    <language>en-us</language>
    <lastBuildDate>Sun, 12 Feb 2012 04:09:04 +0000</lastBuildDate>
    <atom:link href="https://www.s-anand.net/blog/tag/computer-science/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Correlating subjects</title>
      <link>https://www.s-anand.net/blog/correlating-subjects/</link>
      <pubDate>Sun, 12 Feb 2012 04:08:02 +0000</pubDate>
      <guid>https://www.s-anand.net/blog/correlating-subjects/</guid>
      <description>&lt;p&gt;A &lt;a href=&#34;https://www.facebook.com/groups/chennaigeeks/358823254142720/&#34;&gt;question&lt;/a&gt; from &lt;a href=&#34;https://www.facebook.com/dorai.thodla&#34;&gt;Dorai&lt;/a&gt; get me thinking: does being good at maths help in programming?&lt;/p&gt; &lt;p&gt;I don’t have a personal view. But since &lt;a href=&#34;http://www.reportbee.com/&#34;&gt;Reportbee&lt;/a&gt; has data on the Class 12 examination results for the last three years, we thought we could do a bit of analysis.&lt;/p&gt; &lt;p&gt;Here’s the correlation of the scores of various subjects with Computer Science.&lt;/p&gt; &lt;table style=&#34;color: #444&#34; class=&#34;lines numbers&#34;&gt; &lt;tbody&gt; &lt;tr&gt; &lt;th&gt;Correlation&lt;/th&gt; &lt;th&gt;Subject&lt;/th&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td style=&#34;background: #63be7b&#34;&gt;0.79&lt;/td&gt; &lt;td&gt;CHEMISTRY&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td style=&#34;background: #68c07c&#34;&gt;0.79&lt;/td&gt; &lt;td&gt;PHYSICS&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td style=&#34;background: #95cd7e&#34;&gt;0.75&lt;/td&gt; &lt;td&gt;ENGLISH&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td style=&#34;background: #9ecf7f&#34;&gt;0.75&lt;/td&gt; &lt;td&gt;MATHEMATICS&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td style=&#34;background: #b9d780&#34;&gt;0.72&lt;/td&gt; &lt;td&gt;LANGUAGE&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td style=&#34;background: #feea83&#34;&gt;0.67&lt;/td&gt; &lt;td&gt;BIOLOGY&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td style=&#34;background: #fee382&#34;&gt;0.66&lt;/td&gt; &lt;td&gt;ECONOMICS&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td style=&#34;background: #fee282&#34;&gt;0.66&lt;/td&gt; &lt;td&gt;COMMERCE&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td style=&#34;background: #fede81&#34;&gt;0.65&lt;/td&gt; &lt;td&gt;ACCOUNTANCY&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td style=&#34;background: #f98c71&#34;&gt;0.56&lt;/td&gt; &lt;td&gt;HISTORY&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td style=&#34;background: #f8696b&#34;&gt;0.52&lt;/td&gt; &lt;td&gt;GEOGRAPHY&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt; &lt;p&gt;It almost breaks neatly into four groups.&lt;/p&gt; &lt;ol&gt; &lt;li&gt;&lt;strong&gt;Physics &amp;amp; Chemistry&lt;/strong&gt;, both of which have a correlation of 0.79, and clearly are the most correlated with Computer Science  &lt;/li&gt;&lt;li&gt;&lt;strong&gt;Maths, English &amp;amp; Language&lt;/strong&gt;, which have a correlation of 0.72 – 0.75  &lt;/li&gt;&lt;li&gt;&lt;strong&gt;Biology, Economics, Commerce and Accountancy&lt;/strong&gt;, which hover at around 0.66  &lt;/li&gt;&lt;li&gt;&lt;strong&gt;History &amp;amp; Geography&lt;/strong&gt;, which are 0.52 – 0.56&lt;/li&gt;&lt;/ol&gt; &lt;p&gt;The results in 2010 are almost exactly the same.&lt;/p&gt; &lt;table style=&#34;color: #444&#34; class=&#34;lines numbers&#34;&gt; &lt;tbody&gt; &lt;tr&gt; &lt;th&gt;Correlation&lt;/th&gt; &lt;th&gt;Subject&lt;/th&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td style=&#34;background: #70c27c&#34;&gt;0.78&lt;/td&gt; &lt;td&gt;PHYSICS&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td style=&#34;background: #74c37c&#34;&gt;0.78&lt;/td&gt; &lt;td&gt;CHEMISTRY&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td style=&#34;background: #94cd7e&#34;&gt;0.75&lt;/td&gt; &lt;td&gt;ENGLISH&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td style=&#34;background: #9dcf7f&#34;&gt;0.75&lt;/td&gt; &lt;td&gt;MATHEMATICS&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td style=&#34;background: #afd480&#34;&gt;0.73&lt;/td&gt; &lt;td&gt;LANGUAGE&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td style=&#34;background: #ffeb84&#34;&gt;0.67&lt;/td&gt; &lt;td&gt;ACCOUNTANCY&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td style=&#34;background: #fede81&#34;&gt;0.65&lt;/td&gt; &lt;td&gt;ECONOMICS&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td style=&#34;background: #fed880&#34;&gt;0.65&lt;/td&gt; &lt;td&gt;COMMERCE&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td style=&#34;background: #fdcf7e&#34;&gt;0.64&lt;/td&gt; &lt;td&gt;BIOLOGY&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td style=&#34;background: #fbaa77&#34;&gt;0.60&lt;/td&gt; &lt;td&gt;GEOGRAPHY&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td style=&#34;background: #f97f6f&#34;&gt;0.55&lt;/td&gt; &lt;td&gt;HISTORY&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt; &lt;p&gt;I’m not sure what it is that leads to this kind of correlation. In fact, the full correlation between every pair of subjects (for 2011) is below:&lt;/p&gt; &lt;p&gt;&lt;a href=&#34;https://www.s-anand.net/blog/assets/subject-correlation.webp&#34;&gt;&lt;img style=&#34;background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px&#34; title=&#34;subject-correlation&#34; border=&#34;0&#34; alt=&#34;subject-correlation&#34; src=&#34;https://www.s-anand.net/blog/assets/subject-correlation.webp&#34; width=&#34;533&#34; height=&#34;376&#34;&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;What inferences would &lt;em&gt;you&lt;/em&gt; draw from this?&lt;/p&gt; &lt;p&gt;And what do you think is the &lt;em&gt;reason&lt;/em&gt; for this?&lt;/p&gt;
&lt;hr&gt;
&lt;h2 id=&#34;comments&#34;&gt;Comments&lt;/h2&gt;
&lt;!-- wp-comments-start --&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;&lt;a href=&#34;http://arunrocks.com/&#34;&gt;Arun Ravindran&lt;/a&gt;&lt;/strong&gt; &lt;em&gt;12 Feb 2012 5:53 am&lt;/em&gt;:
My inference is purely anecdotal but might be helpful in explaining this data. I had chosen Computer Science for my +2 in 1998. It was taught in C++ and mostly involved memorising operations on Data Structures such as Lists, Stacks and Queues. The C++ standard library had to be memorized including I/O, string and file functions.
The exams were basically a test of memory rather than attacking a new problem space mathematically. Guess which are the other subjects which involve memorising a huge set of symbolic facts? &amp;ndash; Chemistry and to a certain extend, Physics.
I believe the data is more revealing of our Computer Science pedagogical and evaluation methods than the subject itself.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;a href=&#34;http://www.s-anand.net/&#34;&gt;S Anand&lt;/a&gt;&lt;/strong&gt; &lt;em&gt;12 Feb 2012 6:46 am&lt;/em&gt;:
Good point. It&amp;rsquo;s quite debatable whether marks in computer science are indicative of programming ability.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;a href=&#34;http://thenmozhi.yolasite.com&#34;&gt;Anamika&lt;/a&gt;&lt;/strong&gt; &lt;em&gt;12 Feb 2012 10:21 am&lt;/em&gt;:
Netruvarai neram poga villaiyae,
unadhu arugae neram podhavillaiyae&amp;hellip;!&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;a href=&#34;http://nullpointers.wordpress.com&#34;&gt;Sathya&lt;/a&gt;&lt;/strong&gt; &lt;em&gt;16 Feb 2012 12:56 pm&lt;/em&gt;:
In my experience, I&amp;rsquo;ve come across rock star programmers who have sound grasp of mathematics. But i dont have statistics to prove them. As we all know, programming (esp functional) is heavily influenced by mathematics. Coming to inferences, I would take the dataset with a pinch of salt. Is it diverse enough to be statistically significant ? I agree with most of the comments on relating &amp;ldquo;mugging up programs&amp;rdquo; to being good at Chemistry in particular.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Sathyaraj&lt;/strong&gt; &lt;em&gt;12 Feb 2012 7:44 pm&lt;/em&gt;:
My 2 cents based on experience.
People who take the computer science group generally have to always take one language and English subject apart from taking Physics, Chemistry, Maths. They would not be able to take classes in accountancy, economics, history, etc.
Some of the students at the top of the class would have realized that in order to differentiate in terms of coming first in class/school, one would need to excel in language and english. It is given that one needs to get excellent scores in physics, chemistry and maths to get an overall good percentage. Also the fact, that scoring a big total would enable them to get admission in colleges in like BITS pilani which looks at overall score.
Students who take the biology or accountancy group have no such pressure for them to excel in English and language subjects.
Hope it makes sense.
Also, if you can do a correlation between computer science students and the language that they take, I believe you will find that the majority of students would have chosen french rather than Tamil or English.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Shankar V&lt;/strong&gt; &lt;em&gt;13 Feb 2012 6:23 am&lt;/em&gt;:
Anand
Correlation is a misleading statistic if the dependent and independent variables are not &amp;ldquo;really&amp;rdquo; related that way. There could be compounding effects within the independent variables leading to wrong correlation coefficients.
There are ways to detect and cleanse compounding - design of experiments (in statistics) deals in depth on this. It is quite possible that there could be some relationship in how the computer science and math exams are scheduled and the scores in these subjects. If they are too close to each other, the student may have had lesser time to prepare for the math exam. For example, if Physics and Math were scheduled one after the other, and Computer Science test is after the Math test, the student may have prepared better for Physics, not have had enough time for Math and then recovered to do well in Computer Science. This can be a pattern in the entire class as it is normal for kids to focus more on Physics (the dreaded subject!) v/s Math.
The statistic may not reveal ability or natural alignment of the subjects.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;a href=&#34;http://outputlogic.com&#34;&gt;Evgeni&lt;/a&gt;&lt;/strong&gt; &lt;em&gt;11 Dec 2012 3:37 am&lt;/em&gt;:
I&amp;rsquo;d rearrange subjects such that they&amp;rsquo;re more clustered together by correlation, like in a TreeMap view. That way it&amp;rsquo;s easier to see the relationships.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;amanjot kaur&lt;/strong&gt; &lt;em&gt;10 Sep 2015 12:28 pm&lt;/em&gt;:
i need correlation of commerce with language&lt;/li&gt;
&lt;/ul&gt;
&lt;!-- wp-comments-end --&gt;
</description>
    </item>
    <item>
      <title>Resolving the Prisoners Dilemma</title>
      <link>https://www.s-anand.net/blog/resolving-the-prisoners-dilemma/</link>
      <pubDate>Sun, 17 Aug 2008 12:00:00 +0000</pubDate>
      <guid>https://www.s-anand.net/blog/resolving-the-prisoners-dilemma/</guid>
      <description>&lt;p&gt;If you&amp;rsquo;re ever taken a course in Economics, and it discussed Game Theory, you may be familiar with &lt;a href=&#34;http://en.wikipedia.org/wiki/Prisoner%27s_dilemma&#34;&gt;The Prisoner&amp;rsquo;s Dilemma&lt;/a&gt;. Roughly, this is the problem.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Assume you possess copious quantities of some item (money, for example), and wish to obtain some amount of another item (perhaps stamps, groceries, diamonds). You arrange a mutually agreeable trade with the only dealer of that item known to you. You are both satisfied with the amounts you will be giving and getting. For some reason, though, your trade must take place in secret. Each of you agrees to leave a bag at a designated place in the forest, and to pick up the other&amp;rsquo;s bag at the other&amp;rsquo;s designated place. Suppose it is clear to both of you that the two of you will never meet or have further dealings with each other again.&lt;/p&gt;
&lt;p&gt;Clearly, there is something for each of you to fear: namely, that the other one will leave an empty bag. Obviously, if you both leave full bags, you will both be satisfied; but equally obviously, getting something for nothing is even more satisfying. So you are tempted to leave an empty bag. In fact, you can even reason it through quite rigorously this way: &amp;ldquo;If the dealer brings a full bag, I&amp;rsquo;ll be better off having left an empty bag, because I&amp;rsquo;ll have gotten all that I wanted and given away nothing. If the dealer brings an empty bag, I&amp;rsquo;ll be better off having left an empty bag, because I&amp;rsquo;ll not have been cheated I&amp;rsquo;ll have gained nothing but lost nothing either. Thus it seems that no matte what the dealer chooses to do, I&amp;rsquo;m better off leaving an empty bag. So I&amp;rsquo;ll lease an empty bag.&amp;rdquo;&lt;/p&gt;
&lt;p&gt;The dealer, meanwhile, being in more or less the same boat (though at the other end of it), thinks analogous thoughts and comes to the parallel conclusion that it is best to leave an empty bag. And so both of you, with your impeccable (or impeccable-seeming logic), leave empty bags, and go away empty-handed. How sad, for if you had both just cooperated, you could have each gained something you wanted to have. Does logic prevent  cooperation? This is the issue of the Prisoner&amp;rsquo;s Dilemma.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;There&amp;rsquo;s nothing wrong in the logic, actually. The key assumption is that &lt;strong&gt;it is clear to both of you that the two of you will never meet or have further dealings with each other again&lt;/strong&gt;. If you&amp;rsquo;re never going to deal with someone again (and hence there is no question of retribution or any fallout), you really should cheat.&lt;/p&gt;
&lt;p&gt;An aside. During my first few days at IIT, two third years were ragging me about my stance on pre-marital affairs. After trying my best at defending the moral standpoint, I finally confessed that it was only the fear of the after-effects that worried me.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&amp;ldquo;There&amp;rsquo;s this beautiful naked girl in your room,&amp;rdquo; they said. &amp;ldquo;You are guaranteed no repercussions. What will you do?&amp;rdquo;&lt;/p&gt;
&lt;p&gt;&amp;ldquo;No repercussions?&amp;rdquo;&lt;/p&gt;
&lt;p&gt;&amp;ldquo;None whatever.&amp;rdquo;&lt;/p&gt;
&lt;p&gt;I thought for a while. &amp;ldquo;I&amp;rsquo;ll flip a coin.&amp;rdquo; :-)&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Anyway, the aside aside, the solution to the one-off Prisoner&amp;rsquo;s Dilemma is for both people not to cooperate. If contracts are not enforceable, we&amp;rsquo;re all better off not trading. If there are no cops, we&amp;rsquo;re individually better off stealing.&lt;/p&gt;
&lt;p&gt;But, of course, that&amp;rsquo;s not true in the real world. Most situations are repeatable, and you do tend to meet people again. Those you cheat may even have a motivation to meet you again.&lt;/p&gt;
&lt;p&gt;This is the &lt;strong&gt;iterated&lt;/strong&gt; Prisoner&amp;rsquo;s Dilemma. &lt;a href=&#34;http://en.wikipedia.org/wiki/Douglas_Hofstadter&#34;&gt;Douglas Hofstadter&lt;/a&gt; wrote about this in the May 1983 issue of &lt;a href=&#34;http://www.sciam.com/&#34;&gt;Scientific American&lt;/a&gt; in his &lt;a href=&#34;http://en.wikipedia.org/wiki/Metamagical_Themas&#34;&gt;Metamagical Themas&lt;/a&gt; column (which, by the way, is brilliant). While the Prisoner&amp;rsquo;s Dilemma has a simple solution (don&amp;rsquo;t cooperate), the iterated Prisoner&amp;rsquo;s Dilemma does not have a predetermined solution. At best, you can have a strategy. (That can be proven. If there was a predetermined solution, your opponent would know it, and could beat you. One of those cases in mathematics where you are &lt;a href=&#34;https://www.s-anand.net/blog/implicit-information/&#34;&gt;not guaranteed a solution&lt;/a&gt;.)&lt;/p&gt;
&lt;p&gt;But is it possible for cooperation to emerge in an iterated Prisoner&amp;rsquo;s Dilemma? Can it beat competitiveness?&lt;/p&gt;
&lt;p&gt;Robert Axelrod of U.Mich conducted a computer tournament to find out. He invited strategies from game theorists and wrote them as BASIC programs. Each program would be pitted against another. Every time, it could response with either C (cooperate) or D (defect). Cooperation gets both programs 3 points. If one defects, the defector gets 5 points and the cooperator gets nothing. Both defecting gets 1 point each. Axelrod ran each program against each other many times, and added up the scores.&lt;/p&gt;
&lt;p&gt;The program that won was called &lt;a href=&#34;http://en.wikipedia.org/wiki/Tit_for_Tat&#34;&gt;TIT FOR TAT&lt;/a&gt;. It was the shortest program (4 lines of BASIC code). Here&amp;rsquo;s it&amp;rsquo;s strategy:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Cooperate the first time.&lt;/p&gt;
&lt;p&gt;Do what your opponent does thereafter.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Think about it. TIT FOR TAT starts by being &lt;strong&gt;nice&lt;/strong&gt;, and stays that way, unless you defect. Then TIT FOR TAT &lt;strong&gt;punishes&lt;/strong&gt;. If you repent, TIT FOR TAT forgets and &lt;strong&gt;forgives&lt;/strong&gt;. Interestingly, TIT FOR TAT can never win a game. It can, at best, draw a game, but never score more points than its opponent. It goes for winning the war by &lt;strong&gt;losing battles&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;That&amp;rsquo;s four traits:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Being nice&lt;/li&gt;
&lt;li&gt;Punishing immediately&lt;/li&gt;
&lt;li&gt;Forgiving immediately&lt;/li&gt;
&lt;li&gt;Willing to lose battles&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;After publishing these results, and having learnt a lot about different strategies, Axelrod repeated the tournament. Four times as many entries poured in. This time from world experts on game theory. It also included an improved TIT FOR TAT called TIT FOR TWO TATS, which is an improved TIT FOR TAT that does not fall into a C - D - C - D cycle when playing against TIT FOR TAT.&lt;/p&gt;
&lt;p&gt;TIT FOR TAT won again.&lt;/p&gt;
&lt;p&gt;Till date, TIT FOR TAT remains an unbeaten individual strategy, and people believe it may be optimal.&lt;/p&gt;
&lt;p&gt;(PS: By &lt;strong&gt;individual&lt;/strong&gt; strategy, I mean that there are multiple programs that can team together, losing to each other and making sure that one of them wins. This sort of thing can beat TIT FOR TAT. But no &lt;strong&gt;individual&lt;/strong&gt; program beats TIT FOR TAT.)&lt;/p&gt;
&lt;hr&gt;
&lt;p&gt;In our first term at &lt;a href=&#34;http://www.iimb.ernet.in/&#34;&gt;IIMB&lt;/a&gt;, we played a game in our organisational behaviour class, intended to help us understand inter-departmental cooperation (or rivalry). The class was split into two &amp;lsquo;companies&amp;rsquo;. Each company had four divisions.&lt;/p&gt;
&lt;p&gt;The game had 10 rounds. In each round, every division could choose to cooperate or defect. If everyone cooperated, each division made 3 points. If any division defected, it would make 5 points, while all cooperating divisions made 0 points. If all divisions defected, they would all make 1 point. The divisions were not allowed to talk to each other.&lt;/p&gt;
&lt;p&gt;The aim was to beat the other company. (Not other divisions, within or outside the company.)&lt;/p&gt;
&lt;p&gt;Our company started off with 3 Cs and a D, which quickly deteriorated to 1 C with 3 Ds by round 6. At round 7, it was 4 Ds.&lt;/p&gt;
&lt;p&gt;Before round 8, we were all given a chance to have a huddle. A representative from each division would come together and talk things through. We promised to cooperate, and thereafter, it was 4 Cs to the end.&lt;/p&gt;
&lt;p&gt;We lost the game. The other &amp;lsquo;company&amp;rsquo; had started off with 1C and 3Ds, but had learned to cooperate pretty quickly, aided, in &lt;a href=&#34;http://www.iimb.ernet.in/iimb/html/facultyprofile.jsp?id=8&#34;&gt;Prof N M Agrawal&lt;/a&gt;&amp;rsquo;s words, by &amp;ldquo;&amp;hellip; Aparajita threatening the other divisions with her glares.&amp;rdquo;&lt;/p&gt;
&lt;hr&gt;
&lt;p&gt;The reason there&amp;rsquo;s a Prisoner&amp;rsquo;s Dilemma is the inability to reliably communicate or enforce behaviour. Having a chat helps. Having laws that punish you helps. Having a bully threaten you helps. The thing is, you need a signal of some kind. And it needs to be an early signal, or you end up waiting till round 8 and lose the game.&lt;/p&gt;
&lt;p&gt;If you&amp;rsquo;re ever in a situation where cooperation helps everyone, but it&amp;rsquo;s not in interest to cooperate, here&amp;rsquo;s what seems to work:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;See if you can agree to cooperate before-hand
&lt;ul&gt;
&lt;li&gt;Have a chat&lt;/li&gt;
&lt;li&gt;Find policies that punishes defectors&lt;/li&gt;
&lt;li&gt;Threaten if required&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;If not, then try to force cooperation by signaling.
&lt;ul&gt;
&lt;li&gt;Be nice&lt;/li&gt;
&lt;li&gt;Punish defection immediately&lt;/li&gt;
&lt;li&gt;Forgive repentance immediately&lt;/li&gt;
&lt;li&gt;Lose battles to win the war&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;hr&gt;
&lt;h2 id=&#34;comments&#34;&gt;Comments&lt;/h2&gt;
&lt;!-- wp-comments-start --&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Dibyo&lt;/strong&gt; &lt;em&gt;19 Aug 2008 1:05 am&lt;/em&gt;:
I really liked this piece. It&amp;rsquo;s not a new concept to me, and I&amp;rsquo;ve understood it well before, but the TIT-FOR-TAT part really connected.&lt;br&gt;
&lt;br&gt;
Dibyo&lt;br&gt;
(IIMB too, but a couple of years junior - we only heard about Stud Anand)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;S Anand&lt;/strong&gt; &lt;em&gt;19 Aug 2008 11:03 am&lt;/em&gt;:
@Dibyo: Even when playing the game at IIMB, a few of us knew about TIT FOR TAT. Didn&amp;rsquo;t help. Guess there&amp;rsquo;s a huge gap between understanding and practice&amp;hellip;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Abhi&lt;/strong&gt; &lt;em&gt;28 Aug 2008 5:33 am&lt;/em&gt;:
Fantastic piece, very lucidly put.&lt;br&gt;
&lt;br&gt;
IITM - Mtech, we should have heard about Stud Anand.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;a href=&#34;http://www.business-samhita.blogspot.com&#34;&gt;deepak&lt;/a&gt;&lt;/strong&gt; &lt;em&gt;30 May 2010 7:32 pm&lt;/em&gt;:
We played the game in IIMB and ended up doing the same stuff and never getting it right. Dibyo, I think it was Prof. Reddy who made us play this game. But then I went to Solvay for Exchange - 2 each from IIMB and A , we tried TIT for TAT first( many teams too many combinations ), didnt help post the huddle while everyone else was trying for Tit for TAT we kept going against to drive home the message. The prof did mention that one enlightened party doesnt help unless everyone else gets the message :)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Prabu&lt;/strong&gt; &lt;em&gt;10 Dec 2010 9:03 am&lt;/em&gt;:
Hi Anand,
Was going through your post. Just thought of this algorithm that would beat the TIT-FOR-TAT algo. it would be:
&lt;ol&gt;
&lt;li&gt;Never Co-operate.
Now, this algo always either wins or draws individually. Group games are different.
Thanks&lt;/li&gt;
&lt;/ol&gt;
&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;a href=&#34;http://www.s-anand.net/&#34;&gt;S Anand&lt;/a&gt;&lt;/strong&gt; &lt;em&gt;10 Dec 2010 2:56 pm&lt;/em&gt;:
That&amp;rsquo;s an interesting point, Prabu: &amp;ldquo;group games are different&amp;rdquo;. Totally so.
Your Never Cooperate algo, as you pointed out, always wins or draws.
Tit-for-tat, interestingly, NEVER WINS AN INDIVIDUAL GAME. You can prove it, but &lt;a href=&#34;http://files.s-anand.net/blog/a/tit-for-tat.xls&#34;&gt;this file is a demonstration&lt;/a&gt;: it plays random strategies out against Tit-for-tat. Tit for tat never wins.
Maybe the lesson here is a stronger version of &amp;ldquo;Losing the battle, winning the war&amp;rdquo;. Perhaps it&amp;rsquo;s &lt;strong&gt;essential&lt;/strong&gt; to lose the battle to win the war. (I&amp;rsquo;m probably oversimplifying, or in extrapolating analogies&amp;hellip; anyway, just wanted to say: yes, never co-operate beats tit-for-tat on an individual game. Many other such strategies exist too. As you mentioned, group games are quite different)&lt;/li&gt;
&lt;/ul&gt;
&lt;!-- wp-comments-end --&gt;
</description>
    </item>
    <item>
      <title>Knuth Volume 4</title>
      <link>https://www.s-anand.net/blog/knuth-volume-4/</link>
      <pubDate>Mon, 24 Jul 2006 12:00:00 +0000</pubDate>
      <guid>https://www.s-anand.net/blog/knuth-volume-4/</guid>
      <description>&lt;p&gt;&lt;a href=&#34;http://www.cs.utsa.edu/~wagner/knuth/&#34;&gt;The Art of Computer Programming, Volume 4&lt;/a&gt; by Donald Knuth. Pre-fascicles are available for download.&lt;/p&gt;
</description>
    </item>
    <item>
      <title>Some people will never program</title>
      <link>https://www.s-anand.net/blog/some-people-will-never-program/</link>
      <pubDate>Thu, 20 Jul 2006 12:00:00 +0000</pubDate>
      <guid>https://www.s-anand.net/blog/some-people-will-never-program/</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;All teachers of programming find that their results display a &amp;lsquo;double hump&amp;rsquo;. It is as if there are two populations: those who can [program], and those who cannot [program], each with its own independent bell curve.&lt;/p&gt;
&lt;/blockquote&gt;
</description>
    </item>
    <item>
      <title>Classic texts in computer science</title>
      <link>https://www.s-anand.net/blog/classic-texts-in-computer-science/</link>
      <pubDate>Wed, 21 Jun 2006 12:00:00 +0000</pubDate>
      <guid>https://www.s-anand.net/blog/classic-texts-in-computer-science/</guid>
      <description>&lt;p&gt;&lt;a href=&#34;http://www.zafar.se/bkz/wiki/view/43bafac8c8570f4f&#34;&gt;Classic texts in computer science&lt;/a&gt;. Worth reading for the sheer insight.&lt;/p&gt;
&lt;p&gt;Update: The link didn&amp;rsquo;t seem to work in Feb 2007. Here&amp;rsquo;s the list.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&#34;http://www.spatial.maine.edu/~worboys/processes/hoare%20axiomatic.pdf&#34;&gt;An axiomatic basis for computer programming&lt;/a&gt; by C. A. R. Hoare&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;http://www.usingcsp.com/&#34;&gt;Communicating Sequential Processes (CSP)&lt;/a&gt; by C. A. R. Hoare&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;http://homepages.inf.ed.ac.uk/gdp/publications/cbn_cbv_lambda.pdf&#34;&gt;Call-by-name, call-by-value, and the lambda calculus&lt;/a&gt; by Gordon Plotkin&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;ftp://ftp.cs.cmu.edu/user/jcr/theotypestr.pdf&#34;&gt;Towards a theory of type structure&lt;/a&gt; by John C. Reynolds&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;ftp://ftp.cs.cmu.edu/user/jcr/defint.ps.gz&#34;&gt;Definitional interpreters for higher-order programming languages&lt;/a&gt; by John C. Reynolds&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;http://www.slac.stanford.edu/pubs/slacreports/slac-r-114.html&#34;&gt;An APL Machine 1970&lt;/a&gt; by Philip S. Abrams&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;http://www.pipeline.com/~hbaker1/&#34;&gt;Henry Baker&amp;rsquo;s Archive of Research Papers (many classic Lisp papers)&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;http://www-db.stanford.edu/pub/papers/google.pdf&#34;&gt;The Anatomy of a Large-Scale Hypertextual Web Search Engin&lt;/a&gt; by Sergey Brin and Lawrence Page&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;http://www-inst.eecs.berkeley.edu/~maratb/readings/NoSilverBullet.html&#34;&gt;No Silver Bullet: Essence and Accidents of Software Engineering&lt;/a&gt; by Frederic P. Brooks, Jr.&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;http://www.unil.ch/webdav/site/ling/shared/ElementStatText/Shannon1948.pdf&#34;&gt;A Mathematical Theory of Communication&lt;/a&gt; by Claude Shannon&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;http://www.cs.ucla.edu/~jkong/research/security/shannon1949.pdf&#34;&gt;Communication Theory of Secrecy Systems&lt;/a&gt; by Claude Shannon&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;http://www.cs.ubc.ca/~murphyk/Bayes/Charniak_91.pdf&#34;&gt;Bayesian Networks without Tears&lt;/a&gt; by Eugene Charniak&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;http://www.stanford.edu/class/ee398a/resources/ziv:77-SDC.pdf&#34;&gt;A Universal Algorithm for Sequential Data Compression&lt;/a&gt; by Jacob Ziv and Abraham Lempel&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;http://www.cs.duke.edu/~junyang/cps216/papers/codd-1970.pdf&#34;&gt;A Relational Model of Data for Large Shared Data Banks 1970&lt;/a&gt; by Edgar F. Codd&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;http://compilers.iecc.com/crenshaw/&#34;&gt;Let&amp;rsquo;s Build a Compiler 1988-1995&lt;/a&gt; by Jack Crenshaw&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;http://gnowledge.sourceforge.net/damashek-ngrams.pdf&#34;&gt;Gauging Similarity via N-Grams: Language-Independent Sorting, Categorization, and Retrieval of Text&lt;/a&gt; by Marc Damashek&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;http://www.dreamsongs.com/WorseIsBetter.html&#34;&gt;Worse Is Better&lt;/a&gt; by Richard P. Gabriel&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;http://www.cs.berkeley.edu/~necula/cs263/handouts/hoarehints.pdf&#34;&gt;Hints on Programming Language Design&lt;/a&gt; by C.A.R. Hoare&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;http://www.math.chalmers.se/~rjmh/Papers/whyfp.pdf&#34;&gt;Why Functional Programming Matters&lt;/a&gt; by John Hughes&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;http://www.research.ibm.com/journal/rd/174/ibmrd1704F.pdf&#34;&gt;The Design of APL&lt;/a&gt; by Kenneth E. Iverson&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;http://www.metaobject.com/papers/Smallhistory.pdf&#34;&gt;The Early History Of Smalltalk&lt;/a&gt; by Alan Kay&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;http://fresh.homeunix.net/~luke/misc/knuth-turingaward.pdf&#34;&gt;Computer Programming as an Art&lt;/a&gt; by Donald E. Knuth&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;http://www.cs.utah.edu/~wilson/compilers/old/papers/p157-landin.pdf&#34;&gt;The next 700 programming languages&lt;/a&gt; by Peter J. Landin&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;http://www-formal.stanford.edu/jmc/recursive.html&#34;&gt;Recursive Functions of Symbolic Expressions and their Computation by Machine (Part I) 1960&lt;/a&gt; by John McCarthy&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;http://www.cs.wisc.edu/~bolo/shipyard/4th_1970/4th_1970.html&#34;&gt;FORTH - A Language for Interactive Computing&lt;/a&gt; by Charles H.Moore&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;http://www.norvig.com/21-days.html&#34;&gt;Teach Yourself Programming in Ten Years 2001&lt;/a&gt; by Peter Norvig&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;http://www.nhplace.com/kent/PS/About-PS.html&#34;&gt;Parenthetically Speaking, a collection of essays from the 1990s&lt;/a&gt; by Kent M. Pitman&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;ftp://publications.ai.mit.edu/ai-publications/500-999/AITR-595.ps&#34;&gt;The Definition and Implementation of a Computer Language based on constraints&lt;/a&gt; by Guy Lewis Steele Jr.&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;http://www.cs.umbc.edu/331/resources/papers/gls-grow-lang.pdf&#34;&gt;Growing a Language&lt;/a&gt; by Guy Lewis Steele Jr.&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;http://www-pu.informatik.uni-tuebingen.de/users/klaeren/epigrams.html&#34;&gt;Epigrams on Programming&lt;/a&gt; by Alan J. Perlis&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;http://www.cs.helsinki.fi/u/gionis/cc05/cook.pdf&#34;&gt;The Complexity of Theorem Proving Procedures&lt;/a&gt; by Stephen A. Cook&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;http://web.media.mit.edu/~minsky/papers/steps.html&#34;&gt;Steps Toward Artificial Intelligence&lt;/a&gt; by Marvin Minsky&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;http://library.readscheme.org/page1.html&#34;&gt;The Original &amp;lsquo;Lambda Papers&amp;rsquo;&lt;/a&gt; by Guy Steele and Gerald Sussman&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;http://theory.lcs.mit.edu/~rivest/rsapaper.pdf&#34;&gt;A Method for Obtaining Digital Signatures and Public-Key Cryptosystems&lt;/a&gt; by R.L. Rivest, A. Shamir, and L. Adleman&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;http://cm.bell-labs.com/cm/cs/who/dmr/cacm.html&#34;&gt;The UNIX Time-Sharing System&lt;/a&gt; by Dennis Ritchie and Ken Thompson&lt;/li&gt;
&lt;/ul&gt;
&lt;hr&gt;
&lt;h2 id=&#34;comments&#34;&gt;Comments&lt;/h2&gt;
&lt;!-- wp-comments-start --&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;jawahar&lt;/strong&gt; &lt;em&gt;6 Feb 2007 5:52 am&lt;/em&gt;:
anand this link is not working !!&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;a href=&#34;https://maxviv.wordpress.com/2016/06/05/classic-texts-in-computer-science/&#34;&gt;Classic-texts-in-computer-science – maxviv&lt;/a&gt;&lt;/strong&gt; &lt;em&gt;5 Jun 2016 7:15 pm&lt;/em&gt; &lt;em&gt;(pingback)&lt;/em&gt;:
[…] Classic texts in computer science […]&lt;/li&gt;
&lt;/ul&gt;
&lt;!-- wp-comments-end --&gt;
</description>
    </item>
  </channel>
</rss>
