Math is Everywhere

Jun 6, 2024

Cover image for 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

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.

Sn=(a1+an)n2S_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 in Time: O(1).

At school, you were taught the equation

(a+b)2=a2+2ab+b2(a + b)^2 = a^2 + 2ab + b^2

They probably also taught you how to expand

(a+b)2(a+b)^2

and

(a+b)3(a+b)^3

But what if an interview asks you to expand

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

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

Congratulations! Now you can solve this 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.

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!