Just notational difference other than presence of mutation…
How is it harder to understand 3 + 6 + 9 + ... + 3n means compared to the for loop? Is repeated addition hard to grasp?
No it’s not harder to grasp, just less concise. Summation and Product notation exist for the same reason we don’t say “a discernible but subtle level of humidity” and just use “moist” instead - it’s more convenient. People can be taught to readily understand “moist” or the summation notation. It’s much harder to teach people to read the longer notation more quickly.
There’s nothing special about a generic for loop (at least in C-like languages). There’s no reason you couldn’t do something like for (i = 0; true; i++) to make it infinite. Some languages even support an infinite list generator syntax like for i in [0..] (e.g. it lazily generates 0, then 1, then 2, etc. on each iteration) so you can use a for-each style loop to iterate infinitely.
Now, whether or not you should do such things is another question entirely. I won’t pretend there aren’t any instances where it’s useful, but most of the time you’re better off with a different structure.
When you study CompSci (depending on where IG) you tend to see them that way when trying to mathematically prove something about an algorithm. It’s only really a good way of thinking if you’re into coding, but I don’t think a teacher for a non-coding related algebra class should show this, it can be really confusing for some people.
Hi, you can look into “discrete mathematics” if you’re interested in the overall subject of math for programmers, it was one of my hardest class but highly intesting!
The hard part of math isn’t understanding esoteric symbols it’s the theory behind it and it’s application. Number theory will mindbreak almost all people.
Number theory and higher levels of math are a completely different beast. Once your exam is over 50% just writing proofs you will change your tune. Unless you are built for it.
In a way I always thought coding was more intuitive than maths writing norms.
That is if you speak English. If not, it’s as much daunting as weird greek symbols.
i hate that we all got so frightened about math. it’s genuinely fun to learn how it works when you’re not being forced to in a school setting, which was just a fucking nightmare for no reason. i had this former navy DI lady teacher in gifted kid algebra [so already a year ahead] yell at me for asking questions; she wasn’t going to ‘hold my hand’ thru the homework, which was quite literally her fucking job
It’s surprisingly easy. I used tl give maths tutoring to finance my university degree. What I’d do is let the kids do one exercise task from their school books to see where their difficulties were. While they were on it, I quickly read through the relevant sections in the book, and it was so easy every time that I knew everything I needed to know after a few minutes. Like literally stuff that took weeks at school within minutes.
School just sucks and makes it really hard to learn anything. Almost everything kids learn at school is actually really easy.
Well it’s harder for them because they are kids and their brains are still developing. You’ve had a lifetime of experiences to draw from where you use math concepts subconsciously many times a day.
Totally true. They haven’t learned to learn yet, they aren’t learning because they want to, or even because they need what they learned.
But the point I was trying to make is, that many adults are still afraid (and many even strongly so) of maths, because it was hard for them at school. But it probably wouldn’t be hard for them now.
Im sorry you had awful teachers, but not all of them are bad. I had amazing teachers that were very worried for the students to learn. In contrast I had very shitty classmates that just didn’t care and would blame the teachers for their laziness.
Sorry you were put through that. Aggressions are no place for learning
My family and school were god awful at teaching. It was all forced (rote memorisation) learning and not me actually learning. I needed things taught slowly and broken down. I have wanted to learn the more advanced technical maths long ago, but now I am an adult and need to find a safe, quite and gentle environment where i can
anybody reading this, please do not give suggestions or advice in replies. thank you.
i completely agree. this sentiment was echoed pretty well in a (nontechnical and accessible) paper i read a few years ago. he says the current approach is like forcing people to learn music, but only teaching them how to read sheet music and not letting them touch any instruments. it hides the creativity and problem-solving of the discipline and reduces it to memorizing formulas.
The biggest difference (other than the existence of infinity) is that the upper limit is inclusive in summation notation and exclusive in for loops. Threw me for a loop (hah) for a while.
i thought this was pretty weird too when i found out about it. i’m not entirely sure why it’s done this way but i think it has to do with conventions on where to start indexing. most programming languages start their indexing at 0 while much of the time in math the indexing starts at 1, so i=0 to n-1 becomes i=1 to n.
My abstract math professor showed us that sometimes it’s useful to count natural numbers from 1 instead of 0, like in one problem we did concerning the relation Q on A = N × N defined by (m,n)Q(p,q) iff m/n = p/q. I don’t hate counting natural numbers from 1 anymore because of how commonly this sort of thing comes up in non-computer math contexts.
yeah thats a good example and it shows weird the number 0 is compared to the positive integers. it seems like a lot of the time things are first “defined” for the positive integers and then afterwards the definition is extended to 0 in a “consistent way”. for example, the idea of taking exponents an makes sense when n is a positive integer, but its not immediately clear how to define a0. so, we do some digging and see that am+n = aman when m and n are positive integers. this observation makes defining a0=1 “consistent” with the definition on positive integers, since it makes am+n = aman true when n=0.
i think this sort of thing makes mathematicians think of 0 as a weird index and its why they tend to prefer starting at 1, and then making 0 the index for the “weird” term when it’s included (like the displacement vector in affine space or the constant term in a taylor series).
Sorta not really related but Freya’s video on splines (“The Continuity of Splines”) is a virtually perfect resource if you’re interested in learning about… well… splines.
While I acknowledhe that I had some pretty awful math teachers, I would like to add that explaining math concepts in an edited video that you could spend a lot of time making has different demands than babysitting/teaching 30+ students at different levels multiple times a day with little prep time.
Definitely, although I’m sure that under the hood it’s all the same. Some (albeit high-level) languages also support a sum function that takes a generator as an input, which seems pretty close to this math notation.
You are not logged in. However you can subscribe from another Fediverse account, for example Lemmy or Mastodon. To do this, paste the following into the search field of your instance: [email protected]
Rules:
Be civil and nice.
Try not to excessively repost, as a rule of thumb, wait at least 2 months to do it if you have to.
Once you get to integrals these become slightly less scary. Slightly.
Just notational difference other than presence of mutation… How is it harder to understand
3 + 6 + 9 + ... + 3n
means compared to the for loop? Is repeated addition hard to grasp?This thread makes me sad as fuck.
Obviously you can integrate using Sigma notation, if it’s a definite integral.
No it’s not harder to grasp, just less concise. Summation and Product notation exist for the same reason we don’t say “a discernible but subtle level of humidity” and just use “moist” instead - it’s more convenient. People can be taught to readily understand “moist” or the summation notation. It’s much harder to teach people to read the longer notation more quickly.
Meme is gud, title is stupid
Stfu basement dweller. Forgot what channel your in?
This is the part of Reddit that I don’t miss. Please let’s not do this.
I disagree. It’s a while loop, because a for-loop is finite, so you can’t count to infinity with it.
I wanna see how you get a while loop to actually go to infinity. I’ll wait…
on second thought, no I won’t.
There’s nothing special about a generic for loop (at least in C-like languages). There’s no reason you couldn’t do something like
for (i = 0; true; i++)
to make it infinite. Some languages even support an infinite list generator syntax likefor i in [0..]
(e.g. it lazily generates 0, then 1, then 2, etc. on each iteration) so you can use a for-each style loop to iterate infinitely.Now, whether or not you should do such things is another question entirely. I won’t pretend there aren’t any instances where it’s useful, but most of the time you’re better off with a different structure.
there is no reason for a (non-foreach) for loop to be any more or less finite than a while loop.
is just syntactic sugar for
in most or all languages with c-like syntax.
for (i=0; true; i++)
removed by mod
Oh cool, I know who this person is, she did a couple of amazing videos on Bezier curves and splines
Here is an alternative Piped link(s): https://piped.video/aVwxzDHniEw
Piped is a privacy-respecting open-source alternative frontend to YouTube.
I’m open-source, check me out at GitHub.
When you study CompSci (depending on where IG) you tend to see them that way when trying to mathematically prove something about an algorithm. It’s only really a good way of thinking if you’re into coding, but I don’t think a teacher for a non-coding related algebra class should show this, it can be really confusing for some people.
I liked this so much I tried to find more. A few seconds googling turned up a lot, but this is the first hit: https://amitness.com/2019/08/math-for-programmers/
Hi, you can look into “discrete mathematics” if you’re interested in the overall subject of math for programmers, it was one of my hardest class but highly intesting!
That sounds perfect because I don’t want anyone to know I’m studying math.
I was “good at math” in school and all through uni. Discrete mathematics crushed me.
Dude, 🔥👍
The hard part of math isn’t understanding esoteric symbols it’s the theory behind it and it’s application. Number theory will mindbreak almost all people.
The hardest thing for me about math was the symbols. Greek, Roman, English.
Once you get past that, the numbers are easy.
Number theory and higher levels of math are a completely different beast. Once your exam is over 50% just writing proofs you will change your tune. Unless you are built for it.
In a way I always thought coding was more intuitive than maths writing norms. That is if you speak English. If not, it’s as much daunting as weird greek symbols.
i hate that we all got so frightened about math. it’s genuinely fun to learn how it works when you’re not being forced to in a school setting, which was just a fucking nightmare for no reason. i had this former navy DI lady teacher in gifted kid algebra [so already a year ahead] yell at me for asking questions; she wasn’t going to ‘hold my hand’ thru the homework, which was quite literally her fucking job
It’s not about being frightened, it’s just that i know only a handful (mostly esoteric) languages with worse syntax.
Turning 35 in a month and I’ve just started learning maths again after being afraid of it because of a similar situation to yours.
It’s surprisingly easy. I used tl give maths tutoring to finance my university degree. What I’d do is let the kids do one exercise task from their school books to see where their difficulties were. While they were on it, I quickly read through the relevant sections in the book, and it was so easy every time that I knew everything I needed to know after a few minutes. Like literally stuff that took weeks at school within minutes.
School just sucks and makes it really hard to learn anything. Almost everything kids learn at school is actually really easy.
Well it’s harder for them because they are kids and their brains are still developing. You’ve had a lifetime of experiences to draw from where you use math concepts subconsciously many times a day.
Totally true. They haven’t learned to learn yet, they aren’t learning because they want to, or even because they need what they learned.
But the point I was trying to make is, that many adults are still afraid (and many even strongly so) of maths, because it was hard for them at school. But it probably wouldn’t be hard for them now.
Im sorry you had awful teachers, but not all of them are bad. I had amazing teachers that were very worried for the students to learn. In contrast I had very shitty classmates that just didn’t care and would blame the teachers for their laziness.
Sorry you were put through that. Aggressions are no place for learning
My family and school were god awful at teaching. It was all forced (rote memorisation) learning and not me actually learning. I needed things taught slowly and broken down. I have wanted to learn the more advanced technical maths long ago, but now I am an adult and need to find a safe, quite and gentle environment where i can
anybody reading this, please do not give suggestions or advice in replies. thank you.
My advice is to keep something to yourself if you don’t want to listen to peoples opinions about it.
i completely agree. this sentiment was echoed pretty well in a (nontechnical and accessible) paper i read a few years ago. he says the current approach is like forcing people to learn music, but only teaching them how to read sheet music and not letting them touch any instruments. it hides the creativity and problem-solving of the discipline and reduces it to memorizing formulas.
than
The biggest difference (other than the existence of infinity) is that the upper limit is inclusive in summation notation and exclusive in for loops. Threw me for a loop (hah) for a while.
i thought this was pretty weird too when i found out about it. i’m not entirely sure why it’s done this way but i think it has to do with conventions on where to start indexing. most programming languages start their indexing at 0 while much of the time in math the indexing starts at 1, so i=0 to n-1 becomes i=1 to n.
My abstract math professor showed us that sometimes it’s useful to count natural numbers from 1 instead of 0, like in one problem we did concerning the relation Q on A = N × N defined by (m,n)Q(p,q) iff m/n = p/q. I don’t hate counting natural numbers from 1 anymore because of how commonly this sort of thing comes up in non-computer math contexts.
yeah thats a good example and it shows weird the number 0 is compared to the positive integers. it seems like a lot of the time things are first “defined” for the positive integers and then afterwards the definition is extended to 0 in a “consistent way”. for example, the idea of taking exponents an makes sense when n is a positive integer, but its not immediately clear how to define a0. so, we do some digging and see that am+n = aman when m and n are positive integers. this observation makes defining a0=1 “consistent” with the definition on positive integers, since it makes am+n = aman true when n=0.
i think this sort of thing makes mathematicians think of 0 as a weird index and its why they tend to prefer starting at 1, and then making 0 the index for the “weird” term when it’s included (like the displacement vector in affine space or the constant term in a taylor series).
Nah, look at the implementation above:
Means it’s inclusive.
You’re probably referring to some other implementation that doesn’t involve such fine control, like Python where
range(4)
means[0 1 2 3]
Oh yeah, I meant generally. Isn’t it most common if not best practice to say
for (i = 0; i < whatever; i++)
?Fair. I guess to accommodate zero-indexing so that it still happens
whatever
times, notwhatever + 1
times.Sorta not really related but Freya’s video on splines (“The Continuity of Splines”) is a virtually perfect resource if you’re interested in learning about… well… splines.
freya is not a random internet people
While I acknowledhe that I had some pretty awful math teachers, I would like to add that explaining math concepts in an edited video that you could spend a lot of time making has different demands than babysitting/teaching 30+ students at different levels multiple times a day with little prep time.
Also the viewers are actively looking for that content
Wouldn’t reducer be more precise?
I think this is pretty much the imperative equivalent of
foldl (\acc i -> acc + 3*i) 0 [1..4]
.Definitely, although I’m sure that under the hood it’s all the same. Some (albeit high-level) languages also support a sum function that takes a generator as an input, which seems pretty close to this math notation.
Can you explain this out a bit more? I’m a self-taught programmer, of sorts, and I’m not quite getting this…
A reducer “reduces” a list of values to one value with some function by applying it to 2 values at the time.
For instance if you reduce the list [1, 2, 3] with the sum function you get (1 + (2 + 3)) = 6.