# Combinatorics on words

Combinatorics on words is like a game where you play with letters and words. Imagine you have a bunch of letters like A, B, and C. Now, let's create a rule - you can only use these letters to make some words. For example, you can make the word AB or AC, or ABC, but you can't make the word BA, CA, or CBA.

Now, let's add some more rules. Let's say you can repeat the letters and create words such as AA, BB, and CCC. You can also make longer words like AABB, ABAB, and ABCABC.

But wait, there's more! You can also create patterns of letters like ABBCC, ABAAC, and ABCBC. These are called Words with Repetitions.

Combinatorics on words is all about counting and exploring these patterns and words that can be created using given letters and rules. We can figure out how many words we can create with a certain set of letters, or we can look for patterns within the words we create.

For example, if we have the letters A, B, and C, how many three-lettered words can we create? The answer is 27, because we can make AAA, AAB, AAC, ABA, ABB, ABC, ACA, ACB, ACC, BAA, BAB, BAC, BBA, BBB, BBC, BCA, BCB, BCC, CAA, CAB, CAC, CBA, CBB, CBC, CCA, CCB, and CCC.

Combinatorics on words can be a bit tricky, but it's a fun game that helps us explore the world of language, letters, and patterns.