r/ProgrammerHumor • • Oct 06 '21

Don't be scared.. Math and Computing are friends..

Post image
65.8k Upvotes

2.4k comments sorted by

View all comments

1.7k

u/NoMoneyNoHoney18 Oct 06 '21

You make it easy to understand thanks

998

u/nuclearslug Oct 06 '21

This would have been so helpful when I was talking calculus

406

u/[deleted] Oct 06 '21

Yeah, once I realized these are just for loops, the notation made way more sense.

231

u/uhmhi Oct 06 '21

But most of the interesting ones loop to infinity…

145

u/Cat_Marshal Oct 06 '21

It’s while loops then

91

u/OnyxMelon Oct 06 '21

or for loops with a bad exit condition

for (int i = 0; i >= 0; i++) {}

113

u/CodeLobe Oct 06 '21

Or the crying emoji for loop:

for ( ; ; ) { ... }

9

u/supersharp Oct 07 '21

"I forbid you to use while (true)!"

"..... Okay!"

→ More replies (3)

11

u/[deleted] Oct 06 '21

That will exit if your int wraps; hard code to true instead

9

u/[deleted] Oct 06 '21

I think this is the better answer because noone would be able to have the time or memory to repeat something to true infinity.

→ More replies (2)

23

u/Potatolimar Oct 06 '21

You can do that in a for loop (or at least represent it the same way we represent manually adding with these notations)

→ More replies (1)
→ More replies (9)

23

u/[deleted] Oct 06 '21

Integrals are like an infinite summing for loop

→ More replies (25)
→ More replies (4)

0

u/[deleted] Oct 06 '21

[deleted]

→ More replies (5)

80

u/[deleted] Oct 06 '21

Yeah holy shit how was this not taught to me? I got Cs in all three levels of calculus and shit like this would have helped me immensely.

31

u/theGoddamnAlgorath Oct 06 '21

I just realized I've been writing Nashian models for decades to to sort peoples photos.

Holy shit

→ More replies (4)

23

u/gobblox38 Oct 06 '21

The biggest issue with calculus for most people is that it is taught in an abstract way. That's math in general though. I didn't really understand calculus until I took physics where I had real world applications for calculus.

I later took a scientific computing class where we revisited sums, series, methods, etc. and wrote code (matlab) that applied these concepts. And sure, a lot of these concepts have functions built into Matlab, but the point was to show how these functions work, what their shortcomings are, and how to determine when an approximation is good enough (ie how many steps into Taylor's series are required and when does more steps give no additional benefit).

→ More replies (6)

43

u/TheoryOfSomething Oct 06 '21

As someone who did math first and programming later and has also been a teacher, it would never occur to me to teach it this way. I do not understand why this is any simpler than teaching it as repeated addition.

24

u/[deleted] Oct 06 '21

In this case it just helps me conceptualize it as something that makes a little more sense. Code makes more sense to me than math as I'm not great at math, so it's basically just taking a concept and converting it to something I would understand better.

I mean in these two series, particularly the summation, it's easy enough and I don't think I had any struggles there. I did, however, have struggles with your higher-level series dealing with more complex subjects such as a Ramanujan series. I didn't understand Ramanujan at all until I had a programming course ask me to write one, and then it actually made a good bit of sense.

→ More replies (7)
→ More replies (14)

0

u/[deleted] Oct 06 '21

[deleted]

→ More replies (12)
→ More replies (11)
→ More replies (18)

89

u/SillyFlyGuy Oct 06 '21

It's almost too easy. Is that what the funny lookin E thing really means? Or this the physics of telling the greenhorn to go fetch a bucket of dry steam?

145

u/LordJac Oct 06 '21 edited Oct 06 '21

Yeah, capital sigma is just shorthand for "add up all these things". The challenge only really starts when you have an infinite number of things to add up.

53

u/amazondrone Oct 06 '21 edited Oct 06 '21

Worth knowing that that's called a [series](https://en.wikipedia.org/wiki/Series_(mathematics)) though. Same notation, but the OP is talking about summations which always have an upper bound.

→ More replies (8)
→ More replies (4)

26

u/dwdwdan Oct 06 '21

As a maths student, can confirm this is correct (though it’s actually a Greek S)

14

u/TheV295 Oct 06 '21

Yeah and every real use case you see the symbol at the top of the big E is the infinite symbol, good luck with that for loop

15

u/Persona_Alio Oct 06 '21

Just let the code run long enough, like say a few minutes, and then round, it'll be good enough!

→ More replies (1)
→ More replies (8)
→ More replies (21)
→ More replies (26)