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

What is computing?

January 05, 2024

There has been a lot of interest in Quantum Computing in recent years, but what makes it different from regular computing? To understand that, let’s first try to ponder what “computing” is.

Read more...

Latex Pro Tips

August 02, 2023

A collection of useful latex tips for writing scientific papers and reports. I’ll keep updating this page as I learn new tricks!

Read more...

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

Read more...

A quantum-inspired solution to a CP problem

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...

Function optimization - a problem from AdventOfCode 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.

Read more...

ICPC WF 2020, Problem F. Ley Lines

Solution and explanation for Problem F. Ley Lines from the ICPC World Finals 2020, along with the implementation.

Read more...

ICPC WF 2020, Problem C. Domes

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

Read more...

[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!

Read more...

Haskell in C++: The IO Monad

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.

Read more...

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.

Read more...

[Haskell for CP] Solving an interactive problem using laziness

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...

What is a variety?

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...

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.

Read more...

Advent Of Code 2020 - in Haskell

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.

Read more...

[Haskell for CP] Exploiting laziness for memoized DPs

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...

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!

Read more...

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.

Read more...

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.

Read more...

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.

Read more...

[Haskell for CP] Some Basic Problems

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

Read more...

[Haskell for CP] Knapsack DP reinvented

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...
Blogs Home | Full Blogs List | All Tags