<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Aarush Ghate on Medium]]></title>
        <description><![CDATA[Stories by Aarush Ghate on Medium]]></description>
        <link>https://medium.com/@aarushghate5?source=rss-22a2420fe9ea------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*TmVvfV-fzbLvq0fD6LlZDA.png</url>
            <title>Stories by Aarush Ghate on Medium</title>
            <link>https://medium.com/@aarushghate5?source=rss-22a2420fe9ea------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 28 Nov 2026 10:43:05 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@aarushghate5/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[The inevitability of two]]></title>
            <link>https://medium.com/@aarushghate5/the-inevitability-of-two-e6794ef81296?source=rss-22a2420fe9ea------2</link>
            <guid isPermaLink="false">https://medium.com/p/e6794ef81296</guid>
            <category><![CDATA[computer-science]]></category>
            <category><![CDATA[education]]></category>
            <category><![CDATA[mathematics]]></category>
            <category><![CDATA[fun]]></category>
            <category><![CDATA[insights]]></category>
            <dc:creator><![CDATA[Aarush Ghate]]></dc:creator>
            <pubDate>Sun, 13 Jul 2025 06:24:27 GMT</pubDate>
            <atom:updated>2025-07-13T11:55:15.954Z</atom:updated>
            <content:encoded><![CDATA[<p>It’s true. The number 2 is universal in Computer Science and we’d be hard pressed to find any reprieve from it. Here we’re going to try and understand why.</p><p>In the human experience , the simplest kind of question is that of a yes/no question , and it’s rather rare to find cases where allowing a question to have multiple answers can achieve something that breaking the same question down to smaller yes/no questions cannot. <br>Many natural systems such as light polarisations , magnetic poles , neuron activations etc. also appear to have two possible, ‘states’, as it were, and in general, binary systems seem to be much easier to physically relate to.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dGJ1BHIavkYLxdWcbwH_IA.png" /><figcaption>The wonderful world of light!</figcaption></figure><p>In fact , having two outcomes is the simplest way to convey any form of “information”, which should feel fairly intuitive, as having a single known outcome doesn’t really tell you anything new. Only when we add extra outcomes do we get a notion of distinguishability.</p><p>Most of our relational and comparative operations are also binary, which leads to a whole set of derivative systems. <br>For example the physical notion of “bits”. Essentially it compares whether a certain voltage is above a certain threshold (considered to be logical ‘1’) or not. Look at that question again. Does it not end in an ‘or not’?<br>Isn’t that inherently binary !</p><p>But 2 also shows up in numerous algorithms at the heart of computer science. You’ve heard of binary search , binary trees , binary exponentiation , binary this , binary that. But have we ever stopped to think about why ? I know I have.</p><p>In a sense binary seems to offer the best trade off between <strong><em>breadth</em></strong> and <strong><em>depth</em></strong>. In the context of dividing a problem into smaller ones, the trade off is between the number of pieces you have and the size of each of the pieces. We can formulate it as follows:</p><blockquote><strong>Cost for n = m * Cost for (n/m) + Cost spent to consolidate the pieces</strong></blockquote><p>Where the consolidation cost can naively be taken as proportional to :</p><blockquote><strong>(m-1)*some constant cost ‘c’</strong></blockquote><p>As to combine ‘m’ things at best we need to join (m-1) gaps between each part. This is rather naive, but gives us a decent sense of intuition to work with. More complex joins will depend on higher powers of ‘m’ but we ultimately need a minima, which I’ll show, will lead us to 2 anyway.</p><p>Using this ‘m’ pieces approach , we end up performing logₘ(n) steps, as we count the number of times this division process can happen till we reach a constant known value (in this case 1), which is by definition a logarithm!<br>So we have a total of <strong>(m-1)*logₘ(n)</strong> steps for a given n.</p><p>This is the graph of mlogₘ(n) :</p><p><a href="https://www.desmos.com/calculator">https://www.desmos.com/calculator</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nhhdY4-lyF3TxvWWPKgGvQ.png" /><figcaption>This graph is increasing , and the smallest integer value that minimises this is 2!</figcaption></figure><p>This is also loosely the proof of why <em>any</em> comparison based sorting cannot be done faster than <strong>n*log(n)</strong>. What’s hidden in this complexity that all of us are familiar with is it’s actual form : <strong>(m-1) * n * logₘ(n)</strong> <br>Our simple ‘&lt;’ comparison is , as mentioned before , a binary operation , forcing our ‘m’ to conveniently be ‘2’ , which is the minimum !</p><p>Going by the example of quicksort , the idea is that with ‘m’ pieces (starting from 1 piece), <strong><em>in each step</em> </strong>we fix the positions of <strong><em>m-1 entries</em></strong> (that’s what allows us to split into m independent pieces!), but to fix an entry’s position, it <strong><em>has</em></strong> to be compared with <strong><em>all</em></strong> other elements in that piece! <br>[Note: This is again a very loose explanation. Quicksort has an element of randomness and unequal pieces may form , but I wanted to motivate even the most efficient case.]</p><p>Another interesting way to look at it is that any permutation of ‘n’ items belongs to a set of <strong>n!</strong> possible configurations, and sorting narrows it down to just one. The number of comparisons or ‘yes or no’ questions needed for this narrowing down, is effectively <em>the number of bits of information</em> we’re getting from this ! Which is log₂(n!) ~<strong> nlog₂(n)</strong></p><p><em>A summary of what we’ve learnt above :</em><strong> smaller pieces</strong> comes with the <strong>trade off</strong> of <strong>more effort to handle all those pieces</strong> , which usually suits 2 the best.</p><h3>The Hard pressed reprieve</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*O1Q37nQgyhsH3PD2561E1Q.png" /><figcaption>A situation where it’s better to divide into more pieces</figcaption></figure><p>Here’s the situation, and surprisingly it’s not a very abstract use case.<br>We need to find the minimum value of a convex function like so , which has a sort of single point to which it decreases and then increases after that. This comes up quite often in Physics (equillibrium points for least potential energy) and in versions of Machine Learning. Let’s try a simple binary approach to this , by splitting it into two parts and comparing endpoints.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*y7QTXNhFZM0kmKSW40CjeQ.png" /></figure><p>The point B can be on <em>either side</em> of the actual minima and we’d still have a similar sort of configuration ! And the reason this happens is that this sort of splitting gives us <em>no</em> <em>information at all</em>! Because the function is convex, we’d get a similar sort of configuration <em>regardless</em> <em>of where B is chosen</em>, because by definition, convex means that the portion of the graph between two points lies below the line joining them !</p><p>The solution here is to divide our graph into three equal portions !<br>Why so ? Well, because after dividing it into three portions , say regions: 1,2 and 3 , given that it has uniform behaviour before and after the actual minima, we can exclude the extreme region showing repeated uniform behaviour. In simpler words , if regions 1 and 2 both show a decreasing trend , then we can safely exclude region 1 , because if there were the minima there, region 2 would show an increasing trend ! Same goes for an increasing trend in regions 2 and 3 !</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*T4R_htU1tiWlpeLqoVXA1g.png" /></figure><p>Each step reduces the problem to 2/3rd its original size ! This method of three divisions is known as <em>ternary search</em> , and a similar kind of reasoning follows about its efficiency. Intuitively, I guess that the function itself is structured into three regions: one of decrease , one of increase and the actual minima itself , or a region of change. The idea here being that giving three regions allows us to exclude the outer region which shows a uniform trend. I think that’s why a division into three not only fits the problem intuitively, but also gives us a really efficient solution.</p><p>Again , Thanks so much for reading , and I hope I was able to provide some sense of intuition behind something which most of us largely took for granted ! Thanks !</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e6794ef81296" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[A Fun Little Problem]]></title>
            <link>https://medium.com/@aarushghate5/a-fun-little-problem-d8b6da14ffbe?source=rss-22a2420fe9ea------2</link>
            <guid isPermaLink="false">https://medium.com/p/d8b6da14ffbe</guid>
            <category><![CDATA[mathematics]]></category>
            <category><![CDATA[problem-solving]]></category>
            <category><![CDATA[intuition]]></category>
            <category><![CDATA[puzzle]]></category>
            <category><![CDATA[fun]]></category>
            <dc:creator><![CDATA[Aarush Ghate]]></dc:creator>
            <pubDate>Wed, 09 Jul 2025 18:53:18 GMT</pubDate>
            <atom:updated>2025-07-09T18:53:18.067Z</atom:updated>
            <content:encoded><![CDATA[<p>or the consequences of having a nagging curiosity</p><p>A friend of mine asked me to solve a problem today , he goes:</p><blockquote>“Imagine two loooong cylinders of unit radius intersect each other.<br>I’d like you to tell me the volume of the intersecting region”</blockquote><p>The lack of context may seem amusing , but this was part of a predetermined arrangement to ask each other interesting problems we came across. But regardless of the backstory , this is a rather insane problem to ask someone over a phone call. “But no ”, he assures me, “there’s almost no calculations involved, you can totally do it mentally!”<br>Intrigued , I decided to humour him and I did eventually get to the solution and it was truly marvellous, so I thought I’d share.</p><p>The problem in itself is rather hard to visualise. Because your final shape looks something like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/180/1*x9U-PvvGReWzji2KsBqWAQ.gif" /><figcaption>wikipedia GIF of the shape in question</figcaption></figure><p>And one way to do it is through a horrifically messy integration which looks something like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EN7M1eutoAzXW_vEkvErng.png" /><figcaption>said horrific integration</figcaption></figure><p>Okay , I lied , there is a cleaner integration possible , but the point is that its rather clunky and calculative in general. Definitely not doable over the phone.</p><p>So how <em>does </em>one solve it then ? I thought I’d lay out some hints about how one <em>could</em> have come up with this themselves (sort of similar to what I did !)</p><ol><li>The friend in question is insistent that not much mathematics is needed to solve this , and they’ve asked for a volume calculation. Maybe we can relate it to some shape whose volume we already know?</li><li>The shape is a little gnarly to visualise on its own , all I can think of is how it looks for the sides. Will that help?</li></ol><p>I’ll admit , it’s not easy to have structured ideas such as these straight from the get go. Heck I was confused for a solid ten minutes. But eventually , these tiny hints do end up being stumbled on , and from there is a very interesting solution we can come up with.</p><p>So the basic idea , is that we have from point two , an idea of what it looks like in each dimension. In the X and Y dimensions , it does look like a circle when viewed , and from the Z axis , it looks like a square. So the cleaner integration process was to use square slices constrained by these two circular views. Then comes point 1. How can we relate this to a shape we already know ? If you notice , if I change the square to a circle in the previous line , it describes a sphere ! So maybe I can just scale the circle area to that of my square and multiply that factor into my sphere volume !</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/686/1*LgEm7HxW5KV79is_lT-Tmw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/408/1*h0MQA9YdtxycDVPDe45qwg.png" /></figure><p>These images help illustrate the square slicing I mentioned. The square has a side of 2x , giving a volume of 4x² , while the corresponding circle of radius x would’ve had an area of pi*x² , leading to a scaling factor of 4/pi !<br>Hence , 4/pi * 4/3pir³ gives 16r³/3 , which is the exact formula described previously !</p><p><a href="https://www.geogebra.org/m/ptdertw2">Steinmetz Solid (Bicylinder)</a></p><p>Above is a helpful visualiser for the same.</p><p>But this seemed rather clunky. It wasn&#39;t satisfying as such. Which lead me to think , if I ultimately care about the views in 3D , if I added a third cylinder , would it not give a sphere ? Isn’t that cleaner to solve with ?<br>Well turns out it <em>does not give a sphere</em>, rather something called a tricylinder:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xa0yMHdv_JPQ-WgVz6FFKA.png" /><figcaption>a tricylinder (wikipedia)</figcaption></figure><p>Turns out just 3 axis views may not be enough to determine the 3D shape, given our <em>lack of depth information</em> ! But as I was looking up these images, I remembered having heard of Steinmetz solids somewhere before.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2F6iwNsjWYGVY%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3D6iwNsjWYGVY&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2F6iwNsjWYGVY%2Fhqdefault.jpg&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/16d0b4663e20f8e134f2cf5229034113/href">https://medium.com/media/16d0b4663e20f8e134f2cf5229034113/href</a></iframe><p>Not <em>this</em> channel per se, but I’d seen some video of this shape rolling. Which led me to think , hey , the tricylinder looks like a circle from all 3 axes , could it be used as a new kind of ball ? One that could roll in any direction ?</p><p>Again the forces of mathematics defy me. It can’t be used as a ball the way a sphere is because a sphere looks like a circle from <em>infinite axes of view</em> !<br>Which allows it to turn and rotate and roll perfectly , unlike our 3 axis bound tricylinder. The Sphere having infinite symmetries makes it an extremely uniform shape , giving it the lowest surface area to volume ratio.</p><p>But this is no coincidence ! Adding symmetries can provably lead to this kind of uniformity , a rough sketch of which can be provided using this ingenious method known as Steiner Symmetrisation. Let’s look at a 2D example to give us intuition. The idea is to divvy up your shape into a ton of small rectangles and shift these rectangles to be symmetrical about a certain axis. Notice that this preserves volume , but decreases (or keeps the same if it’s already symmetric) the perimeter.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/1*PDR6Vri5eOikzlEzxG8U7A.gif" /><figcaption>Steiner Symmetrisation for a wacko shape</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*V2g1pLKDArLzKJ-fxMQEQw.png" /><figcaption>The black lines after symmetrisation have a shorter length</figcaption></figure><p>Though this isn’t an exact proof , it gives intuition behind why adding lines of symmetry helps to reach a certain state of optimality , with regards to perimeter and area , and similar ideas scale with other dimensions. So yes , I guess that’s it !</p><p>Thanks for reading this crazy rabbit hole my mind went down and hopefully this also helped to showcase how a nagging curiosity can lead to rewarding insights ! Cheers !</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d8b6da14ffbe" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>