Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
This comment is hidden because it contains spoiler information about the solution
A useful fact:
It is sufficient to check if there exist a left neutral element "e" (ie. e * g == g for all g) and each element "g" has a left inverse (ie. there is "h" such that h * g == e).
Then, under associativity and using a few tricky comparisons, we can prove that any left inverse is also a right inverse, "e" is (two-sided) neutral element, from which the uniqeness of "e" and all inverses follows.
I really enjoyed this one. It'd be nice to have similar other ones for different algebraic entities (I've never seen before). Well maybe it would be nice to make them myself if they don't exist....
This comment is hidden because it contains spoiler information about the solution
It would be nice if you give information about the set and the binary operation used for a test, so that the user can debug more easily.
You could still introduce the class in a later stage of the series
Hi, I was thinking I might make it into a series of kata where you add more functions one at a time if this one went down well. I saw that in a Morse code kata and liked the idea. There are other interesting properties of groups that could be interesting to implement like finding subgroups or proving two groups are isomorphic.
Shouldn't
group_set
be aset
rather than alist
? Otherwise there can be duplicate elements.Is it really needed to make a class just to check one thing? A class that serves no purpose but to call a single function using the constructor parameters as its parameters is meaningless. You might as well just turn it into a function
is_group(group_set, binary_operation)
.(Marking this an issue since inevitably every other language translation will pick this up and it'll be very messy)
No idea how that happened
There's an accidental JS version now...
Good catch! I forgot to change my original code rather than just the template, updated Thanks!
I've come up with three more tests that I think catch, associtivity, lack of identity and lack of an inverse while retaining the other three conditions. Thanks for the advice.
Python sample tests are still using
isGroup
instead ofis_group
Thank you! I don't know how I missed that, I didn't realise that when you press validate soloutions it doesn't check the examples.
I've fixed it.
Loading more items...