Bonjour, j'aurais besoin d'aide pour écrire l'algorithme de dichotomie pour l'équation x^2-x-1=0 Merci
Mathématiques
amelier1
Question
Bonjour, j'aurais besoin d'aide pour écrire l'algorithme de dichotomie pour l'équation x^2-x-1=0
Merci
Merci
1 Réponse
-
1. Réponse ProfdeMaths1
algorithme de dichotomie (ALGOBOX) :
VARIABLES
precision EST_DU_TYPE NOMBRE
a EST_DU_TYPE NOMBRE
b EST_DU_TYPE NOMBRE
m EST_DU_TYPE NOMBRE
DEBUT_ALGORITHME
precision PREND_LA_VALEUR 0.00001
LIRE a
LIRE b
TANT_QUE (b-a>precision) FAIRE
DEBUT_TANT_QUE
m PREND_LA_VALEUR (a+b)/2
SI (F1(m)*F1(b)>0) ALORS
DEBUT_SI
b PREND_LA_VALEUR m
FIN_SI
SINON
DEBUT_SINON
a PREND_LA_VALEUR m
FIN_SINON
FIN_TANT_QUE
AFFICHER a
AFFICHER " < solution < "
AFFICHER b
FIN_ALGORITHME
application :
x²-x-1=0 donne x=(1+√5)/2 ou x=(1-√5)/2