The music for the song came from Brian Wilson's first LSD experience. In the Beautiful Dreamer documentary, Wilson said that shortly after taking LSD, he ran up to a bedroom and hid under a pillow, shouting "I'm afraid of my mom, I'm afraid of my dad."
Some time later he left the room and went to a piano. He started playing in the bass the B-F#-G# pattern over and over, and then added in the right hand after a few minutes a B chord, moving to an A chord.
Within a half hour, he had come up with the "well east-coast girls are hip, I really dig the styles they wear" part of the song. The next day, he and Mike Love supposedly finished off the remainder of the song.