Trace Algorithm or Flowchart

A question is this type if and only if it requires tracing through a given algorithm, flowchart, or pseudocode with specific input values.

4 questions

AQA D1 2011 June Q6
6 A student is tracing the following algorithm.
Line 10 Let \(A = 6\)
Line \(20 \quad\) Let \(B = 7\)
Line 30 Input \(C\)
Line 40 Let \(D = ( A + B ) / 2\)
Line \(50 \quad\) Let \(E = C - D ^ { 3 }\)
Line 60 If \(E ^ { 2 } < 1\) then go to Line 120
Line 70 If \(E > 0\) then go to Line 100
Line 80 Let \(B = D\)
Line 90 Go to Line 40
Line \(100 \quad\) Let \(A = D\)
Line 110 Go to Line 40
Line 120 Stop
  1. Trace the algorithm in the case where the input value is \(C = 300\).
  2. The algorithm is intended to find the approximate cube root of any input number. State two reasons why the algorithm is unsatisfactory in its present form.
    (3 marks)
OCR MEI D1 2006 June Q3
3 An incomplete algorithm is specified in Fig. 3.
\(\mathrm { f } ( \mathrm { x } ) = \mathrm { x } ^ { 2 } - 2\)
Initial values: \(\mathrm { L } = 0 , \mathrm { R } = 2\).
Step 1 Compute \(\mathrm { M } = \frac { \mathrm { L } + \mathrm { R } } { 2 }\).
Step 2 Compute \(\mathrm { f } ( \mathrm { M } )\).
Step 3 If \(\mathrm { f } ( \mathrm { M } ) < 0\) change the value of L to that of M .
Otherwise change the value of \(R\) to that of \(M\).
Step 4 Go to Step 1. \section*{Fig. 3}
  1. Apply two iterations of the algorithm.
  2. After 10 iterations \(\mathrm { L } = 1.414063 , \mathrm { R } = 1.416016 , \mathrm { M } = 1.416016\) and \(\mathrm { f } ( \mathrm { M } ) = 0.005100\). Say what the algorithm achieves.
  3. Say what is needed to complete the algorithm.
OCR Further Discrete AS 2022 June Q1
1 The flowchart below has positive inputs \(X , Y\) and \(M\).
\includegraphics[max width=\textwidth, alt={}, center]{74b6f747-7045-4902-8b21-0b59c007f7f6-2_1274_643_392_242}
  1. Trace through the flowchart above using the inputs \(X = 1 , Y = 2\) and \(M = 2\). You only need to record values when they change.
  2. Explain why the process in the flowchart is finite.
Edexcel D1 2021 June Q3
3. \begin{figure}[h]
\includegraphics[alt={},max width=\textwidth]{44ddb176-e265-4545-b438-c1b5ffb40852-04_997_1155_223_456} \captionsetup{labelformat=empty} \caption{Figure 2}
\end{figure} An algorithm for finding the positive real root of the equation \(8 x ^ { 4 } + 5 x - 12 = 0\) is described by the flow chart shown in Figure 2.
  1. Use the flow chart, with \(a = 1\), to complete the table in the answer book, stating values to at least 6 decimal places. Give the final output correct to 5 decimal places. Given that the value of the input \(a\) is a non-negative real number,
  2. determine the set of values for \(a\) that cannot be used to find the positive real root of \(8 x ^ { 4 } + 5 x - 12 = 0\) using this flow chart.