In mathematics , a group is an algebraic structure consisting of a set together with an operation . The operation is used to combine two elements to form a third element . In mathematics , a group is an algebraic structure consisting of a set together with an operation that combines any two of its elements to form a third element .