AQA D1 2008 January — Question 6

Exam BoardAQA
ModuleD1 (Decision Mathematics 1)
Year2008
SessionJanuary
TopicSorting Algorithms

6 A student is solving cubic equations that have three different positive integer solutions.
The algorithm that the student is using is as follows:
Line 10 Input \(A , B , C , D\)
Line \(20 \quad\) Let \(K = 1\)
Line \(30 \quad\) Let \(N = 0\)
Line \(40 \quad\) Let \(X = K\)
Line 50 Let \(Y = A X ^ { 3 } + B X ^ { 2 } + C X + D\)
Line 60 If \(Y \neq 0\) then go to Line 100
Line \(70 \quad\) Print \(X\), "is a solution"
Line \(80 \quad\) Let \(N = N + 1\)
Line 90 If \(N = 3\) then go to Line 120
Line \(100 \quad\) Let \(K = K + 1\)
Line 110 Go to Line 40
Line 120 End
  1. Trace the algorithm in the case where the input values are:
    1. \(A = 1 , B = - 6 , C = 11\) and \(D = - 6\);
    2. \(A = 1 , B = - 10 , C = 29\) and \(D = - 20\).
  2. Explain where and why this algorithm will fail if \(A = 0\).