How many strings of 8 uppercase letters are there a. that start with Y if no letter can be repeated? b. that can start and end with Y if letters can be repeated? c.that start with the letters NE (in that order), if letters can be repeated? d. that start and end with the letters NE (in that order), if letters can be repeated? e. that start or end with the letters NE (in that order), if letters can be repeated?
These are strings of any of the 26 letters right?
(a) Y is already picked as the first letter, which means you have 7 remaining spots which can be taken up by any non-repeating letter of the rest of the alphabet (25 letters) \[1\times\frac{25!}{(25-7)!}\]
(b) The first and last letters are fixed as Y, and since you're allowing repetitions, this means you have 26 letters to choose from for each of the 6 remaining spots: \[1\times26^6\times1=26^6\]
(c) NE are the first two letters, so you have 5 spots remaining. Letters can be repeated, so you have 26 options for each spot: \[1\times1\times26^6=26^6\]
^I meant "... 6 spots remaining." It's the same reasoning as in part (b). (d) This string starts and ends with fixed letters NE (a total of 4 letters), so you have 4 spots remaining, and 26 options per spot: \[1\times1\times26^4\times1\times1=26^4\]
(e) We're going to use this thing called the inclusion/exclusion principle for this one. Notice that strings that start OR end with NE will look like this: \[\begin{matrix}(1)&&&&N&&E&&\Box&&\Box&&\Box&&\Box&&\Box&&\Box\\ (2)&&&&\Box&&\Box&&\Box&&\Box&&\Box&&\Box&&N&&E\\ (3)&&&&N&&E&&\Box&&\Box&&\Box&&\Box&&N&&E \end{matrix}\] Notice that for (1), you can still have the last two letters be NE, but that these are counted again in (3), so the strings that end in NE will be counted twice (repeats are *included*). The inclusion-exclusion principle lets us *exclude* the ones we've already counted: \[(\text{start}~~or~~\text{end})=(\text{start})+(\text{end})-(\text{start}~~and~~\text{end})\] If you've taken a probability course, you'll notice that this strongly resembles the property, \[P(A\cup B)=P(A)+P(B)-P(A\cap B)\] or the cardinality principle from set theory, \[|A\cup B|=|A|+|B|-|A\cap B|\] So to apply the principle, we need to only find the number of strings that start with NE, end with NE, and start/end with NE. We've actually already done this. We have the same number of strings that start with NE as there are strings that end with NE (\(26^6\) each) from (c), and (d) gives us the number of strings that start and end with NE (\(26^4\)). So, the number of strings that start OR end with NE is \(2(26^6)-26^4\).
Join our real-time social learning platform and learn together with your friends!