Question 3
AQA Computer Science November 2020 Paper 1 (7517/1)A level10 marks
On the specification
- 3.1
- 4.4 Theory of computation
- 3.2
- 4.4 Theory of computation
- 3.3
- 4.4 Theory of computation
- 3.4
- 4.4 Theory of computation
- 3.5
- 4.4 Theory of computation
- 3.6
- 4.3 Fundamentals of algorithms4.4 Theory of computation
- 3.7
- 4.3 Fundamentals of algorithms4.4 Theory of computation
Question text
3.1 There are four athletes taking part in a race. Each athlete is allocated a lane that they run in. There can only be one athlete in each lane and there are four lanes available. How many different permutations are there for allocating athletes to lanes? [1 mark] 3.2 If there are n athletes taking part in a race and n lanes available, with each athlete being allocated to one lane and each lane only used by one athlete, how many different permutations are there for allocating athletes to lanes? [1 mark] 3.3 An anagram of a string is another string that contains exactly the same number of each character as in the original string but the characters may not all be in the same positions as in the original string. The original string is also an anagram of itself. If there are n characters in a string, why will the number of anagrams of the string not always be the same as your answer to question 03.2? [1 mark] 3.4 The travelling salesperson problem (TSP) is when a salesperson has to visit every city in a set of cities and needs to find the shortest route that does this without visiting any city more than once before finally returning to the city that they started from. The TSP is an example of an intractable problem. Explain what is meant by an intractable problem. [2 marks] Figure 3 lists some time complexities, where n is the size of the problem input and k denotes a constant. Figure 3 O(1) k O(n ) n O(k ) O(n) O(log n) O(n log n) 3.5 Assuming that the time complexities in Figure 3 are for the most time efficient algorithm that solves a problem, how many of the time complexities in Figure 3 are for intractable problems? [1 mark] 3.6 State which of the time complexities shown in Figure 3 is the time complexity of the linear search algorithm and explain why it has that time complexity. [2 marks] 3.7 State which of the time complexities shown in Figure 3 is the time complexity of the binary search algorithm and explain why it has that time complexity. [2 marks]