Hello once again my spectacular reader,
I got a very underrated topic for you to get good at today. Underrated and completely misunderstood. It really is tragic because when it comes to designing good software solutions, this is among the highest ROI concepts for you to master.
Today we’ll be covering the idea of functions. From a math perspective. As you will see, understanding functions from a Math perspective will actually help you become a much better programmer. And learning how to take word problems, framing them as inputs + equations, and discovering relationships carries over very strongly to writing functions in programming (this is what Leetcode-style interviews are supposed to test).
Highlights
This post will cover the following ideas-
What are functions in Math- Simply put they are a way of representing the relationship b/w inputs and outputs. A function tells you the transformations that must be applied to your input to get your desired output.
Why Math Functions are relevant to coding- It’s not a coincidence that the two ideas have the same name. Both do the exact same thing. Mastering Math functions will help you get much better with writing functions in coding.
How to get good with them- Linear Programming. And precalculus. But mainly some hours into LP (and lots of tears).
You don’t want to miss this one. Allons-si mes amis.
Functions in Math
Simply put, a function relates a set of inputs to an output(s). This holds true for Math and Software Engineering. Math functions are typically denoted by-
f(x1,x2...,xn)= some set of transformations on x1,x2,...xn
Math functions take inputs and return outputs. That’s it. This might seem trivial, but this is extremely powerful. Functional Programming is built on this paradigm. Complex Machine Learning/Data Analysis Models just try to fit a very nuanced function to very complex data. Once you start treating your own (code) funcs as things that take inputs and generate outputs principles behind clean coding will become clearer (more on this later).
Why Mastering Math Functions will boost your software skills
Most of you will not be working in a mathematical domain like AI/Machine Learning or Statistical Analysis. So why should you bother getting good with functions in Math?
One thing that you have to understand is that functions in Math, Computer Science, and Software Engineering all do the same thing. They take input, apply some transformations, and generate some output. So it should not be shocking why mastering one will let you master them all.
Let me give you practical examples of how-
The skill of taking word problems/statements, teasing out the relationships between the given vars, and converting those into full-fledged functions will help you tremendously for Leetcode Style interviews. And in your own coding journies.
Writing good functions will teach you a lot about writing clean code. Once you start to understand how to chain/nest functions properly, adhering to the single responsibility principle will be a breeze.
The process of taking information and domain knowledge and deriving required functions will sharpen your problem-solving skills a lot. The reason that my solutions are always so well-organized is that my Mathematical training beat writing step-by-step solutions into my soul.
Functions are compact ways of describing the transformations that need to be applied to inputs. This is very useful when writing documentation.
This goes without saying, but if you have any aspirations of working in Machine Learning, Data Science, or Deep Learning, then you want to master functions.
Sounds like something that could help you a lot? Let’s now cover how you should get good at them.
How to Master Functions
Depending on how much you want to dive into the funky world of functions, your journey will look different.
In my post on the most important Math topics for Computer Science, I mention that Linear Optimization/Programming is in many ways the crux of software development. I recommend that all of you pick up your favorite Linear Optimization Resources, and start practicing a few questions. The process of creating objective functions, deciphering constraints, and writing out the equations will all be helpful to you. This topic will give you the most bang for your buck.
For those of you trying to get into more mathy domains of Computer Science (or college students), supplement this with learning about the other domains mentioned in that post. Develop your precalc + calculus 1&2 (upto multi-variate calculus. You can avoid vector calc) first. Khan Academy + Professor Leonard are two fantastic resources for this. There are also other practice websites online. Move on to probability. All these topics will help you really sharpen your understanding of functions. In all these topics, take it slow and focus on the derivations. Those are what will help you.
Take your time developing the basics of this topic, and your returns will be exponential. Put in the work and trust the process, and your career will see the benefits.
Before proceeding, if you have enjoyed this post so far, please make sure you like it (the little heart button in the email/post). I also have a special request for you.
***Special Request***
This newsletter has received a lot of love. If you haven’t already, I would really appreciate it if you could take 5 seconds to let Substack know that they should feature this publication on their pages. This will allow more people to see the newsletter.
There is a simple form in Substack that you can fill up for it. Here it is. Thank you.
https://docs.google.com/forms/d/e/1FAIpQLScs-yyToUvWUXIUuIfxz17dmZfzpNp5g7Gw7JUgzbFEhSxsvw/viewform
To get your Substack URL, follow the following steps-
Open - https://substack.com/
If you haven’t already, log in with your email.
In the top right corner, you will see your icon. Click on it. You will see the drop-down. Click on your name/profile. That will show you the link.
You will be redirected to your URL. Please put that in to the survey. Appreciate your help.
In the comments below, share what topic you want to focus on. I’d be interested in learning and will cover them. To learn more about the newsletter, check our detailed About Page + FAQs
If you liked this post, make sure you fill out this survey. It’s anonymous and will take 2 minutes of your time. It will help me understand you better, allowing for better content.
https://forms.gle/XfTXSjnC8W2wR9qT9
Happy Prep. I’ll see you at your dream job.
Go kill all you popular pal,
Devansh <3
To make sure you get the most out of Math Mondays, make sure you’re checking in the rest of the days as well. Leverage all the techniques I have discovered through my successful tutoring to easily succeed in your interviews and save your time and energy by joining the premium subscribers down below. Get a discount (for a whole year) using the button below
Reach out to me on:
Instagram: https://www.instagram.com/iseethings404/
Message me on Twitter: https://twitter.com/Machine01776819
My LinkedIn: https://www.linkedin.com/in/devansh-devansh-516004168/
My content:
Read my articles: https://rb.gy/zn1aiu
My YouTube: https://rb.gy/88iwdd
Get a free stock on Robinhood. No risk to you, so not using the link is losing free money: https://join.robinhood.com/fnud75