Thursday, March 16, 2023

A tale of graphs, matrices and rankings

 

Pre-requisite: ম্যাট্রিক্সের ডেফিনিশন, নোটেশন, এসব।

যারা প্রতিযোগিতামূলক খেলাধুলা পছন্দ করে, তাদের পছন্দের একটা বড় অংশ মনে হয় অনেকগুলো দলের মাঝে র‍্যাংকিং করা। যা অনেক ক্ষেত্রে গিয়ে দাঁড়ায়, নিজের পছন্দের দলের র‍্যাংক কেমন সেইটা খুঁজে বের করায়।

তো, এইটার ক্ষেত্রে একটা কিঞ্চিত প্যারাডক্সিকাল রেজাল্ট একটু মনে করিয়ে দেই। গত বছরের ফিফা ওয়ার্ল্ডকাপে গ্রুপ ই এর রেজাল্ট ছিল এরকম।

Group E results for 2022 Fifa World Cup

এখানে পয়েন্টের সামারির মধ্যে যেইটা বোঝা যাচ্ছে না, তা হল জাপান হারায় স্পেন আর জার্মানিকে। স্পেন আর জার্মানি নিজেরা ড্র করে, কিন্তু দুই দলই হারায় কোস্টারিকাকে। আর কোস্টারিকার কাছে হেরে বসে জাপান। আমরা সবগুলো ইনফো একটু একটা ছবিতে চিন্তা করি। এখানে 1, 2, 3 আর 4 হল যথাক্রমে জাপান, জার্মানি, স্পেইন, আর কোস্টারিকা। 1 থেকে 2 এর দিকে arrow যাচ্ছে মানে হল গিয়ে 1 এর কাছে 2 হেরে গেছে। (একটু কষ্ট করে মিলিয়ে নিন যে গ্রুপের খেলার রেজাল্ট আর ছবিটা একই কথা বলে। একটাই খেয়াল করার জিনিস, কেউ ড্র করলে আমি তাদের মধ্যে কোন arrow দেই নি)।

Graph for Group E match results

এই একই জিনিসকে ম্যাট্রিক্স দিয়েও প্রকাশ করা যায়। প্রতিটা এলিমেন্ট row team vs column team ম্যাচের রেজাল্ট প্রকাশ করে। জিতলে 1, হারলে 0, ড্র করলে 0.5। একটু মিলিয়ে নিন যে এইটা আর আগের গ্রাফ একই জিনিস (নিজের সাথে নিজের ম্যাচ যেহেতু হয় না, তাই ঐ জায়গায় একটা 0 বসানো)। এই ম্যাট্রিক্সটার নাম দেই M। আমরা ফুটবলের ৩-১-০ পয়েন্ট দিয়ে হিসেব না করে আপাতত এই পয়েন্ট দিয়ে হিসেব করি।

Matrix form for the previous graph
Jargon: এই গ্রাফিকাল রিপ্রেজেন্টেশনকে ম্যাথ/কম্পুসায়েন্সের ভাষায় Directed graph বলে। প্রতিটা টিম একেকটা node, arrow গুলোকে ফরমালি বলে edge বা arc। আর ম্যাট্রিক্স ফর্মটাকে বলে ঐ গ্রাফের adjacency matrix।

এখন, ওয়ার্ল্ডকাপের নিয়ম খুব সোজা, ম্যাচ জিতলে ৩ পয়েন্ট, ড্র করলে ১ পয়েন্ট, হারলে ০। সুতরাং জাপানের পয়েন্ট ৬, জার্মানি আর স্পেনের ৪ করে, প্রশ্নটা দাঁড়ায় এদের মধ্যে কারা যাবে। ফিফার সল্যুশন সবার আগে কে বেশি গোল করে কম গোল খেয়েছে এইটা দেখা, সো স্পেন পরের রাউন্ডে যাচ্ছে।

ইন্টারেস্টিংলি এনাফ, কোস্টারিকার কথা কেউ ভাবছে না। ভাবার কথাও না, সবার নিচে বেচারারা জিতেছে একটা ম্যাচ। কিন্তু কোস্টারিকা চিন্তা করতে পারে অন্যভাবে- “আমরা তো গ্রুপ চ্যাম্পিয়নদের হারিয়েছি। এর কি কোন দাম নাই?”

Well-established tournament rules যেখানে আছে, সেখানে আসলেই কোন দাম নাই। কিন্তু এসিব রুল-টুল তৈরি হওয়ার আগে, এই একই প্রশ্ন উঠেছিল আসলে দাবা খেলার সময়। ধরা যাক, দশজনের একটা টুর্নামেন্ট। সবার সাথে সবার ম্যাচ হবে। দিনশেষে খেলোয়াড়দের র‍্যাংক করা হবে কিভাবে? সিম্পল উপায় হচ্ছে সব জেতা খেলার জন্য ১ পয়েন্ট দেওয়া, ড্র-এর জন্য হাফ, তারপর যোগ করে ফেলা। একদম ফুটবলের মতই।

কিন্তু সেই ১৮৭৩ সালে, এক অস্ট্রিয়ান প্লেয়ার Oscar Gelbfuhs প্রপোজ করেন একটা রিপিটেড মেথড। ফুটবলের উদাহরণটা যদি দেখি, অস্কারের প্রপোজাল অনুযায়ী রিপিট করা হবে এভাবে, কোস্টারিকা যেহেতু জাপানকে হারিয়েছে, আর জাপান যে বাকি দুই দলকে হারিয়ে দিয়েছে, এর জন্য তারও কিছু পয়েন্ট প্রাপ্য। ইন ফ্যাক্ট, জাপান যত পয়েন্ট পেয়েছে, অত পয়েন্ট কোস্টারিকাকে দিয়ে দেওয়া হোক। আর কাউকে তো সে হারায় নি, তাহলে জাপানের পয়েন্টটাই তার সম্বল। তাহলে কোস্টারিকার নতুন পয়েন্ট কত হবে? জাপানের থেকে পাওয়া 2। একইভাবে সবারই স্কোর আপডেট হয়ে যাবে। এইখানে আসলে পর্দার আড়ালে একটা ম্যাট্রিক্স অপারেশন হচ্ছে। আগে যেই M ছিল, সেই M কে স্কোয়ার করা হয়ে গেছে।

এর পিছনে লজিকটা মূলত এরকম যে, আমি যাকে হারিয়েছি সে যদি অনেক স্ট্রং হয়, তাহলে আসলে আমার তার জন্য বেশি পয়েন্ট পাওয়া উচিত। আবার সে যদি উইক হয়, তার জন্য খুব একটা কিছু না। এইখানে কোস্টারিকার রো-এর দিকে একটু দেখি। এই M-squared ম্যাট্রিক্সে, তার হারানো দল জাপান যে স্পেন আর জার্মানিকে হারিয়েছে, সে জন্য সে স্পেন আর জার্মানিকে হারানোর পয়েন্ট পাচ্ছে। এখন হঠাত করে দেখা যাচ্ছে, নতুন এই ম্যাট্রিক্স হিসেব করলে সবার পয়েন্ট

অর্থাৎ হঠাত করে কোস্টারিকার পয়েন্ট বেশি হয়ে গেল। এখন, এইখানে জার্মানি, স্পেন আবার প্রশ্ন তুলতে পারে। আমরা একবার রিপিট করে থেমে যাব কেন? আরেকবার রিপিট করা যাক। অথবা আরও দুইবার। অর্থাৎ M² এর বদলে M³ বা M⁵, ইত্যাদি। ইন্টারেস্টিংলি M⁴ নিয়ে হিসেব করতে গেলে আবার জার্মানি আর স্পেনের পয়েন্ট কোস্টারিকার চেয়ে বেশি হয়ে যাবে।

এই প্রশ্ন দেখে, Edmund Landau কিছুদিন পর নতুন প্রস্তাব দেন: ম্যাট্রিক্স কয়বার গুণ করা ভাল এইসব চিন্তা না করে, আমরা বরং এমন কোন হিসেব করি যা ম্যাট্রিক্সের পাওয়ারের উপর নির্ভরশীল না। তার প্রস্তাবটা অনেকটা এরকম। ধরে নেই, চার দলের চারটা স্কোর আছে, যা একটা ভেক্টর দিয়ে লেখা যায়।

এখন, এই স্কোরটা স্টেবল হবে কখন? যখন “আমি অমুককে হারিয়েছি, সুতরাং তমুকের স্কোর থেকে আমাকে কিছু পয়েন্ট দেওয়া হোক” কথার কোন তাৎপর্য থাকবে না। অর্থাৎ, আমার হারানো লোকজনের ইফেক্ট এড করতে গেলেও স্কোর চেঞ্জ হবে না। এই সম্পর্কটাকে ম্যাট্রিক্স নোটেশন দিয়ে লেখা যায় এভাবে-

এই (1) রিলেশনটার সমাধান থাকা আবার সবসময় সম্ভব না। অর্থাৎ এরকম s থাকবে, এইটা সব ম্যাট্রিক্স M এর জন্য নিশ্চিত না। কিন্তু, আমাদের উদ্দেশ্য যদি শুধু একজন আরেকজনের রিলেটিভ স্কোর বের করাই হয়, তাহলে এর খুব কাছাকাছি আরেকটা রিলেশন বের করা সম্ভব, যা সব সময়ে সত্যি হবে। সেইটা দেখতে কেমন?

এখানে λ হচ্ছে যেকোন পজিটিভ রিয়েল নাম্বার (একটা কন্সট্যান্ট পজিটিভ নাম্বার দিয়ে গুন করা হলে আসলে আমাদের স্কোরের খুব বেশি কিছু যায় আসে না। 10,8,6,4 আর 5,4,3,2 তো র‍্যাংক বের করার স্বার্থে একই কাজ করে, তাই না?)। এই নতুন (2) রিলেশনটার আবার সবসময় সল্যুশন পাওয়া সম্ভব। M ম্যাট্রিক্সের সব সংখ্যা যদি জিরো বা পজিটিভ নাম্বার হয়, তাহলে এইটার সব সময় সমাধান থাকবে। আর আমাদের ক্ষেত্রে তো অবশ্যই জয়ের সংখ্যা, ড্রয়ের সংখ্যা পজিটিভ। এই রেজাল্টটা সাধারণত Perron-Frobenius Theorem(PFT) নামে পরিচিত। আমরা এর প্রুফ-টুফে যাব না, সত্যি বলে মেনে নিব আপাতত।

যারা একটু-আকটু লিনিয়ার এলজেব্রা পারেন, তারা খেয়াল করে থাকবেন, বাকিদের জন্য বলে রাখি। এই λ হচ্ছে ম্যাট্রিক্স M এর right eigenvalue। আমি একটু হ্যান্ড-ওয়েভ করে সল্যুশন থাকবে বলে দিচ্ছি। কিন্তু PFT আসলে বলে যে অবশ্যই এরকম ম্যাট্রিক্সের একটা পজিটিভ eigenvalue থাকবে, এবং তার সাথে একটা corresponding eigenvector থাকবে যার প্রতিটা মান পজিটিভ। এর নাম leading eigenvector এবং এটাই হবে আমাদের চাওয়া s এর সল্যুশন।

অর্থাৎ, আমরা এখন একটা স্কোর বের করতে পারব, যেইটা আমি যাদের হারাচ্ছি তাদের ইফেক্টটা হিসেবে নিতে পারে। তাহলে আমরা আমাদের ম্যাট্রিক্স M এর জন্য স্কোরগুলো বের করে ফেলি। সমাধান করলে আমরা পাই-

এই স্কোর দেখে অবশেষে মনে হয় জার্মানি আর স্পেন দল হাঁফ ছেড়ে বাঁচতে পারবে। এট লিস্ট কোস্টারিকা থেকে তো বেশি।

এইখানে যদিও মাত্র একটা করে ম্যাচ হয়েছে, এইটা দিয়ে হিসবে করাটা একটু উইয়ার্ড লাগতে পারে। কিন্তু যখন অনেক অনেক ম্যাচ হয়, আর এই “এক হারালো দুইকে, দুই হারালো তিনকে, তিন আবার এককে” ধরণের সাইকেলের সংখ্যা বেড়ে যায়, তখন এরকম কমপ্লেক্স নিয়ম বেশ কাজে লাগে। অনেক ম্যাচ আছে, এরকম এক্সাম্পল বের না করে আমরা আসলে এই ফুটবলের এক্সাম্পলটাতেই আরেকটু ঘাটি। বেশিরভাগ ম্যাচেই তো বিভিন্ন দল গোল-টোল দেয়। তাহলে, আমরা শুধু, জয়-হার না দেখে, খেলার গ্রাফ বা ম্যাট্রিক্সটা বানাই গোলের কাউন্ট দিয়ে। তাহলে আমরা পাই নতুন ম্যাট্রিক্স P।

নতুন ম্যাট্রিক্স। স্পেন-কোস্টারিকা স্কোর ছিল 7–0, তাই স্পেনের রো-তে কোস্টারিকা কলামে 7, কোস্টারিকার রো-তে স্পেনের কলামে 0

এইটার জন্য আরেকবার leading eigenvector বের করে স্কোর নির্ণয় করা যাক।

এবার দেখা যায় স্পেন আর জার্মানির স্কোর জাপান থেকেও বেশি। এইটা অবশ্য একদিক দিয়ে ভাবলে ঠিকই আছে। ম্যাট্রিক্স দেকেহ মনে হচ্ছে স্পেন, জার্মানি ৭ বার, ৪ বার হারাচ্ছে কোস্টারিকা কে। জাপানের সাথেও ওরা বেশ ইভেন, ২ বার হারে তো ১ বার হারায়। খুব unintuitive result তা বলা যাবে না। এবং এই এক্সাম্পলটা আগের সিম্পলটার থেকে বেশি দেখায় কেন এরকম অদ্ভুত সব র‍্যাঙ্কিং মেথড দরকার। কারণ একেকজন একেক সংখ্যক ম্যাচ খেলছে।

এরকম র‍্যাংকিং বের করার বেশ অনেক নিয়ম আবিষ্কার হয়েছে এই গত দেড়শ-দুইশব বছরে দাবা, ক্রিকেট, যাই হোক, সেই ক্ষেত্রে ব্যবহার করার জন্য। Learning to rank নামে এই ফিল্ড তৈরি হয়েছে এসব কাজের জন্য, এবং এই টপিকে রিসার্চ এখনও চলে, থিওরেটিকাল ম্যাথ থেকে শুরু করে মেশিন লার্নিং এর লোকজনের হাতে।

আজকের আলোচনা করা মেথডটা Spectral ranking নামের একটা বেশ সাধারণ মেথডের স্পেশাল কেইস বলা যায়। Learning to rank এর সবচেয়ে well-known এলগিরদম সম্ভবত PageRank, যার উপর দাঁড়িয়ে ছিল Google এর আদি ব্যবসা। কোন কোন দিক দিয়ে PageRank কেও আসলে স্পেক্ট্রাল র‍্যাঙ্কিং মেথড বলা যায়।

স্পেক্ট্রাল র‍্যাংকিং নিয়ে আইডিয়া পেতে এই সার্ভে পেপারটা খুব ভাল (আমি যা বলেছি তা মোটামুটি প্রথম দুই পেইজে আলোচনা করে ফেলে এই পেপারে)-

Vigna, Sebastiano. “Spectral ranking.” Network Science 4.4 (2016): 433–445.

Tuesday, December 21, 2021

Ted Lasso is a sports anime in disguise, and you should watch it

Ted Lasso is a sports anime, and you should watch it.

To start off, I should say that I'm not the biggest sports anime fan. One reason for this is that many sports anime are mainly Shonens. And being both a Shonen anime, and then following a sports-based setup, the repetitiveness is often quite high. It often follows a particular trend: unlikely or an underdog protagonist tries out a sport, faces obstacle, overcomes obstacle, often times turning rivals into friends into the process. Then repeat on a larger scale. 

However, there's no denying that this ultimately leads to very good feel-good shows. You see the protagonist overcome obstacle after obstacle, and grow an attachment to them. You start rooting for them. On top of this, when a sports anime manages to add something greater on top of this basic framework, that's when I find it much more interesting. 

For example, probably my most favorite sports anime of all time: Ping Pong the animation. You have Smile and Peco and you want to root for both. You want them to get to the top of the Ping Pong tournaments. On top of it, you have the psychological element that comes with really well-written coming-of-age drama. We get an insight into what makes a hero. And we get to rejoice at the triumph of said hero at the end. The unique art and animation is also a big bonus for this.

Another example might be a bit odd one - Chihayafuru. This can possibly be considered more of a Slice of Life anime rather than sports (and the target audience is shojo/josei rather than the more common shonen). And very interestingly, the additional elements that makes Chihayafuru a favorite of mine is the exposition to Karuta (a sport unlike anything else I've seen before) and the romantic element in this. This would not work as a shonen sports anime. But as it is made, it works really well.

Now I come back to the original topic of this writeup - Ted Lasso.

The premise is this: an American Football coach, who knows nothing about regular football (what he knows only as Soccer), is appointed the coach of a struggling British Premier League team. The team is going through big changes. Their ownership changed hand recently from the previous owner to his vengeful (?) ex-wife. There's a budding rivalry between a club legend and an up-and-coming star. Team spirit is in shambles. What to do? How will this new guy, whose superpower is positivity, handle all of these issues?

So, unlikely/underdog protagonist: check.

Superpower of positivity to battle through struggles: check.

Possible long-term antagonist in form of the previous owner: check

What are the added elements that make it better?

A look into most main characters' backstories: how they were brought up, what makes someone a prick, what makes someone else the greatest environmental warrior since Greta Thunberg. I saw someone in Reddit saying, Ted Lasso is a story about fathers. I don't disagree much with that. At the same time, Ted Lasso is also a story about elevation and redemption. How someone's unwithering belief in you can help one grow, how it can also help someone else redeem themselves. Season 2 also has a great discussion about mental health and how it's communicated.

And along with all these, each season covers a football season. We follow the team. We see the team's goals. We get invested in them. We feel good. We feel sad. And at the end of each season, whether happy or sad, we feel immense solidarity with the team, waiting patiently for the next season.

If that's not the plot of a great sports anime, I don't know what is.

Thursday, August 26, 2021

Utilizing the bloody bandwidth

I grew up with dial-up internet. Abbu probably got internet connection at home first time circa 2002. Back then, "computer time" was limited to about one hour per day, "internet time" even more so. And this limited time on a line with 56 kbps download speed. Now let's do some elementary maths. Even if I spent that maximum of allotted computer time on the internet, what's the amount of data that would get me?
56*3600/(1024*8) which is around 25 megabytes 
Heh. An mp3 of a song was around 5 megabytes. So, if I wanted to listen to a song, I'd have to spend 20% of my total internet time dedicatedly towards that one goal. 

Then I eventually first got introduced to a broadband line, when Bhaiya was in his third year of university, about 7 years from that first introduction to internet. I also got introduced to torrents. And local servers. And the rush was amazing. I mean, I didn't have to wait a really long time to download a single piece of music any more. It also meant I could be multi-tasking. I could be reading up on the latest Naruto chapters, while a movie was downloading in the background. I could take breaks by watching HD videos that I'd find on the LAN. I was amazed as the high bandwidth I could get and thought that any time when the internet line is not being used to the maximum possible bandwidth is a "waste of internet". And I knowingly couldn't bring myself to waste this beautiful beautiful thing.

And that usage pattern continued, and weirdly enough leaked into other aspects of my behavior. And not particularly in a good way. I mean, when I was trying to "not waste" internet, it's not like I was using it to save the world or anything, right? So, in multi-tasking in real life, I basically took it to mean I shouldn't be taking a shit without browsing my phone. Such a waste of time. If there's an advertisement while watching a film, I should use that time glued to my phone. If I'm walking up to campus, I should be checking Facebook posts and listening to music (double multi-tasking, take that!). Time's a more important commodity than internet, and no time bandwidth can be wasted.

I only recently made the connection to this urge of utilizing the bloody bandwidth in all aspects of life and the really low attention span I have at this point. I mean, I never really learned to do multi-tasking properly. All I learned was to break down the time to small parts and do different things at the different times. I began to give value to trivial tasks and important tasks alike. I mean, focusing on a single important task is for chumps, I'm increasing bandwidth utilization! And if need came to focus for a longer amount of time on a single task, which might be important, it turns out I'm not equipped to do that. Surprise!

So, I've been trying a lot at recent times to let go of the bandwidth thoughts. I keep telling myself I don't need to utilize the bandwidth to do pointless tasks. Just because there are more posts in the wrestling forum doesn't mean I should be trying to spend my free time reading those. Just because there might be this new fancy tutorial video on YouTube which might give me a minute of excitement doesn't mean I need to watch it. And I'm trying to stop this silly practice of high utilization and trying to rather focus on doing on what I need to.

Tuesday, July 28, 2020

Coder's Block and the Birthday Problem


So, I've been going through something of a Coder's block, which is just a fancy way to say that I've been procrastinating too much instead of working. I get ideas, work on them with pen and paper, but when it comes to testing them, even very simplistic stuff is hard to write down. So, I thought maybe trying something very simplistic (like undergrad first year kind of simplistic) might help at least writing something. And maybe that would help with getting out of this fancy block.

When thinking of simple problems, the Birthday Problem came to mind, which asks-
What is the smallest n, such that in n randomly chosen people, the probability that a pair of them will have the same birthday is at least half?

Now, this problem can be solved analytically (and the solution's really neat as a counting problem). But I'm not really in a counting block, I'm in a coding block. So instead of solving this analytically, decided to do a Monte Carlo (MC) simulation for it. An MC simulation really comes down to generating different random numbers. So, for different values of n, we generate n random integers between 0 and 364 inclusive (why?) and see if any pair among the n are equal. We repeat this experiments a number of time for each n and count how many times, such an event has happened. And we treat the fraction of time this has happened as the prediction of the probability. (In actuality, to get a better prediction, we should repeat this experiment multiple times and take the means, but again, that's not the point of why I was doing this).
As it turns out, the number of people we need to get the probability above half --according to the results of our code, which is shown below-- is merely 23. This is the same as the analytically found result as well.
Now, this was a result that I used to find very intriguing back in high school. There are 365 days in a year after all. So, why can only 23 people give a probability of more than half that two of them share a birthday? Interestingly, this is easy to understand if we count the right thing. We are essentially looking at "pairs of people" than individuals for the Birthday Problem. And how many pairs of people are there with n peoples? n(n-1)/2. For 23 people, this is 253, a number much closer to 365. And suddenly the result does not seem so weird. This argument can naturally be extended to support the fact that soon the probability reaches almost 1. Any way, this 20-ish line code with a couple of for loops and ifs were easy enough. Let's just hope that doing simple exercises does help in getting back to actual coding that I "need" to do.

Thursday, November 21, 2019

Star Wars



They used to do the original trilogy reruns on Star Movies when I was a kid. Me and Bhaiya would go crazy about them. I don't even think I understood much beyond "hey cool light swords and aliens" around the first time, to be honest.

So probably I began "understanding" the Star Wars mythology and everything later on, between the release of Attack of the Clones and Revenge of the Sith. By RotS, I had become this proper SW "stan", as they say this days. Did I think Anakin was a worse protagonist than Luke? Yes. Did I hate Jar Jar Binks? Yes. But did I hate the prequel trilogy? No, not really. I mean, yeah I'll occasionally bash them for the weird plot points and shit but still, teenage me loved the hell out of those things.

Then, by the time the sequel trilogy came along, I was actually a grownup. I've had my time to create "higher" expectations from a eff-ing space opera. I got into the whole web interactions thing, where just watching a movie wasn't enough, dissecting it, "theorizing" about it, then getting mad when the theories didn't become true, then getting mad at other people for spewing nonsense.

Damn, being a SW fan has become complicated. Anyhow, as we near the end of the sequel trilogy, I feel like, this once I'd like to forget all the shit. I'd like to just go, watch the movie, and enjoy some good old space opera.

One last time.

Saturday, November 09, 2019

Break

I graduated from BUET in August 2015, it took about five and a half years. Towards the end, it got more exhausting than I could have imagined in the earlier days. No matter how good some of the times were, I couldn't wait to put it behind me.
I also felt I needed a well-deserved break. I remember telling my mother as early as March of that year, that after graduating I wish I got to go home and stay in Rajshahi for a few weeks, even months may be. That I would not feel bad or whatever if I don't immediately get a job. Bla bla bla.

As fate would have it, I got a rather tempting job offer as soon as graduating. Couldn't resist the allure, deserved break be damned, I joined. And while the first months in the job were possibly easier than whatever I went through in the final year of university, it was no vacation. Eventually, got involved in the job more, used to spend hours in the office at times, would bring work home even (to the irritation of my wife). I think I can safely say, to some extent I enjoyed the work. However much I enjoyed it though, the need for a break that I felt before, was coming back. And it had only gotten stronger during the wait. I used to joke all the time that I'd some day be brave enough to just call my boss and say "I quit, I want to sleep!". During my three years working there, the only long leave that I managed to take was for a two-week tour to Nepal. The tour itself was lovely. My wife and I saw snow for the first time, paraglided, ate different types of momo. Then I came back, rejoined office, and to my utter surprise, realized that I still wanted that goddamn break. That I still need to just lay back, and do abso-fucking-lutely nothing for a few days.

Anyway, again, as time would see, I would get another opportunity that would be great for me. An admission offer letter to graduate school, studying economics, computation and other shit. Again, being the sucker that I am for "good" opportunities, I took the offer. Before leaving for school though, spent even the last few days tying up ends at the job. So, if I had been subconsciously motivated about grad school from the hope that, I'd get some time between quitting the job and needing to leave, that hope was very much misplaced.

So still no break, and lo - I'm suddenly doing my PhD. I mean, I know why I'm here. I understand that with my curiosity, or ambitions or whatever else attributes I might possess, I was bound to end up here anyway.

But, still, I can't help thinking, if only I had managed to take that break, somewhere in the last five years, maybe, maybe today would be more tolerable.   

Monday, July 29, 2019

আপাত অপ্রাসঙ্গিক ব্যাপার-স্যাপার (Supposedly Irrelevant Factors)

(কয়েকদিন হল অর্থনীতিবিদ রিচার্ড থেলারের আংশিক জীবনী, আংশিক টেক্সটবুক ঘরানার বই Misbhevaing: The making of behavorial economics পড়া শুরু করেছি। অনেক জায়গায় বইটাকে Professional Memoir হিসেবে বর্ণনা করতে দেখেছি, যেটা অনেকাংশে ঠিক। প্রফেসর থেলার পিএইচডি থিসিসের সময় (১৯৭০) থেকে শুরু করে মোটামুটি ২০১০ এর দিক পর্যন্ত নিজের কাজের পিছনে মোটিভেশন, witty সব বাস্তবিক উদাহরণ, কলিগদের সাথে তার বিভিন্ন সময়ের interaction উঠে আসে। এর মধ্যেই আমরা দেখতে পাই কিভাবে ধীরে ধীরে আলাদা ফিল্ড হিসেবে Behavorial Economics দাঁড়া হয়ে ওঠে, যাকে বাংলায় আচরণগত অর্থনীতি বলতে দেখেছি এখানে সেখানে। বিহেভরিয়াল ইকোনমিক্সের ডেভেলপমেন্টে উল্লেখযোগ্য ভূমিকা রাখার কারণে রিচার্ড থেলার ২০১৭ সালে অর্থনীতিতে নোবেল পুরস্কার পান। এই বই বেরিয়েছে অবশ্য তারও বছর কয়েক আগে। বইটা পড়ার সময় বেশ কিছু আইডিয়া বেশ পছন্দ হয়, যার কারণে ঠিক করি নিজের মত করে নোট নিয়ে রাখব। সেই নোটগুলোরই প্রথমটা হচ্ছে এই পোস্ট।)

একটা আদর্শ অর্থনৈতিক দুনিয়ায় সব মানুষের একটা কমন বৈশিষ্ট্য থাকার কথা: rationality বা যৌক্তিকতা। অর্থনৈতিক তো বটেই, সব ডিসিশনই মানুষের নেওয়ার কথা যৌক্তিক ভাবে। যৌক্তিকতা মানে কি? নিজের কাজের কারণে মানুষের যেন সর্বোচ্চ লাভ বা সর্বনিম্ন ক্ষতি হয় সেইটা নিশ্চিত করা। এই জিনিসটার একটা গালভরা নাম আছে: utility maximization। কিন্তু কথা হল, মানুষ কিসে নিজের লাভ বা ক্ষতি মনে করে, এটাকে সবসময় টাকা-পয়সা (কিংবা অন্য কোন জিনিস যেটার লাভ-ক্ষতি পরিমাপ করা সহজ) দিয়ে ব্যখ্যা করা যায় কিনা এটা একটা বড় প্রশ্ন। 

প্রফেসর থেলার নিজের জীবন থেকে একটা উদাহরণ ব্যবহার করেন। উনি যখন প্রথম যখন শিক্ষকতা শুরু করেন, তার একটা পরীক্ষায় শিক্ষার্থীদের গড় মার্কস ছিল ৭০-এর আশেপাশে। উনি যেখানে পড়াতেন (University of Rochester, NY, USA), সেখানে মার্কসের সাথে গ্রেডের সম্পর্ক আমাদের দেশের মত এত জোরালো না। ৮০ মানে এ, ৭৫ মানে এ-, এরকম ধরাবাধা নিয়ম নাই আর কি। যেহেতু একেক প্রফেসরের পরীক্ষার ডিফিকাল্টির উপর ডিপেন্ড করে ৫০/১০০ মানে হয় খুব জঘন্য পরীক্ষা, অথবা মোটামুটি ভালো পরীক্ষা, যেকোনটা হতে পারে। উনিও সুন্দর মত বলে দিয়েছেন যে তোমাদের এই নাম্বারের দিকে তাকানোর দরকার নাই, আমি "curving" করে তারপরে গ্রেড দিব। তার পরেও উনি বেশ শোরগোল শুনেন ক্লাস থেকে। "ভাল পড়েও মাত্র ৭০ পেলাম, এ কেমন বিচার?" জাতীয় কথাবার্তা আর কি। পরীক্ষার মান সহজ করার ব্যাপারে অনীহা থাকায়, একটা অদ্ভুত কাজ করে বসলেন তিনি। পরের পরীক্ষা ১০০ মার্কসে না নিয়ে, নিলেন ১৩৭ এ। কেন? "এতে গড় মার্কস ৭০ এর দিকে না থেকে থাকে ৯৫ এর আশেপাশে। এক দুইজন ১০০+ মার্কসও পেয়ে যায়।" (এইটা ১৩৭ দিয়ে ভাগ না করে ১৪০ টাইপের কিছু দিয়ে ভাগ করলেও হত, কিন্তু একটা ১৩৭ দিয়ে মুখে মুখে ভাগ করে ফেলা একটু কঠিন, এটাও হয়তো একটা ভাল ব্যাপার)।
যেহেতু শুধু মার্কস না দেখে এখনও লোকজনের পাওয়া মার্কসের ডিস্ট্রিবিউশন দেখে গ্রেড দেওয়া হবে, এতে আসলে শিক্ষার্থীদের অবস্থার কোন হেরফের হবে না। তার মানে ইউটিলিটি বাড়ানোর দিক দিয়ে, তাদের কিছু যায় আসার কথা না, যেহেতু ইউটিলিটি দিন শেষে গ্রেডের উপরেই নির্ভরশীল, এই মার্কসের উপর না। কিন্তু অবাক করা ব্যাপার হল এই আপাত অপ্রাসঙ্গিক ব্যাপার (মোট মার্কস) পরিবর্তনের কারণে, জীবনে প্রফেসর থেলারকে তার গ্রেডিং নিয়ে আর কোন কমপ্লেইন শুনতে হয় নি। 

আরেকটা উদাহরণ দেখা যাক। এবার আর ক্লাসের ব্যাপার-স্যাপার না। ধরে নিন ফেসবুকে একটা ফুটফুটে বাচ্চার ছবি সহ একটা পোস্ট দেখলেন। ছয় বছর বয়সী ছেলেটার অপারেশনের জন্য কয়েক লক্ষ টাকা লাগবে। তাকে সাহায্য করার উপায় জানানো থাকলে, বিকাশ হোক, ব্যাংক একাউন্ট হোক, আশা করা যায়, মানুষ নিজের জায়গা থেকে একটা এমাউন্ট দান করে বাচ্চাটার অপারেশনের ব্যবস্থা করতে পারবে। এই একই মানুষগুলোকে যদি জানানো হয় যে ইনকাম ট্যাক্স আরেকটু বাড়ানো হলে দেশের হাসপাতালগুলোতে দরিদ্র শিশুদের চিকিৎসা ব্যবস্থার উন্নতি করা যাবে এবং বছরে অন্তত ১০০ জন শিশুর জীবন বাঁচবে, সেক্ষেত্রে হয়তো আর ওরকম আগ্রহ পাওয়া যাবে না। ট্যাক্সের টাকা কই যায়, হাসপাতালে দূর্নীতি হয় কিনা, এসব আপাতত হিসেবের বাইরে রাখি। এখানে মূলত যে পার্থক্যটা তা হল থমাস শেলিং এর মত identified life আর statistical life এর পার্থক্য। প্রথম ক্ষেত্রে, বাচ্চাটাকে আপনি দেখছেন, একটা পরিচয় জানছেন, এবং এটাই একটা বড় পার্থক্য গড়ে দেয়। মানুষ খুব কম ক্ষেত্রেই identified life এর ক্ষতি হোক এটা চায়। এখন যৌক্তিক চিন্তার দিক থেকে কিন্তু এ পার্থক্যটা থাকার কথা না। যদি আমার সরাসরি পরিচিত না হয়, একটা identified life আর statistical life বাঁচানো, দুইটার ক্ষেত্রেই আমার সমান আগ্রহ থাকা উচিৎ। দুর্ভাগ্যজনকভাবে তা থাকে না।

এই যে ফিক্সড ইউটিলিটির বাইরে চলে যাওয়ার মানুষের স্বভাব, এই জিনিসগুলোর কারণ হচ্ছে এসব আপাতদৃষ্টিতে অপ্রাসঙ্গিক ব্যাপার-স্যাপার। এগুলোকে irrational বলে অনেক ক্ষেত্রেই ইকোনমিক এনালিসিসের মধ্যে আনা হয় না। কিন্তু থেলার (এবং আরও অনেকে) আসলেই প্রমাণ করেন, যে এগুলোকে ব্যবহার করে আমরা ভালোমত মানুষের অর্থনৈতিক আচরণ ব্যখ্যা করতে পারব। মানুষের এই ব্যাপারগুলোকেও গাণিতিক মডেল ব্যবহার করে ইকোনমিক্সের মধ্যে আনাটাই এক দিক দিয়ে বলা যায় বিহেভরিয়াল ইকোনমিক্সের উদ্দেশ্য।

(চলবে)