Author Archives: Brent

About Brent

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

Types versus sets in math and programming languages

For several years I have been designing and implementing a functional teaching language especially for use in the context of a Discrete Mathematics course. The idea is for students to be exposed to some functional and statically-typed programming early in … Continue reading

Posted in projects, teaching | Tagged , , , , , , | 10 Comments

Competitive programming in Haskell: folding folds

Now that the semester is over—and I will be on sabbatical in the fall!—you can expect a lot more competitive programming in Haskell posts. In a previous post, I challenged you to solve Origami. j0sejuan took me up on the … Continue reading

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

Average and median via optimization

This is certainly not a new observation, and I’m sure it is folklore and/or contained in various textbooks, but it was amusing to derive it independently. Suppose we have a finite set of real numbers , and we want to … Continue reading

Posted in math | Tagged , , , , | Leave a comment

Competitive programming in Haskell: folding challenge

As of this writing, I am the only person who has solved Origami on Open Kattis (see the problem statistics here). This is a shame since it is a very nice problem! Of course, I solved it in Haskell. I … Continue reading

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

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 , , , | 6 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 , , , , | 7 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