Only 1 and 2 can be placed at even positions, so number of combinations for even positions = n/2*2...........a
and 0,1,2, can be placed at odd positions, so no. of combinations for odd positions= n/2*3............................b
Therefore total no. of combinations= a*b
=n*n*2/3
Let n be an even number. How many ternary strings (i.e. strings over the alphabet 10,...
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?
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)...
explain why the recurrence relation for number of ternary strings of length n contains "01" 7. (10 points) Extra credit: Explain why the recurrence relation for number of ternary strings of length n that contain "01" is bn = 3n-1-bn-2 +31-2?
Discrete mathematics 2) Let be eumber of ternary strings (of 0s, 1s and 2s) of length n that have no adjacent even digits. For example, so (the empty string), s3 (the strings 0, 1 and 2), while s2 5: 01, 0, 12, 2 because the strings 00,02, 20, 22 are not allowed, as they have adjacent even digits. As another example, the string 10112 is allowed, while the strings 10012 and 120121 are not allowed (a) Find #3; (b) find...
How many bit strings of length n are palindromes? Hint: Consider two cases n is even and n is odd. Note a palindrome is a “string” of letters or numbers which read the same “frontwards” and backwards”. Examples: 1101011, 10111101 are palindromes.
thank you Design an NFA over the alphabet <={0,1,2,3,4,5,6,7,8,9} such that it accepts strings which correspond to a number divisible by 3. Hint: String can be of any length. Look up the rule for divisibility by 3 if you need. Give the formal definition of the automaton and draw its transition diagram.
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
Let A be the set of all bit strings of length 10. 1. How many bit strings of length 10 are there? How many bit strings of length 10 begin with 1101? How many bit strings of length 10 have exactly six 0's? How many bit strings of length 10 have equal numbers of O's and 1's? How many bit strings of length 10 have more O's than 1's? a. b. c. d. e.
3. (10 points) Let T = {A, B,C), and let tn be the number of T-strings of length n which do not contain AA or BA as substrings. Find a recurrence for tn, and then use that to find a closed-form (i.e. non-recursive) formula for tn.
Discrete Mathematics 7. (15 points) Let an be the number of length n ({ne Zin 20}) ternary strings (strings made up of {0, 1, 2), ex. 01211120002) that contain two consecutive digits that are the same. For example, a = 3 since the only ternary strings of length 2 with matching consecutive digits are 00, 11, and 22. Also, a, = 0, since in order to have consecutive matching digits, a string must be of length at least two. a....