VCE Maths Methods Pseudocode Mini Test

Number of marks: 9

Reading time: 2 minutes

Writing time: 13 minutes

Section A Calculator Allowed
Instructions
• Answer all questions in pencil on your Multiple-Choice Answer Sheet.
• Choose the response that is correct for the question.
• A correct answer scores 1; an incorrect answer scores 0.
• Marks will not be deducted for incorrect answers.
• No marks will be given if more than one answer is completed for any question.
• Unless otherwise indicated, the diagrams in this book are not drawn to scale.


Question 1 [2024 Exam 2 Section A Q17]

Consider the algorithm below which prints the roots of the cubic polynomial \( f(x) = x^3 - 2x^2 - 9x + 18 \).

\begin{aligned} &\texttt{define } f(x) \\ &\quad \texttt{return } (x^3 - 2x^2 - 9x + 18) \\ &\texttt{c } \gets f(0) \\ &\texttt{if } c < 0 \texttt{ then} \\ &\quad \texttt{c } \gets -c \\ &\texttt{end if} \\ &\texttt{while } c > 0 \texttt{ do} \\ &\quad \texttt{if } f(c) = 0 \texttt{ then} \\ &\quad\quad \texttt{print c} \\ &\quad \texttt{end if} \\ &\quad \texttt{if } f(-c) = 0 \texttt{ then} \\ &\quad\quad \texttt{print -c} \\ &\quad \texttt{end if} \\ &\quad \texttt{c } \gets c - 1 \\ &\texttt{end while} \end{aligned}

The algorithm prints in order:

  • A. -3, 3, 2
  • B. -3, 2, 3
  • C. 3, 2, -3
  • D. 3, -3, 2
Correct Answer: D
Click here for full solution
Question 2 [2023 Exam 2 Section A Q13]

The following algorithm applies Newton’s method using a For loop with 3 iterations...

\[ \begin{array}{l} \textbf{Inputs:} \quad f(x), \text{ a function of } x \\ \quad\quad\quad\quad df(x), \text{ the derivative of } f(x) \\ \quad\quad\quad\quad x_0, \text{ an initial estimate} \\ \\ \textbf{Define } \texttt{newton}(f(x), df(x), x_0) \\ \quad \textbf{For } i \text{ from } 1 \text{ to } 3 \\ \quad\quad \textbf{If } df(x_0) = 0 \textbf{ Then} \\ \quad\quad\quad \textbf{Return } \text{``Error: Division by zero''} \\ \quad\quad \textbf{Else} \\ \quad\quad\quad x_0 \leftarrow x_0 - f(x_0) \div df(x_0) \\ \quad \textbf{EndFor} \\ \quad \textbf{Return } x_0 \end{array} \]

The return value of the function newton(x³ + 3x − 3, 3x² + 3, 1) is closest to

  • A. 0.83333
  • B. 0.81785
  • C. 0.81773
  • D. 1
  • E. 3
Correct Answer: C
Click here for full solution
Question 3 [2023 Sample Exam 2 Section A Q2]

Newton's method is being used to approximate the non-zero \(x\)-intercept of the function with the equation \(f(x) = \frac{x^3}{5} - \sqrt{x}\). An initial estimate of \(x_0 = 1\) is used.

Which one of the following gives the first estimate that would correctly approximate the intercept to three decimal places?

  • A. \(x_6\)
  • B. \(x_7\)
  • C. \(x_8\)
  • D. \(x_9\)
  • E. The intercept cannot be correctly approximated using Newton's method.
Correct Answer: C
Click here for full solution
Question 4 [2023 Sample Exam 2 Section A Q5]

The algorithm below, described in pseudocode, estimates the value of a definite integral using the trapezium rule.

Inputs: f(x), the function to integrate          a, the lower terminal of integration          b, the upper terminal of integration          n, the number of trapeziums to use Define trapezium(f(x),a,b,n)   h ← (b - a) ÷ n   sum ← f(a) + f(b)   x ← a + h   i ← 1   While i < n Do     sum ← sum + 2 × f(x)     x ← x + h     i ← i + 1   EndWhile   area ← (h ÷ 2) × sum   Return area

Consider the algorithm implemented with the following inputs.

trapezium(\(\log_e(x)\), 1, 3, 10)

The value of the variable sum after one iteration of the While loop would be closest to

  • A. 1.281
  • B. 1.289
  • C. 1.463
  • D. 1.617
  • E. 2.136
Correct Answer: C
Click here for full solution
Question 5 [2023 Sample Exam 2 Section A Q6]

Consider the algorithm below, which uses the bisection method to estimate the solution to an equation in the form \(f(x) = 0\).

Inputs: f(x), a function of x, where x is in radians          a, the lower interval endpoint          b, the upper interval endpoint          max, the maximum number of iterations Define bisection(f(x),a,b,max)   If f(a) × f(b) > 0 Then     Return "Invalid interval"   i ← 0   While i < max Do     mid ← (a + b) ÷ 2     If f(mid) = 0 Then       Return mid     Else If f(a) × f(mid) < 0 Then       b ← mid     Else       a ← mid     i ← i + 1   EndWhile   Return mid

The algorithm is implemented as follows.

bisection(\(\sin(x)\), 3, 5, 2)

Which value would be returned when the algorithm is implemented as given?

  • A. -0.351
  • B. -0.108
  • C. 3.25
  • D. 3.5
  • E. 4
Correct Answer: D
Click here for full solution
Question 6 [2023 Sample Exam 2 Section A Q7]

One way of implementing Newton's method using pseudocode, with a tolerance level of 0.001, is shown below.

The pseudocode is incomplete, with two missing lines indicated by an empty box.

Inputs: f(x), a function of x          x0, an initial estimate for the x-intercept of f(x) Define newton(f(x), x0)   df(x) ← the derivative of f(x)   i ← 0   prev_x ← x0   While i < 1000 Do     next_x ← prev_x - f(prev_x) ÷ df(prev_x)     
    Else       prev_x ← next_x       i ← i + 1   EndWhile

Which one of the following options would be most appropriate to fill the empty box?

  • A.
    If next_x - prev_x < 0.001 Then
      Return prev_x
  • B.
    If next_x - prev_x < 0.001 Then
      Return next_x
  • C.
    If prev_x - next_x < 0.001 Then
      Return next_x
  • D.
    If -0.001 < next_x - prev_x < 0.001 Then
      Return prev_x
  • E.
    If -0.001 < next_x - prev_x < 0.001 Then
      Return next_x
Correct Answer: E
Click here for full solution

End of Section A


Section B – No Calculator
Instructions
• Answer all questions in the spaces provided.
• Write your responses in English.
• In questions where a numerical answer is required, an exact value must be given unless otherwise specified.
• In questions where more than one mark is available, appropriate working must be shown.
• Unless otherwise indicated, the diagrams in this book are not drawn to scale.


Question 1 [2023 Sample Exam 1 Q6]

Newton's method is used to estimate the x-intercept of the function \(f(x) = \frac{1}{3}x^3 + 2x + 4\).

a. Verify that \(f(-1) > 0\) and \(f(-2) < 0\). 1 mark

b. Using an initial estimate of \(x_0 = -1\), find the value of \(x_1\). 2 marks


End of examination questions

VCE is a registered trademark of the VCAA. The VCAA does not endorse or make any warranties regarding this study resource. Past VCE exams and related content can be accessed directly at www.vcaa.vic.edu.au

>