Instantly share code, notes, and snippets.

# Nick3523

Created January 2, 2020 14:38
Buffon's Needle Problem
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
 ''' n = nombre de fois où l'aiguille est lancée nbEssais = nombre de fois où l'expérience est répetée a = longueur de l'aiguille b = distance entre 2 lattes theta = l'angle formée par l'aiguille et la latte xcenter = les cordonnées x de l'aiguille sur le sol On limite les valeurs theta et du centre comme suit :
Last active January 2, 2020 14:47
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
 import numpy as np import math ### Parameters ### sigma = 0.3 T = 200 dt = 1/2000 q = 0. #dividendes rate
Last active January 2, 2020 14:48
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
 Le modèle Black-Scholes ou modèle Black-Scholes-Merton qui est un modèle mathématique du marché pour une action, dans lequel le prix de l'action est un processus stochastique en temps continu; par opposition au "modèle Cox Ross-Rubinstein" qui suit un processus stochastique en temps discret. ######################################## Les inputs : S: spot price K: strike price T: time to maturity
Last active January 2, 2020 14:48
Implémentation du Modèle binomial pour pricer les options européennes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
 import numpy as np import math as m ### Les différents input ### S = 100 k = 100 r = .05 #le taux sans risque v = .3 T = 20/36
Last active January 18, 2020 19:45
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
 ## Imports & Params import numpy as np import pandas as pd import matplotlib.pyplot as plt from sklearn import linear_model # On charge le dataset
Last active January 26, 2020 08:34
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
 #!/usr/bin/env python # coding: utf-8 # Code partiel, l'originial étant fait sur Jupyter ## Imports & Param's import numpy as np import matplotlib.pyplot as plt from sklearn.datasets import fetch_openml from sklearn.model_selection import train_test_split from sklearn import neighbors
Created January 27, 2020 10:37
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
 #!/usr/bin/env python # coding: utf-8 # # Imports & Params import numpy as np import pandas as pd import matplotlib.pyplot as plt from sklearn import linear_model import seaborn as sns from sklearn.model_selection import train_test_split
Last active February 3, 2020 07:45
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
 import yagmail import random from datetime import datetime yag = yagmail.SMTP("email_envoyeur@gmail.com","mot_de_passe") quote = "" date = datetime.today().strftime('%d-%m-%Y')
Last active March 5, 2020 18:28
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
 Function my_convert(ch As String) As String Dim dict As New Scripting.Dictionary 'Nécessite d'importer Microsoft Scripting Runtime dict.Add Key:="A", Item:=10 dict.Add Key:="B", Item:=11 dict.Add Key:="C", Item:=12 dict.Add Key:="D", Item:=13 dict.Add Key:="E", Item:=14 dict.Add Key:="F", Item:=15
Created March 7, 2020 13:17
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
 #include int pgcd(int a, int b) { while(b != 0) { int tmp = b; b = a % b; a = tmp; } return a;