Q:

Smallest group containing two given elements

Given two elements of a finite group a, b  Ԑ  G, what is the smallest group containing both these elements?
Is it {axby| x = 0, 1,...., m  &  y = 0, 1,...., n} ? OR
Is it the Union, {axby| x = 0, 1,...., m  &  y = 0, 1,...., n} U {byax| x = 0, 1,...., m  &  y = 0, 1,...., n}?
where m and n are the orders of  a and b respectively..
What exactly do we mean when we talk of a subgroup generated by a given subset S ⊂ G?  

A:

Neither of these needs to be a subgroup. For example, if $a,b$ are generators of the free group $F_2$, then neither of these sets contain $aba$.
The smallest subgroup of $G$ containing $a$ and $b$ (called the subgroup generated by $a$ and $b$) is
$$\langle a,b\rangle = \left\{a^{m_1}b^{n_1}\cdots a^{m_k}b^{n_k} : m_i,n_i\in \mathbb Z, k\in\mathbb N\right\}$$
Note that in general elements an element of $\langle a,b\rangle$ can be written in the form $a^{m_1}b^{n_1}\cdots a^{m_k}b^{n_k}$ in more than one way. The subgroup generated by a set $S\subseteq G$ is defined similarly, i.e.
$$\langle S\rangle=\left\{s_1^{n_1}\cdots s_k^{n_k} : s_i\in S, n_i\in \mathbb Z, k\in\mathbb N\right\}$$

