5 Math Skills Every Programmer Needs

Sahil & Sarra · Beginner ·📰 AI News & Updates ·3y ago

Key Takeaways

Identifies five essential math skills required for programming, including problem-solving and logical reasoning

Full Transcript

most programmers have a degree in engineering or science do you know why there are two main reasons for this one generally speaking Engineers can think logically two Engineers are good at math one of the major reasons I was able to get a job at Google without a computer science degree is because I am above average at math now I cannot teach you all the math I know in one short video you anyway don't need most of it to become a programmer let me do this I'll share five essential math skills that will get you 80 there the rest of the 20 you can learn on the go as you encounter new problems but why do programmers even need math imagine that you are a software engineer at Google and you are given a critical problem to solve many Google users are not able to access the website because of an overloaded server this problem is getting worse with every passing minute just because the client side is configured to do an automatic retry after one second for every failed call [Music] you talk to a senior engineer on the team and she recommends using exponential backup for retries what does exponential mean you ask her she points you to the documentation if your math skills are not good it might take you a long time to understand and Implement exponential piece of the algorithm even after reading the documentation in the meantime the entire internet traffic will see a huge drop because for many people no Google means no internet now if this example doesn't convince you it is an even more important reason to learn math most tech companies conduct coding interviews to see if you're a good fit for the role and whether you like it or not they ask algorithmic style questions in these interviews at the end of the interview the interviewer usually asks you time and space complexity of your solution in order to answer these questions and actually get the job you need to know some basic math concepts many people who come from a non-cs and non-engineering backgrounds have hard time answering these questions that's why I've chosen the top 5 math skills for today keeping these interviews in mind now I know that there's a sizable number of you who pretty much hate coding interviews and don't want to go through them and I completely respect your position but for for the vast majority of us we don't have the luxury to give up on our dreams just because we don't like one step of the process this video is for those people let's learn some math to learn the first concept we need to start with an exercise here is a piece of code that contains a for Loop nested inside another for Loop what is the time complexity of this code in other words how many times will this code print hello world for any arbitrary value of n this video is going to be interactive so you can pause the video and leave the answer in the comments if your answer is order n square or n Square times then you are going to benefit a lot from what I am about to tell you most of the people who answer and square do it because they confuse the code I gave you with this other piece of code they see a nested for Loop inside another and immediately conclude n Square which is the wrong answer in this case to understand why that is let's think from the first principles looking at the code it's obvious that the outside for Loop runs n times each time this outside Loop runs we go inside and run this nested Loop K times we don't know what that K is at this time but we'll find out shortly so in total we print K into n hello world statements now if you look at this other easier and more popular piece of code the internal Loop also runs end times but that's not the case in the code I gave you what I want you to take away from this is that whenever you have a that happens x times and every time a happens B happens y times B will happen a total of X into y times now to know the value of K in the last exercise you need to know the second concept so here is a question for you you're given a stick that is 32 meters in length you break it into two halves you throw the right piece away and you break the left piece into two halves again you throw away the right half and keep breaking the left piece until you have a stick of length one meter left how many times did you break the stick in total you can pause the video and leave the answer below if you answered 5 then you are right here is an interesting observation about the answer if you take 2 which is the total number of pieces you break the stick into every time and if you take five which is your final answer and you multiply 2 to itself 5 times you get 32 which is the original length of the stick in other words 2 to the power 5 is 32 whenever you have an equation like this 5 is called the logarithm of 32 technically speaking its logarithm to the base 2 but a science people usually terms of logarithm to the base two so we can just call it logarithm or log here for our purpose but it's important to know that in math people usually mean logarithm to the base 10 when they say log I recommend that you read a little bit more about logarithm on your own anyway in the generic case if 2 to the power of X is n the next is called the logarithm of n so in the stick example we broke the sticker total of log 32 times which is 5. going back to the example with two for Loops if you look closely at the internal for Loop it does exactly the opposite of the stick breaking example we start with the Stick of length one when you do J is equal to J multiplied by 2 or in other words you double the length you are bringing a stick of the same length from somewhere and you are attaching it to the original stick and you keep doing it until you reach the length n so how many times do you have to double the length of the stick this way until you reach the length of n looking at the stick example I gave you it's going to be log n and that's the cave you are looking for so total number of times you print hello world in this case is n into K which is n log n if you have some X experience with algorithms I'm sure you have already seen that the stick breaking example is very similar to binary search algorithm logarithm also appears in some other algorithms like sorting and some Heap related problems before I can explain what exponential means in exponential back off we have to understand this third concept of the day for that I have another question for you how many three digit numbers can you make by using digits one two and three given that you can use each digit only once you can pause the video and leave the answer in the comments if you answered 6 then you are right but what if I ask the same question for nine digit numbers using digits one to nine without repetition to answer this question you would need to know what a factorial is let's understand factorial using the three digit problem we can call the first digit a second one b and the third one C let's pick the first digit of this number for that we can use any digit from 1 2 and 3. so we have three options here let's say we pick 2 for the first digit for the second digit we only have two options left because we can use one digit only once let's say we pick 3 for the second digit now for the last digit you only have one option which is one so a can have three values and for each a we can have two values and for each P C can have one value can you see that we can use the first concept we learned today here so the total three digit numbers would be a multiplication of three two and one which is six for the nine digit case using all the digits from one to nine the answer would be the multiplication of all the numbers from one to nine and this multiplication is called Nine factorial and is written like this factorial is nothing but the multiplication of all the numbers from 1 to that number including the number itself Factor appears in many algorithms like finding subsets of a set and permutation of numbers Etc now that we have that out of the way let's talk about the fourth concept which is exponentials and for that we need to go back to the three digit numbers example let me change the question a little bit for you how many three digit numbers can you make using the digits one two and three if you can use a digit more than once I would love to see your answer in the comments if you go back to the example I gave you for factorials you will see that now we have three options for a b and c and that's why total such numbers now would be 3 into 3 into 3 which is 3 to the power 3. and this is called exponentiation or exponential let's try to understand exponential backup based on what we know now in the exponential back of algorithm you will do the first free trial for a field request after X seconds if the request fails again you will increase the wait time for retry by let's say two times if the request fails one more time you increase the wait time by two times again and you keep doing it if you look closely the wait time for retrying the field request is increasing exponentially here hence the name exponential back off one of the main characteristics of something that is exponential is that it increases or decreases really fast for example the spread of covid was exponential because one person could let's say infect three people and each of those three will infect three more and so on exponential growth is a powerful concept for life in general and it can be life-changing for new programmers the speakers in the beginning most programmers have the snacking feeling that they are not growing fast enough many get demotivated and give up as a result but here is a graph showing the power of exponentiation from the book Atomic Habits by James Clear if you just improve my one percent each day for 365 days you will be 38 times better at the end of the year and if you build bad habits and become just one person worse each day you will lose 97 percent of what you have today in one year thus exponentiation and action for you my friend another concept you need to know about is modulus for positive numbers modulus or mod is the same as what you would normally call remainder in the division of two numbers modulus operator is written as a percentage sign so 27 mod 5 is 2 which is the same as the remainder when you divide 27 by 5 for negative numbers there is a small difference between mod and remainder which I recommend you read up yourself some popular interview problems that use mod are find greatest common divisor of two numbers and Fizz Buzz so now you know the math you need to become a programmer next you need a simple well-defined step-by-step path to learn programming if you want to know the path I recommend watch this video my name is sahil and I'll see you in the next one

Original Description

Do you need math to become a programmer? Are Software Engineers good at Math? If yes, how much Math do you need to learn coding? I will answer these questions today. ► For more content like this, subscribe to our channel: https://www.youtube.com/PowerCouple26 ► Follow us on Linkedin: https://www.linkedin.com/in/gabag26 https://www.linkedin.com/in/sarrabounouh ► Let's be FRIENDS! https://www.instagram.com/power_couple26/ ► For business inquiries, reach us on: powercouplejourney@gmail.com #coding #maths #softwareengineering
Watch on YouTube ↗ (saves to browser)
Sign in to unlock AI tutor explanation · ⚡30

Playlist

Uploads from Sahil & Sarra · Sahil & Sarra · 42 of 60

1 Product Management Internship - EASIEST Path to Become a PM
Product Management Internship - EASIEST Path to Become a PM
Sahil & Sarra
2 I Quit $200,000 Software Engineer Job at Amazon
I Quit $200,000 Software Engineer Job at Amazon
Sahil & Sarra
3 What do I do as a Product Manager? - Product Manager Role
What do I do as a Product Manager? - Product Manager Role
Sahil & Sarra
4 CHEAT SHEET that I Used to Crack Product Manager Interview at MICROSOFT
CHEAT SHEET that I Used to Crack Product Manager Interview at MICROSOFT
Sahil & Sarra
5 Why Tech Workers are Getting RICH💰💰 #shorts
Why Tech Workers are Getting RICH💰💰 #shorts
Sahil & Sarra
6 Why Is Everyone Quitting Their Six Figure Tech Job?
Why Is Everyone Quitting Their Six Figure Tech Job?
Sahil & Sarra
7 5 Years of Coding - Everything I've Learned
5 Years of Coding - Everything I've Learned
Sahil & Sarra
8 5 Highest Paying Tech Companies 💸💸 #shorts
5 Highest Paying Tech Companies 💸💸 #shorts
Sahil & Sarra
9 How I TRIPLED My Salary by Joining TECH
How I TRIPLED My Salary by Joining TECH
Sahil & Sarra
10 How I Became a Software Engineer Without a Computer Science Degree
How I Became a Software Engineer Without a Computer Science Degree
Sahil & Sarra
11 Top 5 non-CODING Tech Jobs that Pay $100,000+
Top 5 non-CODING Tech Jobs that Pay $100,000+
Sahil & Sarra
12 Top 5 Tech Jobs That Pay $100,000+ Without Coding
Top 5 Tech Jobs That Pay $100,000+ Without Coding
Sahil & Sarra
13 FASTEST Way to Learn Coding and ACTUALLY Get a Job
FASTEST Way to Learn Coding and ACTUALLY Get a Job
Sahil & Sarra
14 Coding Interviews Are Easier Than You Think
Coding Interviews Are Easier Than You Think
Sahil & Sarra
15 THIS is Why Software Engineers Make So Much Money
THIS is Why Software Engineers Make So Much Money
Sahil & Sarra
16 System Design Interviews are a SCAM
System Design Interviews are a SCAM
Sahil & Sarra
17 I got $50,000 more when I negotiated my tech salary
I got $50,000 more when I negotiated my tech salary
Sahil & Sarra
18 How I would learn to code in (If I could start over)
How I would learn to code in (If I could start over)
Sahil & Sarra
19 Google is not the best tech company
Google is not the best tech company
Sahil & Sarra
20 How YouTube is killing your programming career
How YouTube is killing your programming career
Sahil & Sarra
21 This is Why Your Resume Gets Rejected
This is Why Your Resume Gets Rejected
Sahil & Sarra
22 How I Hacked My Mind To Learn Coding
How I Hacked My Mind To Learn Coding
Sahil & Sarra
23 FASTEST Way to Learn Data Science and ACTUALLY Get a Job
FASTEST Way to Learn Data Science and ACTUALLY Get a Job
Sahil & Sarra
24 FASTEST Way to Learn Web Development and ACTUALLY Get a Job
FASTEST Way to Learn Web Development and ACTUALLY Get a Job
Sahil & Sarra
25 Why Most People FAIL to Learn Coding
Why Most People FAIL to Learn Coding
Sahil & Sarra
26 Google Engineer reveals his darkest secrets
Google Engineer reveals his darkest secrets
Sahil & Sarra
27 Become a better Programmer in 8 minutes
Become a better Programmer in 8 minutes
Sahil & Sarra
28 Start Behaving Like a Programmer
Start Behaving Like a Programmer
Sahil & Sarra
29 The Resume That Got Me Into Google
The Resume That Got Me Into Google
Sahil & Sarra
30 I solved 541 Leetcode problems. But you need only 150.
I solved 541 Leetcode problems. But you need only 150.
Sahil & Sarra
31 Why Good Programmers FAIL Coding Interviews
Why Good Programmers FAIL Coding Interviews
Sahil & Sarra
32 Can you solve this problem in one line?
Can you solve this problem in one line?
Sahil & Sarra
33 Puzzles for Software Engineers - Microsoft #1
Puzzles for Software Engineers - Microsoft #1
Sahil & Sarra
34 Puzzles for Software Engineers - Amazon #1
Puzzles for Software Engineers - Amazon #1
Sahil & Sarra
35 Layoffs = The END of Software Engineering?
Layoffs = The END of Software Engineering?
Sahil & Sarra
36 Puzzles for Software Engineers - Apple #1
Puzzles for Software Engineers - Apple #1
Sahil & Sarra
37 Puzzles for Software Engineers - Amazon #2
Puzzles for Software Engineers - Amazon #2
Sahil & Sarra
38 Puzzles for Software Engineers - Microsoft #2
Puzzles for Software Engineers - Microsoft #2
Sahil & Sarra
39 Puzzles for Software Engineers - Apple #2
Puzzles for Software Engineers - Apple #2
Sahil & Sarra
40 2-Minute Rule to Learn Coding - Atomic Habits
2-Minute Rule to Learn Coding - Atomic Habits
Sahil & Sarra
41 2 Minute Rule for Coding
2 Minute Rule for Coding
Sahil & Sarra
5 Math Skills Every Programmer Needs
5 Math Skills Every Programmer Needs
Sahil & Sarra
43 3 Developer Roadmaps That Actually Work
3 Developer Roadmaps That Actually Work
Sahil & Sarra
44 Cracked Google without a CS degree
Cracked Google without a CS degree
Sahil & Sarra
45 Top 5 Coding Languages To Get a Job
Top 5 Coding Languages To Get a Job
Sahil & Sarra
46 4 Reasons Good Programmers FAIL Coding Interviews
4 Reasons Good Programmers FAIL Coding Interviews
Sahil & Sarra
47 Reality of Software Development
Reality of Software Development
Sahil & Sarra
48 C is the grandmother of JavaScript
C is the grandmother of JavaScript
Sahil & Sarra
49 How to Hack Passwords
How to Hack Passwords
Sahil & Sarra
50 Learn Python with ChatGPT
Learn Python with ChatGPT
Sahil & Sarra
51 Learn Web Development with ChatGPT
Learn Web Development with ChatGPT
Sahil & Sarra
52 ChatGPT 2.0 aka GPT-4 is here!
ChatGPT 2.0 aka GPT-4 is here!
Sahil & Sarra
53 7 things I wish I knew in my 20s
7 things I wish I knew in my 20s
Sahil & Sarra
54 💸💸 $177,000,000 Coding Error
💸💸 $177,000,000 Coding Error
Sahil & Sarra
55 5 Google Search Secrets
5 Google Search Secrets
Sahil & Sarra
56 QWERTY Keyboard Slows Your Typing 🤔
QWERTY Keyboard Slows Your Typing 🤔
Sahil & Sarra
57 💰💰 Top 5 Highest Paying Jobs For Programmers
💰💰 Top 5 Highest Paying Jobs For Programmers
Sahil & Sarra
58 👩🏻‍💻 Top 5 Programming Languages
👩🏻‍💻 Top 5 Programming Languages
Sahil & Sarra
59 5 Steps to become a Full-Time Developer
5 Steps to become a Full-Time Developer
Sahil & Sarra
60 Coding is NOT enough
Coding is NOT enough
Sahil & Sarra

Related AI Lessons

You Are Not Behind. The World Is.
You're not behind, the world is still adapting to AI, and it's okay to take your time to learn and grow
Medium · AI
Career choice with the advent of AI - pure Computer Science or learn software with a background of core engineering area
Learn how to choose between a Computer Science and Engineering career path or combining programming with a core engineering background in the age of AI
Dev.to AI
The AI Hype Cycle: Calm Before the Next Breakthrough?
Understand the AI hype cycle to anticipate the next breakthrough and make informed decisions
Medium · Programming
AI won’t replace scientists. It will make the current model of science obsolete
AI is not replacing scientists, but rather making the current model of science obsolete, enabling new forms of discovery and collaboration
Medium · Data Science
Up next
Motorist saved by human chain | 9 News Australia
9 News Australia
Watch →