Question

Theory of Computation Problem 3: Let G be an arbitrary CFG (Context-free Grammer), and let DG...

Theory of Computation Problem 3:

Let G be an arbitrary CFG (Context-free Grammer), and let DG be the string-pushing PDA(pushdown automata) for it. Let w be some string of length n in L(G).

Suppose you know that the leftmost derivation of w in G consists of m substitutions. How many transitions would be in the corresponding computation of DG for input string w? Justify your answer carefully!

All information is given

-----------------------------------------------------------------

Upvote for the right answer!!

Thanks

Homework Answers

Answer #1

ANSWER:

  1. Starting with a single nonterminal 'S' and
  2. form the string by making substitutions according to the rules.
  3. Each rule of the form A -->BC adds a new nonterminal
  4. and each rule of the form A-->a converts one nonterminal into a terminal .
  5. Since it takes n-1 steps to grow the string from the original nonterminal to n nonterminals ,and then n steps to convert each of those nonterminals into terminals,it takes 2n-1 steps to derive a string of length n.
Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT
Active Questions
  • How can you use Bayes’ theorem in light of new information? In Bayes’ theorem, how does...
    asked 3 minutes ago
  • Which of the following is not one of the four states of a working file? Unchanged,...
    asked 6 minutes ago
  • Assume we have CPU instructions that look like this: load register, address save register, address Where...
    asked 19 minutes ago
  • What is the difference between the following two declarations? char array[] = “Hello World”; char *array...
    asked 35 minutes ago
  • Discuss knowledge and understanding gleaned from The Least Dangerous Assumption and Strategies for Presuming Competence. How...
    asked 35 minutes ago
  • Exercise 13-20 (LO13-3) The owner of Maumee Ford-Volvo wants to study the relationship between the age...
    asked 37 minutes ago
  • Scenario The Department of Administrative Services (DAS) provides a number of services to other departments in...
    asked 45 minutes ago
  • Linear Regressions The number of newly reported crime cases in a county in New York State...
    asked 50 minutes ago
  • Specialty courts have been developed for various categories of crimes and offenders (e.g., mental health, substance...
    asked 54 minutes ago
  • An air-track cart with mass m=0.40kg and speed v0=1.2m/s approaches two other carts that are at...
    asked 54 minutes ago
  • Write a program in C# that reverses a collection and removes elements that are divisible by...
    asked 57 minutes ago
  • A gas pipeline with the thickness of 4mm is to be joint together by using welding...
    asked 1 hour ago