Question 5
AQA Computer Science June 2023 Paper 1 (7517/1)A level10 marks
On the specification
- 5.1
- 4.4 Theory of computation
- 5.2
- 4.4 Theory of computation
- 5.3
- 4.4 Theory of computation
- 5.4
- 4.4 Theory of computation
Question text
5 Figure 5 shows the transition function (represented as a state transition diagram) and part of the tape for a Turing machine designed to count the number of zeros between two # symbols on the tape. The current position of the read/write head is indicated by the * symbol. Figure 5 … # 0* 0 0 # … The □ symbol is used to denote an empty cell on the tape. The label on the transition from S6 to S7 means if the machine is in state S6 and a □ is read from the tape, then a 0 should be written to the tape and then the read/write head is moved one cell to the right. The label on the transition from S3 to S3 means if the machine is in state S3 and a □, a 0 or a 1 is read from the tape, then the read/write head is moved one cell to the left; the contents of the tape are not changed. 5.1 Complete the unshaded cells of Table 3 to show the result of tracing the computation of this Turing machine for the first 20 steps only. Show the contents of the tape, the current position of the read/write head and the current state as the input is processed. The top row of the table shows the initial state, the initial position of the read/write head and the starting contents of the tape. Table 3 Tape Current state … # 0* 0 0 # … S0 Copy the contents of the unshaded cells in Table 3 into the table in your Electronic Answer Document. [5 marks] 5.2 Describe two circumstances when the transition function for this Turing machine will not correctly count the number of zeros between two # symbols on the tape. You should assume that: • the read/write head starts immediately to the right of a cell containing a # • there is a cell containing a # symbol somewhere on the tape to the right of the read/write head’s initial position • there are exactly two # symbols on the tape. [2 marks] 5.3 Explain what a Universal Turing machine is. [2 marks] 5.4 State one reason why there are some problems that no real computer can solve that the Universal Turing Machine could solve. [1 mark] You are advised to spend no more than 20 minutes on this section. Enter your answers to Section B in your Electronic Answer Document. You must save this document at regular intervals. The question in this section asks you to write program code starting from a new program/project/file. You are advised to save your program at regular intervals.