by Locke1689 · 14y ago · 0 comments
Edit: If this is too easy, prove that g in G, g -> g^2 is a homomorphism iff G is abelian.
Note: I am not a mathematician.
In that same vein, I'd suggest proving that a group G is abelian if and only if (ab)^2 = a^2.b^2, where a, b are in G.
It's not as straightforward as your question in the sense that proving it requires a little idea that you have to come up with.
(ab)^2 = aabb a^2 b^2 = abab
ab = ba iff G is commutative, so for an Abelian group we can substitute for the middle bit
aabb = a(ab)b = a(ba)b = abab
Which won't hold if G is not commutative.
QED
I recognize that FizzBuzz is supposed to be easy, but it's supposed to recognize programmers with basic competence; I am not a mathematician. (But maybe I underestimate myself or overestimate some of those with advanced degrees in mathematics?)
aabb = a(ab)b = a(ba)b = abab
fail to prove the if?
edit: I did fail to re-state it, but figured it was obvious in the not-really-formal-proof setting. If that's all you meant by "a bit murky" then nevermind.
To be clear, however: I think these are pretty good analogues of FizzBuzz.