Question 11
AQA Computer Science June 2025 Paper 2 (7517/2)A level6 marks
On the specification
- 11.1
- 4.12 Fundamentals of functional programming
- 11.2
- 4.12 Fundamentals of functional programming
- 11.3
- 4.1 Fundamentals of programming4.4 Theory of computation
- 11.4
- 4.12 Fundamentals of functional programming
Question text
11 box The Fibonacci sequence is a number sequence in which the first two numbers are both 1 and every other number in the sequence is the sum of the previous two numbers. The first ten values in the Fibonacci sequence are: 1, 1, 2, 3, 5, 8, 13, 21, 34, 55 Figure 6 shows a function written in a functional programming language to calculate the nth term in the Fibonacci sequence. Figure 6 fibonacci 1 = 1 fibonacci 2 = 1 fibonacci n = fibonacci (n - 1) + fibonacci (n - 2) 11.1 Shade all of the lozenges for the statements that are true about the fibonacci function in Figure 6. [1 mark] A The function has one argument. B The function is a first-class object. C The function outputs a list. D The function uses a higher-order function. 11.2 Shade one lozenge to indicate the function type of the fibonacci function in Figure 6. [1 mark] A ℕ → ℕ B ℚ → ℤ C ℝ → ℤ D ℤ → ℕ 11 3 box . Explain why the recursive method used by the code in Figure 6 is not an efficient method of calculating the nth term in the Fibonacci sequence. [2 marks] 11.4 Describe what partial function application is. [2 marks]