Flowchart or Algorithm Tracing Involving Sequences

Interpret a flowchart or algorithmic procedure that iteratively computes terms or sums related to a sequence, and determine the output or fill in missing steps.

bac-s-maths 2023 Q5 1 marks View
Let $S = 1 + \frac{1}{2} + \frac{1}{3} + \frac{1}{4} + \ldots + \frac{1}{100}$. Among the Python scripts below, the one that allows calculating the sum $S$ is:
a. \begin{verbatim} def somme_a() : S = 0 for k in range(100) : S =1/( k+1) return S \end{verbatim}
b. \begin{verbatim} def somme_b() : S = 0 for k in range(100) : S = S + 1/(k + 1) return S \end{verbatim}
c. \begin{verbatim} def somme_c() : k = 0 while S < 100 : S = S+1 /(k+1) return S \end{verbatim}
d. \begin{verbatim} def somme_d() : k = 0 while k < 100: S = S + 1/(k + 1) return S \end{verbatim}
gaokao 2015 Q8 5 marks View
Executing the flowchart shown in figure (8), the output value of $s$ is
(A) $\frac { 3 } { 4 }$
(B) $\frac { 5 } { 6 }$
(C) $\frac { 11 } { 12 }$
(D) $\frac { 25 } { 24 }$
gaokao 2015 Q7 View
7. Executing the flowchart shown in question (7), if the input value of K is 8, then the condition that can be filled in the decision box is
A. $\mathrm { s } \leq \frac { 3 } { 4 }$
B. $\mathrm { s } \leq \frac { 5 } { 6 }$
C. $\mathrm { s } \leq \frac { 11 } { 12 }$
D. $\mathrm { s } \leq \frac { 15 } { 24 }$ [Figure]
gaokao 2015 Q5 View
5. Executing the flowchart shown in Figure 2, if the input is $n = 3$, then the output $S =$
A. $\frac { 6 } { 7 }$
B. $\frac { 3 } { 7 }$
C. $\frac { 8 } { 9 }$
D. $\frac { 4 } { 9 }$
[Figure]
Figure 2
gaokao 2019 Q8 View
8. The figure shows a flowchart for computing $\frac { 1 } { 2 + \frac { 1 } { 2 + \frac { 1 } { 2 } } }$. The blank box should be filled with
A. $A = \frac { 1 } { 2 + A }$
B. $A = 2 + \frac { 1 } { A }$
C. $A = \frac { 1 } { 1 + 2 A }$
D. $A = 1 + \frac { 1 } { 2 A }$ [Figure]