Question

Answer only a & b thanks A ternary string is a sequence of 0’s,1’s and2’s. Just...

Answer only a & b thanks

A ternary string is a sequence of 0’s,1’s and2’s. Just like a bit string, but with three symbols. Let’s call a ternary string good provided it never contains a 2 followed immediately by a 0. Let Gn be the number of good strings of length n. For example, G1= 3, and G2 = 8 (since of the 9 ternary strings of length 2, only one is not good).

a. List the set of all good strings of length n = 2

b. List the set of all good strings of length n = 3

c. Find, with justification, a recursive formula for Gn, and

d. Use the recursive relation found in(c) to compute G5.

Homework Answers

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
C++ only. Must use loops. Please do not use sequence of if statements. Given as input...
C++ only. Must use loops. Please do not use sequence of if statements. Given as input string and an int N, set result a string made of N repetitions of the last N characters of the string. You may assume that N is between 0 and the length of the string, inclusive.   • for input of "Hello", 3 → "llollollo" • for input of "Hello", 2 → "lolo" • for input of "Hello", 1 → "o"
Automata Theory and Formal Languages Problems 1: Consider the following two grammars. Grammar G1- S →...
Automata Theory and Formal Languages Problems 1: Consider the following two grammars. Grammar G1- S → aSb / ∈ Grammar G2- S → aAb / ∈, A → aAb / ∈ a. is G1=G2 b. What is the grammar generated by the expression Problem 2: Let us consider the grammar. G2 = ({S, A}, {a, b}, S, {S → aAb, aA → aaAb, A → ε } ) Derive aaabbb Problem 3: Suppose we have the following grammar. G: N...
Write a program that reads a binary string (string of 0’s and 1’s) converting the binary...
Write a program that reads a binary string (string of 0’s and 1’s) converting the binary value into decimal. Allow the user to type in as many numbers as they want (one at a time) and end the program when they type in “0”. Use Horner’s method (given in step 3, below) to convert from binary to decimal. Sample Run Binary to Decimal Conversion Enter a binary string: 1101 1101 = 13 decimal Enter a binary string: 10011001 10011001 =...
Let S denote the set of all possible finite binary strings, i.e. strings of finite length...
Let S denote the set of all possible finite binary strings, i.e. strings of finite length made up of only 0s and 1s, and no other characters. E.g., 010100100001 is a finite binary string but 100ff101 is not because it contains characters other than 0, 1. a. Give an informal proof arguing why this set should be countable. Even though the language of your proof can be informal, it must clearly explain the reasons why you think the set should...
ANSWER IN C++ ONLY A string of characters including only alphabets (lowercase letters) is provided as...
ANSWER IN C++ ONLY A string of characters including only alphabets (lowercase letters) is provided as an input. The first task is to compute the frequency of each character appearing in the string. In the output, the characters have to be arranged in the same order as they appear in the input string. Then characters have to be rearranged, such that all the characters having a specific frequency, say xx, come together. Let the frequency of a character, lying in...
in the scheme programming language implement a game of rock paper scissors between a user and...
in the scheme programming language implement a game of rock paper scissors between a user and the computer. Only the following scheme subsets should be used: Special symbols (not case sensitive in our version (R5RS), but is in R6RS): a. Boolean: #t (else) and #f b. Characters: #\a, #\b ... #\Z c. Strings: in double quotes 3. Basic functions: a. quote b. car c. cdr d. c _ _ _ _ r, where each _ is either “a” or “d”...
Relations and Functions Usual symbols for the above are; Relations: R1, R2, S, T, etc Functions:...
Relations and Functions Usual symbols for the above are; Relations: R1, R2, S, T, etc Functions: f, g, h, etc. But remember a function is a special kind of relation so it might turn out that a Relation, R, is a function, too. Relations To understand the symbolism better, let’s say the domain of a relation, R, is A = { a, b , c} and the Codomain is B = { 1,2,3,4}. Here is the relation: a R 1,    ...
Please answer the following Case analysis questions 1-How is New Balance performing compared to its primary...
Please answer the following Case analysis questions 1-How is New Balance performing compared to its primary rivals? How will the acquisition of Reebok by Adidas impact the structure of the athletic shoe industry? Is this likely to be favorable or unfavorable for New Balance? 2- What issues does New Balance management need to address? 3-What recommendations would you make to New Balance Management? What does New Balance need to do to continue to be successful? Should management continue to invest...
1. The failure of the new supply chain system affected Nike adversely. What were the reasons...
1. The failure of the new supply chain system affected Nike adversely. What were the reasons for the failure and how did the breakdown harm Nike? 2. What are the important elements to be kept in mind while implementing a new system in an organization? What is the importance of a good working relationship between partners and the sharing of responsibility in implementing critical projects? What mistakes did Nike and i2 make? 3. comment on the lessons learned and the...
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT