Author Archives: Brent

About Brent

Assistant Professor of Computer Science at Hendrix College. Functional programmer, mathematician, teacher, pianist, follower of Jesus.

Competitive programming in Haskell: cycle decomposition with mutable arrays

In my previous post I I challenged you to solve Chair Hopping: if a bunch of people permute themselves according to the same rule twice, how many different rules could they be following which would result in the observed final … Continue reading

Posted in competitive programming, haskell | Tagged , , , | 2 Comments

Competitive programming in Haskell: 2D cross product, part 1

Time for some more geometry! In my previous post I challenged you to solve Cookie Cutters, which asks us to scale the vertices of a polygon so that it has a certain prescribed area. It’s possible to solve this just … Continue reading

Posted in competitive programming, haskell | Tagged , , , | 5 Comments

Competitive programming in Haskell: data representation and optimization, with cake

In my previous post I challenged you to solve Checking Break, which presents us with a cake in the shape of a rectangular prism, with chocolate chips at various locations, and asks us to check whether a proposed division of … Continue reading

Posted in competitive programming, haskell | Tagged , , , , , | 7 Comments

Competitive programming in Haskell: vectors and 2D geometry

In my previous post (apologies it has been so long!) I challenged you to solve Vacuumba, which asks us to figure out where a robot ends up after following a sequence of instructions. Mathematically, this corresponds to adding up a … Continue reading

Posted in competitive programming, haskell | Tagged , , , , | 2 Comments

Anyone willing to help me get set up with something like miso?

For the last few years I’ve been working (off and on) on a teaching language for FP and discrete math. One of the big goals is to build a browser-based IDE which runs completely client-side, so students can code in … Continue reading

Posted in haskell | Tagged , , , , | 6 Comments

Competitive programming in Haskell: permutations

In my previous post I challenged you to solve The Power of Substitution. This problem presents us with a substitution cipher, and asks how many times we would have to iterate the encoding process in order to turn a given … Continue reading

Posted in competitive programming, haskell | Tagged , , , , , , , | 5 Comments

Competitive programming in Haskell: building unordered trees

In my previous post I challenged you to solve Subway Tree System, which encodes trees by recording sequences of steps taken away from and towards the root while exploring the whole tree, and asks whether two such recordings denote the … Continue reading

Posted in competitive programming, haskell | Tagged , , , , , , , , , | 26 Comments

Competitive programming in Haskell: sorting tree shapes

In my previous post I challenged you to solve this problem, which essentially asks how many distinct binary tree shapes are created when we take lists of numbers and build a tree from each by repeated binary search tree insertion. … Continue reading

Posted in competitive programming, haskell | Tagged , , , , , , , | 19 Comments

Competitive programming in Haskell: summer series

Now that this weird and crazy semester is finally over, I’d like to get back to doing some blogging (among other things). I’m going to return to my series on competitive programming in Haskell (previous posts here: basic setup; code … Continue reading

Posted in competitive programming, haskell | Tagged , , , | 6 Comments

Data structure challenge: application

I forgot to mention this in my previous post, but the thing which got me thinking about the predecessor problem in the first place was this competitive programming problem on Open Kattis: Profitable Pizzas I challenge you to go and … Continue reading

Posted in data structures | Tagged , , , , , , , , , , , , , , | Leave a comment