## Advent of Code 2022 - Lean4

December 29, 2022

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

## Research Updates - April 2022

May 02, 2022

I have a few exciting updates to share!

## A quantum-inspired solution to a CP problem

February 11, 2022

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.

## Function optimization - a problem from AdventOfCode 2021

December 08, 2021

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.

## ICPC WF 2020, Problem C. Domes

November 12, 2021

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

## [CP] Approaching Geometry Problems

November 08, 2021

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!

July 01, 2021

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

June 23, 2021

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.

## Regular tilings of the 2D plane

June 03, 2021

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.

## Helping people in difficult times - Covid Info Hub by Chennai School Students

May 31, 2021

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.

## [Haskell for CP] Solving an interactive problem using laziness

May 31, 2021

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.

## What is a variety?

May 26, 2021

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!

## Haskell in C++: Implementing pure functional constructs in c++ using templates

May 21, 2021

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.

May 17, 2021

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.

## [Haskell for CP] Exploiting laziness for memoized DPs

May 12, 2021

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.

## A calculator in C++ - at compile time!

March 07, 2021

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!

## Sprague-Grundy: Why is it XOR?

February 23, 2021

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.

## Solving a functional equation using Lean

February 22, 2021

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.

## Awesome Software/Tools for Programming

December 01, 2020

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

## [Haskell for CP] Some Basic Problems

November 27, 2020

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

## [Haskell for CP] Knapsack DP reinvented

November 13, 2020

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.

## [Haskell for CP] Introduction and our first problem

October 30, 2020