Question 4
AQA Computer Science June 2024 Paper 1 (7517/1)A level8 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
- 4.4
- 4.4 Theory of computation
- 4.5
- 4.4 Theory of computation
- 4.6
- 4.4 Theory of computation
Question text
4 Figure 1 shows four sets R, S, T and U. Three dots (…) means the remaining members of the set follow the same pattern as the previous members of the set. Figure 1 R = {a, b} S = {a, abb, abbbb, abbbbbb, …} T = {bb, bbbb, bbbbbb, …} U = {c, d, bb, b} 4.1 What is meant by the cardinality of a set? [1 mark] 4.2 Explain what is wrong with the statement: ‘The only subsets of R are the sets {a}, {b} and {a, b}’. [1 mark] 4.3 How many members are there in the set formed by the intersection of R and U? [1 mark] 4.4 The language defined by a regular expression can be represented as a set. Explain the functionality of the | (vertical bar) metacharacter when it is used in a regular expression. [1 mark] The members of the set V are strings that match the regular expression a?b+ Set W is formed by the union of sets S and T. Set X is formed by the set operation V – W. 4.5 Write a regular expression that would match with all the members of the set W. [2 marks] 4.6 Write a regular expression that would match with all the members of the set X. [2 marks]