Notice: Due to an ongoing migration of our storage and publishing system, material requested since last month will not be uploaded for the time being, and new requests are paused. All existing notes remain available.

Unit 4 MCQs CONTEXT- FREE LANGUAGES

CSE322 50 questions. Pick an option to check it.

Read the notes Subjective questions

0 of 50 answered 0 right 0 wrong , 50 left

  1. Question 1 of 50

    Which of the following describes the formal definition of a Context-Free Grammar (CFG)?

  2. Question 2 of 50

    In the Chomsky Hierarchy, Context-Free Languages (CFLs) are classified as which type of language?

  3. Question 3 of 50

    Which of the following correctly defines the language generated by a Context-Free Grammar ?

  4. Question 4 of 50

    What is a Leftmost Derivation (LMD) in a Context-Free Grammar?

  5. Question 5 of 50

    If represents a valid derivation in a CFG, what is called if it contains both variables and terminals?

  6. Question 6 of 50

    If a sentential form is derived using exclusively a rightmost derivation, what is it specifically called?

  7. Question 7 of 50

    When is a Context-Free Grammar considered ambiguous?

  8. Question 8 of 50

    Consider the grammar . Which of the following statements is true?

  9. Question 9 of 50

    What does it mean for a Context-Free Language to be 'inherently ambiguous'?

  10. Question 10 of 50

    Is the problem of determining whether an arbitrary Context-Free Grammar is ambiguous decidable?

  11. Question 11 of 50

    Which of the following strings is NOT derivable from the grammar ?

  12. Question 12 of 50

    What is the primary application of Context-Free Grammars in computer science?

  13. Question 13 of 50

    Which standard format is used to represent Context-Free Grammars in the design of programming languages?

  14. Question 14 of 50

    Which popular parser generator tool directly utilizes Context-Free Grammars to generate C code for a parser?

  15. Question 15 of 50

    In the context of the Pumping Lemma for Context-Free Languages, a string is divided into how many parts?

  16. Question 16 of 50

    According to the Pumping Lemma for Context-Free Languages, which of the following conditions must hold for the decomposition ?

  17. Question 17 of 50

    Which of the following is the 'pumped' string in the Pumping Lemma for Context-Free Languages?

  18. Question 18 of 50

    What is the primary purpose of the Pumping Lemma for Context-Free Languages?

  19. Question 19 of 50

    Which of the following languages is a classic example of a language that is NOT context-free, often proven using the Pumping Lemma?

  20. Question 20 of 50

    What defines a Null () production in a Context-Free Grammar?

  21. Question 21 of 50

    What is a Unit production in a Context-Free Grammar?

  22. Question 22 of 50

    A variable in a CFG is called a 'useless symbol' if it satisfies which of the following conditions?

  23. Question 23 of 50

    When eliminating useless symbols from a CFG, what is the correct order of the two main steps to ensure all useless symbols are properly removed?

  24. Question 24 of 50

    What is the recommended standard order for the three simplification steps of a Context-Free Grammar?

  25. Question 25 of 50

    In a CFG, a variable is termed 'nullable' if it meets which condition?

  26. Question 26 of 50

    Consider a grammar with the production , where both and are nullable variables. When eliminating -productions, which new productions must be added for ?

  27. Question 27 of 50

    How is a unit production eliminated from a grammar?

  28. Question 28 of 50

    Which of the following best defines a 'reduced grammar'?

  29. Question 29 of 50

    What is the specific format of production rules in Chomsky Normal Form (CNF)?

  30. Question 30 of 50

    If a string of length () is generated by a grammar in Chomsky Normal Form, exactly how many steps are in its derivation?

  31. Question 31 of 50

    What structural property does the parse tree of a string derived from a CFG in Chomsky Normal Form possess?

  32. Question 32 of 50

    Which dynamic programming algorithm relies on the grammar being in Chomsky Normal Form to check string membership in a CFL?

  33. Question 33 of 50

    What is the maximum number of variables on the right-hand side of a production rule in Chomsky Normal Form?

  34. Question 34 of 50

    What is the specific format of production rules in Greibach Normal Form (GNF)?

  35. Question 35 of 50

    If a string of length is generated by a grammar in Greibach Normal Form, exactly how many derivation steps are required?

  36. Question 36 of 50

    Before converting a Context-Free Grammar into Greibach Normal Form, which structural issue MUST be eliminated from the grammar?

  37. Question 37 of 50

    Which of the following rules is an example of immediate left recursion?

  38. Question 38 of 50

    Context-Free Languages are closed under which of the following operations?

  39. Question 39 of 50

    If is a Context-Free Language and is a Regular Language, what can be said about ?

  40. Question 40 of 50

    Greibach Normal Form (GNF) is particularly useful for demonstrating the equivalence between Context-Free Grammars and which computational model?

  41. Question 41 of 50

    When eliminating immediate left recursion of the form , which new set of productions correctly replaces it? (Assume is a new variable)

  42. Question 42 of 50

    What is the 'yield' of a parse tree?

  43. Question 43 of 50

    Which of the following grammars generates the language of all palindromes over the alphabet ?

  44. Question 44 of 50

    Which of the following is true regarding deterministic vs non-deterministic Context-Free Languages?

  45. Question 45 of 50

    If and are Context-Free Languages, which operation is NOT guaranteed to produce a Context-Free Language?

  46. Question 46 of 50

    Consider the CFG: , , . What is the language generated by this grammar?

  47. Question 47 of 50

    If a CFG is simplified to eliminate null productions, which string might be accidentally removed from its language if not handled carefully?

  48. Question 48 of 50

    What is the primary benefit of converting a Context-Free Grammar into Chomsky Normal Form (CNF)?

  49. Question 49 of 50

    Which component is missing from this partial definition of a context-free rule: 'The left-hand side of a production rule must consist of...'?

  50. Question 50 of 50

    What type of derivation generates the tree nodes in a depth-first, left-to-right manner?

That's unit 4

Answer a few questions and your score shows up here.