Hacker News new | past | comments | ask | show | jobs | submit login

I think what you are trying to say is that it's not using the modulo operator to derive the pattern from the integers, instead it is simply encoding the pattern directly in the program as a pattern (false, false, true, ...).

Your objection is confusing everyone else because these are both equally "calculations", and the meaning of the "divided evenly by three" calculation and the meaning of the FFTFFTFFT... sequence are the same, so it just two ways of expressing the same thing. Either way is just as "precalculated" as the other.




Yes, exactly. In group theory when we speak of a quotient group modulo one of its normal subgroups, we’re referring to exactly this. Z3, the integers mod 3, is isomorphic to (actually equal to) Z/3Z, the integers quotiented by all the multiples of 3.

People who haven’t studied abstract algebra aren’t used to thinking of it this way though. To most people, the modulus operator is specifically an operator that returns the remainder of Euclidean division. To think of it as a bunch of equivalence classes that split up the integers is not something most people think of right away.


Do you have a good resource for an intro to group theory and abstract algebra? I’ve never had a chance to study it in a course but it pops up a lot in physics and other interesting phenomena.


The best resource I know of is the textbook I bought for the course I took on group theory and ring theory [1]. It’s pretty expensive and the exercises are very challenging but if you’re a self-motivated student, you can learn a TON of abstract algebra from this one book. You may want to review some linear algebra before you dive in, if you haven’t done so in a while. You can find solutions to many of the exercises online though I can’t vouch for their accuracy.

[1] https://www.amazon.com/Abstract-Algebra-3rd-David-Dummit/dp/...


Well yes, if these things represented different things, then the output of the program would be incorrect.

To put it another way, the original version was explicitly calculating the function ℤ -> { "", "fizz" }. The new version had the results of this function directly embeded in the source code (and hence precalculated as opposed to calculated at runtime). I just don't see the two of these approaches really being all that different


I don't think the point of the post was that it was a radically new approach, but rather that it is an application of concepts that are considerably more general. The hope in using such concepts is that, being so general, you will start to see them everywhere, and using higher-level abstractions lets you see connections that you would otherwise miss. It's a kind of compression of the conceptual space that one works in. Category theory is all about trying to recognize and catalog these connections.


Another way to put it is that `x % 3 == 0` and `cycle [0,0,1]` are just two forms of shorthand for the same concept.




Consider applying for YC's Spring batch! Applications are open till Feb 11.

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

Search: