DEV Community

Cover image for 5 Useful Maths Concepts for Software Engineers
Maddy
Maddy

Posted on • Originally published at techwithmaddy.com on

5 Useful Maths Concepts for Software Engineers

Maths is an essential tool in the field of software engineering.

As a software engineer, having a good grasp of maths, you will develop efficient software.

Not all maths concepts are equally crucial for software engineering.

This article will discuss the top 5 useful maths concepts for software engineers.

Let's start.

Boolean Algebra

Boolean algebra is a form of mathematics that deals with statements and their Boolean values.[Cambridge International]

A boolean is a binary variable with two conditions: true or false (which can also be interpreted as 1-0 or HIGH-LOW, respectively).

A real-world example of boolean algebra is when we discuss the weather: "It's sunny outside". You usually reply to this statement as "true" or "false".

In programming, if statements represent boolean algebra.

Boolean algebra also has other basic operations: AND , OR , or NOT.

Let's take the following two statements:

  • It's sunny.

  • It's rainy.

The AND operator returns true if both statements are true.

The OR operator returns true if either one of the statements is true.

The NOT operator returns the opposite of the statement.

The XOR operator returns if either one of the statements is true but not both.

Set Theory

Another useful maths concept for software engineers is set theory.

Set theory is the branch of mathematics where objects (also known as "members") are divided into sets (or collections).

A real-world example of set theory is a musician having a collection of classical vinyl records.

To make a collection, you must first understand if a member can belong to a set or not.

For example, a hip-hop vinyl record cannot belong to a collection of classical vinyl records.

In software engineering, relational databases apply the set theory to describe the relationship between two tables.

Inner, Outer, and Left/Right joins are great examples of set theory.

Inner join to select records that match both tables.

A B

Outer join to select all matching records from both tables.

A B

Left join returns all records from the first table whether or not there's a match in the second table.

(A B) (A - B)

Related : Data Business Logic In Java: jOOQ VS SPL

Floating Points

Floating point is a type of numerical representation that allows both flexibility and precision.

Floating points can represent large numbers (to describe astronomical numbers) or small numbers (to describe molecules and atoms).

"Floating" because the decimal number can "float", and it's not fixed.

Related : Java Interview Questions

Binary Number System

The binary number system is a mathematical expression that only uses 0 and 1.

Each digit in the binary number system represents a bit.

Why do we need a binary number system?

It's because computers don't understand language as humans do. Computers only understand "on" or "off". Plus, it's the simplest counting method.

The binary number system is simple because we only have two symbols available: 0 and 1. Therefore, each place gets multiplied by 2.

Complexity Theory

The computational theory is a useful maths concept often tested d

uring coding interviews.

The theory of computation is a branch of computer science and mathematics combined that "deals with how efficiently problems can be solved on a model of computation, using an algorithm".[Carnegie Mellon University]

Complexity theory helps with explaining the performance and complexity of an algorithm.

In the graph above, green is the most efficient time, with red being the least efficient.

freeCodeCamp

Why do software engineers need to know about complexity theory?

If, for example, a program is written as O(n!), it means that the program is inefficient and, therefore, should be rewritten to make it more performant.

Complexity theory allows software engineers to understand why a program takes too much time (or space) and, as a result, write a program with more optimal performance.

Related : Java Phone Interview Questions - Beginner Level

Key Takeaways

After reading this article, you know five maths concepts for software engineers:

  • Boolean Algebra.

  • Set Theory.

  • Floating Points.

  • Binary Number System.

  • Complexity Theory.

Maths is an essential tool for software engineers.

It provides the foundation for developing efficient and effective algorithms.

If you enjoyed this article, you'd benefit from subscribing to my FREE weekly newsletter.

Until next time!

🙋🏾

Resources:

Top comments (1)

Collapse
 
jonrandy profile image
Jon Randy 🎖️ • Edited

Plus, it's the simplest counting method.

Unary would beg to differ! 🙂