Search Header Logo

Language Theory: Context-Free Grammar

Authored by REMECITO CAPIN

Other

University

Used 1+ times

Language Theory: Context-Free Grammar
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

15 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is a context-free grammar?

A context-free grammar is a formal grammar that describes a formal language in terms of production rules that define how strings of symbols can be formed.

A context-free grammar is a data structure.

A context-free grammar is a mathematical equation.

A context-free grammar is a type of programming language.

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What are the four components of a context-free grammar?

Non-terminal symbols, Terminal symbols, Production rules, Start symbol

Non-terminal symbols, Terminal symbols, Production rules, End symbol

Non-terminal symbols, Terminal symbols, Derivation rules, Start symbol

Non-terminal symbols, Terminal symbols, Production rules, Final symbol

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is a production rule in a context-free grammar?

A production rule in a context-free grammar is a rule that defines how a nonterminal symbol can be replaced by a sequence of terminal and/or nonterminal symbols.

A production rule in a context-free grammar is a rule that defines how a terminal symbol can be replaced by a sequence of nonterminal symbols.

A production rule in a context-free grammar is a rule that defines how a nonterminal symbol can be replaced by another nonterminal symbol.

A production rule in a context-free grammar is a rule that defines how a nonterminal symbol can be replaced by a sequence of terminal symbols.

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the difference between a terminal symbol and a non-terminal symbol in a context-free grammar?

A terminal symbol represents a basic unit of the language, while a non-terminal symbol represents a group of terminal or non-terminal symbols.

A terminal symbol represents a specific rule in the grammar, while a non-terminal symbol represents a basic unit of the language.

A terminal symbol represents a basic unit of the language, while a non-terminal symbol represents a specific rule in the grammar.

A terminal symbol represents a group of terminal or non-terminal symbols, while a non-terminal symbol represents a basic unit of the language.

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the start symbol in a context-free grammar?

A terminal symbol

A production rule

A regular expression

A non-terminal symbol

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the language generated by a context-free grammar?

A context-free grammar generates a context-free language.

A context-free grammar generates a context-sensitive language.

A context-free grammar generates a regular language.

A context-free grammar generates a regular expression.

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the Chomsky normal form for a context-free grammar?

A -> BC or A -> b

A -> BC or A -> a

A -> B or A -> C

A -> a or A -> b

Access all questions and much more by creating a free account

Create resources

Host any resource

Get auto-graded reports

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

Already have an account?