# Number of gauche interactions in an alkane

The textbook states that (a) has 2 gauche interactions, (b) has 3 gauche interactions and (c) has 3 interactions.

But how do we determine this? I thought a gauche interaction would occur when two methyl groups are side by side, however I'm unsure where these answers are coming from.

In the following figure, the $\ce{X}$ and $\ce{Y}$ have a gauche relationship.
$\ce{X}$ and $\ce{Y}$ can be the same (they can both be methyl groups, other alkyl groups, other atoms such as halogen, etc.) or they can be different from each other. In most organic classes, the gauche interaction between methyl groups or alkyl groups is frequently discussed.