1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
lora16 [44]
3 years ago
5

) Consider the ambiguous CFG problem: given a context free grammar, does there exist a string that can be generated by two diffe

rent parse trees. Show that this problem is undecidable by reducing the post correspondence problem to it. The post correspondence problem is the following: given two sequences of strings a1, ..., an and b1, ..., bn, is there a sequence of indices i1, ..., im (with possibly repeats, and whose total length may be much bigger than n) such that ai1 ai2 ...aim = bi1 bi2 ...bim?
Computers and Technology
1 answer:
vodomira [7]3 years ago
4 0

Answer:

See explaination

Explanation:

The post correspondence problem is: Given a_1, \ldots, a_n and b_1, \ldots, b_n , is there a sequence of indices 11. ..., im such that a_{i_1}\ldots a_{i_m} = b_{i_1}\ldots b_{i_m} .

To reduce from the PCP to the ambiguous CFG problem, do the following. Add some more symbols c_1, \ldots, c_n and define the following languages:

L_{A} = \{a_{i_1}\ldots a_{i_k}c_{i_k}\ldots c_{i_1} \mid k \geq 1\}

L_{B} = \{b_{i_1}\ldots b_{i_k}c_{i_k}\ldots c_{i_1} \mid k \geq 1\}

L_{AB} = L_A \cup L_B .

Define the following grammar for the language L_{AB} :

S \to S_{A} \mid S_{B}

S_A \to a_iS_Ac_i \mid a_ic_i, 1 \leq i \leq n

S_B \to b_iS_Bc_i \mid b_ic_i, 1 \leq i \leq n

It is easy to see that the given grammar generates the langauge L_{AB} . The reduction outputs the grammar thus constructed.

To see why this is a valid reduction, let there be a solution to the post correspondence problem, i.e. 11. ..., im such that a_{i_1}\ldots a_{i_m} = b_{i_1}\ldots b_{i_m} . Then the string a_{i_1}\ldots a_{i_m}c_{i_m}\ldots c_{i_1} = b_{i_1}\ldots b_{i_m}c_{i_m}\ldots c_{i_1} has two difference derivations in the given grammar, one using S_A and the other using S_B .

Conversely, let a string generated by the given grammar have two different derivations. Note that S_A and S_B can only generate one derivation tree for any string, hence the only way for two different derivations to happen is for one of them to go to S_A and the other to S_B .

Let the string for which ambiguity appears be of the form a_{i_1}\ldots a_{i_m}c_{i_m}\ldots c_{i_1} . Then the other derivation must produce a string of the form b_{i_1}\ldots b_{i_m}c_{i_m}\ldots c_{i_1} , this is because both derivations must produce the same string for ambiguity to occur, hence the part which uses c_i must be the same. Note that this further implies that a_{i_1}\ldots a_{i_m} = b_{i_1}\ldots b_{i_m} , which is equivalent to saying that the post correspondence problem has a solution.

Hence the reduction works as expected. This proves that the ambiguous CFG problem is undecidable, otherwise post correspondence problem would be decidable, which is a contradiction.

You might be interested in
Out put of Print (3**2*2)
expeople1 [14]

Answer:

18

Explanation:

please mark me as brainliest

4 0
2 years ago
Read 2 more answers
TLO 06 Active Directory Domain and Trusts tool is used to move servers between site in an AD Infrastructure.a. Trueb. False
Elan Coil [88]

Answer:

b. False

Explanation:

Active Directory Domain and Trusts tool is used for the following operations:

1. To increase the domain functional level

2. To increase forest functional level

3. To add UPN suffixes

4. To manage domain trust

5. To manage forest trust.

Hence, the correct answer is: it is FALSE that Active Directory Domain and Trusts tool is used to move servers between site in an AD Infrastructure

4 0
4 years ago
If all of Earth's history were squeezed into one 12-hour period, how long ago did Precambrian time end? How long did the Cenozoi
Jet001 [13]

Answer:

That it

Explanation:

There have been mass extinctions during the Cenozoic as there were during the Mesozoic and Paleozoic, but not as many animals and plants have disappeared. Finally, humanity appeared during the last two million years.The human lineage only diverged from our most recent common ancestor about 5 million years ago; less than half of 1% of that time, and modern Homo sapiens is only between 200,000 and 50,000 years old, depending on your definition.

7 0
3 years ago
This is a python program.
denpristay [2]

Answer:

word = input("Type your name: ")

print(len(word))

Explanation:

The len function will count all the chars in the string.

7 0
3 years ago
Does anybody know how to get this little search bar thing off of my task bar on a HP laptop.
Paul [167]
Try clicking the down arrow on the search bar or right clicking it and selecting an option no if that doesn’t work then drag the || to somewhere or right click it. If none of those work you can right click the taskbar and see if there is anything that looks like it could be the search bear and uncheck it
4 0
3 years ago
Other questions:
  • It is a good idea to use more than one typeface in a document when _____.
    8·2 answers
  • Double clicking a word selects the entire word?
    10·1 answer
  • So, I have strict parents & need help, if u don’t know how to fix this after u read it, leave. I don’t want u getting points
    11·2 answers
  • Please refer to the MIPS solution in the question above. How many total instructions are executed during the running of this cod
    10·2 answers
  • What are some benefits of 3-D printing?
    9·1 answer
  • java Write a program that reads a list of words. Then, the program outputs those words and their frequencies. The input begins w
    11·1 answer
  • wants to redesign the user interface. The customer service agents use ________ to enter explicit statement to invoke operations
    11·1 answer
  • Is an electronics standard that allows different kinds of electronic instruments to
    12·1 answer
  • New product ideas must fit into a company's mission statement and?
    12·1 answer
  • When delivering digital technologies to clients, what is a best practice to make those solutions sustainable?
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!