25.9k views
2 votes
Language Theory:

a. How many distinct prefixes does the string "ababba" have?
b. Given ℒ 1 = {, , } and ℒ 2 = {, }, enumerate the first 6 values of ℒ1 ℒ 2 in lexicographic order
c. What set of languages is a subset of decidable languages and a superset of regular languages?
d. Does P = P

User Guimo
by
7.0k points

1 Answer

6 votes

Final answer:

The string 'ababba' has 5 distinct prefixes. The first 6 values of L1L2 in lexicographic order are .a, .a., .b, .b.a, .b.b, .c. The set of languages that is a subset of decidable languages and a superset of regular languages is the set of recursively enumerable languages (RE). Yes, P = P, meaning any problem that can be solved in polynomial time can also be solved in polynomial time.

Step-by-step explanation:

Language Theory:

a. Distinct prefixes of 'ababba':

In the string 'ababba', the distinct prefixes are:

  1. a
  2. ab
  3. aba
  4. abab
  5. ababb

b. First 6 values of L1L2:

The first 6 values of L1L2 in lexicographic order are:

  1. .a
  2. .a.
  3. .b
  4. .b.a
  5. .b.b
  6. .c

c. Decidable languages and regular languages:

The set of languages that is a subset of decidable languages and a superset of regular languages is the set of recursively enumerable languages (RE).

d. P = P:

Yes, P = P. The notation P represents the class of problems that can be solved in polynomial time. Since P is equal to itself, it means that any problem that can be solved in polynomial time can also be solved in polynomial time.

User Fanchyna
by
7.8k points