Fast Polynomial Multiplication Using the Fourier Transform Algorithm

Fast Polynomial Multiplication Using the Fourier Transform Algorithm

The Fourier transform is a relatively difficult to understand algorithm, whether the fast version (FFT) or the slow one, based directly on the mathematical definition. I’ll give you an overview of the algorithm and how it can be used, specifically for polynomial multiplication, one of the classic applications. Why polynomial multiplication? While it may not…

Shortest Path on a Dynamic Graph

Shortest Path on a Dynamic Graph

Here’s a nice little algorithmic problem I solved several years ago. This problem isn’t that hard, but it wasn’t until recently that I came up with a way to prove that the algorithm works. The statement of Galactic Taxes can be summarized as follows: Given a graph in which edges have a cost specified by…

Solving “Mountainous Landscape,” a Fun Geometry Problem

Solving “Mountainous Landscape,” a Fun Geometry Problem

I have a problem. Would you like to help me out? The statement of Mountainous Landscape can be summarized as follows: Given a polyline, for every segment \(S\), find the first (closest) segment \(R\) to the right, which you’d be able to see if you stand on \(S\). Your vision field can be modeled as…

How to Test Complex Logic Containing Lots of I/O

How to Test Complex Logic Containing Lots of I/O

Let’s say we are making a desktop or mobile app that downloads a file to your system, and we have the following additional requirements: Pretty complex. We could model this using a flowchart: If we implement this model, it’ll end up having a rather high cyclomatic complexity, so even if we code it correctly, it…

One of the Most Useful Language Learning Tricks

One of the Most Useful Language Learning Tricks

A common situation I face when writing in any of the three languages I commonly use (English, Spanish, and Japanese) is not being 100% sure if the phrase I wrote is grammatically correct. This happens to me even in my mother tongue, not just in my non-native languages. There’s a little neat trick that allows…

Trying out Grammarly

Trying out Grammarly

I’ve been thinking about writing more blog posts, but one thing that always bugs me is that I’m a bit too perfectionist when proofreading an article before posting it. One of the reasons why I feel a lot of resistance towards writing is that it’s too cumbersome to make a post ready to be published.…

One of the Coolest Convex Hull Problems Ever

One of the Coolest Convex Hull Problems Ever

Not too Convex Hull is one of the coolest computational geometry problems involving convex hulls I’ve ever solved. Given a finite set of \(N\) points, a number \(B\) of polygons to build, and a center \(C\), you must find \(B\) convex polygons having \(C\) as a common vertex such that the total area of all…

Solving the Dice Game Pig Using Approximation Methods

Solving the Dice Game Pig Using Approximation Methods

Today I’ll explain how to solve the Hold or Continue? problem, which appeared in the ICPC Latin American Regional – 2019 competitive programming contest. This was one of the hardest problems in the set, which you can find here. The problem can be summarized as follows: Pig is a simple dice game for two or…

(Radial Sweep) Find the Largest Square That Does Not Contain Any of the Given Points

(Radial Sweep) Find the Largest Square That Does Not Contain Any of the Given Points

Build the Perfect House is one of the problems that appeared in the ICPC Latin American Regional – 2019 competitive programming contest. It can be summarized as follows: Given a finite set of points, find the square centered in \((0, 0)\) with the largest size that does not contain any of the given points. The…

Finding the Convex Polygon with the Largest Number of Vertices

Finding the Convex Polygon with the Largest Number of Vertices

In this article, I’ll explain how to solve the following problem, which can be summarized as follows: Given a finite set of non-collinear points in the first quadrant, find the convex polygon which has one vertex in the origin, and that has the largest number of vertices (by choosing some or all of the given…

Close