Author Archives: Brent

About Brent

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

Competitive programming in Haskell challenge: Letter Optimization

Now that I’ve wrapped up my series of posts on Infinite 2D Array (challenge, part 1, part 2, part 3), I’d like to tackle another topic related to competitive programming in Haskell. I won’t tell you what the topic is … Continue reading

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

Competitive programming in Haskell: Infinite 2D array, Level 4

In a previous post, I challenged you to solve Infinite 2D Array using Haskell. After deriving a formula for that involves only a linear number of terms, last time we discussed how to efficiently calculate Fibonacci numbers and binomial coefficients … Continue reading

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

Subtracting natural numbers: types and usability

For several years now I have been working on a functional teaching language for discrete mathematics, called Disco. It has a strong static type system, subtyping, equirecursive algebraic types, built-in property-based testing, and mathematically-inspired syntax. If you want to know … Continue reading

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

Competitive programming in Haskell: Infinite 2D array, Levels 2 and 3

In a previous post, I challenged you to solve Infinite 2D Array using Haskell. As a reminder, the problem specifies a two-parameter recurrence , given by for for for . Last time, we derived a formula for that involves only … Continue reading

Posted in competitive programming, haskell | Tagged , , | 1 Comment

Binary search over floating point representations

I got some good feedback on my last post about binary search, and thought it was worth a follow-up post. An important fix First things first: commenter Globules pointed out that doing (l+r) `div` 2 can overflow; my initial, glib … Continue reading

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

Competitive programming in Haskell: better binary search

Binary search is a workhorse of competitive programming. There are occasional easy problems where binary search is the solution in and of itself; more often, it’s used as a primitive building block of more complex algorithms. It is often presented … Continue reading

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

Swarm virtual hackathon

This Wednesday, December 14, we will have the first (annual? monthly? probably somewhere in between…) Swarm swarm, i.e. collaborative virtual hackathon. Details can be found here on the Swarm wiki. Time: 8am-5pm CST / 9am-6pm EST / 2pm-11pm UTC (feel … Continue reading

Posted in haskell, projects | Tagged , , , , | Leave a comment

Competitive programming in Haskell: Infinite 2D array, Level 1

In my previous post, I challenged you to solve Infinite 2D Array using Haskell. As a reminder, the problem specifies a two-parameter recurrence , given by for for for . We are given particular values of and , and asked … Continue reading

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

Swarm alpha release!

The Swarm development team is very proud to announce the very first alpha release of the game. There are still many missing features (for example, saving games is not yet possible) and known bugs, but at this point it’s quite … Continue reading

Posted in haskell, projects | Tagged , , , , | Leave a comment

Competitive programming in Haskell: Infinite 2D array

If you like number theory, combinatorics, and/or optimizing Haskell code, I challenge you to solve Infinite 2D Array using Haskell. Level 1: can you come up with a general formula to compute ? Level 2: In general, how can you … Continue reading

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