Question

In: Computer Science

Which one of the following REs represents the language of all binary strings having two consecutive...

Which one of the following REs represents the language of all binary strings having two consecutive 0s and two consecutive 1s?

a. (0 + 1)*00(0 + 1)* + (0 + 1)*11(0 + 1)*

b. (0 + 1)*0011(0 + 1)* + (0 + 1)*1100(0 + 1)*

c.(0 + 1)*(00(0 + 1)*11 + 11(0 + 1)*00)(0 + 1)*

d. 00(0 + 1)*11 + 11(0 + 1)*00

Solutions

Expert Solution

The correct option is c.

c.(0 + 1)*(00(0 + 1)*11 + 11(0 + 1)*00)(0 + 1)*

Set of all binary strings having two consecutive 0s and two consecutive 1s implied

Anything 00 Anything 11 Anything + Anything 11 Anything 00 Anything

So,it is quite clear, that , the option c correctly represents the language of all binary strings having two consecutive 0s and two consecutive 1s.

The reasons why the other options are incorrect :

Option  a. (0 + 1)*00(0 + 1)* + (0 + 1)*11(0 + 1)* represents , those strings which either have 00 or 11 as substring.so it's not correct answer.

Option b. (0 + 1)*0011(0 + 1)* + (0 + 1)*1100(0 + 1)* represents , those strings which either have 0011 or 1100 as substring, so it's not correct answer.

Option d. 00(0 + 1)*11 + 11(0 + 1)*00 represents , those strings which starting with 00 and ending with 11 or starting with 11 and ending with 00 , so it's not correct answer.


Related Solutions

Write a regular expression for the language of all strings over {a,b} in which every b...
Write a regular expression for the language of all strings over {a,b} in which every b is directly preceded by a, and may not be directly followed by more than two consecutive a symbols.
With being given two n-bit binary strings, verify if the strings are identical or not. Design...
With being given two n-bit binary strings, verify if the strings are identical or not. Design a procedure showing all steps and write a pseudo-code. What is the complexity of the procedure? If it can tolerate some error, is there a better than linear time solution? If so, write the pseudo-code.
How manyn-digit binary strings have at least two 0s?
How manyn-digit binary strings have at least two 0s?
Find a recurrence relation for the number of binary strings of length n which do not...
Find a recurrence relation for the number of binary strings of length n which do not contain the substring 010
Design a circuit that takes two strings of binary digits and outputs 1 (True) if the...
Design a circuit that takes two strings of binary digits and outputs 1 (True) if the strings “partially” match, and 0 otherwise. To keep this manageable assume the two strings are three bits long, that is a1a2a3 and b1b2b3 where each ai or bi is a one or a zero. The strings are a perfect match if for all i, ai = bi;. The strings are a partial match if at most one i, ai is not equal to bi....
S is the language over S = {a, b, c, d, e} containing all strings that...
S is the language over S = {a, b, c, d, e} containing all strings that start with at least 2 a's, followed by any number of b's, followed by 5 c's, followed by an odd number of d's, followed by an even number of e's.  For example, S contains aaabbcccccdee, aaaacccccdddeeee, and so on.  Write S symbolically in the manner of section 6.1, problem # 12 a) - f).  Example 6.12 will also be helpful. bonus: How many strings in {000, 11}*...
Let L1 be the language of the binary representations of all positive integers divisible by 4....
Let L1 be the language of the binary representations of all positive integers divisible by 4. Let L2 be the language of the binary representations of all positive integers not divisible by 4. None of the elements of these languages have leading zeroes. a) Write a regular expression denoting L1. b) Write a regular expression denoting L2. c) a) Draw a state diagram (= deterministic finite state automaton) with as few states as possible which recognizes L1. This state diagram...
Recall that the set {0,1}∗ is the set of all finite-length binary strings. Let f:{0,1}∗→{0,1}∗ to...
Recall that the set {0,1}∗ is the set of all finite-length binary strings. Let f:{0,1}∗→{0,1}∗ to be f(x1x2…xk)=x2x3…xkx1. That is, f takes the first bit of a string x and moves it to the end of x, so for example a string 100becomes 001; if |x|≤1, then f(x)=x Also, suppose that g:{0,1}∗→{0,1}∗ is a function such that g(x1…xk)=0x1…xk (that is, gg puts an extra 0 in front of the given string, so for example g(100)=0100. Everywhere in this question we...
Create a Deterministic finite automaton that takes in binary strings and accepts them which has both...
Create a Deterministic finite automaton that takes in binary strings and accepts them which has both an odd number of zeros and a sum that is divisible by 3 (but no others). For example, 0111 should be accepted, but not 011 or 111.
For questions 7a-7d, use the following functions, one of which represents supply, and the other represents...
For questions 7a-7d, use the following functions, one of which represents supply, and the other represents demand. (1) P = -100Q + 1000 (2) P = 50Q + 250 7a. Equation (1) represents supply/demand, and equation (2) represents supply/demand. 7b. What is the equilibrium quantity Q*? 7c. What is the equilibrium price P* 7d. Suppose that the price floor imposed at $700. This would create an excess supply/demand of 6,9,3,5,11
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT