Approximation pi sur algobox
Argamuffin
-
Argamuffin -
Argamuffin -
Bonjour,
J'ai un problème... Je suis avec un algorithme (créé par qqun d'autre que moi), et je dois le décrire, l'expliquer, et justifier cette méthode sur papier, en gros le comprendre quoi... =s
sachant qu'il s'agit d'approximer la valeur de pi. Voici l'algorithme :
****************************************************************
VARIABLES
2 str1 EST_DU_TYPE CHAINE
3 nomtir EST_DU_TYPE NOMBRE
4 i EST_DU_TYPE NOMBRE
5 x EST_DU_TYPE NOMBRE
6 y EST_DU_TYPE NOMBRE
7 nbrpoi EST_DU_TYPE NOMBRE
8 DEBUT_ALGORITHME
9 str1 PREND_LA_VALEUR "Entrer le nombre de tirages"
10 AFFICHER str1
11 LIRE nomtir
12 nbrpoi PREND_LA_VALEUR 0
13 POUR i ALLANT_DE 1 A nomtir
14 DEBUT_POUR
15 x PREND_LA_VALEUR random( )
16 y PREND_LA_VALEUR random( )
17 SI (y<F1(x)) ALORS
18 DEBUT_SI
19 nbrpoi PREND_LA_VALEUR nbrpoi+1
20 TRACER_POINT (x,y)
21 FIN_SI
22 SINON
23 DEBUT_SINON
24 TRACER_POINT (x,y)
25 FIN_SINON
26 FIN_POUR
27 str1 PREND_LA_VALEUR "une approximation de pi est : " + (4*nbrpoi/nomtir)
28 AFFICHER str1
29 FIN_ALGORITHME
30
31 Fonction numérique utilisée :
32 F1(x)=sqrt(1-x*x)
******************************************************************
Voili, voila... Si quelqu'un pouvait m'expliquer comment ça marche :) ce serait cool
J'ai un problème... Je suis avec un algorithme (créé par qqun d'autre que moi), et je dois le décrire, l'expliquer, et justifier cette méthode sur papier, en gros le comprendre quoi... =s
sachant qu'il s'agit d'approximer la valeur de pi. Voici l'algorithme :
****************************************************************
VARIABLES
2 str1 EST_DU_TYPE CHAINE
3 nomtir EST_DU_TYPE NOMBRE
4 i EST_DU_TYPE NOMBRE
5 x EST_DU_TYPE NOMBRE
6 y EST_DU_TYPE NOMBRE
7 nbrpoi EST_DU_TYPE NOMBRE
8 DEBUT_ALGORITHME
9 str1 PREND_LA_VALEUR "Entrer le nombre de tirages"
10 AFFICHER str1
11 LIRE nomtir
12 nbrpoi PREND_LA_VALEUR 0
13 POUR i ALLANT_DE 1 A nomtir
14 DEBUT_POUR
15 x PREND_LA_VALEUR random( )
16 y PREND_LA_VALEUR random( )
17 SI (y<F1(x)) ALORS
18 DEBUT_SI
19 nbrpoi PREND_LA_VALEUR nbrpoi+1
20 TRACER_POINT (x,y)
21 FIN_SI
22 SINON
23 DEBUT_SINON
24 TRACER_POINT (x,y)
25 FIN_SINON
26 FIN_POUR
27 str1 PREND_LA_VALEUR "une approximation de pi est : " + (4*nbrpoi/nomtir)
28 AFFICHER str1
29 FIN_ALGORITHME
30
31 Fonction numérique utilisée :
32 F1(x)=sqrt(1-x*x)
******************************************************************
Voili, voila... Si quelqu'un pouvait m'expliquer comment ça marche :) ce serait cool
A voir également:
- Approximation pi sur algobox
- Super pi - Télécharger - Optimisation
- Pi-wan wikipedia - Forum jeux en ligne
- Pi sur clavier android - Forum Xiaomi
- Pi sur clavier iphone - Guide
- Comment faire pi sur la calculatrice - Forum Matériel & Système