Skip to content

Commit e0db3e6

Browse files
committed
Update
1 parent 0ee4ee0 commit e0db3e6

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

_toc.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
format: jb-book
22
parts:
3+
- caption: 'Centrale PC*'
4+
chapters:
5+
- url: https://raw.githubusercontent.com/cpge-itc/itc2/main/files/centrale.py
36
- caption: Révisions
47
chapters:
58
- td: "Résumé de cours"

files/centrale.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Exercice 2
2+
import numpy.random as rd
3+
def X(k, n):
4+
return [rd.randint(1, n + 1) for _ in range(k)]
5+
6+
# Exercice 4
7+
import scipy.optimize as resol
8+
9+
def x(n):
10+
def f(x):
11+
s = 0
12+
for k in range(1, n + 1):
13+
s += x**k/k
14+
return s - 1
15+
return resol.fsolve(f, 0.5)

0 commit comments

Comments
 (0)