Why we need MATH for Programming (10 math concepts)
Tags: programming, development, career, beginners
Published: 2023-11-03 19:36:42

Many people believe that you don't need to know any math to be a computer programmer. While that may be partially true, understanding some essential math concepts can make programming much more accessible and help you unlock the secrets of the digital world. 

Now, let's explore the 10 math concepts that every programmer should be familiar with.

![10 math concepts cover image by shahan](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4e5s7z6ee8vm1z1hpujs.png)

## 1. Boolean Algebra

Boolean algebra is a fundamental concept in programming. It deals with binary variables that can have only two values: true or false. We use three operators to work with Boolean values: `AND`, `OR`, and `NOT`.

Imagine these as tools for making decisions. For example, if you want to know if someone is both **rich** and **handsome** to get a **girl**, Boolean variables can help you decide. If both conditions are met, he gets a girl. If not, he may have other options. You can represent this logic using if statements, [Venn diagrams](https://en.wikipedia.org/wiki/Venn_diagram), or [truth tables](https://en.wikipedia.org/wiki/Truth_table).

![boolean algebra image by shahan chowdhury](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/b1ju0l69sc4hlzual24c.png)

## 2. Numeral Systems

Computers use base-2 (binary) numeral systems, unlike humans who use base-10 (decimal) systems. In base-2, numbers are represented using only two symbols: 0 and 1. Understanding binary helps us work with other numeral systems like hexadecimal (base-16) and base-64, which are essential in programming, especially for encoding and representing data.

![Image by shahan chowdhury of binary base-2 vs binary base-10](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/legbrmu97n7rb0sytaw6.png)

## 3. Floating Point Numbers

Floating point numbers are how computers represent real numbers. They are not always precise, which can lead to tiny errors in calculations. These numbers use scientific notation to handle large and small values efficiently. Knowing the limitations of floating point numbers is crucial for avoiding these errors in your code.

```python
print(1.00000000005)  # A positive float
print(-85.6701)  # A negative float
```

## 4. Logarithmic Functions

Logarithms help us understand how some natural phenomena work. Think of a logarithm as a way to measure how many times you need to cut a log to reach a specific length. In programming, logarithmic functions are used in algorithms like binary search. These functions play a vital role in various applications, from algorithms to scientific research.

## 5. Set Theory

The set theory deals with collections of unique values. In programming, this concept is used extensively, especially in databases, where tables are sets of unique rows. Joining sets, finding intersections, unions, and differences are common operations in this context. Understanding set theory is important for working with databases and data manipulation.

![Image by shahan chowdhury of set theory](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5724rsklcbc3qanr9wma.png)

## 6. Combinatorics

Combinatorics is all about counting things and combinations. Whether you're developing algorithms for news apps or designing globally distributed databases, combinatorics helps you calculate all possible combinations or permutations efficiently. It's a valuable skill in programming.

![Image by shahan chowdhury of combinators](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/6ic3tza0tm8gih9afnpq.png)

## 7. Graph Theory

Graph theory involves nodes (vertices) connected by edges. This concept is used to model relationships and connections. Understanding graph theory is vital for solving problems like network routing and optimizing various scenarios.
![Image OF GRAPH THEORY BY SHAHAN CHOWDHURY](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/c2nwhgr17213l3puo8nd.png)
## 8. Complexity Theory (Big O Notation)

Complexity theory helps you analyze the efficiency of algorithms. Big O notation is a tool for expressing the time and memory complexity of algorithms. It helps you choose the most efficient solution for your programming tasks, a valuable skill for interviews and writing efficient code.

![Image OF BIG O NOTATION BY SHAHAN CHOWDHURY](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0tsy1vtrbbp0z11peyo0.png)

## 9. Statistics

Statistics is essential for various fields of programming, especially in artificial intelligence and machine learning. Understanding basic statistical concepts like mean, median, mode, and standard deviation is what makes you best at making predictions. It's the foundation for making predictions and decisions in [data-driven applications](https://try.sanebox.com/kxz8nr6vzzwl).

![Image OF STATISTICS BY SHAHAN CHOWDHURY](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/oh3ef03m8muoujujhrif.png)

## 10. Linear Algebra

[Linear algebra](https://en.wikipedia.org/wiki/Linear_algebra) is essential in computer graphics, deep neural networks, and many other areas of programming. It involves scalars, vectors, and matrices to represent and manipulate data. If you want to work with 3D graphics, cryptography, and machine learning, then Linear Algebra come into play. You need to master Linear Algebra to tackle these.

![Uploading OF linear algebra BY SHAHAN CHOWHDURY](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vgi0514spu0fkbqv1lq1.png)

### 🤖 Recommendation: Use Notion to boost productivity

[Notion](https://affiliate.notion.so/codewithshahan) is a fantastic tool for developers! It supports syntax highlighting for over 60 programming languages. If your day-to-day involves reading coding docs, watching programming tutorials and tracking progress, taking notes, and writing content, Notion can make you more efficient. 

Notion is more than just a note-taking app. As a developer, you can use Notion to track your freelance projects, organize your code snippets, collaborate with clients, keep track of jobs you're applying for, and integrate with third-party tools to boost your entire developer workflow 10x faster.

![notion for devs](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8udltnkn610y1xymrsyv.jpg)

[Notion AI](https://affiliate.notion.so/notion-ai-page) has the capacity to generate code, equations, graphs, and even explanations for code snippets. It is the smartest AI assistant that helps you think bigger, work faster, and augment your creativity, right inside the functional notion workspace you're already familiar with.  


![notion features](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8dwdow0zgqyothha8uy8.png)

It is available as an add-on to [Notion plans](https://affiliate.notion.so/pricing-notion), including Free Plans, for $10 per member, per month. This gives you access to all AI features in Notion. A 20% discount is available to all workspaces on any plan with _annual billing_.

![notion ai upgrade](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4bp341eav7e1qvbhqyyh.png)

---

## Conclusion
Mathematics is a powerful tool in the world of programming, and these 10 concepts are just the beginning. They can help you develop more efficient code, solve complex problems, and unveil the magic behind the digital world. These math concepts will make you a better programmer, and you'll be well-equipped to conquer a wide range of challenges in the ever-evolving field of technology.

**_You can watch a short video of this article here:_**

{% youtube https://youtu.be/YXzDDSreTkM %}

**Related articles:**
[The Roadmap to Frontend Developer in 6 months](https://dev.to/codewithshahan/must-have-frontend-development-skills-roadmap-2024-28jc)

Stay tuned for more valuable content, and if you find it helpful, you may also like my [YouTube channel](https://www.youtube.com/programmingwithshahan?sub_confirmation=1). 

You can follow me on [X](https://twitter.com/shahancd) for latest tech updates.