[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y ] [Home]
4chanarchives logo
Math in programming.
Images are sometimes not shown due to bandwidth/network limitations. Refreshing the page usually helps.

You are currently reading a thread in /g/ - Technology

Thread replies: 127
Thread images: 9
File: csharpprogramming.jpg (51 KB, 400x300) Image search: [Google]
csharpprogramming.jpg
51 KB, 400x300
Where does math come in when it comes to programming. I mean, all these people are telling me you need to be good at math to be a good programmer. I don't understand why though.

Anyone explain please?
>>
math knowledge is what separates a code monkey from a programmer
>>
>>53568826
This.
>>
>>53568776
You don't need math just to program, but when you want to program interesting stuff most of the time you will need to express mathematical concepts in code.
>>
>>53568826
>>53568872
These two. The last one is the answer.
>>
>>53568776
I think for the most part, it isn’t necessarily that you have to be good at math, you just need to have that “left brain” mindset to figure out programming similar to what you would need to figure out math.
>>
>>53568776
just used some trig the other day. someone implemented the haversine formula (https://en.wikipedia.org/wiki/Haversine_formula) in SQL and did a shit job doing it. knowing trig helped me fix it.

seriously. know your math, or be that shit programmer im always cleaning up after.
>>
Most of the basic shit is an orgy of simple algebra.
>>
Minimally you need to appreciate math. If you want to get into some really interesting stuff, you can use the more advanced math. If you do CS math is going to be there like it or not.

Mess around with LaTeX, it might make you think different about math. There are a lot of cool math libraries for python, and there are a lot of free tools now like SAGE (seriously).
>>
File: 1457374223968.png (256 KB, 385x532) Image search: [Google]
1457374223968.png
256 KB, 385x532
>>53568776
More prestigious, more job security, higher salary, working with interesting stuff.

If you're already a good programmer, my recommendation is getting good bachelor level math background.
>>
>>53568776
>Where does math come in when it comes to programming

Computer graphics is literally applied linear algebra.
>>
>>53569779
>Mess around with LaTeX, it might make you think different about math
lol wat
>>
>>53568776
>OH I will just write up this raytracer for this renderer.
>Wait, I do not know any math.
>>
Matrices are pretty important. Linear algebra will come on handy. Basic algebra goes a long way. Graph theory certainly helps with modeling certain applications.

So yes. Math is important for a lot of programming.
>>
When you fuckers say linear algebra, what are we talking about? Just knowing what a matrix/vector is and basic matrix operations?
>>
>>53570502
The basics aren't enough.

You basically need to understand how analytic geometry works.

How to model a 3D world. How to transform some 3D object (scaling, translation, rotation).

How to map specific projections and how that changes the coordinate system you'll use.

How lighting models work, how ray reflection and ray interesection work.
>>
>>53570707
Got it, thanks for clarifying.
>>
What's the fastest way to learn the important CS math, preferably in the smallest amount of different books? Are online courses like khan academy even good? I'd not want to spend years on this because I don't need it/love it that much but I want to do it for myself because I feel like a Sandeep Kumar studying web development/design (where the math is not that needed for the most of the jobs).
>>
>>53571070
get lang's book on linear algebra it's very entry level
>>
>>53569469
This, you don't need to ace calculus to program simple things, but you have to be able to think very logically which most people don't seem to be able to do. Someone who sucks at it might not even realize it but just make a lot of mistakes and waste time that way.

I am on my second internship in engineering and I have had to write mathematical formulas with 4-5 variables as part of a program I was writing. It's not even college math level, but it is different and in some ways more challenging than durr solve this equation with some method your teacher taught you 5 days ago, which I guess is what people think of being "math".
>>
>>53568826
This.

AI, graphics, vision, robot motion, computational [pretty much anything from biology to neuroscience to physics to chemistry], planning of big distributed systems all require math
>>
>>53571070
You won't get good at it without effort.
>>
>>53568776
If you know how to use a scientific calculator then you're set.
>>
>>53571773
im in physics and i dont know what the fuck is going on with modern calculators
ti84 is as far as i go yo
>>
>>53571789
Don't you shitlords just use matlab or mathematica or w/e software when graphing shit?
>>
>>53571833
yeah, been a while since i used my ti84 for anything but what a cheap as shit casio can do
mostly matlab for me, uni has a boner for it
>>
>>53571789
A grasp on angles, vectors and trigonometric functions are the biggies you need to worry about.
>>
The most complicated maths-heavy thing I had to do for my personal project was working out the inverse continuous fourier transform of an n-sphere.
>>
Lots of college age kids come on /g/ looking for insight into Cs careers.

I was a Cs major a few years ago doing the same thing. I sucked horsedick at math and hating my life.

If you really can't cut the math and are struggling, decide how badly you really want to be a programmer. If money is your main driving factor, go into technical sales. I make more than all of my engineering roommates/ friends from college and I work 35 hours a week selling capital equipment to engineering and research labs. Don't force programming on yourself if you hate it, especially if it's just for money.
>>
>>53571890
>inverse continuous fourier transform of an n-sphere
what was it and why did you need it?
>>
>>53571889
im good, been drawing pretty pictures in latex and found out the hard way that brute forcing it is a dumb way to do it
>>
>>53571917
It's a video player. I wanted to find a way to reconstruct n-dimensional sampled signals into continuous waveforms with a symmetric frequency response.

Solution turned out to provide no significant visual benefit (and was also too slow for realtime), sadly.
>>
>>53571946
damn, would have been a cool solution
>>
>>53570502
Linear algebra includes understanding how errors magnify because of scaling problems, partial pivoting and scaling etc. All the type faces " your computer ase different translations (using matrices) of one set. Linear algebra is the study of linear systems ...
>>
>>53571319
Ffs math isn't calculus but calculus is math. Logic (the outcome of a series of if statements), translations/transformations (linear algebra) complicated relations (abstract algebra) ...
>>
>>53571946
What would be the purpose of this?
>>
because all the fun things in life can be modeled as multivariate differentials which
>imblys
you need math to implement them when you feel bored enough to write code

sure you _can_ program things without math, and it does teach you to think more creatively, but hell why not go all-out
>>
>>53572045
The goal was to be able to interpolate image vectors on their path through spacetime, but in reality the problem is that the signals are nowhere close to band-limited - a temporal resolution of 24 Hz is simply much, much, much too low for this to work out in practice.
>>
I thought that I never used math in programming. Then I realized it's all math.
>>
>they fell for the "programming = math" meme
Yeah, totally needed multivariable calculus for creating Java factory implementer enterprise shit.

Unless you're working in AI, 3D or science programming math is useless.
>>
If you want to make video games and model the physics knowing some maths is pretty helpful, but then again you can just take it from wiki (though likely won't end up as efficient as it could be)
>>
If you want to do anything interesting, a solid mathematical foundation is very useful. If you just want to click together frameworks, it does not matter.
>>
Well, a lot of the cool things like multimedia codecs, computer vision and machine learning require a certain amount of knowledge of maths to understand. Mostly linear algebra and vector stuff.

You don't do that stuff every day and you certainly don't need that to make your typical web app.
>>
>>53572255
All of the cool stuff like compiler development and PL theory / type theory benefit greatly from backgrounds in abstract algebra.

So does pretty much anything involving optimization - alongside graph theory, number theory, etc. and the other typical “CS math” courses.
>>
Why is trig so useful in programming?
Drawing great spheres or bends using trig and quaternions.
>>
>>53568776
Math isn't about numbers, it's about logic; an abstract form of thinking. You don't need to be a master of Mathematics to be a programmer in most instances, but you at least need a fundamental understanding in order to understand basic algorithms and a bit higher level understanding to fully understand the runtime complexity of algorithms you implement or create so that your code isn't inefficient garbage.
>>
>>53572474
I'm not in CS but surely you don't spend much time actually creating complex algorithms in the field?
>>
>>53568776

Just think of math as a dumb programming language.

Any math makes more sense when put into some programming language. I find it best to ignore math until I need it and convert it to a simple function or class\method depending on what is needed.

IMO writing math as a function or class makes it about 10x easier to understand as well instead of weird\archaic\nonsensical symbols representing variables.

mathematicians are like shit programmers.

TLDR

Just learn parts that you need when you need, forget the shit math notation when you have made the programming equivalent.
>>
>>53572664
This post gave me cancer
>>
You don't need to be a genius, and you don't need to know formulas or methods and such by heart, but you should have an appreciation for it and be able to understand common notations since CS is the application of math. Pretty much if you can solve a problem with an equation sheet given to you, you should be okay with CS. CS is basically just taking that equation sheets and giving broad application to your math formulas so a computer can use them to solve real world problems. But in order to be able to tell your computer what to do, you need to be able to read the equation sheet. If you can make it that far, you're good.
>>
>>53572496
less creating, more choosing and implementing the right algorithm for the job. To be able to do that you have to actually understand how the algorithm works, and how to determine when one algorithm is more efficient over another.
>>
File: dNVvntX.gif (133 KB, 311x366) Image search: [Google]
dNVvntX.gif
133 KB, 311x366
>>53572675
get triggered elsewhere sjw
>>
>>53572664
Needs a little work, good base for bait.
>>
>>53572721
I'd argue that can be looked up online though, as odds are the problem isn't a special snowflake.
>>
>>53572675
He's sort of right though. Linear Algebra is much less boring when you're reading through a math textbook and making models with functions.
The easiest way to learn math as a programmer is to pick up a math textbook and build a library based on the subject of the book.
>>
>>53572496
Lets be honest, creating a complex efficient algorithm can take years of work.

What you usually do is research already known algorithms and pick the one best suited for your needs. Having a background in maths make this much easier.

For example, there is more than 30 efficient sorting algorithms, but they all have their own quirk. For example, there are scenarios in which the quick-sort algorithm is as bad as an innefficient algorithm.
>>
>>53572750
It surely can--on the Internet or in various algorithm 'cookbooks' like the one in OP's picture. But if you're already familiar with a particular algorithm, it's going to take far less time to implement and test it. Time is a factor in actual development.

Plus understanding the algorithm you're shamelessly copy pasting from stack overflow never hurts
>>
>>53568776

I think it mostly depends on what you're developing, but honestly knowing math really doesn't ever hurt. I'd say the bare minimum you need for programming is a good understanding of Algebra. Anything beyond that , again, completely depends on what you're developing.

Take me for example, I develop software that draws/modifies 3D objects in AutoCAD. So I need to have a solid understanding of things like Trigonometry, Geometry, and a little bit of Calculus, however; someone developing something else might not need those.

However, like I said, there is never any harm in knowing Math. Math is incredibly fucking powerful regardless of it's application
>>
Pretty much anything you'd want to do useful with programming outside of simple website design and phone apps will require math. Financial modeling, scientific simulations, computer graphics, data analysis, compression, game design, etc...
>>
>>53572783
>Having a background in maths make this much easier.
No disagreement here, but in your 30 efficient algorithm examples there should be a pros and cons page for each. May take a bit longer, but the times you run into it it should be possible to figure out which one suits your problem without acutally knowing fuckall about anything.
>>53572795
>Time is a factor
That it would be, not actually disagreeing with you then. Do think that if you're working in any particular field you'll be able to learn to choose the algorithms fast enough though as you're deciding between the same few over and over.
>Plus understanding the algorithm you're shamelessly copy pasting from stack overflow never hurts
This I do see as a bigger problem as it'd be pretty fucking irresponsible, imagine it happens more than I'd like to think though
>>
>>53571319
>calculus
There's lots more to math than what Europeans learn in high school
>>
>>53570502
No, you need to understand things like Singular Value Decompensation, Cholosky matrices, p-norms of higher rank tensors, etc...
>>
>>53572861
>Understand
Eh, more like apply. SVD boils down to an algorithm, no?
>>
>>53572664
>Just think of math as a dumb programming language.
Opposite way around motherfucker.

Maths is much more high-level than any programming language. If you can only understand the latter, then that speaks bounds about your ability to understand abstract thought.
>>
>>53570502
>>53572861
Probably not, but you should know about algorithms (LU, gauss, partial pivoting), vector spaces and subspaces, determinants, linear operators, Euclidean spaces, norms, orthogonalization etc. Stuff that an intro course covers.
>>
File: 1457184279759.jpg (63 KB, 600x788) Image search: [Google]
1457184279759.jpg
63 KB, 600x788
>>53572844
they usually do have pros and cons listed, but they are not comprehensive, nor can they be, considering the countless differing implementations one algorithm can be put to use in.

I agree that with experience you learn to make the right choice quicker. That goes for most aspects of programming--so much of it is just picking the right tool for the job.

And yeah, stack overflow copypasta gets pretty bad sometimes
>>
>>53572877
>apply

Sure, if you are a codemonkey who gets handed psuedocode is expected to type it up.

If you are doing any research yourself and devising new algorithms to solve novel problems, you'll need to understand what an SVD is and why it works.
>>
>>53568776
Math is useless. Everything you'd need to know is highschool level. Unless you want to do stuff that other people have already done, you can just use what's already built. Code monkey like to pretend their low level crap matters but anyone who isn't the lowest programmer at a company works on higher level stuff if given the chance.
>>
I am absolutely terrible, woefully bad beyond comprehension at math, but managed to work for a major company earning more than most people my age even after I dropped out of college due to depression/being socially awkward with people my own age. I am not especially smart in a way that compensates for it or anything, I think you can get pretty far if you just set yourself high standards in the limited things you can do.
>>
>>53572878
Yes I am a concrete and literal thinker. That's the easiest way for me to get math and it works fine for the programming I do at work and probably about 99% of all programming.
>>
>>53572083
>>53571946
Like Smooth Video Project?
>>
>>53572934
Math is more important at the higher level. Of course you don't need to know math to implement an algorithm someone hands you. You need the math to devise the algorithm.
>>
>>53572924
Could you specify/give an example of where knowing why SVD works is helpful when applying it?
>>53572898
>right tool for the job
Unsurprisingly what it boils down to, yeah. Guess "programmer" is bit too vague of a term here, right tool for the job for some retardedly big mixed integer problem may not be trivial to find but in other cases it's 5 min on wiki
>>
>>53573015
Being a perfectionist only leads most people to being /g/-tier autists. Good job on overcoming the odds
>>
I learn math through programming. When I came to grad school for Scientific Computing, I was pretty behind in advanced maths compared to most others. I only had a few calculus courses and linear algebra, since I did a Bio minor. I got thrown right into graduate level math classes here, am would study by actually implementing the concepts into codes that I could play around with.

Things like Laplace transforms get a lot more clear when you sit down and actually code it, then throw tons of test functions at it and watch the outputs.
>>
>>53569486
What if you are not naturally good at Math?
>>
File: 1446080692474.png (469 KB, 1255x770) Image search: [Google]
1446080692474.png
469 KB, 1255x770
>>53572855
>Europoor thinks Americans don't learn calculus in HS
>>
>>53570502

Vector spaces, bases and changing bases, linear operators, traces and determinants, eigenvalues and eigenvectors, inner products, various decompositions, numerical algorithms.
>>
>>53572924
I agree with you

but nobody gets there overnight, can't expect anyone to start devising new algorithms for particular research or projects without already being familiar with one's that exist
>>
>>53573162
>naturally good at math
stop this meme, below average is literally fine
>>
>>53573064
No, at higher level you just need to know how to keep the client happy and how to distribute the work to your team. Algorithms are done for you and you just need to guesstimate if it will function, if it doesn't, then you throw a code monkey at it to debug it.
>>
>>53568776
If you ever become a programmer, you'll understand without any need to make threads about it. If you don't, you won't, and you still shouldn't ask about it, because it's like a feeling rather than a specific reason, so it's mostly unexplainable.

tl;dr: No.
>>
>>53572136
This is what everyone said. You only need math if you want to do fun things. For soulless enterprise stuff basic algebra is more tnah enough.
>>
>>53571070
Discrete math, Johnsonbaugh. Stewart, Calculus. Zill, Differential Equations.
>>
>>53568826
>thread ended on first post
>>
File: burgerswerentevenmadebyburgers.png (570 KB, 1075x959) Image search: [Google]
burgerswerentevenmadebyburgers.png
570 KB, 1075x959
>>53573183
>place of creation
>uncertain
>>
Friendly reminder that 99% of all programming work is dumb CRUD ui building shit.
You will not be building anything fun with math 99% of the time, because that's not what you're being paid to do.
>>
>>53574225
depends on what job you go for, crazy as that may sound
>>
>>53573535
Probability would be way more useful than differential equations
>>
>>53574225
>I neglected math during my studies and ended up as an enterprise Java monkey
>>
>>53574281
Depends on what he wants to do. I'm just discrete gives you a basis on statistics.
>>
File: potato-baked-lrg.jpg (51 KB, 740x400) Image search: [Google]
potato-baked-lrg.jpg
51 KB, 740x400
much like everything else you learn in your programming classes, most of the heavy lifting for math is already taken care of via libraries and api's.

whether or not you will be allowed to use those libraries depends on project/work circumstances and the license of the library.

computer graphics uses a boatload of math. take a numerical analysis class and it should go over this kind of stuff. as does linear algebra.
again though, most of that stuff is programmed into libraries, so all you really need to do is make a function call to computeEigenvalues(A) or something like that and it would do the computations for you.
it does help to know that these things exist, and arent some scary thing at all. so that in case you do need to implement your own library of matrix operations (because of licensing restrictions at work), you would know what to do.
>>
So how do I git gud, Anons? I have a basic knowledge of math after HS.
>>
File: 1453874971165.png (286 KB, 652x640) Image search: [Google]
1453874971165.png
286 KB, 652x640
>>53572689
This

There's a wide array of problems and there are mathematical/statistical formulas and concepts out there that can help. If you can read a paper and understand the math behind it enough to apply it in code, you're good.

The math that has been helpful for me so far in programming has been mostly statistics and linear algebra.
>>
>>53574347
Math isn't about computation but about formal reasoning. There is no library that does that for you.
>>
Can someone fucking explain to me what Certification i need to get from Cisco in order to know how to config fucking DSL and Cable modems, i see that both CCNA and CCNP don't give a fuck about it
>>
>>53574347
>>53574225

It's really sad that a majority of paid developers are actually really really shit at their job and they basically do nothing but search stack overflow and glue together other people's libraries without ever understanding how any of their magic library functions work.
You could ask them to write a simple bubble sort, or maybe something more relevant to CRUD work, a strstr implementation, and they would be completely lost because they have no fucking idea how to implement any of the libraries they use.
>>
>>53574382
Practice.
>>
File: 1451486578054.jpg (54 KB, 700x472) Image search: [Google]
1451486578054.jpg
54 KB, 700x472
>tfw really slow
>tfw require a really really long time to grasp simple math concepts, even though I've been programming for 4 years

I've tried doing stuff with Processing, but I soon realized it way over my head.

Is it realistic to go into math at this point if I want to do stuff like generative art and computer graphics? Will I end up killing myself?
>>
>>53568776
Algorithms are combinatorics and discrete math heavy,anything related to graphics is all vector algebra.I mean if you want to use tons of frameworks and never touch anything little bit more fundamental, you can still get payed,but you will never do anything interesting and worthy.
>>
maths suck dick

>>53570030
yeah i dont know, i know you can easily write formulas in LaTeX but i don't know what the fuck that means for math skills
>>
>>53574555
>555
>5*5*5
>125

thats the amount of hours required for your brain to understand it
>first and last digit is 5
>there are four 5's in your post number
>2/4 = .5
>50%
you're halfway there brother. just 62.5 more hours to go

you can nail this shit in a week if you dedicate yourself to it, if you take your time you can learn it in a month.

you will learn it. your post number says so. dont give up
>>
>>53573036
Yes exactly. Only problem is it doesn't work because 1. real video is not linear, 2. real video is ridiculously undersampled
>>
>>53574421
People don't get paid to reinvent the wheel retard.
>>
>>53568776
You do need to know linear algebra and calculus really well in order to work as graphics programmer.
>>
Yo guys what do I need Galois theory for?
>>
>>53575105
>be engineer
>why should I learn to design a bridge when i can just
import bridge
>>
>>53575206
if there is a bridge design that works, that's exactly what they do you retard.
>>
>>53575177
to sound smart on the internet
>>
>>53574555
let buff math teacher carry you to the promise land

https://www.youtube.com/playlist?list=PLF797E961509B4EB5
>>
>>53573162
Not sure if you're looking for a genuine answer, but I'll bite.

If you aren't naturally good at math -- get better. I dropped out of highschool at 16, didn't start college until I was 25, and barely knew pre-algebra at the time (the math you learn in 6th grade). I transferred out of community college with a 4.0 and 16 honors credits, and got my BS from Berkeley without a single grade below 93.
Math isn't exactly a natural skill, or at least as much of a natural skill as it's been made out to be. Yes, you can be more inclined to use logic, but it's not something that exclusive to anybody, and you can achieve that same inclination with time and effort. Honestly, practice daily. Practice daily. Practice daily.
Go to Khan Academy and practice daily, even if you're starting at very basic levels.
It really is just memorization. You will get the hang of it if you put effort into learning, and there really isn't an excuse with as many online resources are available now.
In the programming field, algorithms are one of the most important subjects that you should know. Once you get the hang of that, it's just memorizing syntax between languages.

Once again, practice daily.
>>
>sign up for a trade school
>decide to sign up for telecommunications, how hard could it be?
>we start learning about assembler and electrical engineering (what the fuck)
>the requirements for signing up was literally high school 4th grade maths, something i struggled really hard to get
>teacher doesn't give a shit and said you needed to be in the "strong maths" class, something we only have where i live and it still wasn't a requirement to sign up
>doesn't even teach us basic concepts, a lot of people in my class are in their 30's and didn't study maths for a long time
bunch of fucking cunts and it made me hate maths forever, i actually dropped out
>>
>>53575743
oh and keep in mind the teacher literally said "if you don't have a diploma in strong maths you might as well just drop out" to everyone

fucker didn't give a shit since he was a year away from retirement
>>
You honestly don't need it as a prerequisite. I see it more as a learn as you go kind of thing. For example, for graphics programming you don't need entire courses for linear algebra, just learn what you need. Even then, you don't have to understand the ins and outs of everything, most libraries you use are black boxes for all you care.
>>
>>53568776
just logic
and being able to approximate the cost like one search takes log(n) vs (x)
>>
>>53569779
>Mess around with LaTeX, it might make you think different about math

worst advice I have ever seen, congratulations.
>>
>>53575206
thats pretty much how it works
>>
>>53575602
Thanks mate.

I just want to learn to code so I can try making indie games on my own. I hear the math can be pretty strenuous. Thank you for the encouragement.
>>
>>53576893
for indie games, you do need some math because you won't always have what you need easily accessible and it would help a lot if you understand what you were doing when you are trying to do it.
>>
>>53575602
Speaking of khan academy, can you actually learn something more advanced there?
>>
>>53577084
algebra right?
>>
>>53578396
"it's fucking algebra, nigger" -terry a. davis
>>
>>53578396
yeah, real algebra not your baby y=mx+b shit
>>
>>53569779
>a typesetting language will help you understand maths
Wot r u on m80?
>>
>why does formally defining of procedures require understanding of the science of formal systems?
>>
Once you start to get into like boolean algebra etc etc, circuitry theory shit
>>
>>53578722
>>53578422

Any good beginner books to help me get started?
Thread replies: 127
Thread images: 9

banner
banner
[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y] [Home]

All trademarks and copyrights on this page are owned by their respective parties. Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
If a post contains personal/copyrighted/illegal content you can contact me at [email protected] with that post and thread number and it will be removed as soon as possible.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com, send takedown notices to them.
This is a 4chan archive - all of the content originated from them. If you need IP information for a Poster - you need to contact them. This website shows only archived content.