TITLE: Prove that $D_3 \oplus D_4$ is not isomorphic to $D_{12}\oplus\mathbb Z_2$
QUESTION [6 upvotes]: This is a problem from the textbook, doing this for practice and not assignment. 

Prove that $D_3 \oplus D_4$ is not isomorphic to $D_{12}\oplus\mathbb Z_2$.

So we know 
$|D_3| = 6$ and $|D_4| = 8$ then $|D_3\oplus D_4| = 6\cdot 8 = 48,$ and similarly $|D_{12}\oplus\mathbb Z_2| = 24\cdot 2 = 48.$ 
So the groups are of same size. We can also see that none of the groups are cyclic since orders of the individual groups are not relatively prime. 
Would there be a intuitive way of approaching this question, rather then looking at the number of elements of each order in the two groups?

REPLY [5 votes]: For any group $G$, let $P(G)$ be the probability that two elements of $G$ commute. Then $$P(D_{12} \oplus \mathbb{Z}_2)= P(D_{12}) \ \text{and} \ P(D_3\oplus D_4)= P(D_3) \cdot P(D_4).$$
With some calculations, we find $P(D_3)=\frac{1}{2}$, $P(D_4)= \frac{5}{8}$ and $P(D_{12})= \frac{3}{8}$, hence $$P(D_{12} \oplus \mathbb{Z}_2) \neq P(D_3 \oplus D_4).$$