Page 1 of 1

Correction algo BAC STL(Bio) 2015 (Polynésie - juin 2015)

Unread postPosted: 13 Jun 2015, 14:13
by critor
Correction algo exercice n°4 (suites+algo) du sujet de Maths du BAC STL Biotechnologies 2015 en Polynésie.

Question A)1)
La programmation de l'algorithme sur calculatrice graphique nous permet de répondre à la question :

Algorithme
Programme
Code: Select all
Saisir N
H prend la valeur 0
V prend la valeur N
Tant que V<10^5
|   H prend la valeur H+1
|   V prend la valeur 2*V+1000
Fin Tant que
Afficher H
Code: Select all
Prompt N
0→H
N→V
While V<10^5
   H+1→H
   2V+1000→V
End
H

Code: Select all
Define poly2015stlb(n)=
Func
   Local h,v
   0→h
   n→v
   While v<10^5
      h+1→h
      2v+1000→v
   EndWhile
   Return h
EndFunc
Code: Select all
?→N
0→H
N→V
While V<10^5
   H+1→H
   2V+1000→V
WhileEnd
H

Code: Select all
Input n
0⇒h
While v<10^5
   h+1⇒h
   2v+1000⇒v
WhileEnd
Print h
Code: Select all
EXPORT poly2015stlb(N)
BEGIN
   H:=0;
   V:=N;
   WHILE V<10^5 DO
      H:=H+1;
      V:=2*V+1000;
   END;
   H;
END;


La valeur affichée par l'algorithme est donc 4.


Question B)1)
L'affectation récurrente de la variable V variant selon une condition, nous allons utiliser l'instruction conditionnelle Si/Alors/Sinon.
Voici l'algorithme, et sa traduction pour calculatrices graphiques :

Algorithme
Programme
Code: Select all
Saisir N
H prend la valeur 0
V prend la valeur N
Tant que V<10^5
|   H prend la valeur H+1
|   Si V<40000 Alors
|   |   V prend la valeur 2*V
|   Sinon
|   |   V prend la valeur V+50*V/100
|   FinSi
Fin Tant que
Afficher H
Code: Select all
Prompt N
0→H
N→V
While V<10^5
   H+1→H
   If V<40000
   Then
      2V→V
   Else
      V+50V/100→V
   End
End
H

Code: Select all
Define poly2015stlb(n)=
Func
   Local h,v
   0→h
   n→v
   While v<10^5
      h+1→h
      If v<40000 Then
         2v→v
      Else
         v+50v/100→v
      EndIf
   EndWhile
   Return h
EndFunc
Code: Select all
?→N
0→H
N→V
While V<10^5
   H+1→H
   If v<40000
   Then 2V→V
   Else V+50V÷100→V
   IfEnd
WhileEnd
H

Code: Select all
Input n
0⇒h
While v<10^5
   h+1⇒h
   If v<40000
   Then
      2v⇒v
   Else
      v+50v/100⇒v
   IfEnd
WhileEnd
Print h
Code: Select all
EXPORT poly2015stlb(N)
BEGIN
   H:=0;
   V:=N;
   WHILE V<10^5 DO
      H:=H+1;
      IF V<40000 THEN
         V:=2*V;
      ELSE
         V:=V+50*V/100;
      END;
   END;
   H;
END;




Question B)2)
D'après la programmation de l'algorithme précédent sur calculatrice graphique, c'est désormais au bout de 5 heures que l'on dépasse 10000 bactéries.