In abstract algebra, the notion of a group is fairly fundamental. To get a group, we need a set of objects, and an binary operation with 3 properties (4 if you count closure). If we want to randomly generate a group given a finite set, (that is, randomly generate a table giving the result of every possible combination of elements in the set), then it's pretty easy to hack in an identity element, and hack in inverses, but it seems very hard to randomly generate an operation that is associative.
My question is whether there is some (efficient) way to randomly generate an associative operation. I've tried randomly generating an operation, then perturbing non-associative relationships so that they are associative one at a time, but this doesn't really seem to converge. Any ideas?