2

Count the number of strings of length $8$ over $A = \{w, x, y, z\}$ that begins with either $w$ or $y$ and have at least one $x$

So here is what I came up with..Can someone check my work?

$A = \{w,x,y,z\}$

$U = \{w,y\} * A^7$

$S = \{w,y\} * \{w,y,z\}^7$

$|U - S| = |U| - |S|$

$= |\{w,y\} * A^7| - |\{w,y\} * \{w,y,z\}^7|$

$= |\{w,y\}||A|^7 - |\{w,y\}||\{w,y,z\}|^7$

$= 2(4^7) - 2(3^7) = 28,394$

Yusha
  • 1,631

1 Answers1

2

Yes, there are $2$ ways to select from $\{w, y\}$ for the first place, and of the $4^7$ ways to select from all the letters into the remaining seven places, $3^7$ do not include any $x$.   So the ways to fill the required pattern are:$$\lvert \{w, y\} \times (\{w,x,y,z\}^7\setminus\{w, y, z\}^7)\rvert = 2\cdot (4^7-3^7)$$ In an exam it's advisable to include some words, to indicate you grok what the symbols represent.   However, you seem to have grasped the concept and just need to work on presentation.

Graham Kemp
  • 129,094
  • This is straight from the book by the way lol...so yeah. They just changed the numbers.. as far as "presentation" goes.. – Yusha Sep 03 '15 at 02:42