Lesson 4.4.3.1
4.4.3.1 Backus-Naur Form and syntax diagrams Quiz: AQA Computer Science, Unit 4
20 questions
In partnership with Revision Ninja
Lesson 4.4.3.1, Backus-Naur Form and syntax diagrams: 20 multiple choice questions for the AQA Computer Science (7517), Unit 4: Theory of computation, written with Revision Ninja.
Host it live on the board and students join with a game code on their own devices, or revise alone with Free Play. The answers are revealed in the game.
The 20 questions
-
What is Backus-Naur Form (BNF) primarily used to describe?
- Programming language syntax
- Data storage capacity
- Hardware circuit logic
- Algorithm time complexity
-
In Backus-Naur Form notation, what does the symbol ::= mean?
- Is mapped to
- Is equal to
- Is defined as
- Is identical to
-
In Backus-Naur Form notation, what do angle brackets enclose?
- Regular expressions
- Optional comments
- Terminal symbols
- Non-terminal symbols
-
What do syntax diagrams visually represent in programming languages?
- Syntax rules
- Memory addresses
- Data structures
- Execution paths
-
Which feature allows BNF to describe languages that regular expressions cannot?
- Alternative syntax paths
- Finite state transitions
- Recursive production rules
- Terminal symbol definitions
-
With the rule <integer> ::= <digit> | <integer><digit> and <digit> from 0 to 9, which string is a valid integer?
- -5
- 12a
- an empty string
- 2024
-
Using the grammar <s> ::= 01 | 0<s>1, which string is generated?
- 0101
- 0110
- 1100
- 0011
-
In the grammar <s> ::= 01 | 0<s>1, how many production steps are needed to derive 000111?
- 4
- 2
- 6
- 3
-
Which production rule describes one or more letters?
- <word> ::= <word>
- <word> ::= <letter> | <word><letter>
- <word> ::= 1
- <word> ::= <letter>+<letter>
-
With the rule <expr> ::= <number> | <expr>+<expr> and <number> any integer, which string is valid?
- +1
- 1+
- 1 2
- 1+2+3
-
In Backus-Naur Form, what does a production rule specify?
- How errors handle
- How memory allocates
- How code executes
- How symbols expand
-
In the grammar <s> ::= 01 | 0<s>1, which string cannot be generated?
- 0110
- 01
- 000111
- 0011
-
In Backus-Naur Form, what is a terminal symbol?
- A replaceable variable
- A recursive function
- A rule header
- A final symbol
-
A grammar generates the strings aabb, ab and so on from <s> ::= a<s>b | ab. Which string is generated?
- abab
- aabb
- ba
- aab
-
With <p> ::= a | b | a<p>a | b<p>b, which string is generated?
- aba
- abb
- aa
- ab
-
Which structure is best defined using BNF rather than regular expressions?
- Lower-case character sets
- Strings ending in 1
- Fixed-length passcodes
- Nested arithmetic expressions
-
What does it mean if a context-free grammar is ambiguous?
- No parse trees
- Multiple parse trees
- Syntax errors
- Infinite loops
-
How many characters does the string derived by applying 0<s>1 twice and then 01 contain, using <s> ::= 01 | 0<s>1?
- 6
- 4
- 8
- 5
-
What does a backward loop in a syntax diagram represent?
- Repetition
- Selection
- Sequence
- Recursion limit
-
Which language notation can express recursive nested structures that regular expressions cannot?
- Finite state machines
- Truth tables
- Regular expressions
- Backus-Naur Form
Related quizzes
- Problem-solving and algorithms Quiz · 4.4.1.1 · 20 questions
- Abstraction Quiz · 4.4.1.3 · 20 questions
- Problem reduction and decomposition Quiz · 4.4.1.8 · 20 questions
- Composition Quiz · 4.4.1.10 · 20 questions
- Automation Quiz · 4.4.1.11 · 20 questions
- Finite state machines Quiz · 4.4.2.1 · 20 questions
- Regular expressions Quiz · 4.4.2.3 · 20 questions
- Comparing algorithms Quiz · 4.4.4.1 · 20 questions
- Order of complexity Quiz · 4.4.4.3 · 20 questions
- Limits of computation and computable problems Quiz · 4.4.4.4 · 20 questions