How many strings of six lowercase letters from the English alphabet contain:
a) The letter 'a'
b) The letters 'a' and 'b'
c) The letters 'a' and 'b' in consecutive positions with 'a' preceding 'b' with all the letters distinct.
d) The letters 'a' and 'b' where 'a' is somewhere to the left of b in the string with all the letters distinct
I have no idea how to go about completing this question. The first thing I started with was P(26,6) = 26*25*24*23*22*21
a) The letter 'a'
b) The letters 'a' and 'b'
c) The letters 'a' and 'b' in consecutive positions with 'a' preceding 'b' with all the letters distinct.
d) The letters 'a' and 'b' where 'a' is somewhere to the left of b in the string with all the letters distinct
I have no idea how to go about completing this question. The first thing I started with was P(26,6) = 26*25*24*23*22*21
-
Assumption: your strings require you to have ANY of the 26 letters of the English alphabet with special restrictions:
a) Number of strings that contain the letter `a` is the same as # of strings with at least 1 `a`
# of Strings with at least 1 `a` = # of strings - strings with NO `a`.
# of strings possible is 26^6
# of string without `a` is 25^6
therefore, number of strings that contain the letter `a` is 26^6 - 25^6 = 64,775,151 strings.
b) Number of strings that contain the letter `a` AND `b` is:
# of strings - # strings with NO `a` - # strings with NO `b` + # of strings with NO `a` AND `b` (double counted)
26^6 - 25^6 - 25^6 + 24^6 = 11,737,502 strings
c) since all the letters are distinct, (counting AB as one letter)
choose AB first, then choose 4 other letters, then rearranging.
=24C4 * 5!
=1,275,120 strings
d)arrange A and B first _A_B_
Ways to select the 4 remaining letters = 24C4 = 10,626
and arrange: 10,626*4! = 255,024
Then it's rearranging |,|,_,_,_,_ = 6!/(4!2!) {where the first | will always represent A} = 15
Thus, with all letters distinct and `a` before `b` will be 255,024*15
There are 3,825,360 strings where `a` preceeds `b`.
a) Number of strings that contain the letter `a` is the same as # of strings with at least 1 `a`
# of Strings with at least 1 `a` = # of strings - strings with NO `a`.
# of strings possible is 26^6
# of string without `a` is 25^6
therefore, number of strings that contain the letter `a` is 26^6 - 25^6 = 64,775,151 strings.
b) Number of strings that contain the letter `a` AND `b` is:
# of strings - # strings with NO `a` - # strings with NO `b` + # of strings with NO `a` AND `b` (double counted)
26^6 - 25^6 - 25^6 + 24^6 = 11,737,502 strings
c) since all the letters are distinct, (counting AB as one letter)
choose AB first, then choose 4 other letters, then rearranging.
=24C4 * 5!
=1,275,120 strings
d)arrange A and B first _A_B_
Ways to select the 4 remaining letters = 24C4 = 10,626
and arrange: 10,626*4! = 255,024
Then it's rearranging |,|,_,_,_,_ = 6!/(4!2!) {where the first | will always represent A} = 15
Thus, with all letters distinct and `a` before `b` will be 255,024*15
There are 3,825,360 strings where `a` preceeds `b`.