---
title: "Math is Everywhere"
description: "Some lazy and short-sighted developers claim that you don't need math to be a programmer. Based on my personal experience, I can say that math can improve a developer's life in ways they never expected."
canonical_url: "https://otabek.io/blogs/math-is-everywhere"
md_url: "https://otabek.io/blogs/math-is-everywhere.md"
language: "en"
last_updated: "2024-06-06"
tags: ["Math"]
---

# Math is Everywhere

Some lazy and short-sighted developers claim that you don't need math to be a programmer. Based on my personal experience, I can say that math has improved my life as a developer far more than I expected. Let me prove it with some examples.

![Math is everywhere meme](https://telegra.ph/file/e0433ffc8fdb88f5b3d27.png)

### Math is in Algorithms

Imagine you're in an interview, and you're asked to calculate the sum of numbers from **1** to **100**. Would you just add up all the numbers manually? What if it were **1** to **1 million**, or even **1** to **N**, or **n** to **m**? This is where math comes in to help. The answer: **Arithmetic progression**.

$$S_n = \frac{(a_1 + a_n)n}{2}$$

With this formula, you can easily calculate the sum of numbers between **x** and **y** by just plugging in the starting number, the ending number, and the total count. Congratulations, you now have the skills to solve this [LeetCode problem](https://leetcode.com/problems/product-of-array-except-self) in **Time: O(1)**.

At school, you were taught the equation

$(a + b)^2 = a^2 + 2ab + b^2$

They probably also taught you how to expand

$(a+b)^2$

and

$(a+b)^3$

But what if an interview asks you to expand

$(a+b)^{10} = ?$

Well, that's easy too: **Pascal's triangle or Binomial expansion**.

<iframe width="560" height="315" src="https://www.youtube.com/embed/v9Evg2tBdRk?si=XB9nAQkDF_Prz2_s" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe>

Congratulations! Now you can solve this [LeetCode problem](https://leetcode.com/problems/pascals-triangle 'LeetCode Problem'). In short, learning math can teach you how to ace FAANG interviews.

### Math is in the Tech World

Ever tried having a conversation in a noisy room? 🙉 Imagine two friends recording a podcast, but they're both talking at the same time. The result? Audio chaos! Or picture this: you're doing an important interview when suddenly - _WAAAH!_ - someone's baby starts crying in the background. How do we fix these messy sound problems?

Math swoops in like a superhero wearing a calculator-shaped cape! The secret weapon? Something called **Fourier transform**.

<iframe width="560" height="315" src="https://www.youtube.com/embed/spUNpyF58BY?si=MG8b1paE0jI1pONu" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe>

Think of human voices like waves at the beach - they go up and down in patterns (we call these sinusoidal waves). This amazing math formula can separate different sound waves from each other, like magically sorting red, blue, and green marbles that were all mixed together.

It's so powerful that your phone uses it to clean up background noise when you make calls! Without this math, your video calls during the pandemic would have been even more painful - imagine hearing your coworker's dog, kids, and blender all at once! 🤯

Want to learn how this magic works? Check out the video above - it explains everything with pretty animations instead of scary equations!

### Conclusion

In conclusion, everything you use and develop in technology has math underlying it. Let's learn math. Prove and explain its usefulness to your friends as well!

---

```quiz
{
  "quiz": {
    "id": "math-programming-quiz",
    "title": "Math in Programming Quiz",
    "description": "Test your understanding of math concepts in programming",
    "questions": [
      {
        "id": "q1",
        "type": "single-choice",
        "question": "What mathematical concept helps you calculate the sum of 1 to N in O(1) time?",
        "options": [
          { "id": "a", "text": "Arithmetic progression", "description": "" },
          { "id": "b", "text": "Multiplication tables", "description": "Multiplication is basic. Arithmetic progression gives you the formula." },
          { "id": "c", "text": "Division", "description": "The formula uses division, but the concept is arithmetic progression." },
          { "id": "d", "text": "Counting one by one", "description": "That would be O(n). The formula gives O(1)." }
        ]
      },
      {
        "id": "q2",
        "type": "drag-fill",
        "question": "Complete the sum formula for arithmetic progression:",
        "template": "S = ({{b1}} + {{b2}}) * n / 2",
        "options": [
          { "id": "opt1", "content": "a1" },
          { "id": "opt2", "content": "an" }
        ],
        "blanks": [
          { "id": "b1" },
          { "id": "b2" }
        ]
      },
      {
        "id": "q3",
        "type": "single-choice",
        "question": "What helps you expand (a+b)^10 without manual calculation?",
        "options": [
          { "id": "a", "text": "Pascal's triangle / Binomial expansion", "description": "" },
          { "id": "b", "text": "Addition", "description": "You'd need Pascal's triangle or binomial theorem for this." },
          { "id": "c", "text": "Subtraction", "description": "Pascal's triangle is the key concept here." },
          { "id": "d", "text": "Guessing", "description": "Math provides a systematic way through Pascal's triangle!" }
        ]
      },
      {
        "id": "q4",
        "type": "single-choice",
        "question": "What mathematical concept is used to separate different sound waves?",
        "options": [
          { "id": "a", "text": "Fourier transform", "description": "" },
          { "id": "b", "text": "Addition", "description": "Fourier transform is the mathematical tool for signal processing." },
          { "id": "c", "text": "Counting", "description": "Fourier transform separates wave frequencies." },
          { "id": "d", "text": "Averaging", "description": "Fourier transform decomposes signals into frequencies." }
        ]
      },
      {
        "id": "q5",
        "type": "single-choice",
        "question": "How do human voices appear mathematically?",
        "options": [
          { "id": "a", "text": "As sinusoidal waves", "description": "" },
          { "id": "b", "text": "As straight lines", "description": "Sound waves are oscillating, not straight lines." },
          { "id": "c", "text": "As random dots", "description": "Sound has wave patterns, not random dots." },
          { "id": "d", "text": "As squares", "description": "Sound waves are sinusoidal, not square." }
        ]
      },
      {
        "id": "q6",
        "type": "multiple-choice",
        "question": "Where is math used in technology? (Select all that apply)",
        "options": [
          { "id": "a", "text": "Algorithms and data structures", "description": "" },
          { "id": "b", "text": "Audio and signal processing", "description": "" },
          { "id": "c", "text": "Only in calculators", "description": "Math is everywhere in tech, not just calculators!" },
          { "id": "d", "text": "LeetCode interview problems", "description": "" }
        ]
      }
    ]
  },
  "answers": {
    "q1": { "correctOptionIds": ["a"] },
    "q2": { "correctPlacements": { "b1": "opt1", "b2": "opt2" } },
    "q3": { "correctOptionIds": ["a"] },
    "q4": { "correctOptionIds": ["a"] },
    "q5": { "correctOptionIds": ["a"] },
    "q6": { "correctOptionIds": ["a", "b", "d"] }
  }
}
```


## Sitemap

See the full [Markdown sitemap](/sitemap.md) for all pages.
