Eklavya's Blog - Game theoryhttps://sharmaeklavya2.github.io/blog/2023-10-09T00:00:00+05:30Analyzing Hand Cricket using Game Theory2023-02-07T00:00:00+05:302023-10-09T00:00:00+05:30Eklavya Sharmatag:sharmaeklavya2.github.io,2023-02-07:/blog/hand-cricket.html<p>Hand cricket is a popular game among children in India. I analyzed it using game theory and got my findings published at FSTTCS, a well-known CS theory conference!</p><p></p>
<p><em>Hand cricket</em>, also known as <em>Odd or Even</em>, is a popular two-player game among children in India.
It is a hand game, i.e., the game is played using hand gestures, similar to rock-paper-scissors.
As the name suggests, hand cricket is inspired by <a href="https://en.wikipedia.org/wiki/Cricket">Cricket</a>.</p>
<p>I used to play hand cricket a lot in childhood: an estimated 300 hours in total.
But back then it never occurred to me that maybe I can use math to figure out how to play this game well.
I searched the internet to see if anyone has analyzed this game already,
but I didn't come across anything.
This game doesn't even have a Wikipedia page! This is a shame.
I decided to help fix this by giving it the attention it deserves,
at least from the game theory research community.</p>
<p>I and my friend <a href="https://aniket2.web.illinois.edu/">Aniket Murhekar</a> showed that
(a generalization of) hand cricket has a unique Nash equilibrium.
We got this result published at <a href="https://www.fsttcs.org.in">FSTTCS</a>!
Link to research paper: <a href="https://arxiv.org/abs/2309.15870">arXiv:2309.15870</a>.</p>
<h2 id="description-of-the-game">Description of the Game<a class="headerlink" href="#description-of-the-game" title="Permanent link">¶</a></h2>
<p>An informal description of hand cricket can be found on
<a href="https://www.instructables.com/How-to-Play-Hand-Cricket/">this instructibles page</a>,
or on <a href="https://theshubhamarya.github.io/HandCricket/">this iOS app's website</a>.
Here I describe it formally to make it amenable to mathematical analysis.</p>
<p>Hand cricket is a game played by two players: a <em>batter</em> and a <em>bowler</em>.
The game is parametrized by a sequence <span class="katex"><span aria-hidden="true" class="katex-html"><span class="base"><span class="strut" style="height:0.6833em;"></span><span class="mord mathnormal" style="margin-right:0.05764em;">S</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">:=</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em;"></span><span class="mopen">[</span><span class="mord"><span class="mord mathnormal">s</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3011em;"><span style="top:-2.55em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">1</span></span></span></span><span class="vlist-s"></span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mpunct">,</span><span class="mspace" style="margin-right:0.1667em;"></span><span class="mord"><span class="mord mathnormal">s</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3011em;"><span style="top:-2.55em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">2</span></span></span></span><span class="vlist-s"></span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mpunct">,</span><span class="mspace" style="margin-right:0.1667em;"></span><span class="minner">…</span><span class="mspace" style="margin-right:0.1667em;"></span><span class="mpunct">,</span><span class="mspace" style="margin-right:0.1667em;"></span><span class="mord"><span class="mord mathnormal">s</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.1514em;"><span style="top:-2.55em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight">n</span></span></span></span><span class="vlist-s"></span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mclose">]</span></span></span></span>
of non-negative real numbers, called the <em>score vector</em>.</p>
<p>The game consists of multiple rounds (called <em>bowls</em> in cricket terminology).
In each round, the batter and the bowler simultaneously pick a number from <span class="katex"><span aria-hidden="true" class="katex-html"><span class="base"><span class="strut" style="height:0.6444em;"></span><span class="mord">1</span></span></span></span> to <span class="katex"><span aria-hidden="true" class="katex-html"><span class="base"><span class="strut" style="height:0.4306em;"></span><span class="mord mathnormal">n</span></span></span></span>.
Suppose the batter selects <span class="katex"><span aria-hidden="true" class="katex-html"><span class="base"><span class="strut" style="height:0.6595em;"></span><span class="mord mathnormal">i</span></span></span></span> and the bowler selects <span class="katex"><span aria-hidden="true" class="katex-html"><span class="base"><span class="strut" style="height:0.854em;vertical-align:-0.1944em;"></span><span class="mord mathnormal" style="margin-right:0.05724em;">j</span></span></span></span>.
If <span class="katex"><span aria-hidden="true" class="katex-html"><span class="base"><span class="strut" style="height:0.6595em;"></span><span class="mord mathnormal">i</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:0.854em;vertical-align:-0.1944em;"></span><span class="mord mathnormal" style="margin-right:0.05724em;">j</span></span></span></span> (called <em>collision</em> or <em>bowling out</em>),
the game ends and no more rounds are played.
Otherwise, if <span class="katex"><span aria-hidden="true" class="katex-html"><span class="base"><span class="strut" style="height:0.8889em;vertical-align:-0.1944em;"></span><span class="mord mathnormal">i</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel"><span class="mrel"><span class="mord vbox"><span class="thinbox"><span class="rlap"><span class="strut" style="height:0.8889em;vertical-align:-0.1944em;"></span><span class="inner"><span class="mord"><span class="mrel"></span></span></span><span class="fix"></span></span></span></span></span><span class="mrel">=</span></span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:0.854em;vertical-align:-0.1944em;"></span><span class="mord mathnormal" style="margin-right:0.05724em;">j</span></span></span></span>, then the game proceeds to the next round.</p>
<p>In each round, if the batter picks action <span class="katex"><span aria-hidden="true" class="katex-html"><span class="base"><span class="strut" style="height:0.6595em;"></span><span class="mord mathnormal">i</span></span></span></span>, then she scores <span class="katex"><span aria-hidden="true" class="katex-html"><span class="base"><span class="strut" style="height:0.5806em;vertical-align:-0.15em;"></span><span class="mord"><span class="mord mathnormal">s</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3117em;"><span style="top:-2.55em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight">i</span></span></span></span><span class="vlist-s"></span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span></span></span></span> points.
The batter wants to maximize her total score and the bowler wants to minimize it.</p>
<p>I had come across variants of this game in childhood. I won't discuss them here,
but our research paper mentions them. In fact, in our paper,
we solve a generalization of this game that captures all variants I know of.</p>
<h2 id="results">Results<a class="headerlink" href="#results" title="Permanent link">¶</a></h2>
<p>Each player would have to play randomly, otherwise her opponent may be able to
find out her strategy and defeat her.</p>
<p>We showed that a Nash equilibrium always exists for this game, and there is only one Nash equilibrium.
Basically, this means that there is a unique pair <span class="katex"><span aria-hidden="true" class="katex-html"><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em;"></span><span class="mopen">(</span><span class="mord mathnormal">x</span><span class="mpunct">,</span><span class="mspace" style="margin-right:0.1667em;"></span><span class="mord mathnormal" style="margin-right:0.03588em;">y</span><span class="mclose">)</span></span></span></span> of randomized strategies
and a number <span class="katex"><span aria-hidden="true" class="katex-html"><span class="base"><span class="strut" style="height:0.625em;vertical-align:-0.1944em;"></span><span class="mord mathnormal">ρ</span></span></span></span> such that:</p>
<ol>
<li>If the batter uses strategy <span class="katex"><span aria-hidden="true" class="katex-html"><span class="base"><span class="strut" style="height:0.4306em;"></span><span class="mord mathnormal">x</span></span></span></span>, then the expected value of the total score is at least <span class="katex"><span aria-hidden="true" class="katex-html"><span class="base"><span class="strut" style="height:0.625em;vertical-align:-0.1944em;"></span><span class="mord mathnormal">ρ</span></span></span></span>,
regardless of what strategy the bowler uses.</li>
<li>If the batter doesn't use strategy <span class="katex"><span aria-hidden="true" class="katex-html"><span class="base"><span class="strut" style="height:0.4306em;"></span><span class="mord mathnormal">x</span></span></span></span>, then it's possible for the bowler to use a strategy
that gives expected total score less than <span class="katex"><span aria-hidden="true" class="katex-html"><span class="base"><span class="strut" style="height:0.625em;vertical-align:-0.1944em;"></span><span class="mord mathnormal">ρ</span></span></span></span>.</li>
<li>If the bowler uses strategy <span class="katex"><span aria-hidden="true" class="katex-html"><span class="base"><span class="strut" style="height:0.625em;vertical-align:-0.1944em;"></span><span class="mord mathnormal" style="margin-right:0.03588em;">y</span></span></span></span>, then the expected value of the total score is at most <span class="katex"><span aria-hidden="true" class="katex-html"><span class="base"><span class="strut" style="height:0.625em;vertical-align:-0.1944em;"></span><span class="mord mathnormal">ρ</span></span></span></span>,
regardless of what strategy the batter uses.</li>
<li>If the bowler doesn't use strategy <span class="katex"><span aria-hidden="true" class="katex-html"><span class="base"><span class="strut" style="height:0.625em;vertical-align:-0.1944em;"></span><span class="mord mathnormal" style="margin-right:0.03588em;">y</span></span></span></span>, then it's possible for the batter to use a strategy
that gives expected total score more than <span class="katex"><span aria-hidden="true" class="katex-html"><span class="base"><span class="strut" style="height:0.625em;vertical-align:-0.1944em;"></span><span class="mord mathnormal">ρ</span></span></span></span>.</li>
</ol>
<p>Moreover, the Nash equilibrium is given by eigenvectors of an appropriate matrix,
and we give an efficient algorithm to compute the Nash equilibrium.</p>
<h2 id="how-popular-is-hand-cricket">How popular is hand cricket?<a class="headerlink" href="#how-popular-is-hand-cricket" title="Permanent link">¶</a></h2>
<p>Hand cricket was very popular at my school (in Delhi).
Later I found that many of my friends, from all around India, have played hand cricket.</p>
<p>I decided to look more into this. I posted a survey on two WhatsApp groups I was part of,
and here are the results:</p>
<ol>
<li>BITS Pilani CS undergrads (96 students, 30 responded, 56 didn't respond):<ol>
<li>Have played it: 27</li>
<li>Have heard of it but not played it: 1</li>
<li>Never heard of it: 2</li>
</ol>
</li>
<li>UIUC Fall 2021 grad students (245 students, 29 responded, 216 didn't respond):<ol>
<li>Have played it: 26</li>
<li>Have heard of it but not played it: 1</li>
<li>Never heard of it: 2</li>
</ol>
</li>
</ol>
<h2 id="how-this-project-started">How this project started<a class="headerlink" href="#how-this-project-started" title="Permanent link">¶</a></h2>
<p>I started working on this problem in January 2023 as a hobby project.
Then I told Aniket about it and we started working together.</p>
<p>I was taking the course <a href="https://courses.illinois.edu/schedule/2023/spring/CS/598">CS 598 TH1</a>
(Recent Advances in Theoretical Computer Science) in spring 2023, where I had to do a research project.
I and Aniket teamed up for the project and we were thinking of working on a variant of bin packing.
Obviously, I wasn't going to suggest hand cricket as a course project, because it seemed too
silly for <em>actual</em> research (and also it didn't fit the theme of the course).
But I was forced to do so when the deadline was close enough
and we hadn't done anything for the course project.
Hand cricket didn't seem as silly at that point, since by then we had
generalized our hand cricket results to arbitrary payoff matrices.
The course instructor, Prof. Ruta Mehta, accepted it, and I got to work on it as part of the course!
She seemed happy with our results, and she suggested that we may be able to
publish our results in some <em>okayish</em> (paraphrased) conference if we could improve them a bit.</p>
<p>I continued working on hand cricket during the summer.
It turned out to be a very interesting problem with beautiful math underneath.
We submitted it to FSTTCS. I guessed FSTTCS would be more likely to have Indian reviewers,
so they may care about hand cricket more.
We used standard game-theoretic terminology in our paper instead of cricket terminology,
though we did mention hand cricket as one of the main applications.
Even our title had nothing to do with hand cricket:
'Nash Equilibrium of Two-Player Matrix Games Repeated Until Collision'.
The paper was accepted and the reviews were good.
None of the reviewers mentioned hand cricket, which I have mixed feelings about:</p>
<ol>
<li>How can they not know about such a popular game?!</li>
<li>They liked our paper despite no apparent interest in hand cricket!</li>
</ol>
<p>I enjoyed working on this problem a lot. Aniket has been an awesome collaborator.
I'm grateful to Prof. Ruta Mehta for forcing me to work on something other than fair division,
being supportive of my foray into hand cricket, and reviewing our manuscript.
My advisor, Prof. Jugal Garg, also offered valuable comments on our manuscript.</p>