Past-paper question · 2023 May-June · Paper 33 · Q12(b)

Question 12(b) 2023 · May-June · Paper 33 · 5 marks

Original past-paper question for 12(B)
Original past-paper question for 12(B)
Reveal official mark-scheme answer Official mark-scheme answer for 12(B)

Official answer for Question 12

Part (b)

✓
One mark per mark point (Max 5)

Question 5

✓
Call number column correct
✓
Function call and Number columns correct
✓
Result column down to base case (Winding) rows 1–6 correct
✓
Result column down from base case (Unwinding) rows 7–10 correct
✓
Return value column correct
✓
Call
✓
Function call
✓
Number
✓
Result
✓
Return
✓
number
✓
value

Question 1

✓
Fib(5)

Question 5

✓
Fib(4) + Fib(3)

Question 2

✓
Fib(4)

Question 4

✓
Fib(3) + Fib(2)

Question 3

✓
Fib(3)

Question 3

✓
Fib(2) + Fib(1)

Question 4

✓
Fib(2)

Question 2

✓
Fib(1) + Fib(0)

Question 5

✓
Fib(1)

Question 1

Question 1

Question 1

Question 6

✓
Fib(0)
✓
0
✓
0
✓
0
✓
(4)
✓
Fib(2)

Question 2

✓
1 + 0

Question 1

✓
(3)
✓
Fib(3)

Question 3

✓
1 + 1

Question 2

✓
(2)
✓
Fib(4)

Question 4

✓
2 + 1

Question 3

✓
(1)
✓
Fib(5)

Question 5

✓
3 + 2

Question 5

Mark scheme 9618_s23_ms_33.pdf →

Show text version of question

Question 12

Part (b)

Part (b)

A Fibonacci sequence is a series of numbers formed by adding together the two preceding

numbers, for example:

0, 1, 1, 2, …

This function calculates and returns values in the Fibonacci sequence and uses recursion.

FUNCTION Fib(Number : INTEGER) RETURNS INTEGER IF Number <= 1 THEN Result ← Number ELSE Result ← Fib(Number – 1) + Fib(Number – 2) ENDIF RETURN Result ENDFUNCTION

Complete the trace table for the function when it is called as Fib(5).

Call number Function call Number Result Return value

Question 5

[5]

reasonable effort has been made by the publisher (UCLES) to trace copyright holders, but if any items requiring clearance have unwittingly been included, the publisher will be pleased to make amends at the earliest possible opportunity.

To avoid the issue of disclosure of answer-related information to candidates, all copyright acknowledgements are reproduced online in the Cambridge Assessment International Education Copyright Acknowledgements Booklet. This is produced for each series of examinations and is freely available to download at www.cambridgeinternational.org after the live examination series.

Cambridge Assessment International Education is part of Cambridge Assessment. Cambridge Assessment is the brand name of the University of Cambridge Local Examinations Syndicate (UCLES), which is a department of the University of Cambridge.

Topic relevance

Why this question appears here

98% assigned-topic match · Computational thinking and problem-solving › Recursion

Topic-match percentages estimate how closely each question fits the selected syllabus topic. They are a guide for choosing stricter or broader practice.

Permanent source page: Educate A Change · From 9618_s23_qp_33.pdf

Keep practising this topic