Jekyll2019-08-01T16:18:42+00:00https://sagnikb.github.io/feed.xmlThoughts, QuantizedHomepage for Sagnik Bhattacharya, Electrical Engineering undergrad at IITKSagnik Bhattacharyasagnikb@iitk.ac.inVolumes of spheres in discrete metrics2019-04-20T08:30:00+00:002019-04-20T08:30:00+00:00https://sagnikb.github.io/blogposts/leemetric<p>Recently I co-authored a <a href="/assets/pdfs/Lee_metric.pdf">paper</a> with <a href="#">Prof Adrish Banerjee</a>, which we submitted to <a href="https://2019.ieee-isit.org/">ISIT 2019</a>, and I thought I would go over the key ideas in the paper as a blog post. Our main concern was to find out the volume of spheres in discrete metrics, and applications of the method to the Lee metric.</p>
<h1 id="background">Background</h1>
<p>Why would it be an interesting problem to talk about the Lee metric and bounds of the kind that we were looking for? It turns out that there are quite a few applications for results of this sort.</p>
<p>A bound on the volume of a sphere in a discrete metric is used to find bounds on the limits of reliable communication over a channel (more on that later). We actually see this in the paper itself - the moment we obtain an upper bound on the volume of a sphere in the Lee metric, we could use known results to immediately find analogues of the binary Hamming, Elias-Bassalygo and Gilbert-Varshamov bounds in the case of the Lee metric (more on all of these later). The basic utility of bounds on the limits of reliable communication over a channel should be clear - it gives people who design communication protocols something to aim at, and if such a design hits the upper bound, we know that one cannot do better, at least from the rate point of view (one could still improve things like encoding-decoding efficiency etc.). There are other examples too - consider the result of <a href="/assets/pdfs/Shared_randomness.pdf">another paper</a> that I was a co-author on that was also accepted to ISIT, where we showed that if the capacity under vanishing average error of a channel does not equal the zero-error capacity (both of these terms will also be talked about later in slightly more detail) of the channel, we need at least <script type="math/tex">\log(n)</script> bits of common randomness, where <script type="math/tex">n</script> is the blocklength of the code, to communicate reliably at capacity over the channel. Common randomness being a valuable resource (it is hard to generate and distribute such randomness), such a bound is good to know. How to show such a gap exists? We need an upper bound on the capacity of the kind that our results help us find.</p>
<p>This is the thing that brought our attention to this problem in the first place. We already knew the common randomness result, and we knew that the gap exists for the Hamming metric, but we thought it would be interesting to show that the gap exists for a more general channel - enter the Lee metric.</p>
<h2 id="why-is-a-metric-important">Why is a metric important?</h2>
<p>Before proceeding further, let me quickly talk about metrics and why they are useful in information and coding theory. So a major subfield of information theory involves finding the limits of reliable communication over a particular channel. Now <em>reliable</em> can be defined in various ways - two of which are</p>
<ul>
<li>we want the <em>average</em> error to go down to zero when we use the channel multiple times</li>
<li>we want the error to be <em>exactly</em> zero for all channel uses</li>
</ul>
<p>In most cases, the maximum rate at which we can transmit information in the first case will be higher than the maximum rate for the second case. Now, any transmission is done using an <em>encoder-transmitter</em> pair and a <em>receiver-decoder</em> pair, with a (possibly noisy) channel in between. In recovering the transmitted data from the noisy data at the receiver, it makes intuitive sense that the decoder should choose the most probable transmitted codeword given the model of the channel noise and the received data, an idea called <strong>M</strong>aximum <strong>L</strong>ikelihood (ML) decoding. This is where the metric comes in. If the channel noise model is sufficiently ‘nice’ we can replace the ML decoding at the decoder by using a metric (which is just a measure of distance) such that choosing the nearest neighbour in the set of all possible transmitted codewords to the received data, we get the same result as what we would get if we were to use ML decoding. When this happens, we say that the metric is <em>matched</em> to the channel under consideration. Note that the metric that will be used depends crucially on the encoder, noise model of the channel, and the decoder. This idea will become clearer in the next section.</p>
<h2 id="the-hamming-and-the-lee-metrics">The Hamming and the Lee metrics</h2>
<p>Two metrics that have been studied relatively deeply in the literature are the Hamming metric and the Lee metric. The Hamming metric is a very simple metric - given two <script type="math/tex">n</script>-length words <script type="math/tex">a</script> and <script type="math/tex">b</script>, it counts the number of differences between them. It is useful in cases where, given any two distinct <em>symbols</em> (not words) <script type="math/tex">a</script> and <script type="math/tex">b</script>, the probability that the channel corrupts <script type="math/tex">a</script> to <script type="math/tex">b</script> is the same, and this probability remains the same if the pair <script type="math/tex">(a, b)</script> is replaced by any other distinct pair <script type="math/tex">(a',b')</script>. Even though this metric is really simple, it can be used to describe a large class of encoder, decoder and channel combinations, and thus has been the most well-studied metrics in information and coding theory. The Lee metric is useful whenever symbols closer together are more probable to corruption than symbols further apart, and the decision of the ‘closeness’ of two symbols is made by arranging the symbols in a circle (for example, the first symbol and the last symbol are considered adjacent, which wouldn’t be the case if they were on a line).<sup id="fnref:1"><a href="#fn:1" class="footnote">1</a></sup></p>
<h2 id="rate-distance-trade-offs">Rate-Distance Trade-offs</h2>
<p>Another interesting concept is that of a rate-distance trade-off. It again makes intuitive sense to say that if two codewords are far apart in a suitable metric, then the probability that the channel will confuse the two is low. So, to protect against as many errors as possible, we want our codewords to be as far off from each other as possible. However, in a finite space, we can only pack so many codewords that are all pair-wise more than a given distance away. So, given the number of errors a code can handle, we get a bound on the number of codewords we can use. If we use <script type="math/tex">n</script>-length code, the number of such codewords grows exponentially in <script type="math/tex">n</script>, and therefore it makes sense to define the rate as <script type="math/tex">\log \mathcal{M}(n)/n</script>, where <script type="math/tex">\mathcal{M}(n)</script> is the number of possible <script type="math/tex">n</script>-length messages. In the case of the error being exactly zero, we want there to be no codewords in a sphere around a given codeword. For average error going to zero, we can allow small intersections between the spheres. Note that this means that finding how many <script type="math/tex">n</script>-letter words are there in a neighbourhood of a given radius around a point is going to be important because we have to ensure that none of these is part of the code that we are going to use.</p>
<p>In the rest of this post, we will be concerned with only zero-error information theory, the second error criteria used above. In this case, we know a lot for the Hamming metric - given a particular rate, we know that a particular rate is achievable (that is, we can construct a code that achieves that rate), and we know that some rates are not achievable. The achievability result is via the Gilbert-Varshamov bound, while there are several upper bounds known (like the Hamming, singleton and Elias-Bassalygo bounds). Unfortunately, these do not match, and a gap exists <sup id="fnref:2"><a href="#fn:2" class="footnote">2</a></sup> which has been an open problem for quite some time now.</p>
<figure>
<img src="/assets/images/bounds.svg" width="100%" alt="Binary Hamming metric" /><br />
<div class="divider"></div>
<figcaption> What the bounds look like for the Hamming metric. The Gilbert-Varshamov bound is the achievability result. The rest are upper bounds. Note the gap between them. </figcaption>
<div class="divider"></div>
</figure>
<p>In the case of the Lee metric, far less is known. We saw above why it is important to bound the number of words that are within a given distance away from a point, a quantity that we will call the size of a ball in the metric. The main difficulty in the case of the Lee metric is that it is much harder to find the size of a ball in the Lee metric than it is in the Hamming metric. Assuming we know the size of the ball in the Lee metric, a formula for each of the rate-distance bounds mentioned above appears in a wonderful book - <em>Algebraic Coding Theory</em> by Elwyn Berlekamp.</p>
<p>So now, the issue is to figure out what the size of a ball in the Lee metric is. This is the main content of our paper. Once we had this result, we were able to use Berlekamp’s work to immediately obtain the above-mentioned bounds for the Lee metric.</p>
<h1 id="our-approach">Our approach</h1>
<h2 id="first-steps">First steps</h2>
<p>The first step was essentially a rediscovery of results that were known when Berlekamp wrote his book in the 60s. The idea is that one can think of this problem as estimating a particular coefficient in the expansion of a particular generating polynomial for the metric. To gain some intuition for this, consider the simple case of the binary Hamming metric, and suppose we need to find all the <script type="math/tex">n</script>-letter words that are a Hamming distance <script type="math/tex">d</script> away from the word <script type="math/tex">(0, \ldots, 0)</script><sup id="fnref:3"><a href="#fn:3" class="footnote">3</a></sup>. The Hamming metric just says that if there are <script type="math/tex">d</script> locations where two equal length words differ, the Hamming distance is <script type="math/tex">d</script>. The required number of words is given by the number of choices of <script type="math/tex">d</script> positions out of <script type="math/tex">n</script> that will have <script type="math/tex">1</script>’s, which is simply <script type="math/tex">\binom{n}{d}</script>. This is also the coefficient of <script type="math/tex">x^d</script> in the polynomial <script type="math/tex">(1+x)^d</script>. One simple way to understand the equivalence is that this coefficient also involves the choice of <script type="math/tex">d</script> <script type="math/tex">1</script>’s from <script type="math/tex">n</script> choices.</p>
<p>This idea generalises to the Lee metric. Say the alphabet size in the Lee metric is <script type="math/tex">5</script>. Then the generating polynomial is given by <script type="math/tex">(1 + 2x + 2x^2)</script>, and the problem of finding the size of the Lee ball of radius <script type="math/tex">d</script> reduces to finding the coefficient of <script type="math/tex">x^d</script> in <script type="math/tex">(1 + 2x + 2x^2)^n</script>. Now, this is not an especially easy problem, because no such simple idea as the one in the case of the Hamming metric works in this case. There exist formulae for this (also known from the 60s), but they are a) difficult to use and b) do not give much insight to the problem. I was at this time doing an online course on analytic combinatorics on Coursera, and there they talked about problems of this form and how to find analytic solutions for the same. I learned a lot of interesting new approaches to solving problems like this (in fact the first time I thought about the generating polynomial method of solving the problem was while doing the course), but ultimately in turned out that the techniques in the course weren’t well suited for this particular application (in particular because here we need to fix <script type="math/tex">n</script> to be a particular finite value and there one could take the limit as <script type="math/tex">n \rightarrow \infty</script>, and the forms of the polynomials that we were working with could not be handled very easily via the techniques proposed in the course).</p>
<h2 id="a-question">A question</h2>
<p>While spending a few weeks trying to use techniques from analytic combinatorics and ruling them out one by one, I noticed that even the Hamming metric calculations are done using assuming that we are finding the coefficient of some <script type="math/tex">x^d</script> where <script type="math/tex">d</script> is then the location of the largest coefficient. I figured it would be a start if we could at least figure out where the maximum coefficient would be, we would at least know the parameter range where we would be working. After a few days wrestling with this problem, I seemed to have guessed a solution to it but was not able to prove it myself. So I posted the following question on the Mathematics StackExchange - <a href="https://math.stackexchange.com/questions/3057144/largest-coefficient-in-the-power-of-a-polynomial">Largest coefficient in the power of a polynomial</a>. A couple of answers could be used to get a proof of the maximum coefficient, and I finally hit upon <em>some</em> path of progress - I could use the central limit theorem to find the required coefficients for large enough <script type="math/tex">n</script>. Using Python’s <code class="highlighter-rouge">numpy.polynomial</code>, I was able to get some graphs that showed me how the coefficients were behaving and how the normal approximation looked. I tried to use the results to obtain the bounds that we want, but the results were rather bad - they didn’t even match the known results for the Hamming case, leave alone the Lee metric. When I went to see what the problem was, it was quite apparent - I had been using the log scale to look at the graphs, and the normal approximation was really good close to the peak but was really bad away from it. The log scale hid the fact that a couple of standard deviations away from the peak, the approximation was giving a value many orders of magnitude more than the actual value (say <script type="math/tex">10^{10}</script> times higher).</p>
<h2 id="large-deviations-and-sanovs-theorem">Large Deviations and Sanov’s theorem</h2>
<p>This was a problem that reeks of large deviation theory - but it took me some time to recognise that because I had not used it before. Large deviation theory, as the name says, gives good bounds when one is working more than a few standard deviations away from the central peak.</p>
<p>One of the basic results in large deviation theory is something called Sanov’s theorem. It gives a powerful bound on the size of a set of type classes drawn from a probability distribution. The idea is as follows - suppose we have a discrete probability distribution, like the one that governs what face of a die comes up when it is thrown. Now, if we sample the probability distribution <script type="math/tex">n</script> times (throw the die <script type="math/tex">n</script> times), the outcomes will probably not be distributed exactly like the underlying distribution, but would be something called the empirical distribution - in the case of a die, this would consist of the number of times each number came up when the die was thrown <script type="math/tex">100</script> times. Empirical distributions are also called types, a powerful concept in information theory, with several very nice properties. A type class is the set of all outcomes which have the same type <sup id="fnref:4"><a href="#fn:4" class="footnote">4</a></sup>. Now, given a set of types, Sanov’s theorem allows us to bound the size of that set of types - the number of sequences such that their type is in the set. In our case, the class is just the set of all types such that the expected value with that probability distribution is less than <script type="math/tex">d/n</script>. This could be calculated using the normal approximation, but as mentioned earlier, the bounds obtained from it are pretty poor away from the peak.</p>
<h2 id="convex-optimisation">Convex Optimisation</h2>
<p>Sanov’s theorem requires us to find the type in the set that has the minimum relative entropy with the underlying probability distribution. This is a convex optimisation problem, and one could take its dual. The dual problem was just a complicated single variable optimisation that became something that I could handle without any of the sophisticated methods used to solve convex optimisation problems, using some Python code that ran reasonably quickly. This was part of the problem solved - numerically finding this maximising parameter gave some upper bound on the required coefficient. I wanted something better.</p>
<h2 id="a-weird-function">A weird function</h2>
<p>By the duality properties of convex optimisation it was clear that any positive value of the single parameter that the dual was over would work, so what remained was to choose what the positive value would be as a function of the expected value that was used to define the type class. I plotted out what the optimal value looked like, and it seemed an odd kind of curve. Now the first thing that entered my head was that the negative of the curve looked like a <script type="math/tex">q</script>-th root function, appropriately scaled and shifted. Now, using <code class="highlighter-rouge">curve_fit</code> from <code class="highlighter-rouge">scipy.optimize</code> in Python, I was able to fit it to other functions, like polynomials or exponentials, but either they were very sensitive to parameters or were not very good fits - something that can be quantified using the output of the <code class="highlighter-rouge">curve_fit</code> function. Anyway, it turned out that the best fit among all the functions I tested was indeed given by that weird function, and that’s what found its way into the paper. We also found that perturbing the optimal values for the constants in this fit did not affect the final result much - so this fit was robust in some sense. If you look at the curve and some other functional form comes to your mind, I would love to know it!</p>
<h1 id="final-thoughts">Final thoughts</h1>
<p>Once we obtained the formula for the size of the Lee ball, all that remained to do was to substitute the result in the formulae from Berlekamp’s book and plot the results. The results for <script type="math/tex">q = 6</script> are shown below. We also verified that <script type="math/tex">q = 2</script> with our method gives the same results as the binary Hamming case pointed out above - one way in which we were able to be somewhat sure that the method works.</p>
<figure>
<img src="/assets/images/Leebounds.svg" width="100%" alt="Lee metric for q=6" /><br />
<div class="divider"></div>
<figcaption> What the bounds look like for the Lee metric with alphabet size of \(6\). Note a few similarities with the Hamming case. The GV and EB bounds agree on where the rate is zero (\(\delta = 1.5\)). There is again a gap between the upper and lower bounds, and the EB is again the tightest upper bound.</figcaption>
<div class="divider"></div>
</figure>
<figure>
<img src="/assets/images/comparisonbounds.svg" width="100%" alt="Comparison with the Hamming case" /><br />
<div class="divider"></div>
<figcaption> Our technique (markers) compared with the known results for the Hamming metric case (lines). </figcaption>
<div class="divider"></div>
</figure>
<p>If you are wondering what we used to make the graphs, there’s a very nice way of using Latex in <code class="highlighter-rouge">matplotlib</code> in Python, and <code class="highlighter-rouge">matplotlib</code> can also be made to output the graphs in SVG, for the rather good looking graphs that you see both in this post and the paper.</p>
<p>If you are interested in looking at out code, it is all reasonably well documented and <a href="https://github.com/sagnikb/LeeMetric">uploaded on Github</a>. If you have any thoughts about this work, use the comment section below or get in touch via email. Provided things work out, I might be presenting this at <a href="https://2019.ieee-isit.org/">ISIT 2019</a>, so this might not be the last time that this paper is featured on this blog.</p>
<hr />
<div class="footnotes">
<ol>
<li id="fn:1">
<p>Brief side note here. One might wonder about the metric that describes the situation where ‘closeness’ is defined by arranging on a line and not a circle. In this case, it can be shown that there are no channels that are matched to this metric, and so, even though the metric is mathematically interesting. it doesn’t concern us that much here (it’s not just mathematically interesting, but a situation where it would be of interest to an information/communication theorist would be too big a detour for this blog post.) <a href="#fnref:1" class="reversefootnote">↩</a></p>
</li>
<li id="fn:2">
<p>In the Hamming case the gap exists for alphabet sizes less than <script type="math/tex">49</script>, above which there is a construction based on algebraic geometry that closes the gap. <a href="#fnref:2" class="reversefootnote">↩</a></p>
</li>
<li id="fn:3">
<p>Point to note - for ‘nice’ metrics, one can always translate in this way to calculate the size of the neighbourhood around zero. <a href="#fnref:3" class="reversefootnote">↩</a></p>
</li>
<li id="fn:4">
<p>One of the cool properties of types is that all members of the type class have the same probability. <a href="#fnref:4" class="reversefootnote">↩</a></p>
</li>
</ol>
</div>Sagnik Bhattacharyasagnikb@iitk.ac.inOn the paper 'A method to find the volume of a sphere in the Lee metric, and its applications'One More April Puzzle2019-04-01T06:30:00+00:002019-04-01T06:30:00+00:00https://sagnikb.github.io/blogposts/One-More-April-Puzzle<p>On a <em>melancholy</em> spring evening, you doze off. When you wake up, you find yourself in mathematical utopia - every plane surface is perfectly plane, and ever sphere perfect. In front of you is a perfectly vertical wall that is exactly perpendicular to the infinite plane that you are standing on. On the wall, there is a strange shelf, and lying around are exactly <del>six</del> seven spherical balls of lead. You pick up the one on the ground and ponder about what you’re seeing. The wall is shown in the diagram below.</p>
<p><img src="/assets/images/april.svg" alt="" /></p>
<p>You note the date, and it is April 1, 2019. You realise that if you find what the thing in front of you means, you’ll be able to cause a new <em>renaissance</em> in your own world when you wake up. It’s not long before you are snatched out of this utopia, this Garden of Euler - so think fast!</p>
<p>Oh yes, this world is non-ideal in one way - every collision is completely inelastic.</p>
<h2 id="hint">Hint:</h2>
<p><img src="/assets/images/rhino.png" alt="" /></p>Sagnik Bhattacharyasagnikb@iitk.ac.inOne more special puzzle to celebrate April Fools DayShannon’s Channel Coding Theorem2018-07-27T08:30:00+00:002018-07-27T08:30:00+00:00https://sagnikb.github.io/blogposts/cool-new-way-to-understand-Shannon-result<p>Let me start with some quick praise of MIT and its educational outreach programs, mainly via <a href="https://ocw.mit.edu/index.htm">MIT-OCW</a> and MITx courses on <a href="https://www.edx.org/">edX</a>. These have been an integral part of my college life and as noted <a href="/blogposts/Why-quantum">here</a>, are one of the reasons I am studying the things that I do. <sup id="fnref:1"><a href="#fn:1" class="footnote">1</a></sup></p>
<p>Coming to the point - I was going through a course on Quantum Error Correction, Complexity and Fault Tolerance offered by MIT on edX. Even though I wasn’t able to complete it on time because I discovered it very late, I learned a lot from that course, one of which I will talk about in this post.</p>
<p>So Prof Isaac Chuang wanted to quickly explain the point of Shannon’s Channel Coding theorem in order to draw connections with von Neumann’s pioneering observations in fault tolerant computing, and he came up with an interesting way to put it that I hadn’t explicitly thought about before.</p>
<p>A quick description of the setting of the channel coding problem: suppose Alice and Bob are trying to talk to eachother and they have to do so over a noisy channel (which may simply be the air from Alice’s mouth to Bob’s ear in a noisy marketplace). Somehow, Alice and Bob must ensure that they are able to communicate with low rate of error even over such a channel. Shannon’s channel coding theorem tells us something non-trivial about the rates at which it is possible to communicate and the probability of error involved, but to understand why it is so cool let’s spend some time imagining that we don’t know what Shannon’s result is and think about what we might intuitively expect to happen.</p>
<p>Imagine a professor lecturing in a noisy classroom. We might expect that if he speaks faster and faster, then it will become more and more difficult to understand what he’s saying, that is, the probability of error will increase. He might need to repeat what he said, but that would only reduce the rate. Therefore, it is reasonable to expect that as the rate increases, the communication becomes more and more error-prone. If we plot the probability of error versus the rate of speaking, intuitively we might expect to see something like this…</p>
<figure>
<img src="https://lh3.googleusercontent.com/NhANZjrNhLam1Sz4DaGCtKQVTOsJg5KCB_JI47W0RU_ECyYF99csfK2R0P82f1rGlmZ2MikhUJLYT6U5vjQZf1d_RjmefLnpc3v5fyPwxWMOfitteGD_QrTXO2yqfvx1X6aTEh2Y-NY=w2400" width="70%" alt="Intuition says..." /><br />
</figure>
<p>However, Shannon showed that this is not the case. His result basically showed that there is a rate C, called the capacity, associated with a channel which precisely characterises what rates are possible and what are not. Every rate below C can be achieved with negligible probability of error (in the limit of large block-lengths, a subtlety that, along with several others, I will ignore to make in order to illustrate the point here) and every rate higher than C will result in error probability bounded away from zero (that is, always greater than some number which is greater than zero). In fact, it was shown later that when the rate is higher than C, the probability is actually very close to one, and if we re-draw the graph, we get something like this…</p>
<figure>
<img src="https://lh3.googleusercontent.com/2RJYbUwSOYv2_yUYnaNxmyQt6ZiFYQMoLn9bY1DzFPzKkwLN3WvN6PxeXb2ON8WoaS-4vHTw0RaFVmP_x6Yko55HCpIsD8f9yvljW1676NphcTI_MtBfEejRO2-iXgDXEUdRdpaJLgM=w2400" width="70%" alt="Intuition says..." /><br />
</figure>
<p>This is precisely the non-intuitive content of Shannon’s channel coding theorem. A similar result was derived by von Neumann where he showed that as long as the basic gates used in constructing a computer are more reliable than a certain threshold, one could make a highly precise computer. What prompted him to think in this direction and why that result is hugely important today is an interesting tale in its own right, and one that I won’t be attempting here.</p>
<p>The impact of Shannon’s results can hardly be overstated - one could argue that his highly original ideas ultimately kickstarted the communication revolution that has ended up giving us mobile phones, the Internet etc. This way of looking at it gives us a way to appreciate Shannon’s result without going into any math whatsoever.</p>
<div class="footnotes">
<ol>
<li id="fn:1">
<p>Quick side note: that link is a bit backdated at this point. Information and coding theory have gained a good amount of real estate since then as far as my interests are concerned, but that is another story for another day. <a href="#fnref:1" class="reversefootnote">↩</a></p>
</li>
</ol>
</div>Sagnik Bhattacharyasagnikb@iitk.ac.inThe (highly) non-trivial content of Shannon's Channel Coding theoremTravelogue – Old Bangkok2018-06-25T08:30:00+00:002018-06-25T08:30:00+00:00https://sagnikb.github.io/blogposts/bangkok<p>The whiff of Sanskrit and by extension my homeland of India that I got as our flight touched down at the Suvarnabhumi International Airport of Bangkok would only get stronger as we saw the sights in the city. If the decorations in the airport seemed vaguely similar to certain temple decorations in India, the paintings depicting scenes from the Ramayana on some of the walls of the temples of old Bangkok almost made me believe I was in India. Such is Bangkok and Thailand – a country with a culture that is at once very similar to and very different from the familiar surroundings of India.</p>
<figure class="">
<img src="https://lh3.googleusercontent.com/GIUX5iYPB9_n5c_u8lAgxdY-ofNle5fPanHcyrCkNN35bwSi84EA8jwjsJWR1C2vf7SgcHqG_wuGe1yuWtMbqi898RHzMCrhSC17tsbKsH6t5dvHJX9HwQEVSP5Z46lkkoTdKtxiL1s=w2400" alt="A temple complex" />
</figure>
<p>On second thoughts, I should not have been surprised to know that King Rama still reigns in Thailand and that the old capital of Thailand is called Ayutthaya after Ayodhya, the birthplace of Lord Rama in Hindu mythology – after all, the largest Hindu temple in the world is not in India, but is the Angkor Wat temple in modern day Cambodia. It is a pity that the history of the golden age of the south Indian empires like the Cholas is not taught much in Indian history at the school level, for it is partly because of them and their empires that stretched across southeast Asia that many countries in this part of the world still contain strong imprints of medieval Indian culture. Thailand is one of these countries – even though the dominant religion now is Buddhism, there are fingerprints of Hinduism all over the country. Apart from the Sanskrit place names and the wall paintings, this is also somewhat visible in the art styles and traditional clothes of the country. Analysis of the art forms and other historical evidence suggests that even Theravada Buddhism was introduced to Thailand via the Gupta empire.</p>
<figure class="">
<img src="https://lh3.googleusercontent.com/r-L6poumybRYs_LwlvPhIb-fUGLHNesCXOC2n8kAaZOR3_biaffKmjGooylTFY_RX_iBvQ7j8NTCtQLu2GCMf57zQ6ryN7FLhrtXNQapeQV6E7AffU05zqU_f1KeYgxixzvrKfDmgnM=w2400" alt="Wat Pho Reclining Buddha" />
<figcaption>
The Reclining Buddha of the Wat Pho Temple Complex, Bangkok. The people in the frame can give you an idea of how big the statue is. ‘Architecture as power’ was nowhere more apparent than in front of the gigantic reclining Buddha in the Wat Pho temple complex.
</figcaption></figure>
<p>The old part of the city of Bangkok is where these similarities could be seen the most. Apart from the paintings from the Ramayana on the temple walls as mentioned earlier, it was interesting to note that the Buddha statues and the style that they were painted in. Unlike the Chinese style, these idols had faces that looked familiar from several places in India, like the Ajanta and Ellora caves. Of course, the ornamentation and the use of gold was something that is not seen in the Ajanta and Ellora caves, and neither is the elaborate decoration seen in some of the Buddha statues.</p>
<figure class="half ">
<img src="https://lh3.googleusercontent.com/lnbeOSvCYyd3gU6OHRk0M-ROM84Xtllkf2oXzMt0-pY-Iv4_8cYb3cjwmmwpw9IK9Ztx67SpJHcNGQzKIvmKhJK3vu7doJ3GBshIpP_GnPuIMq922f3qjGWYV-crkrN83i6G88kpNIs=w2400" alt="One of the more Indian looking Buddha idols" />
<img src="https://lh3.googleusercontent.com/NdpeVjDoHXj7YRdKEvsiIq5ezO4KNRc1H0nSvYHVyoBT4N8Ti6dpfXw3kd46Z189IweRM54T4ERv5oSOEBiyxy-l2A8eL1N1h9oWOR68VdEnghoDpYi8T30BRMcxCMDDbAh7f_Ap63s=w2400" alt="A series of Buddha idols in one of the temple complexes" />
<figcaption>One of the more Indian looking Buddha idols along with a series of Buddha idols in one of the temple complexes
</figcaption>
</figure>
<p>The Grand Palace itself has a curious mixture of Asian and European styles that I hadn’t before – in particular, the facade is in European style, while the roof decorations are from South-East Asia. They reminded me of the design of the Khmer civilization buildings in the Age of Empires II Asian Dynasties expansion.</p>
<figure class="">
<img src="https://lh3.googleusercontent.com/r9xmxY-v8-jl5wlm36bpgmaGyhaUUbrmryOXX5dx1PXXqxmjzUHZcxsmot9yNklRNNtLTeItCsUppH_VGrBPFJ-CK7DLGXMRtvHAhhM9B-QB0nSjqJ2LALinmO56kZS8DwH2ivt6Odc=w2400" alt="The Grand Palace, Bangkok" />
<figcaption>
The Grand Palace, Bangkok
</figcaption></figure>
<p>Much of my knowledge of the history of Thailand comes due to a particular tourist attraction that is strongly recommended that you visit if you are going to Bangkok – Jim Thompson’s house. Jim Thompson was an American businessman and architect, who built his house in central Bangkok by putting together six traditional Thai houses and interconnecting them. It is now a museum, housing the substantial collection of art that Mr. Thompson accumulated before his disappearance in 1967. One can find paintings and sculptures from all over southeast Asia in that house, and even if you’re not interested in art or history, you can always check out the tropical garden within the compound. It is here that I found some official source to confirm that Theravada Buddhism was introduced to Thailand via the Gupta Empire of India, which goes a long way to explain why their Buddha statues have faces resembling Buddha faces in the Indian style.</p>
<figure class="">
<img src="https://lh3.googleusercontent.com/3Esh3e5zkd_gGbfMewkdNg4vMLVg_e-VrVosqNKa7xa2cN-zzDzR7lgUYzVQPt8IL4Di3MbrLWSQ2oNyISxIySHUBw4ylCMMtXja8AOPZCSMjDtteLLdzLe0XU1Cxb5zM-1Lg3s-mK0=w2400" alt="A small part of Jim Thompson’s substantial art collection" />
<figcaption>
A small part of Jim Thompson’s substantial art collection
</figcaption></figure>
<p>Something else that I tried during our stay in Bangkok was some interesting food. The most interesting was a serving of traditional pineapple rice, served in an actual pineapple, and I am pleased to say that it tasted delicious! I also had a santol fruit juice – one of the first times that I needed to Google a fruit’s name before actually having it.</p>
<figure>
<img src="https://lh3.googleusercontent.com/U-oUwNz566HOp28TJkywRbWLIHrYrS_tnmGaWYzXhMeNA4RolqRuFA2KZCd_W0AjRlwqiGzbBbZvbMe7vwsoLHeGwLwlQY7BjV-xMNsiU7FMefPzuLGbm6zxVFgPJEtlVKkxo6u7aEg=w2400" alt="santol fruit juice" />
<figcaption>Santol fruit juice</figcaption>
</figure>
<figure class="">
<img src="https://lh3.googleusercontent.com/3vndJwsgRV1ws_SJlLJi9b6vseSltDxnLXdMubME1BwH5Foukr5jKL9152DtUm6nCUda1UeXYLyB3ZlnDx8qIZKvEaqdqiAC8I-90XnMMTeMyZK3hzxMrXoXOGtP3SMVmPco1p30bEY=w2400" alt="pineapple rice" />
<figcaption>
Pineapple on pizza may be an abomination, but pineapple rice, Thailand style, is definitely not!
</figcaption></figure>
<p>The coolest memento I have from my time in Bangkok is a croaking wooden frog – the croaks really are realistic!</p>
<figure class="">
<img src="https://lh3.googleusercontent.com/NxSBBI_DA2Pv1ZhLRwhJSYKY-34clJJy_r0Nl9yUvc2HBA6JFvrWzSKPNg6tdJ628FlIzNWl-qyG4RQVlSh3ZxwmQ0KWOtaPEEkkGTZnDNGTDJkOr85SbL5aeydHTOVSNgTZH2gYDTA=w2400" alt="wooden frog" />
<figcaption>
I now own this funny little wooden frog that can make pretty realistic croaking sounds. It seems these things are pretty popular in Thailand!
</figcaption></figure>
<p>I had this idea before going to Bangkok that the experience of the city was limited to glitzy shopping malls, spas, and parties, but even though we visited a couple of those places too, easily the most surprising part of the trip was the day, or so we spent exploring the old city. This part of the ‘Bangkok experience’ isn’t emphasized much in the stories that people tell of the city, but it’s certainly worth checking out.</p>
<hr />Sagnik Bhattacharyasagnikb@iitk.ac.inAdventures in the old city of BangkokBinary Search, the Ulam game and Coding Theory2018-05-07T08:30:00+00:002018-05-07T08:30:00+00:00https://sagnikb.github.io/blogposts/Ulam<h2 id="introduction">Introduction</h2>
<p>Binary search allows us to search for an entry in a sorted list in <script type="math/tex">\log(n)</script> time. In this post, I shall talk about a more general version, where the answers to some of the queries used during the binary search may be false (which is the Ulam game) and how that is related to adaptive block codes in coding theory and how these ideas help us.</p>
<p>Much of this is based on <a href="http://www.desjardins.org/david/thesis/thesis.pdf">David desJardin’s PhD thesis</a> which gives a general solution to Ulam’s game. I am writing about it because I had heard of the Ulam game where only one lie is allowed from a friend and was surprised to see the same crop up when learning about coding theory. It is not a very difficult topic while also being an interesting extension of something well known, so I thought I could give an overview of the same in a post such as this.</p>
<h3 id="the-ulam-game">The Ulam Game</h3>
<p>The game 20 questions is a specific formulation of the problem of searching for a marked element in an ordered list of elements and is easily solved by binary search. The game itself is the following:</p>
<blockquote>
<p>Alice thinks of a number between one and one million. Bob can ask up to 20 yes/no questions to Alice, each of which Alice answers truthfully. Bob wins if he can determine which number Alice had thought of by asking just the 20 questions.</p>
</blockquote>
<p>Note that <script type="math/tex">2^{20}</script> is <script type="math/tex">1048576</script>, which is just more than a million. Bob always wins because he can do a simple binary search for the number which will give him the answer in <script type="math/tex">\log_2(2^{20}) = 20</script> steps. The questions, in this case, could be of the form:</p>
<ul>
<li>is the number greater than 500,000? If the answer is no,</li>
<li>is the number greater than 250,000?</li>
</ul>
<p>and so on, halving the range every time.</p>
<p>We can formalize this process of questioning in the following way - we can think of each question as a subset of the positive integers below one million, and Alice’s answer is yes if her chosen number belongs to the set and 0 otherwise.</p>
<p>It is interesting to note that Alice need not decide on her number at the beginning - if all her answers are merely consistent with some number that she chooses at the end, Bob still wins.</p>
<p>Stanislaw Ulam proposed a more interesting version of the above in his autobiography, called the Ulam game.</p>
<blockquote>
<p>Someone thinks of a number between one and one million (which is just less than <script type="math/tex">2^{20}</script>). Another person is allowed to ask up to twenty questions, to each of which the first person is supposed to answer only yes or no. Obviously, the number can be guessed by asking first, “Is the number in the first half million?” then again reduce the reservoir of numbers in the next question by one-half, and so on. Now suppose one were allowed to lie once or twice, then how many questions would one need to get the right answer?</p>
</blockquote>
<p>One clearly needs more than <script type="math/tex">n</script> questions for guessing one of <script type="math/tex">2^n</script> objects because one does not know when the lie was told. This problem is not solved in general.</p>
<p>When I first came across this problem via a friend, the question was to find some lower bound on the number of questions needed. One possible lower bound is</p>
<script type="math/tex; mode=display">\log(n) + \log(\log(n))</script>
<p>where all logarithms are to the base-2. The reason is the following: let us perform the binary search again. In the worst case, we will need <script type="math/tex">\log(n)</script> questions before we get a contradiction. Then we need to find the questions to which the answers were wrong, and since there are <script type="math/tex">\log(n)</script> total questions, we need at least <script type="math/tex">\log(\log(n))</script> steps to find such questions.</p>
<p>It turns out that the Ulam game is equivalent to the problem of showing the existence of adaptive block codes of certain parameters, and this will occupy us for the rest of this post.</p>
<h3 id="adaptive-block-codes">Adaptive Block Codes</h3>
<p>Coding theory deals with reliable communication across a noisy channel. Alice and Bob are communicating over a channel that corrupts some of what Alice sends, and the idea is that Alice encodes the data in such a way that Bob can correctly decode it given some reasonable assumptions about the level of noise in the channel.</p>
<p>We can possible classification of channels is into two categories - with feedback and without feedback. <strong>Coding without feedback</strong> depends only on the input, and the transmitter is assumed to have no information about what is happening at the receiver. In the <strong>feedback</strong> case, the encoder is also considered to have access to the information about whether the previously sent information was received in error or not, and can use this information while sending the rest of the data. In our case, this information is assumed to reach the encoder immediately and noiselessly.</p>
<p><strong>Block coding</strong> is a coding technique where the information to be sent is broken up into blocks. Each of these blocks is mapped to chunks of appropriately chosen transmitted bits to reduce the probability of error. This is in contrast to <strong>convolutional</strong> codes where the data to be sent is encoded into the transmitted bits continuously (without breaking into chunks).</p>
<p>Claude Shannon in his landmark 1948 papers showed that associated with every channel, there is a certain rate of communication called the capacity which characterizes it. He demonstrated that codes exist that guarantee nearly error-free communication at rates below channel capacity. He also showed in 1956 that feedback does not increase the theoretical capacity of the forward channel. However, the use of feedback in coding can give us better encoding and decoding strategies; therefore the question of the existence of adaptive block codes is an interesting question.</p>
<h2 id="the-equivalence-between-the-two-problems">The equivalence between the two problems</h2>
<p>The proof of this equivalence is in the PhD thesis mentioned above. Instead of redoing the proof, let’s see why the equivalence intuitively makes sense.</p>
<p>Let us consider what we are actually doing when we say we want an adaptive block code to exist. The message to be sent has been mapped to a chunk of bits to be transmitted, and these bits are transmitted one-by-one. Once each bit is sent the transmitter receives a signal from the receiver informing whether the bit was in error or not. What we want is that after all the bits have been sent, the receiver must be able to figure out which message was sent. The relation with the Ulam game is now clear - think of the bits being sent as being the yes/no questions in the Ulam game and the response from the receiver being the received answer. If in Ulam’s game a number can be pinpointed using <script type="math/tex">N</script> questions, we can say that a message <script type="math/tex">M</script> among <script type="math/tex">2^N</script> possibilities can also be obtained with certainty after the whole process is over. In both cases, the number of errors/lies is assumed to be less than some number <script type="math/tex">E</script>.</p>
<p>The formal statement of the above is the following.</p>
<blockquote>
<p>There exists a winning strategy for Ulam’s game with parameters <script type="math/tex">N</script>, <script type="math/tex">E</script>, <script type="math/tex">M</script> if and only if there exists an adaptive block code with the same parameters.</p>
</blockquote>
<p>Here <script type="math/tex">N</script> is the number of questions in Ulam’s game and the number of transmitted bits in the block code, <script type="math/tex">E</script> is the number of lies in Ulam’s game and the number of errors during transmission and <script type="math/tex">M</script> <script type="math/tex">= 2^N</script> is the number of possible numbers/messages.</p>
<h2 id="solving-the-ulam-problem">Solving the Ulam Problem</h2>
<p>Next, let’s quickly take a look at how to tackle the Ulam game.</p>
<p>First, state space is constructed using tuples of non-negative integers, and a game is defined on it. The game starts with an <script type="math/tex">(E+1)</script>-tuple of non-negative integers, called <script type="math/tex">s_0</script>. There is a translation operator <script type="math/tex">T</script> defined on the tuples that drops the first number in the tuple and retains the rest, taking an <script type="math/tex">(E+1)</script>-tuple to an <script type="math/tex">E</script>-tuple. Bob partitions <script type="math/tex">s_0</script> into <script type="math/tex">a_0</script> and <script type="math/tex">b_0</script> such that</p>
<script type="math/tex; mode=display">a_0, b_0 \in \mathbb{N}^{E+1}</script>
<p>and</p>
<script type="math/tex; mode=display">s_0 = a_0 + b_0</script>
<p>Alice can choose either one of <script type="math/tex">(T \cdot a_0 + b_0)</script> or <script type="math/tex">(a_0 + T \cdot b_0)</script>, her choice becomes <script type="math/tex">s_1</script> and the process is repeated. Bob wins if and only if sum of elements of <script type="math/tex">s_N</script> is <script type="math/tex">0</script> or <script type="math/tex">1</script>, and a state for which Bob wins is called a winning <script type="math/tex">N</script>-state. If <script type="math/tex">s_0</script> is the <script type="math/tex">(E+1)</script>-tuple</p>
<script type="math/tex; mode=display">(0,0,...,0,M)</script>
<p>then this game is shown to be equivalent to Ulam’s game with parameters <script type="math/tex">N</script>, <script type="math/tex">E</script>, and <script type="math/tex">M</script> defined above.</p>
<p>Using this state space representation, certain states are shown to be winning <script type="math/tex">N</script>-states (for suitable <script type="math/tex">N</script>) in the state space, which are called:</p>
<ul>
<li><strong>singlets:</strong> those tuples for which sum of all entries is 1.</li>
<li><strong>doublets:</strong> those tuples for which sum of all entries is 2.</li>
<li><strong>zero-error states:</strong> these are states where <script type="math/tex">E=0</script> (that is, there are no lies). Then the tuple <script type="math/tex">s=(s_0)</script> and such a state is winning <script type="math/tex">N</script>-state iff <script type="math/tex">s_0 \leq 2^N</script>.</li>
<li><strong>Fibonacci states:</strong> these are explicitly constructed states that are part of a winning sequence of states. A sequence of states is called a winning <script type="math/tex">N</script>-state sequence if <script type="math/tex">s_n</script> is winning <script type="math/tex">(N+3n)</script>-state for all <script type="math/tex">n</script>.</li>
</ul>
<p>The volume of an <script type="math/tex">N</script>-state, defined as</p>
<script type="math/tex; mode=display">\text{Vol}_N(s) = \sum_{J = 0}^{E}s_J\sum_{J'=0}^{J} \binom{N}{J'}</script>
<p>is shown to be at most <script type="math/tex">2^N</script> for winning <script type="math/tex">N</script>-states. This is called the <strong>volume bound</strong>.</p>
<p>Winning <script type="math/tex">N</script>-states that meet the volume bound are either singlets or can be shown not to be winning <script type="math/tex">(N-1)</script>-states and are therefore called borderline winning <script type="math/tex">N</script>-states.</p>
<p>Another result called the <strong>translation bound</strong> shows that if <script type="math/tex">s</script> is winning <script type="math/tex">N</script>-state, <script type="math/tex">N \geq 3</script> and sum of all entries in <script type="math/tex">s</script> is at least <script type="math/tex">3</script>, then <script type="math/tex">T \cdot s</script> (the translation operator <script type="math/tex">T</script> acting on <script type="math/tex">s</script>) is a winning <script type="math/tex">(N-3)</script>-state.</p>
<p>A final result called the <strong>summation rule for states</strong> gives a condition on states <script type="math/tex">s</script> that can be shown to be winning <script type="math/tex">N</script>-states based only on the knowledge that certain states <script type="math/tex">c</script> and <script type="math/tex">d</script> are winning <script type="math/tex">N</script>-states.</p>
<p>We can prove certain states are winning <script type="math/tex">N</script>-states using the above results, in the following way. We start with certain states from the four categories that are known to be <script type="math/tex">N</script>-winning, and put them together using the summation rule to find a <script type="math/tex">(N+1)</script>-winning state. This lets us form a binary tree, with the parent being an <script type="math/tex">N</script>-winning state and the children being <script type="math/tex">(N-1)</script> winning states.</p>
<p>All these results allow us to find winning states. There are also some results that allow us to do the opposite, that is, show that some state is a losing state. This is easy if the state violates the volume bound or the translation bound, and in other cases, we can show results of the following form: if a tree rooted at a particular state is of depth <script type="math/tex">x</script> then the volume of the state is less than <script type="math/tex">v</script>. Thus, in some cases, looking at a state we can predict how deep the subtree at that state is.</p>
<p>Of course, because all three of the starting problems are equivalent, each of the winning <script type="math/tex">N</script>-states we find also gives us a solution to the Ulam problem and shows the existence of an adaptive block code with the same parameters. Killing three birds with one stone.</p>
<p>The rest of the thesis uses all of these results to computationally find optimal codes given the parameters <script type="math/tex">N</script>, <script type="math/tex">E</script>, <script type="math/tex">M</script>. Optimal in this case means that an adaptive block code ceases to exist if the value of <script type="math/tex">M</script> is increased by one. The thesis includes parameters for all optimal block codes up to <script type="math/tex">M = 2^{20}</script>, please check that out if you are interested.</p>
<p>As mentioned above, this whole post is based on <a href="http://www.desjardins.org/david/thesis/thesis.pdf">David desJardin’s PhD thesis</a>. Please look at it for further details.</p>Sagnik Bhattacharyasagnikb@iitk.ac.inBinary search with lies allowed and adaptive block codesApril Puzzles2018-05-05T06:30:00+00:002018-05-05T06:30:00+00:00https://sagnikb.github.io/blogposts/April-Puzzles<p>I made these puzzles for Science Coffeehouse and were released on April Fools Day. Needless to say there will be some relation between the day and the puzzles. Don’t look at the solutions before trying though, they are not very difficult! I received some input for puzzle number three from <a href="http://prannay.com/">Prannay Khosla</a>.</p>
<h2 id="puzzle-1">Puzzle 1</h2>
<p><img src="/assets/images/welcome.png" alt="" /></p>
<h2 id="puzzle-2">Puzzle 2</h2>
<p>You have an important homework to hand over tomorrow, but because you are stuck here at SCH, you can’t write it out. So you explain the ideas to your friend and ask him to type it out and you come here to hang out with the cool guys. After a week, when in true IITK style you will have completely forgotten what the homework is all about, you enbe handed it back with a note to see the instructor. There will be gibberish on the paper:</p>
<p><img src="/assets/images/text.png" alt="" /></p>
<p>You will recall your friend saying that he is a lousy typist, but you didn’t think he could be so bad! You will quickly figure out that he pressed one key among the intended key and its immediate neighbours. The spaces are correct, for he didn’t miss that gigantic key, and so are the numbers, for he loves math. You will need to quickly decipher what you wanted to say, for your marks will depend on you telling your professor what you wanted to say.</p>
<p><img src="/assets/images/keyboard.png" alt="" /></p>
<h2 id="puzzle-3">Puzzle 3</h2>
<p>You are chilling on a long weekend, and because you are hungry you
decide to make a sandwich. You reach for your jar of mayonnaise and lo
and behold a resident of the exotic planet of Xnorlax who you had never
before had the privilege of coming across. Before you can introduce
yourself, the Xnorlaxian challenges to a duel of wits. Needless to say,
you (being very proud of your wits) agree.</p>
<p><img src="/assets/images/xnor.png" alt="" /></p>
<p>The Xnorlaxian claims that xe (the only pronoun Xnorlaxians accept)
has a better calculator than yours. You disagree, and you immediately
want to see what the calculator is. Xe agrees, and xir calculator is
shown below. There are two keys you don’t recognise and xe immediately
notices. Xe says xe’s going to show you the power of the calculator. You
can see all that xe does and the results.</p>
<script type="math/tex; mode=display">% <![CDATA[
21 + 34 + 29 << 2 + 25 >> 1 + 3 << 1 + 4 - 459 >> 3 = 8 %]]></script>
<script type="math/tex; mode=display">% <![CDATA[
13 << 1 + 45 << 1 - 50 >> 2 + 3 >> 1 << 2 + 30 >> 1 = 23 %]]></script>
<p>You suddenly claim that you can do the same using your calculator. Xe
gives you the following calculation - can you quickly use your calculator
to figure out what the calculation below should give?</p>
<script type="math/tex; mode=display">% <![CDATA[
22 + 33 << 1 + 50 >> 1 + 130 << 1 + 9 = ???? %]]></script>
<p><img src="/assets/images/calc.png" alt="" /></p>
<h2 id="puzzle-4">Puzzle 4</h2>
<p>You are an assistant to the brilliant spy Eleanor Shadymiss and you are
on the field trying to track the movements of the great aviator
Eadwaerd Shackleplane who you suspect may be up to some illegal
business. You come across an interesting piece of paper among his
navigation charts and now you and Elli (as Ms Shadymiss likes to call
herself) must glean some information from it. You can clearly see that
some squares are important, but you need to figure out which one is the
secret location!</p>
<p><img src="/assets/images/map.png" alt="" /></p>
<h2 id="puzzle-5">Puzzle 5</h2>
<p>In the beginning there was the Word. This Word gave rise to everything around us. Series of great people have roamed the surface of the earth, inspired by the Word. Of all of them, we remember very few. Puzzles the mind, does it not? You may be the one humanity will remember. Have you the spark that will ensure that we do? Been to places, have you? April be this month. Fooled be he who will not believe it! You need to be the very first to be remembered though, like the great Neil Armstrong, or Newton, or Romulus or Hannibal. Have the courage to act. A mind of your own. Date after date will remember you for that. Time will never forget you. And you will be famous! Location after location will have monuments built in your remembrance. Though the path is complicated, persevere! Be brave, be strong, and come to the place you have discovered! There will we be, waiting to discover you!</p>
<h1 id="solutions">Solutions!!!</h1>
<p>To be updated soon…</p>Sagnik Bhattacharyasagnikb@iitk.ac.inScience Coffeehouse - special puzzles to celebrate April Fools DayMusical Excursions: the Maihar Band2018-03-13T08:30:00+00:002018-03-13T08:30:00+00:00https://sagnikb.github.io/blogposts/Maihar<p>I first heard of Maihar in high school while reading the information booklet that came along with one of the beautiful releases in the All India Radio ‘Fond Memories’ series featuring Pt Nikhil Banerjee, a sitarist I grew to love over time. Born in Calcutta, the booklet noted that the child-prodigy in him was grown and nurtured by the attention of Ustad ‘Baba’ Alauddin Khan of the Maihar Gharana.</p>
<p>Curiosity piqued, I started reading about ‘Baba’ Alauddin Khan, and it was a journey into the life of a supremely gifted artist and teacher. I like to draw a comparison here with Gauss. Like Gauss, Ustad Alauddin Khan lived to a great age (around 110), continues to be a legendary figure in his field of Indian Classical music, was versatile (<a href="https://en.wikipedia.org/wiki/Allauddin_Khan">Wikipedia</a> notes that he could play over 200 musical instruments - I myself have heard recordings of him playing the sarod, surbahar, sitar and violin, no mean feat) and taught a generation of students who were legendary in their own right. They include some of the biggest names in Indian classical music, like Pt Ali Akbar Khan, Pt Ravi Shankar, Pt Nikhil Banerjee, Pt Pannalal Ghosh, Pt V.G. Jog and his own daughter Annapurna Devi.</p>
<p>However, here I shall not talk about these legendary figures, but another group of Ustad Alauddin Khan’s students who I only heard about very recently (that is, today). They are the Maihar Band.</p>
<p>According to <a href="http://www.omenad.net/page.php?goPage=http%3A%2F%2Fwww.omenad.net%2Farticles%2Fmaiharband.htm">legend</a>, the Ustad formed the band to provide some solace to young kids who had been orphaned due to an epidemic. The band uses Indian classical instruments and plays in an innovative style comprising of both Indian and western musical elements, and is in my limited knowledge, a unique experiment of the kind.</p>
<p>The following is a video of the band at work, unfortunately one of the very few examples I could find.</p>
<!-- Courtesy of embedresponsively.com //-->
<div class="responsive-video-container">
<iframe src="https://www.youtube-nocookie.com/embed/9fWwnu7Wo4Q" frameborder="0" allowfullscreen=""></iframe>
</div>
<p>The lead instrumentalist in that video is playing what is known as the ‘Nal tarang’, a variant of the jaltarang conceptualized by the Ustad himself, that uses gun barrels of varying types and lengths to produce different notes of music.</p>
<p>However, as <a href="https://www.outlookindia.com/magazine/story/maihars-fading-notes/206652">this article</a> notes, this unique offshoot of the Indian classical musical tradition is probably dying a slow death, due to various reasons that the article explains better.</p>
<p>Is there any way to stop Maihar’s notes from fading away? Who knows. Did I like the music based on just that one track? Yes, very very much.</p>Sagnik Bhattacharyasagnikb@iitk.ac.inThe beautiful music of the dying notes of the Maihar bandQuanta on Quantum Computation2018-01-21T18:52:00+00:002018-01-21T18:52:00+00:00https://sagnikb.github.io/blogposts/Quantum_computation_1<p>I am currently working on quantum complexity, with a working title of ‘adversarial and polynomial methods in quantum query complexity’. If I come across something interesting, I plan to write on it as I guess it will sharpen my understanding of things, and maybe you, the reader, will find it cool too. This is meant as an introduction to the field itself.</p>
<p>Some background, then. Quantum computing can be said to have begun with Feynman thinking about the difficulty of simulating quantum systems on a classical computer, a difficulty arising out of the form of the governing equations. The question is that, if nature can achieve a (classical) computationally difficult task while evolving the world quantum mechanically, <strong>can we harness the power to accomplish some tasks quicker than what we can do with classical computers?</strong></p>
<p>Now, David Deutsch came up with a problem in 1985, that he showed could be solved by quantum computers faster than any classical algorithm, (Deutsch’s problem). This sparked some interest in the field, which increased when in 1992, Deutsch and Richard Jozsa gave a variation of the problem (Deutsch-Jozsa problem) and an algorithm to solve the problem that gave a stronger separation between classical and quantum computers (look at the appendix for more). This provided inspiration for some truly groundbreaking work later in the decade, with Shor’s factoring algorithm and Grover’s unstructured search algorithm, that provided clear separations between classical and quantum algorithms in problems of great practical importance.</p>
<p>The original question, however, has proved a little difficult to answer. Quantum algorithms like Grover’s and Shor’s, have been proposed that are faster than any known classical algorithm but we cannot just yet say that quantum computers are in general ‘better’ than classical computers. There are some questions that need to be answered first.</p>
<p>So, what are these questions?</p>
<p>First, the model. Many of the better known statements about ‘running-time’ of algorithms in classical computing depend on something called the Turing Machine model, but ‘running-time’ of quantum algorithms is different from the classical concept. Then, comparing between the two is like comparing apples and oranges. Not quite, though, because the oracle model can be used to prove certain lower bounds about the same problem in the Turing machine model, but we must at least be careful when making statements like ‘Problem X is easier on a quantum computer than a classical computer’.</p>
<p>There’s another model issue here. The laws of quantum mechanics forbid the perfect copying of an arbitrary quantum state (<em>the no-cloning theorem</em>), which is obviously not true classically (think of where these words came from!<sup id="fnref:1"><a href="#fn:1" class="footnote">1</a></sup>). This therefore does place a restriction on the sort of things we are allowed to do. Also, quantum computing must be <em>reversible</em> in the absence of measurements, which is not necessary for classical computation, but this can be shown to not make much of a difference in the conclusions that can be drawn (I am skipping several details here though!).</p>
<blockquote>
<p><strong>Aside #1 - The Turing Machine Model -</strong> The Turing Machine model is an abstraction of what we mean by a classical computer running an algorithm. We endow a computer with infinite memory (certainly an abstraction!), in the form of a tape. This tape is segmented into boxes, and initially has the input on it, in the form of symbols in the boxes. It is fed to the Turing Machine, which then moves around on and manipulates symbols on the tape according to certain rules (the algorithm). When it stops, the tape is said to hold the output of the algorithm. This can be taken to be the most basic description of what an algorithm <em>means</em>. This was a revolutionary concept introduced by Alan Turing that changed the way we think about computation, and has wide ranging implications in computer science and mathematics. Running time of algorithms in this model is defined as the number of steps taken for the algorithm to stop. There are simplifications here, of course. For example, what if the algorithm doesn’t stop? Since this isn’t a course, I will pretend I didn’t notice that!</p>
</blockquote>
<blockquote>
<p><strong>Aside #2 - The Oracle Model -</strong> The Query model is a different type of model of computation. Here, we don’t assume the input to be given to the computer. However, the computer has access to an oracle, to which it can query the value of specific bits in the input. For example, if the input is a sequence of <script type="math/tex">100</script> <script type="math/tex">0</script>’s and <script type="math/tex">1</script>’s, the computer may ask the value of the <script type="math/tex">61</script><sup>st</sup> number in the sequence. This is, however, the classical version, and in the quantum version we can use a superposition of queries to ‘query’ multiple bits at the same time. Again, I have ignored subtleties (‘Does that mean we can learn everything about all the input bits at once?’).</p>
</blockquote>
<p>Treating quantum computing in the Turing Machine model is difficult (proof by authority, bigger people think so!), so for the time being let’s talk about classical computing also in the query model. Now can we compare classical and quantum computers? Let’s first see an example.</p>
<p>Suppose there’s a string of bits (<script type="math/tex">0</script>’s and <script type="math/tex">1</script>’s), of length <script type="math/tex">n</script>. You only know that there are just two possibilities, either all the bits are <script type="math/tex">0</script> or there is just one <script type="math/tex">1</script>. You need to tell which one it is. Classically, we need to look at all the bits in the string, because we don’t know where the <script type="math/tex">1</script> is, which seems intuitively true <sup id="fnref:2"><a href="#fn:2" class="footnote">2</a></sup>. So we require about n queries to the oracle to answer the question (this can be mathematically proven). However, ‘quantumly’ (and this is Grover’s algorithm), we can show that only about <script type="math/tex">O(\sqrt{n})</script> queries are sufficient. In this case, then, we know that the quantum algorithm is better.</p>
<p>Now think of a hypothetical example, where we have an algorithm that does better than any known classical algorithm, but it hasn’t been proven that there cannot exist a classical algorithm that can do better. Here, we cannot conclude that a quantum computer is better! This is an issue with a certain class of problems called the hidden subgroup problem, which is too technical to discuss here.</p>
<p>Another question can now arise : Can a quantum algorithm do better than Grover’s search given the same problem?</p>
<p>These are questions that <strong>quantum complexity theory</strong> basically seeks to answer. For example, given a problem (like the search problem mentioned above), what is a lower bound on the number of queries to an oracle that is required to solve the problem? An answer to a question like this allows us to determine in some sense ‘the best we can do’ to solve a given problem, and I find it pretty interesting! Answering this question for more and more problems is one of the ultimate aims for research in the area and I hope to make some contributions in the effort :D</p>
<h2 id="appendix---deutschs-problem">Appendix - Deutsch’s problem</h2>
<p>The Deutsch’s problem is the following.</p>
<blockquote>
<p>Given a function <script type="math/tex">f : \{0,1\} \rightarrow \{0,1\}</script>, and the promise that the function is either constant (same for both <script type="math/tex">0</script> and <script type="math/tex">1</script>) or balanced (<script type="math/tex">0</script> for <script type="math/tex">1</script> and <script type="math/tex">1</script> for <script type="math/tex">0</script> or vice versa), tell which of the two possibilities is actually the case. Since we want the computation to be reversible and without any arbitrary copying, we consider a black-box that takes two inputs, <script type="math/tex">x</script> and <script type="math/tex">y</script>, and outputs <script type="math/tex">x</script> and <script type="math/tex">f(x) \oplus y</script>. Here <script type="math/tex">\oplus</script> is the classical XOR (<script type="math/tex">1</script> if <script type="math/tex">x</script> and <script type="math/tex">y</script> are different, <script type="math/tex">0</script> otherwise). It can easily be checked that this is reversible (given the outputs, we can uniquely arrive at the inputs).</p>
</blockquote>
<p>What is the quantum and classical solution for this problem? Classically, we need to use the black-box twice, but quantumly we can do it in one use! How? There’s too much background that I need to get into to provide a sensible answer to that here, so I will take the easy way out and refer you <a href="https://www.cse.iitk.ac.in/users/rmittal/prev_course/f17/reports/intro.pdf">here</a> for details. It is a link to the lecture notes from the very first lecture of a course (that I did!) on Quantum Computation by Dr Rajat Mittal (Computer Science and Engineering, IIT-Kanpur), and should be accessible to most readers!</p>
<hr />
<div class="footnotes">
<ol>
<li id="fn:1">
<p>Shamelessly quoting the Bible of Quantum Computation, Nielsen-Chuang! <a href="#fnref:1" class="reversefootnote">↩</a></p>
</li>
<li id="fn:2">
<p>For an example where even classically you do not need to look at everything, consider a problem where you are given a binary string of length n, and you know that it is <em>sorted</em>, ie all zeros appear at the beginning and all 1’s appear at the end. You need to find the position of the first 1. Classically, you only require only <script type="math/tex">O(\log{n})</script>, using binary search. <a href="#fnref:2" class="reversefootnote">↩</a></p>
</li>
</ol>
</div>Sagnik Bhattacharyasagnikb@iitk.ac.inA short(ish) introduction to quantum complexityTravelogue – Rajasthan, on the Feluda Trail2017-12-30T08:30:00+00:002017-12-30T08:30:00+00:00https://sagnikb.github.io/blogposts/rajasthan<p>For the unaware, <em>Sonar Kella</em> (‘The Golden Fortress’) can be considered to be a rite of passage for any Bengali. Directed (story-written, music-directed, costume-created etc. etc. etc.) by Oscar-winning director Satyajit Ray and starring Soumitra Chatterjee, it is a detective story that almost every Bengali is expected to have seen. Some, like yours truly, remember almost everything in the movie by heart. Set mostly in the Indian state of Rajasthan, it tells the story of a young boy, Mukul, who claims to remember the events of his past life, where he speaks of a Golden Fortress and a possible treasure. A parapsychologist, Dr Hajra, takes a professional interest in the boy, but a failed kidnapping attempt forces the boy’s father to turn to Pradosh Mitter aka Feluda, a private investigator, to protect the boy from harm. This leads to Feluda, his cousin Topshe, and Lalmohan Ganguly aka Jatayu, an aspiring writer whom they meet on the train, to travel across Rajasthan with the boy and Dr Hajra in search for the Golden Fortress and the treasure.</p>
<figure class="">
<img src="https://lh3.googleusercontent.com/YOCDDoLpAQVsRCKyOW1aaQyHph4EPoOa0XQhUy8Ricztuk8IOxWqBUaDg335eo-v62PNndsmd8jP5fpazVPC-bTgxlJYiDm4jsJ4oOxRsAlGjT__bWgSvQg9cpwmXRFLcOkkx64H1y8=w2400" alt="Sonar Kella movie poster" />
<figcaption>
<strong>Sonar Kella</strong> The cover of the book that the film is based on. The photo shows Feluda in the Jaisalmer Fort.
</figcaption></figure>
<p>Enough background, on to the point of this post.</p>
<p>A disclaimer first, for those who know the storyline of the film. This post involves no train journey or camel journey whatsoever so you could take it as the route Feluda, Topshe and Jatayu took by car, from Jodhpur to Ramdevra and then the route taken by the driver from Ramdevra to Jaisalmer.</p>
<p>So, on a trip to Rajasthan along with my parents, I found myself in Jodhpur. It was the start of a ten-day long trip through the state over the Christmas holidays. We were making our way back to our hotel after visiting the Mandore fort when I noticed a signboard for the Jodhpur Circuit House. Circuit Houses used to be the only places to stay in small Indian towns 30-40 years back, but the only place I had encountered it before was the film, ‘Sonar Kella’. Something stirred in my memory, and I soon remembered that it was the Jodhpur Circuit House where the Feluda, Jatayu and Topshe first meet Mukul and Dr Hajra. A quick Google search confirmed the same, and we immediately noted the fact that we were about to travel from Jodhpur to Jaisalmer along the same route as taken by the characters in the movie. That’s where the idea that we would be following the ‘Feluda Trail’ first formed in our minds.</p>
<p>We began from the Mehrangarh (or the Mehran Fort) in Jodhpur, which is the first stop the characters in the film take in their journey to find the Golden Fortress. Built around the year 1460 by Rao Jodha, this fort is one of the most well-preserved forts in Rajasthan, with amazingly detailed carvings on the palaces inside and a well-stocked museum. This makes it a very important spot on the tourist circuit in Rajasthan. There’s a room of mirrors inside, which is really cool.</p>
<figure class="half ">
<img src="https://lh3.googleusercontent.com/y027gR952ZrwZIlAeVdK-cYbpTZpj-bIhSilmTS85xeX9icjjoKyriV_lnMzSV89cKBbBiceEhd4SaNXIZ9wgXG11qTnO7uud9hyGjxLYSXWnOi3aqadG5dm_tHGlImWm6n-_xMAejY=w2400" alt="Stonework in Mehrangarh Fort" />
<img src="https://lh3.googleusercontent.com/Ji8tWo7P6zKDyktdKGI_PItBJC1WVilC3l6DSsPZbz2kaDGdq_vRIcX9EDXXjnQGh1eXezgRM_6J-uwU2ZNaklN_jowjcXt4rHS9OfIzY5nuDjm1qFEfnxgZFypP0N9dnvCnY52CwAE=w2400" alt="Stonework in Mehrangarh Fort" />
<img src="https://lh3.googleusercontent.com/5EVdnHoe-gvR4YYRnrQjY8lGu9-F_MMIMME4NrxolS-qZhsdw-XZ5uLzYS_G3ceNMmubmbE5s2-4khEtJ-T5cXi491wCHETFAVrrEUZ8lVjxtKxb1ArJANAGSFmKKuK5haJPekdDjSw=w2400" alt="Stonework in Mehrangarh Fort" />
<img src="https://lh3.googleusercontent.com/8B-nZMwl44SyfrlRt1w7Zgotq5Co2B-ruMY-7qpoq8QqPU-fTPr7_F8_12h7NhbXmB05rfkI2rb2MM-1xCmxffZva_-webRrF8LfUmiYdzWd2PidJteey71-YfdPPx3NvGe7tOTwNIk=w2400" alt="Stonework in Mehrangarh Fort" />
<figcaption>Some examples of the remarkable stonework inside Mehrangarh Fort
</figcaption>
</figure>
<p>This fort is also seen in the background when Bruce Wayne escapes from Bane’s well prison in the movie The Dark Knight Rises, so that’s two reasons for a film aficionado to visit this place if the draw of the colourful Rajasthan culture wasn’t strong enough.</p>
<figure class="">
<img src="https://lh3.googleusercontent.com/oF0Omw3MTLPS__giMG0hFJ83a7_GRxyCP7USiytLmtnQqgIWvTH0tQiA3ifK6_N0ys6a9_KroaEBKmOhdNN5_zqDW-E1bg8GoIqS9y_Ezy1V83lvRPb6tR4R849FeSdo2j6icob8Oew=w2400" alt="Inside Mehrangarh Fort" />
<figcaption>
<strong>Inside Mehrangarh Fort</strong> Including this only because of the ‘bird-in-flight’ silhouette in the frame.
</figcaption></figure>
<p>Something else that I personally loved about the fort was the presence of several traditional style singers, who sang songs from several different parts of India, including some famous songs from Bengal. When asked the reason for this, they said that they are invited to perform at weddings across the country, and that’s how they pick up the local songs. It was slightly weird to hear a Bengali song sung in voices and accents that are distinctively Rajasthani. We were lucky to be visiting Rajasthan in the off-season for weddings. Otherwise, we would not have heard these songs.</p>
<figure class="">
<img src="https://lh3.googleusercontent.com/r5GMygiT7hHqSfFvI1WOkXu7YpdW3y0sy4gFMqw0QbqUuhQnTXiRHAxmy_gRqNj78SrnQsNkAZJoPTI7TdEPDLD2RTGGQ-Wc96ho4u6DWSL1OnDh1S4Z16h0HVmw8kDW72EPfznVcag=w2400" alt="Mehrangarh Fort" />
<figcaption>
<strong>Mehrangarh Fort</strong> I love this picture because the sun looks like it is giving the fort a halo.
</figcaption></figure>
<p>In the film, the next part of the journey is from Jodhpur to Jaisalmer. The roads during the journey up to the town of Ramdevra have now been converted to two-lane highways, so we did not encounter the kind of roads seen in the film until we crossed Ramdevra. One interesting thing to note during the journey was the amount of flora around. When the film was shot, there was nothing around but sand, with some very occasional trees, but now there are some trees along the road. Our driver attributed this to the Indira Gandhi canal. The canal project brought greenery to the Thar, to the extent that vegetables can now be grown in the desert.</p>
<figure class="">
<img src="https://lh3.googleusercontent.com/PhflM37KM8qhjIqKyfrvEmmDV0dU8MgUQZAGtB12uXm1wO3LrIpq-IdDiZZwxQdyLCsfSx45_YPGegWQjMRmUuy0Otr3arw8EEeu0HG6n3fncZku7uGbHPlYxIwXsG7bHG3N88ZS37E=w2400" alt="Jaisalmer to Ramdevra Road" />
<figcaption>
The more film-like single lane highway between Ramdevra and Jaisalmer
</figcaption></figure>
<p>On reaching Ramdevra, stopped at the railway station – and the stationmaster’s office therein where the film has a ‘detective-moment’ that I will not spoil for those who haven’t seen the film. It didn’t appear to have changed much in the years that have passed after the film came out. In my mind’s eye I could imagine that after nightfall, this place would appear exactly as it does in the film.</p>
<figure class="">
<img src="https://lh3.googleusercontent.com/TT4Z2RUyNu-OULt7mjdI-gLoMUngAwBsTNJ9lGeBWoHoGG17xvYZDmUx3dJPC8lIeM2hf_DdcK1gS3bISU_lISYpsr0Z6vO3Zj7SEzeFm2V_-pqwP2zfYQ7B7a2GyCjdFr7NSdVGgz0=w2400" alt="The Ramdevra Railway station" />
<figcaption>
The Ramdevra Railway station
</figcaption></figure>
<p>I have already mentioned the flora seen on the way, but there was also fauna to be seen. As we neared Jaisalmer, sightings of camels became more and more frequent. On reaching Jaisalmer, we would go on a short camel ride into the desert. As an experiment, I tried to walk fast on the sand, and, because of the pressure I needed to apply, my foot sank right in. On observing the camels walking or running, it is apparent why they are the ships of the desert – their feet hardly sink into the sand! Also, the experience of sitting on a camel’s back while it gets up is quite extraordinary – the back legs go up first, followed by the front legs, and given how long those legs are, it means that there are two violent jerks in two opposite directions that may be quite unnerving to someone who is not expecting it.</p>
<figure class="">
<img src="https://lh3.googleusercontent.com/u80yXEXoYp731SKaAyHueaRPfIme6zNBRQeMfIntrM9uWOfDPUVZ8Yjvuor6As4BrVM2314PGLE0poPdqeeQM_oOo2WueG0vg47JN2rlMAK1FvlQ1vNBZVK2IjbkznNn9j5hq0A9BTI=w2400" alt="Camels" />
<figcaption>
We also encountered these dudes on the way – they were accompanied by people, so will have to suffice for the camel riders who gave Feluda and co a ride
</figcaption></figure>
<p>From Ramdevra, it’s not long before one reaches Jaisalmer. Unlike the other forts of Rajasthan, the Jaisalmer fort is a residential fort, and a large number of people live inside the walls of the fort. This does make it seem very cluttered in comparison to, for example, Mehrangarh, but it gives the fort a very unique feel. The reason why the name Sonal Kella is appropriate for this particular fort is quickly apparent on seeing the yellow sandstone using which the entire fort is constructed. Still, during the day the golden colour is not that apparent, but during sunrise and sunset, it does look very, very golden.</p>
<figure class="">
<img src="https://lh3.googleusercontent.com/iDsph9lzQEMm5pzVAvVC4FlBURR3-OrJT36yKp3BGLHmLLrDn2sLvWXTTnPZidGdSfHMq_zsMUmaY4GtWF7bfS_z3Roe1DHoGiV7NgAl1_YUY0jMEpdqIw2md7qAslcW2hzFPP3m9ps=w2400" alt="Inside Jaisalmer Fort" />
<figcaption>
<strong>Inside Jaisalmer Fort</strong> One of the not-that-golden views of the fort.
</figcaption></figure>
<p>This is also a good place to note that several of the towns of Rajasthan can be associated with particular colours. It is not just the fort in Jaisalmer that is made out of yellow sandstone – many of the buildings in the town are too, and looking at it from a distance makes the town look yellow. Similarly, Jodhpur is blue, and Jaipur is supposed to be the pink city.</p>
<p>Jaisalmer is also one of the last settlements in India before the Pakistan border, and it used to be an important trade town a couple of centuries back, making it a place where the Marwari businesspeople flourished. A quick look into history tells us that the rise of the British Raj and with it maritime trade and the port of Bombay (now Mumbai) killed the trade and financial importance of the town, and by the mid-1960s, many of the rich traders had left the place. It was also too far from the main tourist routes to attract much attention. A turnaround in its fortunes happened because of two events – India’s first nuclear test happened near Pokharan, which is close-by, and Satyajit Ray made Sonar Kella. According to our guide, the release of the film meant that Bengali tourists began to come to see the golden fortress, and slowly the fort became a tourist destination. Such is the power of a film!</p>
<figure class="">
<img src="https://lh3.googleusercontent.com/Bya-VjwZEuDyi66672TeMjiyQW8AMJBYSml6QW4aJUCYKcf9Iaxvw0Dg2v2A-MndLujcGcI0aUe7688uQbCW6Zr9QRfpo6_m0xryf8R3jHkimKn5su62FzEBjeJK1mQxIME0fu1GwA8=w2400" alt="Sonar Kella climax location" />
<figcaption>
<strong>Sonar Kella</strong> The location of the climax of the movie – Mukul’s house in a previous birth. The house itself is the bare bricked structure to the right. Our guide can be seen sitting regally on the bench.
</figcaption></figure>
<p>Our guide knew all of the major spots where the shooting of the film took place, and his knowledge of the film surprised us a lot. Laughing about it, he said that he would need to know about the film because the film drove the tourism that is giving people like him their daily bread.</p>
<p>It is therefore ironic that one of the most important spots in the film – the location of the climax – is one of the most poorly maintained spots in the fort. Mukul’s house, while shown to be dilapidated in the movie too, is now even more ramshackle, and a large water tank has now come up around that spot. While changes like this may be inevitable because of the ‘living’ nature of the fort, it would have been nice had locations of importance like that been preserved better.</p>
<figure class="">
<img src="https://lh3.googleusercontent.com/4jstD6NhsRN7kHae7SMpIpKynQk_K0CilJu9kcGUBVMXk5Y_9XXXWPGdAiV94XiSzJkP6bW96nkt-K4ZyhF3pNKxX9NuH1SgHnt4H6VgywIO3TbYn1cnSFRPWNsiworoXygK8UiXvaw=w2400" alt="Golden Fort" />
<figcaption>
When the Jaisalmer Fort is most golden
</figcaption></figure>
<p>Satyajit Ray is known to the outside world as one of the greatest film directors of his generation, but in Bengal and particularly among kids too young to appreciate his more mature films, he’s more well-known as an author. For most Bengali children growing up, even today, the first detective fiction and science fiction that they are introduced to are his creations – Feluda and Professor Shonku. My trip to Rajasthan and the above following of the Feluda trail gave me renewed appreciation of Ray’s genius and range as a storyteller and film-maker, and how he was able to take the colour of the fort at a time when it was not very well known at all, and wove a whole travelogue and detective story around it. That is just the result of an absolute master at work.</p>
<hr />Sagnik Bhattacharyasagnikb@iitk.ac.inSatyajit Ray’s film Sonar Kella and how we ended up following the journey by the protagonists of the film during our trip to RajasthanA Night Full of Questions2017-09-03T18:52:00+00:002017-09-03T18:52:00+00:00https://sagnikb.github.io/blogposts/A-Night-Full-of-Questions<p>A few days back, SnT Code, one of the biggest events of Takneek 2017, was organised. For the uninitialized, Takneek is the intra-college technical festival of IIT Kanpur. All the clubs under the Science and Technology (SnT) Council have to make questions that the rest of the campus can then try and solve. I participated in Takneek in both my first and second years and this time I made the questions for the hobby group I co-lead, Science Coffeehouse.</p>
<p>Solutions to the questions follow if you scroll down, so if you don’t want spoilers, don’t scroll down before taking whatever tries you want to take. All bouquets and brickbats for the questions to be directed at me, please. If they feel esoteric, they were supposed to be solved by some of the brightest of the campus residents with the full power of Google at their fingertips and (nearly) unlimited time. They are supposed to remain hard to solve in such surroundings. If you are unsure as to what exactly the paragraphs of text want, look deeper, and try and see something more than what is obvious. I have experimented with some of my friends, and some of them did get the answers to the second and third questions without serious trouble. The first question is, in my opinion, the hardest one.</p>
<p>Another disclaimer seems relevant here. The questions here may not exactly match what was asked in the event itself, but the minor changes you might find do not change the answer or the process used to arrive at the answer.</p>
<h1 id="questions">Questions</h1>
<h2 id="question-1">Question 1</h2>
<p><strong>“Refer to the fitting resource you can find on the biggest encyclopaedia”</strong></p>
<p><img src="/assets/images/SnT_Code_Q1.JPG" alt="Question 1" /></p>
<h2 id="question-2">Question 2</h2>
<h3 id="a-theoretical-computer-scientistphysicist-rants">A Theoretical-Computer-Scientist/Physicist Rants…</h3>
<p>Isn’t machine learning too applied? What is it that attracts people to a field like that? Xkcd was correct (https://xkcd.com/1838/), you know. It is just a whole lot of numbers in multidimensional arrays that you keep throwing about here and there. Every time someone tries to explain that stuff to me, I feel like a burnt wick! You might think I am not normal. I agree! I often spend hours thinking I am Spiderman, swinging from building to building and webbing people up. Is webbering even a word? If it is, that is what I would like to call it. Well, I deviated from the topic under discussion. Or, as I would like to put it, I got tangentially away from the things I was planning to say. The stone called machine learning hangs like a heavy load from my neck - because almost everyone around me is doing only that and nothing else! Just go and do some real math, guys! Heat up a metal plate. See how the heat spreads. Heat it up, even more, see how it bends? Can you calculate how all that is going to happen? Even though these problems are years and years old, these are the cool ones! Heated vessels sound boring, right? No, the math is interesting, satisfying! Try doing those calculations quickly though - you don’t want to be stuck on it forever, right?</p>
<p>I shall meander away again. If these people are kind enough, I would love to have a theorem or law named after me. It would be so cool if I could be remembered for a lifetime right? Right, man? That would be awesome! I hear you say, I have heard this before. You kid all the time!. No, no, I love Math! Look at this Cera basin, isn’t the curvature lovely? I am digressing again! Let’s meet again, right?</p>
<p><em>[All views expressed in the above are of a fictional character only. The creator of this question has no animosity towards machine learning of any form whatsoever]</em></p>
<h2 id="question-3">Question 3</h2>
<h3 id="we-are-freaks-oddities-we-drive-the-world-forward-precisely-because-we-are-but-if-we-come-together-we-go-together">‘We are freaks, oddities! We drive the world forward precisely because we are, but if we come together, we go together!’</h3>
<p>So in your quest to look closely at the oddities in the world, you have reached Kolkata, nicknamed the City of Joy or the City of Palaces. The names have varying sources - City of Joy comes from a book by Dominique Lapierre, and City of Palaces comes from the abundance of colonial-era architecture in the city. After all, it was the capital of British India longer than Delhi was, and was also one of the biggest trade centres of the British Empire. It is also the city where Ronald Ross did his Nobel Prize-winning work on malaria, and CV Raman did the majority of his work on light. However, you do not want to keep thinking about Science all the time, so you ask a trusted friend to guide you to the sights in the city. Your guide takes you on a walk down central Kolkata, near an open green area what is called the Maidan, and tells you that you are actually walking in the heart of the old British city. Among the colonial era buildings to be seen in the area, chief are the Victoria Memorial, Fort William, and the St. Pauls Cathedral. Your guide first takes you into the cathedral. It was the first cathedral built in the British Empire outside England itself, and it is currently the seat of the Diocese of Calcutta. Your guide shows you around the main altar and the library, and you are hooked by its Indo-Gothic architecture. You can see the Victoria Memorial outside, and you are a little surprised - why was it built in Calcutta, a provincial city and not the capital in Delhi? Your guide takes a moment, and launches into a long account of the early 19th century when increased nationalism in Bengal forced the British Indian Empire to move the capital to Delhi. Work on the Memorial, he says, started before the shift, so they could not move it. Incidentally, says the guide, the shift occurred just a year after Mark Twain died. You are surprised by the tangential reference - does it have any meaning? The guide assures you that he brought up the name just because Twain is his favourite author. He recommends to you the Twain’s travelogue - Following the Equator - where he has some typical witticisms about things that he saw in the country. You assure him that you will try and read the book, and you part with a spring in your step having just spent an amazing evening. You promise to meet again the following day, where your guide would take you on another quest through the tons of new stuff to see in a new city!</p>
<p>There is, however, something that is bothering you. Why did the guide insist on that particular walk? And, more importantly, who doesn’t find Twain-ish witticisms irritating?</p>
<h1 id="solutions">Solutions</h1>
<h2 id="question-1-1">Question 1</h2>
<p>The first question has a pretty obvious Harry Potter reference in the text to the right of the matrix. It is the message that first appears when someone uses the Marauders’ Map, just with the names and the terms changed. The biggest encyclopaedia is obviously Wikipedia, so we are now in possession of two clues.</p>
<p>Now, someone might go down the Harry Potter route and get totally lost, but I thought that a square with an HP reference would suggest ‘magic square’. Also, if someone reads books, and has ever read Dan Brown’s excellent ‘The Lost Symbol’, they would probably put ‘cryptograph’ and ‘magic square’ together to guess that the decryption has to be done using a magic square.</p>
<p>The question now is how to find the magic square. We require a 12 x 12 magic square, and the only thing that can help us now is the Wikipedia reference. If you visit the Wikipedia page for magic squares, you will find two 12 x 12 magic squares. In the worst case, you will need to try both. The encryption proceeded thus: I wrote a message in a 12 x 12 matrix, and numbered each square from 1 to 144, like this.</p>
<p><img src="/assets/images/SNT1.PNG" alt="original" /></p>
<p>The magic square I chose had numbers from 1 to 144. If the entry at the position i, j of the magic square is k, then the letter at square k of the message square goes to the square i,j in the cryptogram. To decrypt, one has to simply reverse this process. Before shuffling, I also Caesar shifted each letter in the yellow boxes by 1 and converted to ASCII, so one has to reverse that too to finally solve it. I had to do this because otherwise, people could have tried to unjumble the yellow boxes only and guess what message they contain.</p>
<p>The magic square used is this</p>
<p><img src="/assets/images/SNT2.PNG" alt="magic square" /></p>
<p>Once the decryption is complete, this is the result. The answer, Srinivas Ramanujan, should be obvious now. Also, the Queen in ‘Cryptograph of the Queen’ refers to Number Theory, which Gauss called the ‘queen of Mathematics’ and which Ramanujan worked on extensively.</p>
<p><img src="/assets/images/SNT3.PNG" alt="solution" /></p>
<h2 id="question-2-1">Question 2</h2>
<p>One of my friends solved this in about 5 minutes, and it should be trivial to anyone who knows anything about the history of science. The question has nothing to do with machine learning whatsoever, and that was intended simply to throw people off.</p>
<p>Starting from the last paragraph, it should be obvious that we are looking for someone who has something named after them, who probably worked on mathematics, and probably also worked on curvature. Towards the end of the first paragraph, there are hints that heat is also important to this problem.</p>
<p>The answer should now be obvious. Gauss’s Law. Gauss worked on curvature and was the first person to suggest that non-Euclidean geometry is a thing. Historically, the mathematics of heat flow on a metal plate was the setting in which Fourier developed the theory of Fourier series, and solving it ‘fast’ is a reference to the fact that Gauss had discovered some form of the fast Fourier transform. The rest of the clues are a little less obvious, but in the first paragraph, there are references to a load on the neck, webbering and a burnt wick. The first two are supposed to hint at the magnets (also known as lodestones) and Gauss’s work with them, and Gauss was born in Brunswick (I couldn’t help a pun, could I?)</p>
<blockquote>
<p>The friend who solved this suggested that Riemann is probably a more natural fit in this question, and he has good reason to recommend that. In hindsight, I think so too.</p>
</blockquote>
<h2 id="question-3-1">Question 3</h2>
<p>Here I couldn’t help dropping references to my hometown of Kolkata. However, the answer has nothing to do with Kolkata. The reason why I got to Kolkata was because of the existence of St. Paul’s Cathedral in the city. The answer is however linked to the cathedral of the same name in London, which replaced an earlier cathedral that was destroyed in the Great Fire of London. The architect was Sir Christopher Wren, which will be important later.</p>
<p>Mark Twain was shoved in to relate to Halley’s Comet. Mark Twain’s year of birth and death are both years during which the Halley’s Comet made an appearance. He also has a quote regarding this issue, a garbled version of which forms the title of the question. Halley will also be important in the solution.</p>
<p>The last reference is a little more veiled. The person being spoken to leaves with a ‘spring in his step’ and is ‘hooked’ by the architecture of the cathedral. These are oblique references to Robert Hooke, of Hooke’s law fame.</p>
<p>The three people above - Christopher Wren, Edmond Halley and Robert Hooke, met at a coffeehouse in London in January of 1684 and had a discussion regarding the nature of gravity. The things they discussed during the meeting prompted Halley to meet Sir Isaac Newton, who hadn’t yet published the Principia Mathematica and had no intention to do so. Halley soon found out that Newton had formulated a full theory of motion and gravity and then pushed him to publish the Principia. In retrospect, the meeting in the coffeehouse was vitally important in the history of science. The answer to the question, then, is <strong>coffeehouse</strong>!</p>Sagnik Bhattacharyasagnikb@iitk.ac.inQnA for SnT Code in Takneek, the technical fest of IIT Kanpur.