Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Sigma and power aren't for loops, but they do represent the melding of iteration and operation - the key is your definition of the sigma above - silly computers are always trying to 'do' things, and often math can simplify problems too big to 'do' by fiddling with representation - so I do agree with you, I just think you're being cruel to the for loop example :-)


Perhaps I am being a bit cruel, but that's just to point out the fundamental difference between what an "operation" means in computer science and what it means in classical math (constructive math is a different story).

Classical math is concerned with relations between "preexisting" objects. The statement 4 + 5 = 9 does not mean that the numbers 4 and 5 are added by some algorithm to construct the number 9, but that the three numbers are related via a ternary relation. The statement 9 - 5 = 4 is an equivalent statement in classical math, expressing the very same relation, but means something radically different in computer programs. I think it's important for computer scientists to understand this difference.

Jean-Yves Girard, the inventor of system F in functional programming discusses this difference in Proofs and Types[1], in the very first section, called "Sense, Denotation and Semantics".

[1]: http://www.paultaylor.eu/stable/prot.pdf




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: