Skip to content

Instantly share code, notes, and snippets.

@JoelQ
Last active February 27, 2023 17:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JoelQ/95fd5f02c92a6eb3b56f43c6ce90bcb4 to your computer and use it in GitHub Desktop.
Save JoelQ/95fd5f02c92a6eb3b56f43c6ce90bcb4 to your computer and use it in GitHub Desktop.

The Math Every Programmer Needs

Abstract

Leave your fear of math behind along with the equations and symbols, we're headed to Ruby-land! On this whirlwind tour, we’ll explore how to write better conditionals with Boolean algebra, figure out how many test cases we need with combinatorics, a mental model for breaking down large tasks with graph theory, and more.

You’ll leave this talk equipped to better do your job with some ideas, techniques, and mental models from the wonderfully practical world of discrete math.

Details

This talk is primarily aimed at those who have joined the industry without going through a traditional computer science degree. It aims to teach the practical parts of discrete math that a jobbing programmer can expect to use on a regular basis to do their work.

Secondarily, this talk is aimed at those who may have studied discrete math in college but didn't see the point. I want to inspire them to see how they can apply the theory that they had learned.

This talk will avoid getting bogged down in theory or symbols. For the most part I will be showing Ruby code or visualizations. I aim to approach the topic through two lenses:

  1. Ideas that can help us in common daily tasks, such as simplifying conditional code with boolean logic.
  2. Analytical techniques to help us understand code, such as truth tables

Discrete Math is a grab-bag of different disciplines within math. I don't plan to go into any depth. Instead, I will take ~5 mins for each and show the big idea of this discipline along with one or two concrete examples of how this can help improve our daily programming work.

This is a rough outline of the topics I plan to go through as well as the examples I want to show:

  • Write better conditionals with boolean algebra
    • Don't use if all the time
    • Use DeMorgan's laws to spot bugs
    • Truth tables as a visual tool
    • Expanding to decision tables
  • Graphs
    • Using a dependency graph to break down a large task
  • Sets as a mental model
    • Venn diagrams as a visual tool
    • Understanding SQL joins
    • Designing better types
  • Combinatorics
    • How many unit tests do you need?
    • Designing better database schemas
  • Probability
    • What are the odds of a collision for this unique ID?
  • Predicate logic
    • getting better intuition around Enumerable's all vs any
    • improving your communication and interpretation

Pitch

In my opinion, discrete math is one of the most underrated subjects that’s traditionally included in a Computer Science degree. Unlike many other “fundamentals”, it is directly applicable to the daily work that most web developers do.

Boolean algebra helps me write better conditionals, combinatorics helps me figure out how many test cases I need, graphs give me a mental model for breaking down large tasks, and much more!

If I had one subject from CS that I would want to share with colleagues who took a different path into our field, this is it!

I’m a prolific writer and have spoken at conferences before. Mostly, I take complex or theoretical topics and break them down to show the useful parts in a practical setting to an intermediate audience, so this proposal is right in my wheel house. Audiences tell me I’m good at explaining things and that my content has given them “ah-ha!” moments that unlock new understanding and techniques.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment