1. okay let's prove it by the straight forward approach.
Start with the initial bit and use the rule to generate the desired
number
=> Base is 1
=> then if 1 is in T then 10 will be in T because if s is in T
then s0 will be in T
=> then if 10 is in T then 100 will be in T with the same
logic
=> then if 100 is in T then 11001 will be in T because if s is
in T then so is 1s1
=> then if 11001 is in T then 011001 will be in T, because if s
is in T then so is 0s
so here we showed that if 1 is in T which is given, and given the recursive rules we can create the desired bit sequence which proves that 011001 is in T
2. if any string in T of length n has odd numbers of 1s
then,
possible sequences of length n+1 will be:
0s, s0, 1s1, 11s, s11
there is this observation that every new sequence has
odd numbers of 1s because we are adding two 1s always otherwise
single 0
that concludes that every bit sequence of length n+1
will contain an odd number of 1s
In short, we know that if the sequence of length n contains an
odd number of 1s then bit sequence of length n+1 in T will also
contain an odd number of 1s
Now transiting this logic one step ahead, if the sequence of length
n+1 in T contains an odd number of 1s then any sequence of length
n+2 in T will also contain an odd number of 1s
hence proved that if the bit sequence in T of length n contains an odd number of 1s then bit sequence of length n+2 in T will also contain an odd number of 1s
Suppose that the following subset T of binary strings is defined recursively: • Basis: 1 is...
4. (10pts) Let S be the subset of the set of binary strings defined recursively by Basis: XES. Recursive rule: If ze S, then c0 € S, and 1.6 ES. List the elements of S produced by the recursive definition with length less than or equal to 3.
discrete math. Structural Induction: Please write and explain clearly. Thank you. Let S be the set of binary strings defined recursively as follows: Basis step: 0ES Recursive step: If r ES then 1rl E S and 0x0ES (I#x and y are binary strings then ry is the concatenation of and y. For instance, if 011 and y 101, then ry 011101.) (a) List the elements of S produced by te first 2 applications of the recursive definition. Find So, Si...
For each of the following, construct context-free grammars that generate the given set of strings. If your grammar has more than one variable, we will ask you to write a sentence describing what sets of strings you expect each variable in your grammar to generate. For example, if your grammar were: S → EO E → EE CC 0+ EC C+01 We would expect you to say “E generates (non-empty) even length binary strings; O generates odd length binary strings;...
Write down the regular expressions for the following set of strings over {a, b}: 1.Strings that contain no more than one occurrence of the string aa. 2.All strings containing aba: 3.All strings of odd length 4.A string in this language must have at least two a's. 5.All strings that begin with a, and have an even number of b Bonus - All strings with “a” at every odd position
Help with Pascal’s Triangle: Paths and Binary Strings Suppose you want to create a path between each number on Pascal's Triangle. For this exercise, suppose the only moves allowed are to go down one row either to the left or to the right. We will code the path by using bit strings. In particular, a O will be used for each move downward to the left, and a 1 for each move downward to the right. So, for example, consider...
1. The following function t(n) is defined recursively as: 1, n=1 t(n) = 43, n=2 -2t(n-1) + 15t(n-2), n> 3 1. Compute t(3) and t(4). [2 marks] 2. Find a general non-recursive formula for the recurrence. [5 marks] 3. Find the particular solution which satisfies the initial conditions t(1) = 1 and t(2) = 43. [5 marks] 2. Consider the following Venn diagram, illustrating the Universal Set &, and the sets A, and C. А B cat,pig mouse, horse camel...
2. 9 marks] Strings. Consider the following definitions on strings Let U be the set of all strings Let s be a string. The length or size of a string, denoted Is, is the number of characters in s Let s be a string, and i e N such that 0 < ί < sl. We write s[i] to represent the character of s at index i, where indexing starts at 0 (so s 0] is the first character, and...
2. 9 marks] Strings. Consider the following definitions on strings Let U be the set of all strings. Let s be a string. The length or size of a string, denoted Is, is the number of characters in s Let s be a string, and ie N such that 0 Si< Is. We write si] to represent the character of s at index i, where indexing starts at 0 (so s(0 is the first character, and s|s -1 is the...
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...
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)...