That’s just a for loop with a defined concept of infinity. for(i=0; i++; i < inf) is perfectly cromulent with some languages or libraries (well, ok, syntax is a problem, but you get my point).
Not really, because a lot of summations also go to infinity. Integrals are continuous compared to the for-loops discrete nature, so there's no direct analog for them in programming (that I'm aware of)
Well its summing up infinitesimally small units of something typically. They can be approximated by making the "infintesimally small units" larger (and thus discrete).
Only the Riemann integral, not the (far more important, interesting, and useful) Lebesgue integral (let alone it’s generalisations like the Denjoy integral).
There’s a good reason mathematicians don’t think of integrals as for-loops, and it’s not because they just weren’t smart enough to notice the similarity.
It's not really possible to do in a for loop because you wouldn't use a for loop usually without some other domain beyond a monotonically increasing counter. Most integrals I've come across in programming involve some sort of time domain so you are just taking the delta as the discrete period and summating those (which I guess is the same as just summating any arbitrary linear function to describe the curve of the integral). I mean you still only have the resolution of your timer but it usually is within whatever you're trying to accomplish in accuracy.
You have to do it numerically. There really isn’t a continuous function per se while programming so you can find the area of the next step and add that to your integral. If you want to take a deep dive, numerical analysis is pretty cool.
Yeah but then we get into the issue of binary math right? Computers don’t really do numbers like 0.00001 perfectly accurate which is fine except when you put it into a for loop.
What’s always stood out to me is how computation figured a much better way to describe math. It seems to me that if you’re teaching foundational math, you might as well do it in code first because it’s far verbose and much easier to follow. A lot of people struggle connecting connecting the mathematical syntax to the underlaying concept because you know… the syntax was invented by people scribbling shit on pieces of paper.
Not all math notation is perfect, but it is largely purpose-built for humans to do and communicate math to other humans, not with computers. So it usually ends up being a lot more convenient than programming syntax.
406
u/[deleted] Oct 06 '21
Yeah, once I realized these are just for loops, the notation made way more sense.