12

If this is a duplicate please mark it down.

We know that if $(G,\ast)$ is a group then it must verify the associative property, that is, $$\forall x,y,z\in G:\quad x\ast(y\ast z)\quad=\quad(x\ast y)\ast z\,.$$

My question is how many elements have to verify the associativity in a group?

I suspect that it must be $$\frac{n!}{3!},$$ where $n$ is the order of $G$.

Is that right?

Thank you!

EDIT: as you have opined I would like to know the worst case, that is, in those where we have not realized the inheritance that can have an operation within the group or any other factor that reduces the number of check rows (yes, "silly" mode activated!). If you want, you can propose the best level if certain restrictions occur (be Abelian, etc.) :)!

manooooh
  • 2,269
  • 2
    Do you mean how many triples you have to check to ensure that associativity holds? – Robert D-B Jul 23 '18 at 02:28
  • Yes! Fore example here. I think I would have to make $6!/3!;=;120$ rows. – manooooh Jul 23 '18 at 02:29
  • 2
    Well the worst case is certainly $|G|^3$, but some can be ruled out because of the identity. If $G$ is non-abelian, then I don't think you can cancel out the $3!$ permutations of $xyz$. Maybe someone knows a clever algorithm! – Robert D-B Jul 23 '18 at 02:32
  • 1
    As rwbogl points out, one needn't check the cases where any of $x, y, z$ are the identity, so an upper bound for general $G$ is $(|G| - 1)^3$. This is clearly sharp in the case $G = \Bbb Z_2$; NB the conjectured bound $n! / 3!$ fails in this case. – Travis Willse Jul 23 '18 at 02:51
  • Thank you @JavaMan!! It occurred to me to ask after asking that question. – manooooh Jul 23 '18 at 03:08
  • @Travis thank you for your response! Hmm... you are totally right about the case $G=\mathbb Z_2$, so, why we can't restrict for $|G|>2$? :'). I would like to know the answer in the worst case, that is, in those where we have not realized the inheritance that an operation has. Please see my future edit. – manooooh Jul 23 '18 at 03:10
  • @Travis now I think you are wrong. Note that the property holds for, in best of cases, $\textbf 3$ elements. So I don't think that we need to restrict the order of the group because we know $|G|>2$. – manooooh Jul 23 '18 at 03:15
  • 1
    @manooooh Can you state precisely which of my claims you believe to be incorrect? I'm also not sure what exactly you mean by, "Note that the property holds for, in best of cases, 3 elements." – Travis Willse Jul 23 '18 at 03:17
  • @Travis $\mathbb Z_2$ does not have order $2$? – manooooh Jul 23 '18 at 03:20
  • I think you are right with ${(|G|-1)}^3$ :). – manooooh Jul 23 '18 at 03:23
  • 1
    I don't understand the question. If we know it is a group then we know it is associative. So are we allowed to assume the other group axioms I.e. identity and inverses? – Derek Holt Jul 23 '18 at 08:01
  • @DerekHolt sorry for the misunderstanding. I don't say that we are allowed to assume the other properties that a group has. In some cases, it is "easy" to prove these properties. Please see this comment. – manooooh Jul 23 '18 at 08:16
  • 1
    @manooooh NB that bound assumes the existence of an identity element---since we're checking whether $G$ is a group, we may or may not already know this, depending on context. – Travis Willse Jul 23 '18 at 08:28
  • 1
    You can check whether a binary $n\times n$ table is a group multiplication table in time $O(n^2 \log n)$. – Derek Holt Jul 23 '18 at 09:00
  • @Travis what is "NB"? And when you say " identity" this is, in Spanish, equivalent to "neutro" (I mean $e$)? – manooooh Jul 23 '18 at 14:38
  • The question does not make sense to me for the reason I said in my previous comment (groups are associative by definition) , and I am honestly unsure exactly what you are asking. I wish you would try and clarify the question. – Derek Holt Jul 23 '18 at 16:38
  • @DerekHolt suppose we want to know how many rows are needed to check the associativity of group $({-1,0,1},\cdot)$. Depending how is defined the set ${-1,0,1}$ and $\cdot$ I will assume that ${-1,0,1}\subseteq\mathbb Z$ and $\cdot$ is the usual product for integers. Then we have $1$ row to check: $$\begin{matrix}-1\cdot(0\cdot1)&=&(-1\cdot0)\cdot1&\Rightarrow&0&=&0 \end{matrix}.$$ My question is, then, instead of $3$ elements, to know how many rows are needed to check (without repetition, etc.) the associativity. Shortcuts exist, but this question does not need shortcuts. – manooooh Jul 23 '18 at 16:48
  • 1
    @manooooh NB means "nota bene" https://en.wikipedia.org/wiki/Nota_bene And yes, by identity I mean the identity element, or neutral element. – Travis Willse Jul 23 '18 at 17:34
  • @Travis oh OK. So yes, I assume that we know the existence of the identity element. – manooooh Jul 23 '18 at 17:43

3 Answers3

15

In “Verification of Identities” (1997), Rajagopalan and Schulman discuss associativity testing for binary operations on a finite set of $n$ elements. For certain types of operations, a random algorithm works with high probability. However:

This random sampling approach does not work in general. For every $n≥3$, there exists an operation with just one nonassociative triple.

(Page 3.)

So the answer to your question, unfortunately, is that in the general case one must check all $n^3$ triples of elements. (Not $\frac{n!}6$ as you suggested.)

The Rajagopalan and Schulman paper has more to say that may be useful to you anyway.


Since R&S don't say, here's a very simple example of an operation with only one nonassociative triple. Consider the set $\{0, 1, 2, \ldots n-1\}$ (for $n\ge 3$) with the following operation:

$a\ast b = 0$ in all cases, except $2\ast 1=2$.

Then it is easy to show that $a\ast(b\ast c) = (a\ast b)\ast c$ with only one exception: Since $b\ast c\ne 1$, the left side must be equal to $0$. And, except in the one case $(2\ast 1)\ast 1 = 2\ast 1 = 2$, the right side will be $0$ also.)

MJD
  • 65,394
  • 39
  • 298
  • 580
3

If you want to do an absolute brute-force proof, then yes, you may have to check a lot of permutations of the group's elements, but $n!/3!$ is greater than the number of permutations you have to check for any group of more than $6$ elements. You only need to check permutations of three elements with repetition, which means $n^3$ cases to check.

For the linked problem, in which the group has only $6$ elements, $n!/3!$ actually underestimates the number of possible permutations: you would actually need to check $6^3 = 216$ cases, whereas $6!/3!$ is only $120.$

David K
  • 98,388
  • Thanks! I would like to know the answer in the worst case, that is, in those where we have not realized the inheritance that an operation has. So it would be, without any reduction, $n^3$? – manooooh Jul 23 '18 at 03:13
  • 1
    Indeed $n^3$ is the "worst case" number of checks that you are looking for. – David K Jul 23 '18 at 03:24
  • Does the formula $n^3$ has any lower bound ($n>3,n>4$, etc.)? Because I am thinking on this group that I say in comments. Since it has $3$ elements, the only row that has to be checked is $-1\cdot(0\cdot 1)=(-1\cdot0)\cdot1$ (or some other permutation, like $0\cdot(-1\cdot1)=(0\cdot-1)\cdot1$). But clearly they are not $3^3=27 $ rows in the worst cases... – manooooh Jul 24 '18 at 19:29
  • 1
    If you really do not have "any other factor that reduces the number of check rows" then I don't see how you decide not to check $1\cdot(0\cdot-1)$ and $1\cdot(-1\cdot0)$ in addition to $-1\cdot(0\cdot1),$ or even how you decide not to check $1\cdot(1\cdot1).$ As has been noted in recent comments, however, it seems reasonable that you would at least eliminate some rows involving the identity without checking them, if you have already proved enough of the other group properties to make this safe. – David K Jul 24 '18 at 20:32
  • 1
    To put it in brief, if some rows are too silly to check even in "maximum silly mode", then indeed the number to check would be fewer than $n^3$ rows. – David K Jul 24 '18 at 20:34
  • Wait, the definition says "$\forall x,y,z$". A possibility could be $x=y=z$? – manooooh Jul 24 '18 at 20:53
  • I thought the statement not holds for $x=y=z$ or $x,y=z$ or something like that... Am I wrong? – manooooh Jul 24 '18 at 20:55
  • 1
    $\forall x,y,z$ definitely includes the case $x=y=z$ and all cases where two of the terms are equal. – David K Jul 24 '18 at 20:57
  • What a mess. Thank you! – manooooh Jul 24 '18 at 20:57
2

As I explained in my comments, I do not understand the question, but it has got plenty of upvotes, so I guess others do understand it. But I think there are two distinct questions that you could be asking here.

I guess we are agreed that we are given a finite set $G$ of size $n$ and an operation $*:G \times G \to G$ i.e. for all $g,h \in G$, $g*h$ is a known element of $G$. (The problem I have with your wording is that you persist in referring to $G$ as a group, but the whole point is that we don't know yet whether it is a group.)

Two questions we can ask are

  1. Is $*$ associative? I think that most posters have been addressing that question. From the answers and references it looks as though there are probabilistic algorithms that work faster, but no deterministic method is known that is better than $O(n^3)$ in the worst case.

  2. Does $*$ define a group? It is interesting that this is apparently asking us to check more conditions than Question 1, but it can be decided in time $O(n^2 \log n)$ in all cases, which is quicker than just checking associativity.

The reason for this is that we start by checking for the existence of an identity element and inverses, which can be done in $O(n^2)$. If the answer is no, then $*$ is not a group and we are done. But if the answer is yes, then we can make use of that to speed up checking associativity. Roughly you do that by finding a generating set $S$ for $G$ of size at most $\log_2 n$. To test associativity it then suffices to check $(gh)s=g(hs)$ for all $g,h \in G$ and $s \in S$.

This was also asked here.

Derek Holt
  • 90,008
  • Do what you want. Mark it as a duplicate. I do not care about the upvotes. Ah, by the way: The group must be finite. Imagine that if we have group $(\mathbb Z_n,\overline +)$ it has infinite elements and in this way it is impossible to verify the associativity. – manooooh Jul 24 '18 at 17:27
  • I don't want to mark it as a duplicate. What I find most interesting about this discussion is that there are two distinct questions, and the question "is this a group?" which seems to be asking more than the question "is this operation associative?" is actually easier to answer. I am not sure what you mean by $({\mathbb Z}_n,\mp)$. ${\mathbb Z}_n$ normally denotes a finite set/group/ring of size $n$. – Derek Holt Jul 24 '18 at 17:54
  • Why would be important to know if this is a group? I am just asking a formula; a way to know the rows of associative operations we need to do for finite groups, even if we don't know yet if this is a group. And yes, $\mathbb Z_n$ is the set of integres modulo $n$ and $\overline +$ is the sum of classes. – manooooh Jul 24 '18 at 18:08
  • 1
    But then ${\mathbb Z}_n$ is a finite group. And it is associative. I still don't know what you are asking. Are you asking Question 1 in my answer above? – Derek Holt Jul 24 '18 at 18:52
  • Yes, sorry, take the aditive abelian group $(\mathbb Z,+)$. I'm not asking any of your two questions. – manooooh Jul 24 '18 at 19:24
  • In that case I have no idea at all what you are asking. MJD is answering Question 1. – Derek Holt Jul 24 '18 at 19:46
  • What is "MJD"? I am asking if we were in silly mode how many options do we need to check to prove the associativity property in a group. Take the finite group you want. My question is: for example the group you picked has $5$ elements. How many possibilites do we need to check, using that $5$ elements, to prove the associativity? $5^3$? $5!/3!$? How many? – manooooh Jul 24 '18 at 19:52