Skip to content

Instantly share code, notes, and snippets.

View NKSonny's full-sized avatar

Sonny NKSonny

View GitHub Profile
@NKSonny
NKSonny / az.py
Last active May 26, 2024 12:41
ite
Variable aleatoire:
|N|
| |x P^K x (1-P)^N-K
|K|
P(x=??) == K
B(?;?) == B(N;P)
|N| |N-1| |N-1|
| | = | | + | |
|K| |K-1| | K |
@NKSonny
NKSonny / bindec.py
Last active March 13, 2024 17:34
ok
# Programme de conversion binaire-décimal avec affichage des calculs pour NumWorks n110
def binaire_vers_decimal(binaire):
decimal = 0
puissance = 0
calculs = []
while binaire != 0:
reste = binaire % 10
calculs.append(f"{reste} * 2^{puissance}")