<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom" ><generator uri="https://jekyllrb.com/" version="4.3.4">Jekyll</generator><link href="https://ssriva1998.github.io//feed.xml" rel="self" type="application/atom+xml" /><link href="https://ssriva1998.github.io//" rel="alternate" type="text/html" /><updated>2026-02-12T20:52:12-05:00</updated><id>https://ssriva1998.github.io//feed.xml</id><title type="html">Rep(i,n)</title><subtitle>Personal blog</subtitle><author><name>Siddhartha Srivastava</name></author><entry><title type="html">Competitive Programming at IIT Kanpur</title><link href="https://ssriva1998.github.io//personal/IITKonCF.html" rel="alternate" type="text/html" title="Competitive Programming at IIT Kanpur" /><published>2024-03-22T00:00:00-04:00</published><updated>2024-03-22T00:00:00-04:00</updated><id>https://ssriva1998.github.io//personal/IITKonCF</id><content type="html" xml:base="https://ssriva1998.github.io//personal/IITKonCF.html"><![CDATA[<p>One of the more unfortunate aspects of IIT Kanpur culture has been the fact that most discussions around career take place based on vibes and anecdotes. You rarely see hard data on what people who took part in certain activities went on to do.</p>

<p>This has been on the back of my mind until I noticed this tweet.</p>

<p><img src="/assets/images/Screenshot 2025-10-31 161026.png" alt="Tweet screenshot" /></p>

<p>Similar to the tweet, I decided to first see how many people from IIT Kanpur have a max rating 1900. Running a small script, I found there were roughly 98 people. (The fact that some people create alts and some people don’t put their college means that getting an exact count is hard).</p>

<p>Gathering more data on 98 people is a significant task, so I decided to look at a smaller subset (max rating above 2100). This turned out to be roughly 38 people, who I’ve listed below</p>

<div class="sheetiframe-container">
    <iframe src="https://docs.google.com/spreadsheets/d/e/2PACX-1vRrvBibr6eSwRVV3ntSte_ENA9oYbD7zw8dlRQXNTXD0O6p-KtOc5BqqLN-nBKugQ/pubhtml?gid=1292932476&amp;single=true&amp;widget=true&amp;headers=false" class="sheetiframe"></iframe>
</div>

<p>The one interesting thing is that almost everyone is at a company that comes on day 1 of placements. A majority are from CSE (19), Math (6) and Electrical (3) but there are a few from Civil (2) which is surprising. A good chunk of people working full time are currently at or have been at either Glean, Rubrik or Google. For those that are still in college, most have internships at trading firms.</p>

<p>I think the larger interesting point is that almost everyone who hits 2100 at any point of time does really well and arguably, there’s a higher probability of a non CSE &gt;2100 rated coder getting into a top company than the average non &gt;2100 rated CSE student.</p>

<p>It would be unfair to not discuss the few obvious flaws in this discussion.</p>

<ul>
  <li>The data is skewed towards recent graduates - due to rating inflation, it’s easier to hit 2100 now than it was 5 years ago. Codeforces is also relatively new, so lots of older alumnus didn’t use Codeforces. This means that we’re essentially analysing early career data. Only 5-6 people in this list graduated before 2020.</li>
  <li>Competitive programming is essentially “teaching the test” - most companies have tests where you have an advantage if you’ve done competitive programming. This means that it’s relatively easy to break in early on, but it may not be a predictor of future success.</li>
</ul>

<p>The relatively small script to pull names.</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>import requests
import json


# Get the list of all rated users
rated_users_url = "https://codeforces.com/api/user.ratedList?activeOnly=false&amp;includeRetired=true"
rated_users_response = requests.get(rated_users_url)
rated_users_data = json.loads(rated_users_response.text)

rs = rated_users_data["result"]
iitk_users = []
for it in rs:
    if(('organization' in it) and (it['organization'] == 'IIT Kanpur') and (it['maxRating'] &gt;= 2100)):
        iitk_users.append(it)
        print(f"{it.get('firstName', '')}{' ' if it.get('firstName', '') else ''}{it.get('lastName', '')} {it.get('handle', '')}")
</code></pre></div></div>]]></content><author><name>Siddhartha Srivastava</name></author><category term="personal" /><category term="personal" /><summary type="html"><![CDATA[One of the more unfortunate aspects of IIT Kanpur culture has been the fact that most discussions around career take place based on vibes and anecdotes. You rarely see hard data on what people who took part in certain activities went on to do. This has been on the back of my mind until I noticed this tweet.]]></summary></entry><entry><title type="html">Puzzle 2</title><link href="https://ssriva1998.github.io//puzzles/Puzzle02.html" rel="alternate" type="text/html" title="Puzzle 2" /><published>2022-08-28T00:00:00-04:00</published><updated>2022-08-28T00:00:00-04:00</updated><id>https://ssriva1998.github.io//puzzles/Puzzle02</id><content type="html" xml:base="https://ssriva1998.github.io//puzzles/Puzzle02.html"><![CDATA[<p><strong>Problem</strong>: A basketball player has a season free throw average of \(70\%\) halfway through the season, and raises it to \(80\%\) by the end of the season.</p>

<p>Is it necessarily true that it was exactly \(75\%\) at some point? Why or why not? <a href="https://twitter.com/TaterTotient/status/1563246271884042253">Source</a></p>

<p><strong>Extension</strong>: For which integer triples \((a,b,c)\) can a basketball player go from a free throw average of \(a\) to \(c\) while avoiding a free throw average of \(b\).</p>

<p><a href="Solution02.html">Solution</a></p>]]></content><author><name>Siddhartha Srivastava</name></author><category term="puzzles" /><category term="puzzle" /><summary type="html"><![CDATA[Problem: A basketball player has a season free throw average of \(70\%\) halfway through the season, and raises it to \(80\%\) by the end of the season. Is it necessarily true that it was exactly \(75\%\) at some point? Why or why not? Source Extension: For which integer triples \((a,b,c)\) can a basketball player go from a free throw average of \(a\) to \(c\) while avoiding a free throw average of \(b\). Solution]]></summary></entry><entry><title type="html">Solution 2</title><link href="https://ssriva1998.github.io//puzzles/Solution02.html" rel="alternate" type="text/html" title="Solution 2" /><published>2022-08-28T00:00:00-04:00</published><updated>2022-08-28T00:00:00-04:00</updated><id>https://ssriva1998.github.io//puzzles/Solution02</id><content type="html" xml:base="https://ssriva1998.github.io//puzzles/Solution02.html"><![CDATA[<p><strong>Problem</strong>: A basketball player has a season free throw average of \(70\%\) halfway through the season, and raises it to \(80\%\) by the end of the season.
Is it necessarily true that it was exactly \(75\%\) at some point? Why or why not?</p>

<p><strong>Solution</strong>:  Let \((70\%, x_1, \dots, x_n, 80 \%)\) be the free throw averages after every free throw starting from the season’s halfway mark until the end of the season.</p>

<p>Now suppose that at no point in time was the free throw average \(75 \%\). We know that there must exist some \(i\) such that \(x_i &lt; 75\% &lt; x_{i+1}\). Suppose that the number of free throws taken at point \(i\) is \(n_i\) and the number of successful throws taken are \(s_i\). Additionally, as the free throw average increases, we know that the free throw taken after the \(i\)th point must have been successful. Therefore,</p>

\[x_i = \frac{s_i}{n_i} &lt; \frac{3}{4} \text{ and } x_{i+1} = \frac{s_i + 1}{n_i + 1} &gt; \frac{3}{4}\]

\[4s_i &lt; 3n_i \text{ and } 4s_i + 4 &gt; 3n_i + 3\]

\[4s_i &lt; 3n_i \text{ and } 4s_i + 1 &gt; 3n_i\]

<p>This is not possible for natural numbers \(s_i\) and \(n_i\) which leads to a contradiction.</p>

<p>Therefore, the basketball player must always reach a point where their free throw average is \(75\%\).</p>

<p><strong>Extension</strong>: For which integer triples \((a,b,c)\) can a basketball player go from a free throw average of \(a\) to \(c\) while avoiding a free throw average of \(b\).</p>

<p><strong>Solution (Extension)</strong>: First we look at the case where \(a &lt; c\). Looking at the previous proof, we note that all \(b\) such that \(b = n/(n+1)\) for some natural number \(n\) are unavoidable. To prove that they are the only unavoidable numbers, suppose \(b = p/q\) where \(p + 1 \not = q\). Using the same logic previously</p>

\[qs_i &lt; pn_i \text{ and } qs_i + (p-q) &gt; pn_i\]

<p>If we have \(pn_i = qs_i + 1\), we see that both equations are satsified. We know that it is always possible to find \(n_i\) and \(s_i\) such that this equation holds. To see this, note that since \(p\) and \(q\) are co-prime, there exist multiple \(n_i\) such that \(pn_i \equiv 1 \pmod{q}\). Therefore, \(pn_i = qs_i + 1\). Therefore, to avoid \(b\), we note that we can first aim to reach \(n_i\) shots with \(s_i\) successful ones while making sure that all required successful shots happen at the end (to avoid crossing \(b\) before). Then we shoot one successful free throw to get to \((s_i + 1)/(n_i + 1) &gt; b\) after which you can reach \(c\) by frontloading successful shots.</p>]]></content><author><name>Siddhartha Srivastava</name></author><category term="puzzles" /><category term="solution" /><summary type="html"><![CDATA[Problem: A basketball player has a season free throw average of \(70\%\) halfway through the season, and raises it to \(80\%\) by the end of the season. Is it necessarily true that it was exactly \(75\%\) at some point? Why or why not? Solution: Let \((70\%, x_1, \dots, x_n, 80 \%)\) be the free throw averages after every free throw starting from the season’s halfway mark until the end of the season. Now suppose that at no point in time was the free throw average \(75 \%\). We know that there must exist some \(i\) such that \(x_i &lt; 75\% &lt; x_{i+1}\). Suppose that the number of free throws taken at point \(i\) is \(n_i\) and the number of successful throws taken are \(s_i\). Additionally, as the free throw average increases, we know that the free throw taken after the \(i\)th point must have been successful. Therefore, \[x_i = \frac{s_i}{n_i} &lt; \frac{3}{4} \text{ and } x_{i+1} = \frac{s_i + 1}{n_i + 1} &gt; \frac{3}{4}\] \[4s_i &lt; 3n_i \text{ and } 4s_i + 4 &gt; 3n_i + 3\] \[4s_i &lt; 3n_i \text{ and } 4s_i + 1 &gt; 3n_i\] This is not possible for natural numbers \(s_i\) and \(n_i\) which leads to a contradiction. Therefore, the basketball player must always reach a point where their free throw average is \(75\%\). Extension: For which integer triples \((a,b,c)\) can a basketball player go from a free throw average of \(a\) to \(c\) while avoiding a free throw average of \(b\). Solution (Extension): First we look at the case where \(a &lt; c\). Looking at the previous proof, we note that all \(b\) such that \(b = n/(n+1)\) for some natural number \(n\) are unavoidable. To prove that they are the only unavoidable numbers, suppose \(b = p/q\) where \(p + 1 \not = q\). Using the same logic previously \[qs_i &lt; pn_i \text{ and } qs_i + (p-q) &gt; pn_i\] If we have \(pn_i = qs_i + 1\), we see that both equations are satsified. We know that it is always possible to find \(n_i\) and \(s_i\) such that this equation holds. To see this, note that since \(p\) and \(q\) are co-prime, there exist multiple \(n_i\) such that \(pn_i \equiv 1 \pmod{q}\). Therefore, \(pn_i = qs_i + 1\). Therefore, to avoid \(b\), we note that we can first aim to reach \(n_i\) shots with \(s_i\) successful ones while making sure that all required successful shots happen at the end (to avoid crossing \(b\) before). Then we shoot one successful free throw to get to \((s_i + 1)/(n_i + 1) &gt; b\) after which you can reach \(c\) by frontloading successful shots.]]></summary></entry><entry><title type="html">Puzzle 1</title><link href="https://ssriva1998.github.io//puzzles/Puzzle01.html" rel="alternate" type="text/html" title="Puzzle 1" /><published>2022-08-21T00:00:00-04:00</published><updated>2022-08-21T00:00:00-04:00</updated><id>https://ssriva1998.github.io//puzzles/Puzzle01</id><content type="html" xml:base="https://ssriva1998.github.io//puzzles/Puzzle01.html"><![CDATA[<p><strong>Problem</strong>: Suppose you have an \(n \times n\) grid. Show that for any \(2n - 1\) points chosen on the grid, there exist \(3\) points that form a right-angle triangle.</p>

<p><strong>Extension</strong>: Show that \(2n - 2\) points aren’t sufficient to get an (axis-aligned) right-angle triangle. Is it sufficient to get any right-angle triangle (not necessarily axis-aligned)?</p>

<p><a href="Solution01.html" class="solutioncss">Solution</a></p>]]></content><author><name>Siddhartha Srivastava</name></author><category term="puzzles" /><category term="puzzle" /><summary type="html"><![CDATA[Problem: Suppose you have an \(n \times n\) grid. Show that for any \(2n - 1\) points chosen on the grid, there exist \(3\) points that form a right-angle triangle. Extension: Show that \(2n - 2\) points aren’t sufficient to get an (axis-aligned) right-angle triangle. Is it sufficient to get any right-angle triangle (not necessarily axis-aligned)? Solution]]></summary></entry><entry><title type="html">Solution 1</title><link href="https://ssriva1998.github.io//puzzles/Solution01.html" rel="alternate" type="text/html" title="Solution 1" /><published>2022-08-21T00:00:00-04:00</published><updated>2022-08-21T00:00:00-04:00</updated><id>https://ssriva1998.github.io//puzzles/Solution01</id><content type="html" xml:base="https://ssriva1998.github.io//puzzles/Solution01.html"><![CDATA[<p><strong>Problem</strong>: Suppose you have an \(n \times n\) grid. Show that for any \(2n - 1\) points chosen on the grid, there exist \(3\) points that form a right-angle triangle.</p>

<p><strong>Solution</strong>: The standard solution here is to use the pigeon-hole principle.</p>

<p>We note that the existence of an (axis-aligned) right-angle triangle is guaranteed if there exists a point such that there exists one point in the same row (i.e. with the same y-coordinate) and another point in the same column (i.e. with the same x-coordinate).</p>

<p>This motivates us to try to find the number of points that share a row/column with another point. To find the minimum number of points that share a row/column with another point, we find the maximum number of points that don’t share a row/column with another point. This comes out to \(n - 1\) since we can isolate \(n-1\) points in \(n - 1\) row/columns (we can’t do \(n\) since we only have \(n\) rows and given we have \(&gt;n\) points, one row will have more than one point.)</p>

<p>Therefore, the minimum number of points that share a row is \(n\). Likewise, the number of points that share a column is \(n\). Given that we have only \(2n - 1\) points, we see that there must be \(1\) point which both shares a row with another point and shares a column with another point.</p>

<p><strong>Extension</strong>: Show that \(2n - 2\) points aren’t sufficient to get an (axis-aligned) right-angle triangle. Is it sufficient to get any right-angle triangle (not necessarily axis-aligned)?</p>

<p><strong>Solution (Extension)</strong>: If the grid is \([1,n] \times [1,n]\), consider the \(2n - 2\) points \((1,1), (1,2), \dots, (1,n-2), (1,n-1), (2,n), (3,n), \dots, (n-1,n), (n,n)\). We see that no right-angle triangle can be made (even non axis aligned).</p>]]></content><author><name>Siddhartha Srivastava</name></author><category term="puzzles" /><category term="solution" /><summary type="html"><![CDATA[Problem: Suppose you have an \(n \times n\) grid. Show that for any \(2n - 1\) points chosen on the grid, there exist \(3\) points that form a right-angle triangle. Solution: The standard solution here is to use the pigeon-hole principle. We note that the existence of an (axis-aligned) right-angle triangle is guaranteed if there exists a point such that there exists one point in the same row (i.e. with the same y-coordinate) and another point in the same column (i.e. with the same x-coordinate). This motivates us to try to find the number of points that share a row/column with another point. To find the minimum number of points that share a row/column with another point, we find the maximum number of points that don’t share a row/column with another point. This comes out to \(n - 1\) since we can isolate \(n-1\) points in \(n - 1\) row/columns (we can’t do \(n\) since we only have \(n\) rows and given we have \(&gt;n\) points, one row will have more than one point.) Therefore, the minimum number of points that share a row is \(n\). Likewise, the number of points that share a column is \(n\). Given that we have only \(2n - 1\) points, we see that there must be \(1\) point which both shares a row with another point and shares a column with another point.]]></summary></entry></feed>