Weak point in programming.
Posted by Tough_Pride4428@reddit | learnprogramming | View on Reddit | 25 comments
Hello, how do you deal with calculations/mathematics in programming? For me, this is a very big problem that causes many blocks to further action. I can do simple calculations, but slightly more complex ones are my weak point.
johnmatthewwilder@reddit
Practice more. There is no easy solution to getting better at math based problems. There’s a reason true CS curriculum is heavily math/logic based. Find some math based problem sets and chip away at them! I used to teach high school CS. Let me know if you need study/practice resources and I’ll see if I can’t dig up some up and share them with you.
Dubious-Voices@reddit
Not the OP but I’d love some suggestions! I’m finishing up my first year now and am having a similar experience with my logic being lacking. Any kind of resource would be much appreciated, thank you!
farting_neko@reddit
There many resources for Mathematics, you can check out MIT's courses and resources for CS.
Like this one: https://courses.csail.mit.edu/6.042/spring18/mcs.pdf
Gbl2000@reddit
I have interest too.
johnmatthewwilder@reddit
For those interested in resources I’ll try and compile a list of stuff tomorrow evening and pop back in this thread. I’ve got a newborn so I’ve been busy! Just keep in mind I taught in the US so all the resources will be in English. Another thing is that we prepped students for an AP course so almost everything I put up will be in Java.
ViraLCyclopes25@reddit
same here im ass w math
ferdouseOfficial@reddit
You are absolutely right 👍
Imwoahluis@reddit
Same here!!
National_Check_8003@reddit
Not OP either, but I would love the resources too please.
RobertDeveloper@reddit
there are so many fields where you hardly do any difficult calculations/mathematics, so I wouldn't worry about that at all.
mxldevs@reddit
Do more math problems.
Lasagna321@reddit
How complex are we talking? Like vector math in relation to game design? Working out partial derivatives for cost function of a logistic regression model? Math in this discipline is a given, but depending on your task it can definitely vary in scale
glaz5@reddit
Top comment already pointed it out that its all practice, but id also recommend its also about having a good foundation to get to the next step.
I used to hate math because I found it too complex, but thats because I didnt care early on in school and missed alot of crucial steps, making any math course impossible for me. I went back in college and started with complete basics (Like 2+2 level) and worked my way up from there. I realized how many small things I missed, and how much easier it made getting to the next step. Just start small and work your way up, youll be surprised at how helpful this is.
Personally, I got a textbook for each grade and did it that way, but id recommend just using Khan Academy since its free and has videos for each subject. You can absolutely achieve this if you dedicate the time! Good luck
LargeD@reddit
Tbh, you will get better with math. Just keep working on it.
EmperorLlamaLegs@reddit
I literally went on khan academy a few years back and just did a speedrun of grade 3+ maths. Whenever I couldn't answer the questions without looking anything up, I did the lessons. Good refresher and I picked up a lot of fundamentals that I absolutely did not learn in my extremely mediocre public school education.
Crafty_Concept8187@reddit
I took the math courses in college. So while I would need to look up graduate probability equations at this point, or like...diff eqs, I could puzzle them out still. I learned them once after all.
Maestro-Kira@reddit
I use chat gpt to explain the problem to me step by step and I mention that I suck at math and ask ai to explain it to me as simple as possible as detailed as possible. Usually helps. if I still don't understand I ask smarter people for help
Careful-Lecture-9846@reddit
Depends on what you work on. The most math I’ve done so far is the distance between two points.
Darkstar_111@reddit
Time.
As everyone else is saying you gotta break things down into smaller steps. But that also means spending more time as you go through each of those steps.
I started programming wanting to learn to make video games. I begwn making my first game and got to movement and collisions (in 2D), so far I was just moving x and y coords based on key presses.
But now I wanted to get more advanced. Have easing motions on start and stop, shooting towards the mouse pointer, sliding along diagonal walls. Bouncing away from other entities... I understood it was time to learn vectors. Something I knew nothing about.
Khan academy got me the basics, coupled that with some example code, and I eventually became proficient in finding target vectors, dot products, and the Pythagorean theorem, combined with SohCahToa, let me find the shortest line to potential targets.
It took time. You can't learn this in 20 minutes. But once learned, you got it forever. More or less.
armahillo@reddit
Which kind of calculations are you struggling with that the program cant do for you?
iOSCaleb@reddit
What do you mean by how do you deal with calculations…?
You break them down into steps. Write down the equation or expression that you need to “deal with.” How would you evaluate it by hand? Write down the first step. Write down the next step. Repeat until you’ve reduced the entire thing to simple steps. There’s your code.
Pale_Height_1251@reddit
Get better.
You can learn mathematics same as you learn anything else.
You're learning to code, right? You can learn mathematics too.
cheyyne@reddit
Like everything else, you break the calculation down into simpler, single steps, to the best of your ability. If you have a complex calculation, write it out one operation at a time. This will make it easier to find out either a) where you're wrong, or b) which part you don't understand and need to learn.
Wooden-Donut6931@reddit
An example? I don't understand the question.
HQMorganstern@reddit
Write the calculation by hand, get Chat GPT to translate it to Python/Julia/R, move whatever operations you can to vectorized computation like numpy.
In general computers allow for a rather straightforward translation of nearly every mathematical expression there is.