# Counting strings with 7 letters

With the letters A, B, C, D, E, F, G.

a. How many strings can you make with 5 characters?

b. maximum 7 characters?

c. 4 characters, no repetition?

d. sorted strings without repetition. Sorted = alphabetical.

e. sorted strings with 7 characters.

I think I got a-d solved, so no need to explain those too much. However, please do explain how you got the answer for e, in a way I could figure out similar questions later.

EDIT:

I tried messing around some with 'e' and got a question equal to something a machine told me. Used formula $$\binom{m+n-1}{n-1} \left(\binom{7+7-1}{7-1}= 1716\right)$$ to get there. I'm not sure why what I did was right though.

• Is there a typo on e.? Commented Oct 21, 2013 at 16:08
• It appears so. Fixed it. Commented Oct 21, 2013 at 16:10
• Before I post my full solution, I would like to clarify. What do you mean by "sorted strings"? Do you mean A must come before B, C, D, E, F, or G, B must come before C, D, E, F, or G, etc.? Commented Oct 21, 2013 at 16:12
• Yes. Sorted, meaning alphabetical. Commented Oct 21, 2013 at 16:13
• And you may repeat? Commented Oct 21, 2013 at 16:14

a. Assuming you may repeat, there are $7$ choices for each of the five slots, so the answer is $7^5$.

b. This is just $7^0+7^1+\cdots+7^7$.

c. There are $7$ choices for the first slot, $6$ for the second slot, $5$ for the third slot, and $4$ for the last slot, so the answer is $$7 \cdot 6 \cdot 5 \cdot 4.$$

d. Unclear. How many letters?

e. Waiting for clarification. Will edit in when I find out.

• 'd' has no repetition, so I guess it's maximum 7 characters. Commented Oct 21, 2013 at 16:20
• What needs to be clarified on 'e'? Commented Oct 21, 2013 at 18:26

You want the number of weak compositions of $7$ into $7$ parts. Each element of the composition tells you how many of that letter are in your string, and the order is set because the string is sorted. For example, the composition 4,2,0,0,0,1,0 would correspond to the string AAAABBF