This text is devoted to the combinatorial theory of polynomial algebras, free associative and free Lie algebras, and algebras with polynomial identities. It also examines the structure of automorphism groups of free and relatively free algebras. It is based on graduate courses and short cycles of lectures presented by the author at several universities and its goal is to involve the reader as soon as possible in the research area, to make him or her able to read books and papers on the considered topics. It contains both classical and contemporary results and methods. A specific feature of the book is that it includes as its inseparable part more than 250 exercises and examples with detailed hints (50 per cent of the numbered statements), some of them treating serious mathematical results. The exposition should be accessible for graduate and advanced undergraduate students with standard background on linear algebra and some elements of ring theory and group theory. The professional mathematician working in the field of algebra and other related topics should also find the book useful for his or her research and teaching.