Consider the following algorithm used to estimate a volume of revolution.
The algorithm above will print the value
- \(5 \pi\)
- \(9 \pi\)
- \(14 \pi\)
- \(29 \pi\)
Aussie Maths & Science Teachers: Save your time with SmarterEd
Consider the following algorithm used to estimate a volume of revolution.
The algorithm above will print the value
\(B\)
\(\text{Working through algorithm:}\)
\(f(x)=\sqrt{x+1}\)
\begin{array}{ccl}
\text { left } & \text { volume } & \text { sum } \\
1 & \pi(f(1))^2 & 2 \pi \\
2 & \pi(f(2))^2 & 2 \pi+3 \pi=5 \pi \\
3 & \pi(f(3))^2 & 5 \pi+4 \pi=9 \pi
\end{array}
\(\Rightarrow B\)
Consider the following pseudocode.
define \(f(x, y)=e^{x y}\)
\(\begin{aligned} & x \leftarrow 0 \\ & y \leftarrow 0 \\ & h \leftarrow 0.5 \\ & n \leftarrow 0\end{aligned}\)
while \(n \geq 0\)
\(\begin{aligned} & y \leftarrow y+h \times f(x, y) \\ & x \leftarrow x+h \\ & n \leftarrow n+1\end{aligned}\)
print \(y\)
end while
After how many iterations will the pseudocode print 2.709 ?
\(C\)
\(\text{1st iteration:}\ 0+\dfrac{1}{2} \times e^0=\dfrac{1}{2} \)
\(\text{2nd iteration:}\ \dfrac{1}{2} +\dfrac{1}{2} \times e^{\frac{1}{4}}=1.142… \)
\(\text{3rd iteration:}\ 1.142 +\dfrac{1}{2} \times e^{1 \times 1.142}=2.7085… \)
\(\Rightarrow C\)