Want to get updates? You can add the feed link to your favourite feed reader. For email updates, you could subscribe via feedrabbit.

This year, I attempted Advent of Code in Lean 4 - A theorem prover and programming language. My full solutions are available on github:anurudhp/aoc2022

Read more...I have a few exciting updates to share!

Read more...I came across a very interesting problem in a recent team contest. Given some array $a$, we were asked to transform it into $b$ where each element of $b$ was some weighted summation of the elements of $a$. Though its solution is very old and well-known, I found thinking of it as a quantum algorithm quite useful and enlightening.

Read more...This is my approach for the 7th problem of AdventOfCode 2021, including some related variations that I came up with. I’ll be using `R`

to implement the solutions.

Solution and explanation for Problem C. Domes from the ICPC World Finals 2020, along with the implementation.

Read more...This week, I will be hosting a session on Geometry at the IIIT-H programming club, where I plan to discuss a few techniques and problems.

At first sight, computational geometry might seem very hard and intimidating. But once you familiarize yourself with some basic tools and tricks, you’ll become a geometry expert! Let’s break the myth “geometry is hard” together!

Read more...A log of what I have been up to in the last one month.

Read more...In a previous post, I described how to implement Functors in C++. Now I will try to represent the `IO` monad, with a few toy examples.

I recently came across Euclidean tilings by convex regular polygons, which is super interesting. The problem is to fill the entire (infinite) 2D plane with non-overlapping regular polygons. The simplest case is to use a single regular polygon of fixed size - called *Regular Tilings*.

My brother Abhiram - a class 12 student - and a few of his classmates started an admirable initiative to help people find proper medical care and hospital resources in Chennai during the pandemic. They created a “COVID Information Hub” where they curated verified information and links from various sources, making it easy for people to quickly find it. The Times of India even wrote an article about it.

Read more...Haskell is an interesting and beautiful language for many reasons. One is laziness, which lets us write very elegant computation recipes.

I will attempt to solve an interactive CP problem from a recent codeforces contest - Guess the K-th Zero.

Read more...Of course, I am not talking about the English word “variety” here, which everyone knows the meaning. I am referring to algebraic varieties. These are the primary objects one studies in algebraic geometry. I am no expert on the subject, but I have a little understanding of the concept. I would like to share my thoughts and insights by showing some elementary and common examples everyone would have seen sometime or the other - completely unaware that they are varieties in disguise!

Read more...When I first learnt Haskell a while back, I found it difficult to adjust my thinking to the pure-functional style. Especially because I have been coding in imperative languages for more than 7 years before that. It took me a while to fully grasp and appreciate the elegance of these constructs in Haskell, like functors and monads. At some point, I attempted to implement the same constructs in C++, to help my understanding, and get a feel of the expressive power Haskell has.

Read more...A few months ago, I was introduced to the Advent Of Code contest series. The 2020 round has just begun, and looking at the problems from previous years, I felt it would be fun and challenging to program them in Haskell. And so I got to work and got 40 out of 50 stars at the end. This was incredibly fun, and surprisingly difficult at certain stages, and I want to share my thoughts with others.

I have put up my solutions on GitHub.

In this blog I attempt to solve the Partition Problem using Haskell. The key is to utilize laziness to cleanly express the standard dynamic-programming solution for the problem.

Read more...Calculator programs are usually one of the first practice programs people implement. And writing a basic one in c++ is pretty straightforward. But today, I’ll demonstrate how to use your compiler (say `gcc`

or `clang`

) as a calculator!

I have always wondered why the *correct* way to combine nim games is taking the XOR of their grundy numbers. But never got around to learning the theory behind it.

Recently, I had a very enlightening conversation with Siddharth Bhat. He showed me a very simple and elegant proof for this.

Read more...Here is a problem from the 2019 Brazil Undergrad MO:

Find all functions \(f: \mathbb{R} \rightarrow \mathbb{R}\) satisfying \(f(x f(y) + f(x)) + f(y^2) = f(x) + y f(x + y)\)

I was curious to see if I could formalize and prove/verify this in Lean, so here goes.

Read more...This is a collection of useful software and tools that I have found over my years of programming.

Read more...This week I will be discussing a couple of basic problems: Repetitions and GCD on Blackboard

Read more...Here is the problem Money Sums that I shared in my last blog

You have $n$ coins, with values $x_1, x_2 \ldots x_n$. You have to find all possible totals you can form with them.

Read more...