Question 4
AQA Computer Science June 2023 Paper 1 (7517/1)A level6 marks
On the specification
- 4.1
- 4.4 Theory of computation
- 4.2
- 4.4 Theory of computation
- 4.3
- 4.4 Theory of computation
Question text
4 A regular language is one that can be defined using a regular expression. Figure 4 shows definitions for six different languages. Figure 4 Language A <string> ::= <term> <op> <term> <string> ::= ( <string> ) <op> ::= ÷ | - <term> ::= a | b Language B (a|b)+ab* Language C <string> ::= a | b | <num> <string> ::= <string> a | <string> b <digit> ::= 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 <num> ::= <digit> <num> | <digit> Language D {anb | n ≥ 1} Language E Language F 4.1 Complete Table 2 to show which of the languages in Figure 4 are regular languages. Table 2 Regular language Language (Y/N)? Language A Language B Language C Language D Language E Language F Copy the contents of the unshaded cells in Table 2 into the table in your Electronic Answer Document. [3 marks] 4.2 Show that the language defined by the union of the sets {bn | n > 0} and {a, ab} is a regular language by writing a regular expression for the language. [2 marks] 4.3 Explain what is meant by the cardinality of a set. [1 mark]