In the above - grammar, rhetoric, logic - formed the "trivium" and - arithmetic, geometry, music, and astronomy - formed the "quadrivium".
Also "trivium" represented the place where three roads would intersect. People would meet here and exchange pleasantries and gossip. That is how you get the current meaning of the word "trivia".