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...
) Find a recurrence relation for the number of ternary strings of length n≥1 that do not contain two or more consecutive 2s. (Hint: A ternary string consists of 0s, 1s, and 2s.)
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....
Problem 3. A ternary string is a sequence of O's, 1's and 2's. Just like a bit string, but with three symbols 0,1 and 2. Let's call a ternary string good provided it never contains a 2 followed immediately by a 0, i.e., does not contain the substring 20. Let Go be the number of good strings of length n. For example, G_1=3, and G. = 8 (since of the 9 ternary strings of length 2, only one is not...
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)...
2. A binary string s a finite sequence u = ala2 . . . an, where each ai įs either 0 or 1. In this case n is the length of the string v. The strings ai,aia2,...,ai...an-1,aan are all prefixes of v. On the set X of all binary strings consider the relations Ri and R2 defined as follows R, = {(u, u) | w and u have the same length } {(w, u) | w is a prefix of...