A | B | |
xxxxxxxxxx
def suite(n):
p = ...
s = [p]
for i in range(...):
p = ...
s.append(p)
return s
xxxxxxxxxx
n = 0
u = 12
while ...
u = ...
n = ...
print(...)
1 | f(x)=x*exp(-x)+1 | |
2 | g(x)=Dériver( Dériver(f(x)) ) | |
3 | Résoudre( g(x) >= 0 ) |
xxxxxxxxxx
from math import e # la constante d'Euler e
def mystere(n):
a = 1
L = [a]
for i in range(1,n):
a = e - (i + 1)*a
L.append(a)
return L
xxxxxxxxxx
def seuil(p):
n = 1
while 1-(5.0/6)**n <= p:
n = n+1
return n
Masse | |||||
Fréquence |
Volume en cL | Fréquence |
xxxxxxxxxx
from math import*
def esp(valeurs,probas):
n = len(valeurs)
e = 0
for i in range(0,n):
e = e+...
return e
def sigma(valeurs,probas):
n = len(valeurs)
v = 0
e = esp(valeurs,probas)
for i in range(0,n):
v = v+probas[i]*(...)**2
s = ...
return s
valeursX = [997, 998, 999, 1000, 1001, 1002, 1003]
freqX = [0.19, 0.23, 0.21, 0.17, 0.09, 0.06, 0.05]
print(esp(valeursX,freqX))
print(sigma(valeursX,freqX))
xxxxxxxxxx
def u(n):
L = []
L.append(2)
L.append(3)
for i in range(2,n):
L.append( L[i-2]+L[...] )
return ...
xxxxxxxxxx
def racine(a, b):
while abs(b - a) >= 0.001:
m = (a + b)/2
if f(m) < 0 :
b = m
else:
a = m
return m
xxxxxxxxxx
def racine(a, b):
m = (a + b)/2
while abs(b - a) >= 0.001:
if f(m) < 0 :
a = m
else:
b = m
return m
xxxxxxxxxx
def racine(a, b):
m = (a + b)/2
while abs(b - a) <= 0.001:
if f(m) < 0 :
a = m
else:
b = m
return m
xxxxxxxxxx
def racine(a, b):
while abs(b - a)> = 0.001:
m = (a + b)/2
if f(m) < 0 :
a = m
else:
b = m
return m
xxxxxxxxxx
def somme_a():
S = 0
for k in range(100):
S = 1/(k+1)
return S
xxxxxxxxxx
def somme_b():
S = 0
for k in range(100):
S = S+1/(k+1)
return S
xxxxxxxxxx
def somme_c():
k = 0
while S < 100:
S = S+1/(k+1)
return S
xxxxxxxxxx
def somme_d():
k = 0
while k < 100:
S = S+1/(k+1)
return S
xxxxxxxxxx
def mystere(L):
S = 0
for i in range(len(L)):
S = S+L[i]
return S/len(L)