Question 3

AQA Computer Science June 2019 Paper 1A level7 marks

On the specification

3.1
3.4 Theory of computation
3.2
3.4 Theory of computation
3.3
3.4 Theory of computation
3.4
3.4 Theory of computation
3.5
4.2 Fundamentals of data structures
3.6
4.2 Fundamentals of data structures
Question text

3 Figure 3 shows a partial solution to a logic puzzle. To complete the solution each of the letters A-I must appear exactly once in each row of nine cells, exactly once in each column of nine cells and exactly once in each of the collections of three-by-three cells shown with limits shown by a thicker border. In Figure 3 the logic puzzle has been completed except for the collection of three-by- three cells in the top-right corner. Figure 3 D F G B A C I E H F G D A B C I H E B G D E C H A F I F H I D B A E G C C A E G I F B H D H D B C E G F I A G C F A D I H B E E I A H F B D C G 3.1 Complete the solution for the puzzle shown in Figure 3. Copy the contents of the unshaded cells in Figure 3 into the table in your Electronic Answer Document. [1 mark] Figure 4 shows a simpler example of this type of logic puzzle with fewer cells. In this simpler puzzle only the letters A-D are used. Figure 4 C B A B A It is possible to represent this type of puzzle as a graph. To do this a unique number is given to each cell and a node containing this unique number is added to the graph. An edge between two nodes denotes a link between those two cells, meaning they cannot contain the same letter as each other. Figure 5 shows how unique numbers have been allocated to each cell in the puzzle in Figure 4 and Figure 6 shows an adjacency matrix that represents this puzzle. Figure 5 1 2 3 45 6 7 89 10 11 12 13 14 15 Figure 6 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 1 1 1 1 0 0 1 0 0 0 1 0 0 0 11 1 1 1 0 0 0 1 0 0 0 1 0 0 21 0 0 1 1 0 0 1 0 0 0 1 0 30 0 1 1 0 0 0 1 0 0 0 1 41 1 1 1 0 0 0 1 0 0 0 51 1 0 1 0 0 0 1 0 0 61 0 0 1 0 0 0 1 0 70 0 0 1 0 0 0 1 81 1 1 1 1 0 0 91 1 1 1 0 0 10 1 0 0 1 1 11 0 0 1 1 12 1 1 1 13 1 1 14 1 15 The graph in Figure 6 can be considered to be both a representational abstraction and an abstraction by generalisation of the puzzle from Figure 4. 3.2 What is representational abstraction? [1 mark] 3.3 What is abstraction by generalisation? [1 mark] 3.4 Other than the contents of the cells, what information has been removed from the puzzle in Figure 4 when it has been represented as a graph? [1 mark] A graph can be represented using an adjacency list or as an adjacency matrix. 3.5 Explain the circumstances when it would be more appropriate to use an adjacency matrix instead of an adjacency list. [2 marks] 3.6 Only the top half of the matrix in Figure 6 needed to be used to present the puzzle. For which type of graph would the bottom half of the matrix also need to be used? [1 mark]