Author: Ryan Vogt

Making Objects Immutable

This blog post describes what immutable objects are in object-oriented programming. After reading this post, you should be able to implement immutable objects, and understand how they can be used to prevent unintended side effects in our code.

Computing Power Sets

This blog post describes what power sets are and how to compute them recursively. After reading this post, you should understand how to derive the power set of a given set, and appreciate the immense computational expense of computing a power set.

The Pigeonhole Principle and Hash Tables

This blog post describes what the pigeonhole principle states, demonstrates how to prove its correctness by contrapositive, then applies the pigeonhole principle to the hash table data structure. After reading this post, you should understand how to prove the pigeonhole principle, and recognize situations in computer science where it applies.

Wrapping Multiline Macros in C With Do/While

This blog post describes logical errors that can occur with multiline macros in C programming, and demonstrates how to resolve them directly in the definition of the macro itself. After reading this post, you should understand why wrapping multiline C macros with a “do/while” statement is a best practice to avoid these logical errors.

Reversing Your Approach to Induction

After reading this post, you should feel comfortable writing proofs by induction in the order of inductive step first, followed by base cases. You should be able to use this method of writing proofs to identify the correct base cases in problems where it is not clear how many or which base cases are necessary.