this post was submitted on 16 Jul 2023
1654 points (96.5% liked)

Memes

52145 readers
1057 users here now

Rules:

  1. Be civil and nice.
  2. Try not to excessively repost, as a rule of thumb, wait at least 2 months to do it if you have to.

founded 6 years ago
MODERATORS
 
(page 2) 50 comments
sorted by: hot top controversial new old
[–] Metriximor@lemmy.world 8 points 2 years ago (2 children)

Freya is a really good programming maths communicator so it doesn't surprise me

load more comments (2 replies)
[–] Makeshift@lemmy.dbzer0.com 8 points 2 years ago

wow I wish we learned this kind of stuff in school

[–] lasagna@programming.dev 7 points 2 years ago

Invented in the 50s, Fortran = FORmula Translating language. It was basically created to solve this sort of problem.

[–] UserNotFound@lemmy.world 7 points 2 years ago (7 children)

I don't know her, so maybe my question is stupid, but does she explain math without using code? I, honestly, am too stupid to programing, I don't understand it. I understand summary, not the second one

[–] radix@lemm.ee 3 points 2 years ago

I don't know anything about the original post author, but product notation is the same as summation notation except that instead of adding each new term to the running total, you're multiplying each new term. You don't have to know programming to see from the code samples that the only difference in the code is += vs *= (well, maybe it would help to know that * means multiply; I honestly dont rember how common-knowledge that is).

load more comments (5 replies)
[–] Duchess@yiffit.net 6 points 2 years ago

i still don't understand but thanks

[–] radix@lemm.ee 6 points 2 years ago (4 children)

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.

[–] affiliate@lemmy.world 3 points 2 years ago (1 children)

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.

[–] radix@lemm.ee 5 points 2 years ago (1 children)

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.

load more comments (1 replies)
load more comments (3 replies)
[–] fidodo@lemm.ee 5 points 2 years ago (3 children)

Wouldn't reducer be more precise?

[–] Faresh@lemmy.ml 4 points 2 years ago

I think this is pretty much the imperative equivalent of foldl (\acc i -> acc + 3*i) 0 [1..4].

[–] basketsandhoes@lemmy.ml 3 points 2 years ago (1 children)

Can you explain this out a bit more? I'm a self-taught programmer, of sorts, and I'm not quite getting this...

[–] nicolairathjen@lemmy.world 3 points 2 years ago

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.

load more comments (1 replies)
[–] spacesweedkid27@lemmy.world 5 points 2 years ago (1 children)

Ok now try infinite for loops

[–] SmoothSurfer@lemmy.ml 4 points 2 years ago

freya is not a random internet people

load more comments
view more: ‹ prev next ›