Grade 11 / Algorithms 5 exercises (including 4 corrected)

a
1. Sum of the terms of a sequence E.8169 1 a Enter the algorithm below in Python : a=2; for i in range(0.10): a=a*2; print(a); b The values successively taken by the variable a dur-ing the execution of this algorithm are the terms of a sequence, noted u n whose nature and characteristic elements will be specified. c Give the ranks of the terms displayed by the algorithm. d Modify the algorithm so that it displays all terms from rank 0 to rank 20 . 2 a Enter the algorithm below in Python : S=0; a=2; for i in range(0.10): a=a*2; S=S+a print(S); b What is the value displayed by the algorithm? c Which of the sums below corresponds to the value of the variable S at the end of the algorithm’s execution. 9 k =0 u k 10 k =0 u k 9 k =1 u k 10 k =1 u k 3 Modify the algorithm to obtain the value of the following sums : a 20 k =10 u k b 8 k =0 3 · u k c 10 k =0 u 2 k E.8170 1 a Enter the algorithm given below in pseudocolde in the Python language : a 2 For i ranging from 0 to 10 a a + 2 ; End For b The values successively taken by the variable a dur-ing the execution of this algorithm are the terms of a sequence, noted u n whose nature and characteristic elements will be specified. c Give the ranks of the terms in the sequence u n as-signed to the variable a during the execution of this algorithm. 2 a Enter the algorithm below in Python : S 0 a 2 For i ranging from 0 to 10 a a + 2 ; S S + a End For b What is the value of the variable S at the end of the execution of this algorithm. c Which of the sums below corresponds to the value of the variable S at the end of the algorithm’s execution. 9 k =0 u k 10 k =0 u k 11 k =0 u k 9 k =1 u k 10 k =1 u k 11 k =1 u k 3 Modify the algorithm to obtain the value of the following sums : a 20 k =10 u k b 8 k =0 3 · u k c 10 k =0 u 2 k 2. Unclassified financial years E.6473 1 a In AlgoBox, enter the following algorithm: a 2 For i ranging from 0 to 4 a a+3 End For b Performing a step-by-step execution, note the succes-sive values taken by the variable a : . . . ; . . . ; . . . ; . . . ; . . . ; . . . 2 a Modify the algorithm so that the successive values taken by the variable a are: 2 ; 6 ; 10 ; 14 ; 18 ; 22 b Modify the algorithm so that the successive values taken by the variable a are: 5 ; 10 ; 15 E.7290 Consider the sequence u n defined by: u 0 = 0 ; u n +1 = 0.8 · u n + 0.1 for any n N 1 a Enter the algorithm below : u 0 For i from 1 to n u 0.8 × u + 0.1 End For b With the variable n taking a strictly positive integer value, describe the action and purpose of this algo-rithm as a function of the value of the variable n . c What is special about the terms in the sequence u n ? 2 a Enter the algorithm below : u 0 n 0 As long as u<0.499 u 0.8 × + 0.01 n n + 1 https://chingmath.fr sacados/8169 chapExoCorrec/8170 sacados/8170 chapExoCorrec/6473 sacados/6473 chapExoCorrec/7290 sacados/7290
End As long as b What is the purpose of this algoritme? E.7291 A company produces bacteria for industry. In the laboratory, it has been measured that, in a suitable nutrient medium, the mass of these bacteria, mea-sured in grams, increases by 20 % in one day. The company sets up the following industrial device. In a tank of nutrient medium, 1 kg of bacteria are initially introduced. Then, at a fixed time each day, the nutrient medium contained in the tank is replaced. During this op-eration, 100 g of bacteria are lost. The company sets itself the target of producing 30 kg of bac-teria. The evolution of the bacteria population in the tank is mod-eled by the sequence u n defined as follows : u 0 = 1 000 ; u n +1 = 1.2 · u n 100 The company wants to know after how many days the bacte-ria mass will exceed 30 kg . The following algorithm can be used to answer the problem posed. Copy and complete this algorithm. Variables : u and n are numbers. Processing: u takes the value 1 000 n takes the value 0 As long as . . . . . . do u takes the value . . . n takes the value n +1 Fin As long as Output: Display . . . . . . https://chingmath.fr chapExoCorrec/7291 sacados/7291