This popular riff is often one of the first an aspiring guitarist learns, as it is easy to play and distinctive. But when I am trying to understand it in terms of music theory, it makes me wonder.
Just the plain tones are G-Bb-C-G-Bb-Db-C-G-Bb-C-Bb-G. But these notes neither fit G major nor G minor (the Db is not part of any of these).
Also what baffles me, there are two ways to "add notes". For example, I mostly find that a fourth note is added to every of the above, like in this tab. But other people add the fifth, like here, i.e. playing power chords (suggesting that chord vary in the riff, but that would neither fit any of the above keys).
So could this be somehow explained theoretically? And why fit both version above?