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.
Construct a DFA machine to recognize the language of all binary numbers which are a multiple...
Construct a DFA machine to recognize the language of all binary numbers which are a multiple of 5. L = { w belongs {0,1}* : w is a binary number and is a multiple of 5} Example: 101 belongs to L; 1010 belongs to L; 110 doesn't belong to L.
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.
Find a recurrence relation for the number of hexadecimal strings that contain two consecutive Fs. What...
Find a recurrence relation for the number of hexadecimal strings that contain two consecutive Fs. What are the initial conditions?
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....
Express the binary strings in the left column of the following table in hexadecimal notation in...
Express the binary strings in the left column of the following table in hexadecimal notation in the right column of the table. Binary string Binary string expressed in hexadecimal notation 1111000011110000 1010111010101110 1111000111011111 11110000110110001101 10001100111011111000 Add the bit strings in the first two columns of the following table and report the answer in the last column in binary notation. Bit string 1 Bit string 2 Result of the addition in binary notation 111101 111110 100010 110011 111011 101111 110001 100001...
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}*...
Construct a PDA that matches all strings in the language over {x,y} such that each string...
Construct a PDA that matches all strings in the language over {x,y} such that each string has at least twice as many y's as x's. Below, give a short description of the set of strings associated with each state of your PDA.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT