• Aucun résultat trouvé

A gt;>&gt

N/A
N/A
Protected

Academic year: 2022

Partager "A gt;>&gt"

Copied!
1
0
0

Texte intégral

(1)

BTS SIO Correction TRAVAUX DIRIGÉS 3 2019-2020

Une solution def SommeL(liste):

i=0 somme=0

while i<len(liste) and liste[i]>0 : somme=somme+liste[i]

i+=1

return somme,i

def EstElleStochastique(matrice) : ligneOK=0

for i in range(len(matrice)) : S=SommeL(matrice[i])

if S[0]==1 and S[1]==len(matrice) : ligneOK=ligneOK+1

if ligneOK==len(matrice) :

return "Matrice stochastique"

else :

return "Matrice non stochastique"

• • Appel de la fonction dans l’interpréteur

>>> A=[[0.2,0.3,0.5],[0.11,0.32,0.58],[0.9,0.04,0.06]]

>>> EstElleStochastique(A)

’Matrice non stochastique’

• •

Lycée Bertran de Born 1 sur 1

Références

Documents relatifs

[r]

[r]

Quelles r´ eflexions relatives au p´ erim` etre et ` a l’aire de la figure limite vous inspirent ce probl`

La d´ erivabilit´ e sur R de l’argument sinus hyperbolique implique alors par produit puis composition celle de

Line and keyboard command functions include carriage return, line feed, incremental cursor positioning, line/local, half/full intensity field, blink field, underline

[r]

[r]

[r]