(a) Suppose we create strings from the alphabet {a, b}, for example, “baba”, “abab”, or “aaab”. How many strings of length 10 are there that have at least one of each letter in the alphabet?
(b) Suppose we change to the alphabet {a, b, c}. Now how many strings of length 10 are there that have at least one of each letter in the alphabet?
a) creating the string of length 10, there are 2 choices to fill each position
number of all possible string = 210
b) creating the string of length 10, there are 3 choices to fill each position
number of all possible string = 310
press like
(a) Suppose we create strings from the alphabet {a, b}, for example, “baba”, “abab”, or “aaab”....
(a) Suppose we create strings from the alphabet {a, b}, for example “baba”, “abab”, or “aaab”. How many strings of length 10 are there that have at least one of each letter in the alphabet? (b) Suppose we change to the alphabet {a, b, c}. Now how many strings of length 10 are there that have at least one of each letter in the alphabet?
Problem 3 a) How many strings are there of length 10 over the alphabet (a, b) with exactly five a's? b) How many strings are there of length 10 over the alphabet (a, b, c) with exactly five a's?
1. (5) Suppose we have a set of small wooden blocks showing the 26 letters of the English alphabet, one letter per block. (Think of Scrabble tiles.) Our set includes 10 copies of each letter. We place them into a bag and draw out one block at a time. (a) If we line up the letters on a rack as we draw them, how different ways coukl we fill a rack of 5 letters? (b) Now suppose we just toss...
Multiple Choice How many strings of length 12 over the alphabet {a,b,c} have exactly three a's or have exactly three b's or have exactly three c's? (1?).22-3-(3) °(12):22-3-(?) (3) ° (13)-3-(1) QUESTION 20 Multiple Choice How many binary strings of length 12 have exactly six 1's or begin with a 0? ° (62) +211 -(0 ° (12) +201 - 1 ° (6) +211 -(5) ° (12) + 211
animali 32. How many strings of six lowercase letters from the En- glish alphabet contain IS a) the letter a? b) the letters a and b? Osadno-o lls i d 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? into
Suppose the alphabet is sigma = {a, b, ..., z, 0, 1, ..., 9,: }, i.e., the standard letters a-z, decimal numbers, and colon (: ). The colon is used as a delimiter between fields in a text file. Each line of the file thus corresponds to a string. a) Give a regular expression that accepts strings with four fields (i.e., with 3 delimiters). b) Give a regular expression that accepts strings where the second field is numerical. c) Give...
Construct context-free grammars that generate the given set of
strings. If the grammar has more than one variable, we will ask to
write a sentence describing what sets of strings expect each
variable in the grammar to generate. For example, if the grammar
was:
I could say "C generates binary strings of length one, E
generates (non-empty) even length binary strings, and O generates
odd length binary strings." It is also fine to use a regular
expression, rather than English,...
Create DFAs for the following language specifications. 1. All strings on Σ = {A, B, C} that contain each letter (A, B, and C) at least once.
Suppose that we have a language L dened over the alphabet {a, b, c} and suppose that L is context-free. We define a new language pm(L) to be the setof all permutations of all words in L. For example, if L = {abc, aab} then pm(L) = {abc, acb, bac, bca, cab, cba, aab, aba, baa}. Show that pm(L) need not be context-free by giving an example of a language L that is context-free but where pm(L) is not context-free.
Let Σ = {0, 1). (a) Give a recursive definition of Σ., the set of strings from the alphabet Σ. (b) Prove that for every n E N there are 2" strings of length n in '. (c) Give a recursive definition of I(s), the length of a string s E Σ For a bitstring s, let O(s) and I(s) be number of zeroes and ones, respectively, that occur in s. So for example if s = 01001, then 0(s)...