SlideShare a Scribd company logo
1 of 8
Download to read offline
import matplotlib.pyplot as plt
import numpy as np
from scipy.stats import norm,binom,poisson,uniform,expon
from math import sqrt,exp
####Loi uniforme
N = 100
a = 0
b = 5
t=0.5
v = (exp(t*b)-exp(t*a))/(t*(b-a))
u = (a+b)/2
sigma = ((b-a)**2)/12
s = np.random.uniform(a,b,N)
def uni(k,N,s):
x3,x4 = 0,0
for i in range(N):
if np.abs(s[i]-u)>= k:
x3 += 1
x4=x3/N
return x4
def uni2(k,N,s):
x2 = 0
x1 = 0
for i in range(N):
if s[i]>= k:
x1 += 1
x2 = x1/N
return x2
xlist=np.arange(0.5,5,0.01)
def chebyshev(u,sigma,k):
return sigma/k**2
chebylist=[]
def markov(u,k):
return u/k
markovlist=[]
def chernoff(v,k,t):
return v/exp(t*k)
chernofflist = []
pklist = []
difflist= []
difflist2= []
difflist3= []
for k in xlist:
chebylist.append(chebyshev(u,sigma,k))
markovlist.append(markov(u,k))
chernofflist.append(chernoff(v,k,t))
pklist.append(uni(k,N,s))
difflist.append(np.abs(uni(k,N,s)-chebyshev(u,sigma,k)))
difflist2.append(np.abs(uni2(k,N,s)-markov(u,k)))
difflist3.append(np.abs(uni2(k,N,s)-chernoff(v,k,t)))
uniflist = uniform.sf(xlist,a,b)
#plt.plot(xlist,uniflist,label= 'Loi uniforme([{},{}])'.format(a,b))
#plt.plot(xlist,markovlist,label = 'Inégalité de Markov')
#plt.plot(xlist,chernofflist,label = 'Inégalité de Chernoff')
#plt.xlabel('k')
#plt.ylabel('P(X>k)')
#plt.plot(xlist,pklist,label = 'Loi uniforme([{},{}])'.format(a,b))
#plt.plot(xlist,chebylist,label = 'Inégalité de Chebyshev')
#plt.xlabel('k')
#plt.ylabel('P(|X-E(X)|>k)')
plt.plot(xlist,difflist,label = 'Inégalité de Chebyshev')
plt.plot(xlist,difflist2,label = 'Inégalité de Markov')
plt.plot(xlist,difflist3,label = 'Inégalité de Chernoff')
#plt.ylabel('Valeur de l'erreur')
#plt.xlabel('k')
plt.legend()
plt.show()
###### Loi de Bernoulli
N = 100
n = 1
p = 0.5
t=1
u = n*p
sigma = n*p*(1-p)
s = np.random.binomial(n,p,N)
xlist=np.arange(0.5,50,1)
v = (exp(t)*p + (1-p))**n
chernofflist = []
chebylist=[]
markovlist=[]
pklist = []
difflist= []
difflist2= []
difflist3= []
for k in xlist:
chebylist.append(chebyshev(u,sigma,k))
markovlist.append(markov(u,k))
chernofflist.append(chernoff(v,k,t))
pklist.append(uni(k,N,s))
difflist.append(np.abs(uni(k,N,s)-chebyshev(u,sigma,k)))
difflist2.append(np.abs(uni2(k,N,s)-markov(u,k)))
difflist3.append(np.abs(uni2(k,N,s)-chernoff(v,k,t)))
bernlist = binom.sf(xlist,1,p)
plt.plot(xlist,bernlist,label = 'Loi de Bernoulli({})'.format(p))
plt.plot(xlist,markovlist,label = 'Inégalité de Markov')
plt.plot(xlist,chernofflist,label = 'Inégalité de Chernoff')
#plt.xlabel('k')
#plt.ylabel('P(X>k)')
#plt.plot(xlist,pklist,'Loi de Bernoulli({})'.format(p))
#plt.plot(xlist,chebylist,label = 'Inégalité de Chebyshev')
#plt.xlabel('k')
#plt.ylabel('P(|X-E(X)|>k)')
#plt.plot(xlist,difflist,label = 'Inégalité de Chebyshev')
#plt.plot(xlist,difflist2,label = 'Inégalité de Markov')
#plt.plot(xlist,difflist3,label = 'Inégalité de Chernoff')
#plt.ylabel('Valeur de l'erreur')
#plt.xlabel('k')
plt.legend()
plt.show()
############ Loi Binomiale
N = 100
n = 10
p = 0.5
t=0.5
u = n*p
sigma = n*p*(1-p)
v = (exp(t)*p + (1-p))**n
s = np.random.binomial(n,p,N)
xlist=np.arange(0.5,50,1)
chernofflist = []
chebylist=[]
markovlist=[]
pklist = []
difflist3=[]
difflist= []
difflist2= []
for k in xlist:
chebylist.append(chebyshev(u,sigma,k))
markovlist.append(markov(u,k))
chernofflist.append(chernoff(v,k,t))
pklist.append(uni(k,N,s))
difflist.append(np.abs(uni(k,N,s)-chebyshev(u,sigma,k)))
difflist2.append(np.abs(uni2(k,N,s)-markov(u,k)))
difflist3.append(np.abs(uni2(k,N,s)-chernoff(v,k,t)))
binomlist = binom.sf(xlist,n,p)
plt.plot(xlist,binomlist,label='Loi Binomiale({},{})'.format(n,p))
plt.plot(xlist,markovlist,label = 'Inégalité de Markov')
plt.plot(xlist,chernofflist,label = 'Inégalité de Chernoff')
#plt.xlabel('k')
#plt.ylabel('P(X>k)')
#plt.plot(xlist,pklist,label='Loi Binomiale({},{})'.format(n,p))
#plt.plot(xlist,chebylist,label = 'Inégalité de Chebyshev')
#plt.xlabel('k')
#plt.ylabel('P(|X-E(X)|>k)')
#plt.plot(xlist,difflist,label = 'Inégalité de Chebyshev')
#plt.plot(xlist,difflist2,label = 'Inégalité de Markov')
#plt.plot(xlist,difflist3,label = 'Inégalité de Chernoff')
#plt.ylabel('Valeur de l'erreur')
#plt.xlabel('k')
plt.legend()
plt.show()
###### Loi de Poisson
N = 100
lam = 0.3
t=1
u = lam
sigma = lam**2
s = np.random.poisson(lam,N)
v = exp(lam*(exp(t)-1))
xlist=np.arange(0.5,10,0.01)
chebylist=[]
markovlist=[]
pklist = []
chernofflist = []
difflist= []
difflist2= []
difflist3= []
for k in xlist:
chebylist.append(chebyshev(u,sigma,k))
markovlist.append(markov(u,k))
chernofflist.append(chernoff(v,k,t))
pklist.append(uni(k,N,s))
difflist.append(np.abs(uni(k,N,s)-chebyshev(u,sigma,k)))
difflist2.append(np.abs(uni2(k,N,s)-markov(u,k)))
difflist3.append(np.abs(uni2(k,N,s)-chernoff(v,k,t)))
poisslist = poisson.sf(xlist,u)
plt.plot(xlist,poisslist,label= 'Loi de Poisson({})'.format(lam))
plt.plot(xlist,markovlist,label = 'Inégalité de Markov')
#plt.plot(xlist,chernofflist,label='Inégalité de Chernoff')
#plt.xlabel('k')
#plt.ylabel('P(X>k)')
#plt.plot(xlist,pklist,label='Loi de Poisson({})'.format(lam))
#plt.plot(xlist,chebylist,label='Inégalité de Chebyshev')
#plt.xlabel('k')
#plt.ylabel('P(|X-E(X)|>k)')
#plt.plot(xlist,difflist,label = 'Inégalité de Chebyshev')
#plt.plot(xlist,difflist2,label = 'Inégalité de Markov')
#plt.plot(xlis,difflist3,label = 'Inégalité de Chernoff')
#plt.ylabel('Valeur de l'erreur')
#plt.xlabel('k')
plt.legend()
plt.show()
##### Loi exponentille
N = 100
lam = 2
#t>lam
t=3
u = 1/lam
sigma = 1/lam**2
s = np.random.exponential(u,N)
v=lam/(t-lam)
xlist=np.arange(0.5,10,0.01)
explist = expon.sf(xlist,u)
chebylist=[]
markovlist=[]
chernofflist=[]
pklist = []
difflist= []
difflist2= []
difflist3=[]
for k in xlist:
chebylist.append(chebyshev(u,sigma,k))
markovlist.append(markov(u,k))
pklist.append(uni(k,N,s))
chernofflist.append(chernoff(v,k,t))
difflist.append(np.abs(uni(k,N,s)-chebyshev(u,sigma,k)))
difflist2.append(np.abs(uni2(k,N,s)-markov(u,k)))
difflist3.append(np.abs(uni2(k,N,s)-chernoff(v,k,t)))
plt.plot(xlist,explist,label='Loi Exponentielle({})'.format(lam))
plt.plot(xlist,markovlist,label = 'Inégalité de Markov')
plt.plot(xlist,chernofflist,label = 'Inégalité de Chernoff')
plt.xlabel('k')
plt.ylabel('P(X>k)')
#plt.plot(xlist,pklist,label = 'Loi Exponentielle({})'.format(lam))
#plt.plot(xlist,chebylist,label = 'Inégalité de Chebyshev')
#plt.xlabel('k')
#plt.ylabel('P(|X-E(X)|>k)')
#plt.plot(xlist,difflist,label = 'Inégalité de Chebyshev')
#plt.plot(xlist,difflist2,label = 'Inégalité de Markov')
#plt.plot(xlist,difflist3,label = 'Inégalité de Chernoff')
#plt.ylabel('Valeur de l'erreur')
#plt.xlabel('k')
plt.legend()
plt.show()
#############"" Loi normale standard
N = 100
u=0
sigma=1
s = np.random.normal(u,sigma,N)
t=1
xlist=np.arange(0.5,5,0.01)
v = exp(-u*t-0.5*sigma*(t**2))
chebylist=[]
markovlist=[]
chernofflist=[]
pklist = []
difflist= []
difflist2= []
difflist3=[]
for k in xlist:
chebylist.append(chebyshev(u,sigma,k))
markovlist.append(markov(u,k))
pklist.append(uni(k,N,s))
chernofflist.append(chernoff(v,k,t))
difflist.append(np.abs(uni(k,N,s)-chebyshev(u,sigma,k)))
difflist2.append(np.abs(uni2(k,N,s)-markov(u,k)))
difflist3.append(np.abs(uni2(k,N,s)-chernoff(v,k,t)))
normlist = norm.sf(xlist,u)
plt.plot(xlist,normlist,label = 'Loi Normale({},{})'.format(u,sigma))
plt.plot(xlist,markovlist,label = 'Inégalité de Markov')
plt.plot(xlist,chernofflist,label = 'Inégalité de Chernoff')
#plt.xlabel('k')
#plt.ylabel('P(X>k)')
#plt.plot(xlist,pklist,label='Loi Normale({},{})'.format(u,sigma))
#plt.plot(xlist,chebylist,label = 'Inégalité de Chebyshev')
#plt.xlabel('k')
#plt.ylabel('P(|X-E(X)|>k)')
#plt.plot(xlist,difflist,label = 'Inégalité de Chebyshev')
#plt.plot(xlist,difflist2,label = 'Inégalité de Markov')
#plt.plot(xlist,difflist3,label = 'Inégalité de Chernoff')
#plt.ylabel('Valeur de l'erreur')
#plt.xlabel('k')
plt.legend()
plt.show()
Pdfcode

More Related Content

What's hot

Bellman ford
Bellman fordBellman ford
Bellman fordKiran K
 
TensorFlow Tutorial
TensorFlow TutorialTensorFlow Tutorial
TensorFlow TutorialNamHyuk Ahn
 
Fourier series example
Fourier series exampleFourier series example
Fourier series exampleAbi finni
 
Matlab plotting
Matlab plottingMatlab plotting
Matlab plottingAmr Rashed
 
Topic: Fourier Series ( Periodic Function to change of interval)
Topic: Fourier Series ( Periodic Function to  change of interval)Topic: Fourier Series ( Periodic Function to  change of interval)
Topic: Fourier Series ( Periodic Function to change of interval)Abhishek Choksi
 
Algorithm Design and Complexity - Course 7
Algorithm Design and Complexity - Course 7Algorithm Design and Complexity - Course 7
Algorithm Design and Complexity - Course 7Traian Rebedea
 
Ch01 basic concepts_nosoluiton
Ch01 basic concepts_nosoluitonCh01 basic concepts_nosoluiton
Ch01 basic concepts_nosoluitonshin
 
Program implementation and testing
Program implementation and testingProgram implementation and testing
Program implementation and testingabukky52
 
6. graphs of trig functions x
6. graphs of trig functions x6. graphs of trig functions x
6. graphs of trig functions xharbormath240
 

What's hot (19)

CLIM Undergraduate Workshop: (Attachment) Performing Extreme Value Analysis (...
CLIM Undergraduate Workshop: (Attachment) Performing Extreme Value Analysis (...CLIM Undergraduate Workshop: (Attachment) Performing Extreme Value Analysis (...
CLIM Undergraduate Workshop: (Attachment) Performing Extreme Value Analysis (...
 
Python hmm
Python hmmPython hmm
Python hmm
 
Bellman ford
Bellman fordBellman ford
Bellman ford
 
Calculus III
Calculus IIICalculus III
Calculus III
 
About RNN
About RNNAbout RNN
About RNN
 
About RNN
About RNNAbout RNN
About RNN
 
TensorFlow Tutorial
TensorFlow TutorialTensorFlow Tutorial
TensorFlow Tutorial
 
Fourier series example
Fourier series exampleFourier series example
Fourier series example
 
AEM Fourier series
 AEM Fourier series AEM Fourier series
AEM Fourier series
 
Python Tidbits
Python TidbitsPython Tidbits
Python Tidbits
 
Matlab plotting
Matlab plottingMatlab plotting
Matlab plotting
 
CLIM Undergraduate Workshop: Tutorial on R Software - Huang Huang, Oct 23, 2017
CLIM Undergraduate Workshop: Tutorial on R Software - Huang Huang, Oct 23, 2017CLIM Undergraduate Workshop: Tutorial on R Software - Huang Huang, Oct 23, 2017
CLIM Undergraduate Workshop: Tutorial on R Software - Huang Huang, Oct 23, 2017
 
Topic: Fourier Series ( Periodic Function to change of interval)
Topic: Fourier Series ( Periodic Function to  change of interval)Topic: Fourier Series ( Periodic Function to  change of interval)
Topic: Fourier Series ( Periodic Function to change of interval)
 
Matlab plotting
Matlab plottingMatlab plotting
Matlab plotting
 
Algorithm Design and Complexity - Course 7
Algorithm Design and Complexity - Course 7Algorithm Design and Complexity - Course 7
Algorithm Design and Complexity - Course 7
 
Ch01 basic concepts_nosoluiton
Ch01 basic concepts_nosoluitonCh01 basic concepts_nosoluiton
Ch01 basic concepts_nosoluiton
 
Program implementation and testing
Program implementation and testingProgram implementation and testing
Program implementation and testing
 
CLUSTERGRAM
CLUSTERGRAMCLUSTERGRAM
CLUSTERGRAM
 
6. graphs of trig functions x
6. graphs of trig functions x6. graphs of trig functions x
6. graphs of trig functions x
 

Similar to Pdfcode

On the smallest enclosing information disk
 On the smallest enclosing information disk On the smallest enclosing information disk
On the smallest enclosing information diskFrank Nielsen
 
Implement the following sorting algorithms Bubble Sort Insertion S.pdf
Implement the following sorting algorithms  Bubble Sort  Insertion S.pdfImplement the following sorting algorithms  Bubble Sort  Insertion S.pdf
Implement the following sorting algorithms Bubble Sort Insertion S.pdfkesav24
 
Algorithm Design and Analysis - Practical File
Algorithm Design and Analysis - Practical FileAlgorithm Design and Analysis - Practical File
Algorithm Design and Analysis - Practical FileKushagraChadha1
 
University of manchester mathematical formula tables
University of manchester mathematical formula tablesUniversity of manchester mathematical formula tables
University of manchester mathematical formula tablesGaurav Vasani
 
Truth, deduction, computation lecture g
Truth, deduction, computation   lecture gTruth, deduction, computation   lecture g
Truth, deduction, computation lecture gVlad Patryshev
 
Agda であそぼ
Agda であそぼAgda であそぼ
Agda であそぼerutuf13
 
A Note on the Derivation of the Variational Inference Updates for DILN
A Note on the Derivation of the Variational Inference Updates for DILNA Note on the Derivation of the Variational Inference Updates for DILN
A Note on the Derivation of the Variational Inference Updates for DILNTomonari Masada
 
DSP LAB COMPLETE CODES.docx
DSP LAB COMPLETE CODES.docxDSP LAB COMPLETE CODES.docx
DSP LAB COMPLETE CODES.docxMUMAR57
 
Slides: The Burbea-Rao and Bhattacharyya centroids
Slides: The Burbea-Rao and Bhattacharyya centroidsSlides: The Burbea-Rao and Bhattacharyya centroids
Slides: The Burbea-Rao and Bhattacharyya centroidsFrank Nielsen
 
Add math may june 2016 p1
Add math may june 2016 p1Add math may june 2016 p1
Add math may june 2016 p1Don Cunningham
 
R + Hadoop = Big Data Analytics. How Revolution Analytics' RHadoop Project Al...
R + Hadoop = Big Data Analytics. How Revolution Analytics' RHadoop Project Al...R + Hadoop = Big Data Analytics. How Revolution Analytics' RHadoop Project Al...
R + Hadoop = Big Data Analytics. How Revolution Analytics' RHadoop Project Al...Revolution Analytics
 
Lecture4 kenrels functions_rkhs
Lecture4 kenrels functions_rkhsLecture4 kenrels functions_rkhs
Lecture4 kenrels functions_rkhsStéphane Canu
 

Similar to Pdfcode (20)

Codecomparaison
CodecomparaisonCodecomparaison
Codecomparaison
 
On the smallest enclosing information disk
 On the smallest enclosing information disk On the smallest enclosing information disk
On the smallest enclosing information disk
 
NCM LECTURE NOTES ON LATIN SQUARES(27) (1) (1)
NCM LECTURE NOTES ON LATIN SQUARES(27) (1) (1)NCM LECTURE NOTES ON LATIN SQUARES(27) (1) (1)
NCM LECTURE NOTES ON LATIN SQUARES(27) (1) (1)
 
NCM LECTURE NOTES ON LATIN SQUARES(27)
NCM LECTURE NOTES ON LATIN SQUARES(27)NCM LECTURE NOTES ON LATIN SQUARES(27)
NCM LECTURE NOTES ON LATIN SQUARES(27)
 
Lambda calculus
Lambda calculusLambda calculus
Lambda calculus
 
Implement the following sorting algorithms Bubble Sort Insertion S.pdf
Implement the following sorting algorithms  Bubble Sort  Insertion S.pdfImplement the following sorting algorithms  Bubble Sort  Insertion S.pdf
Implement the following sorting algorithms Bubble Sort Insertion S.pdf
 
Algorithm Design and Analysis - Practical File
Algorithm Design and Analysis - Practical FileAlgorithm Design and Analysis - Practical File
Algorithm Design and Analysis - Practical File
 
ch3.ppt
ch3.pptch3.ppt
ch3.ppt
 
University of manchester mathematical formula tables
University of manchester mathematical formula tablesUniversity of manchester mathematical formula tables
University of manchester mathematical formula tables
 
Truth, deduction, computation lecture g
Truth, deduction, computation   lecture gTruth, deduction, computation   lecture g
Truth, deduction, computation lecture g
 
Agda であそぼ
Agda であそぼAgda であそぼ
Agda であそぼ
 
A Note on the Derivation of the Variational Inference Updates for DILN
A Note on the Derivation of the Variational Inference Updates for DILNA Note on the Derivation of the Variational Inference Updates for DILN
A Note on the Derivation of the Variational Inference Updates for DILN
 
purrr.pdf
purrr.pdfpurrr.pdf
purrr.pdf
 
DSP LAB COMPLETE CODES.docx
DSP LAB COMPLETE CODES.docxDSP LAB COMPLETE CODES.docx
DSP LAB COMPLETE CODES.docx
 
Slides: The Burbea-Rao and Bhattacharyya centroids
Slides: The Burbea-Rao and Bhattacharyya centroidsSlides: The Burbea-Rao and Bhattacharyya centroids
Slides: The Burbea-Rao and Bhattacharyya centroids
 
Math report
Math reportMath report
Math report
 
Add math may june 2016 p1
Add math may june 2016 p1Add math may june 2016 p1
Add math may june 2016 p1
 
R + Hadoop = Big Data Analytics. How Revolution Analytics' RHadoop Project Al...
R + Hadoop = Big Data Analytics. How Revolution Analytics' RHadoop Project Al...R + Hadoop = Big Data Analytics. How Revolution Analytics' RHadoop Project Al...
R + Hadoop = Big Data Analytics. How Revolution Analytics' RHadoop Project Al...
 
Lecture4 kenrels functions_rkhs
Lecture4 kenrels functions_rkhsLecture4 kenrels functions_rkhs
Lecture4 kenrels functions_rkhs
 
Cse41
Cse41Cse41
Cse41
 

Recently uploaded

Hot Call Girls |Delhi |Hauz Khas ☎ 9711199171 Book Your One night Stand
Hot Call Girls |Delhi |Hauz Khas ☎ 9711199171 Book Your One night StandHot Call Girls |Delhi |Hauz Khas ☎ 9711199171 Book Your One night Stand
Hot Call Girls |Delhi |Hauz Khas ☎ 9711199171 Book Your One night Standkumarajju5765
 
(+971568250507 ))# Young Call Girls in Ajman By Pakistani Call Girls in ...
(+971568250507  ))#  Young Call Girls  in Ajman  By Pakistani Call Girls  in ...(+971568250507  ))#  Young Call Girls  in Ajman  By Pakistani Call Girls  in ...
(+971568250507 ))# Young Call Girls in Ajman By Pakistani Call Girls in ...Escorts Call Girls
 
₹5.5k {Cash Payment}New Friends Colony Call Girls In [Delhi NIHARIKA] 🔝|97111...
₹5.5k {Cash Payment}New Friends Colony Call Girls In [Delhi NIHARIKA] 🔝|97111...₹5.5k {Cash Payment}New Friends Colony Call Girls In [Delhi NIHARIKA] 🔝|97111...
₹5.5k {Cash Payment}New Friends Colony Call Girls In [Delhi NIHARIKA] 🔝|97111...Diya Sharma
 
INDIVIDUAL ASSIGNMENT #3 CBG, PRESENTATION.
INDIVIDUAL ASSIGNMENT #3 CBG, PRESENTATION.INDIVIDUAL ASSIGNMENT #3 CBG, PRESENTATION.
INDIVIDUAL ASSIGNMENT #3 CBG, PRESENTATION.CarlotaBedoya1
 
Call Girls Service Chandigarh Lucky ❤️ 7710465962 Independent Call Girls In C...
Call Girls Service Chandigarh Lucky ❤️ 7710465962 Independent Call Girls In C...Call Girls Service Chandigarh Lucky ❤️ 7710465962 Independent Call Girls In C...
Call Girls Service Chandigarh Lucky ❤️ 7710465962 Independent Call Girls In C...Sheetaleventcompany
 
Low Rate Young Call Girls in Sector 63 Mamura Noida ✔️☆9289244007✔️☆ Female E...
Low Rate Young Call Girls in Sector 63 Mamura Noida ✔️☆9289244007✔️☆ Female E...Low Rate Young Call Girls in Sector 63 Mamura Noida ✔️☆9289244007✔️☆ Female E...
Low Rate Young Call Girls in Sector 63 Mamura Noida ✔️☆9289244007✔️☆ Female E...SofiyaSharma5
 
Nanded City ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready ...
Nanded City ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready ...Nanded City ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready ...
Nanded City ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready ...tanu pandey
 
Moving Beyond Twitter/X and Facebook - Social Media for local news providers
Moving Beyond Twitter/X and Facebook - Social Media for local news providersMoving Beyond Twitter/X and Facebook - Social Media for local news providers
Moving Beyond Twitter/X and Facebook - Social Media for local news providersDamian Radcliffe
 
All Time Service Available Call Girls Mg Road 👌 ⏭️ 6378878445
All Time Service Available Call Girls Mg Road 👌 ⏭️ 6378878445All Time Service Available Call Girls Mg Road 👌 ⏭️ 6378878445
All Time Service Available Call Girls Mg Road 👌 ⏭️ 6378878445ruhi
 
Call Now ☎ 8264348440 !! Call Girls in Shahpur Jat Escort Service Delhi N.C.R.
Call Now ☎ 8264348440 !! Call Girls in Shahpur Jat Escort Service Delhi N.C.R.Call Now ☎ 8264348440 !! Call Girls in Shahpur Jat Escort Service Delhi N.C.R.
Call Now ☎ 8264348440 !! Call Girls in Shahpur Jat Escort Service Delhi N.C.R.soniya singh
 
AWS Community DAY Albertini-Ellan Cloud Security (1).pptx
AWS Community DAY Albertini-Ellan Cloud Security (1).pptxAWS Community DAY Albertini-Ellan Cloud Security (1).pptx
AWS Community DAY Albertini-Ellan Cloud Security (1).pptxellan12
 
WhatsApp 📞 8448380779 ✅Call Girls In Mamura Sector 66 ( Noida)
WhatsApp 📞 8448380779 ✅Call Girls In Mamura Sector 66 ( Noida)WhatsApp 📞 8448380779 ✅Call Girls In Mamura Sector 66 ( Noida)
WhatsApp 📞 8448380779 ✅Call Girls In Mamura Sector 66 ( Noida)Delhi Call girls
 
Call Girls In Defence Colony Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Defence Colony Delhi 💯Call Us 🔝8264348440🔝Call Girls In Defence Colony Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Defence Colony Delhi 💯Call Us 🔝8264348440🔝soniya singh
 
How is AI changing journalism? (v. April 2024)
How is AI changing journalism? (v. April 2024)How is AI changing journalism? (v. April 2024)
How is AI changing journalism? (v. April 2024)Damian Radcliffe
 
Hire↠Young Call Girls in Tilak nagar (Delhi) ☎️ 9205541914 ☎️ Independent Esc...
Hire↠Young Call Girls in Tilak nagar (Delhi) ☎️ 9205541914 ☎️ Independent Esc...Hire↠Young Call Girls in Tilak nagar (Delhi) ☎️ 9205541914 ☎️ Independent Esc...
Hire↠Young Call Girls in Tilak nagar (Delhi) ☎️ 9205541914 ☎️ Independent Esc...Delhi Call girls
 
Enjoy Night⚡Call Girls Dlf City Phase 3 Gurgaon >༒8448380779 Escort Service
Enjoy Night⚡Call Girls Dlf City Phase 3 Gurgaon >༒8448380779 Escort ServiceEnjoy Night⚡Call Girls Dlf City Phase 3 Gurgaon >༒8448380779 Escort Service
Enjoy Night⚡Call Girls Dlf City Phase 3 Gurgaon >༒8448380779 Escort ServiceDelhi Call girls
 
Lucknow ❤CALL GIRL 88759*99948 ❤CALL GIRLS IN Lucknow ESCORT SERVICE❤CALL GIRL
Lucknow ❤CALL GIRL 88759*99948 ❤CALL GIRLS IN Lucknow ESCORT SERVICE❤CALL GIRLLucknow ❤CALL GIRL 88759*99948 ❤CALL GIRLS IN Lucknow ESCORT SERVICE❤CALL GIRL
Lucknow ❤CALL GIRL 88759*99948 ❤CALL GIRLS IN Lucknow ESCORT SERVICE❤CALL GIRLimonikaupta
 
GDG Cloud Southlake 32: Kyle Hettinger: Demystifying the Dark Web
GDG Cloud Southlake 32: Kyle Hettinger: Demystifying the Dark WebGDG Cloud Southlake 32: Kyle Hettinger: Demystifying the Dark Web
GDG Cloud Southlake 32: Kyle Hettinger: Demystifying the Dark WebJames Anderson
 

Recently uploaded (20)

Hot Call Girls |Delhi |Hauz Khas ☎ 9711199171 Book Your One night Stand
Hot Call Girls |Delhi |Hauz Khas ☎ 9711199171 Book Your One night StandHot Call Girls |Delhi |Hauz Khas ☎ 9711199171 Book Your One night Stand
Hot Call Girls |Delhi |Hauz Khas ☎ 9711199171 Book Your One night Stand
 
(INDIRA) Call Girl Pune Call Now 8250077686 Pune Escorts 24x7
(INDIRA) Call Girl Pune Call Now 8250077686 Pune Escorts 24x7(INDIRA) Call Girl Pune Call Now 8250077686 Pune Escorts 24x7
(INDIRA) Call Girl Pune Call Now 8250077686 Pune Escorts 24x7
 
(+971568250507 ))# Young Call Girls in Ajman By Pakistani Call Girls in ...
(+971568250507  ))#  Young Call Girls  in Ajman  By Pakistani Call Girls  in ...(+971568250507  ))#  Young Call Girls  in Ajman  By Pakistani Call Girls  in ...
(+971568250507 ))# Young Call Girls in Ajman By Pakistani Call Girls in ...
 
VVVIP Call Girls In Connaught Place ➡️ Delhi ➡️ 9999965857 🚀 No Advance 24HRS...
VVVIP Call Girls In Connaught Place ➡️ Delhi ➡️ 9999965857 🚀 No Advance 24HRS...VVVIP Call Girls In Connaught Place ➡️ Delhi ➡️ 9999965857 🚀 No Advance 24HRS...
VVVIP Call Girls In Connaught Place ➡️ Delhi ➡️ 9999965857 🚀 No Advance 24HRS...
 
₹5.5k {Cash Payment}New Friends Colony Call Girls In [Delhi NIHARIKA] 🔝|97111...
₹5.5k {Cash Payment}New Friends Colony Call Girls In [Delhi NIHARIKA] 🔝|97111...₹5.5k {Cash Payment}New Friends Colony Call Girls In [Delhi NIHARIKA] 🔝|97111...
₹5.5k {Cash Payment}New Friends Colony Call Girls In [Delhi NIHARIKA] 🔝|97111...
 
INDIVIDUAL ASSIGNMENT #3 CBG, PRESENTATION.
INDIVIDUAL ASSIGNMENT #3 CBG, PRESENTATION.INDIVIDUAL ASSIGNMENT #3 CBG, PRESENTATION.
INDIVIDUAL ASSIGNMENT #3 CBG, PRESENTATION.
 
Call Girls Service Chandigarh Lucky ❤️ 7710465962 Independent Call Girls In C...
Call Girls Service Chandigarh Lucky ❤️ 7710465962 Independent Call Girls In C...Call Girls Service Chandigarh Lucky ❤️ 7710465962 Independent Call Girls In C...
Call Girls Service Chandigarh Lucky ❤️ 7710465962 Independent Call Girls In C...
 
Low Rate Young Call Girls in Sector 63 Mamura Noida ✔️☆9289244007✔️☆ Female E...
Low Rate Young Call Girls in Sector 63 Mamura Noida ✔️☆9289244007✔️☆ Female E...Low Rate Young Call Girls in Sector 63 Mamura Noida ✔️☆9289244007✔️☆ Female E...
Low Rate Young Call Girls in Sector 63 Mamura Noida ✔️☆9289244007✔️☆ Female E...
 
Nanded City ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready ...
Nanded City ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready ...Nanded City ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready ...
Nanded City ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready ...
 
Moving Beyond Twitter/X and Facebook - Social Media for local news providers
Moving Beyond Twitter/X and Facebook - Social Media for local news providersMoving Beyond Twitter/X and Facebook - Social Media for local news providers
Moving Beyond Twitter/X and Facebook - Social Media for local news providers
 
All Time Service Available Call Girls Mg Road 👌 ⏭️ 6378878445
All Time Service Available Call Girls Mg Road 👌 ⏭️ 6378878445All Time Service Available Call Girls Mg Road 👌 ⏭️ 6378878445
All Time Service Available Call Girls Mg Road 👌 ⏭️ 6378878445
 
Call Now ☎ 8264348440 !! Call Girls in Shahpur Jat Escort Service Delhi N.C.R.
Call Now ☎ 8264348440 !! Call Girls in Shahpur Jat Escort Service Delhi N.C.R.Call Now ☎ 8264348440 !! Call Girls in Shahpur Jat Escort Service Delhi N.C.R.
Call Now ☎ 8264348440 !! Call Girls in Shahpur Jat Escort Service Delhi N.C.R.
 
AWS Community DAY Albertini-Ellan Cloud Security (1).pptx
AWS Community DAY Albertini-Ellan Cloud Security (1).pptxAWS Community DAY Albertini-Ellan Cloud Security (1).pptx
AWS Community DAY Albertini-Ellan Cloud Security (1).pptx
 
WhatsApp 📞 8448380779 ✅Call Girls In Mamura Sector 66 ( Noida)
WhatsApp 📞 8448380779 ✅Call Girls In Mamura Sector 66 ( Noida)WhatsApp 📞 8448380779 ✅Call Girls In Mamura Sector 66 ( Noida)
WhatsApp 📞 8448380779 ✅Call Girls In Mamura Sector 66 ( Noida)
 
Call Girls In Defence Colony Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Defence Colony Delhi 💯Call Us 🔝8264348440🔝Call Girls In Defence Colony Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Defence Colony Delhi 💯Call Us 🔝8264348440🔝
 
How is AI changing journalism? (v. April 2024)
How is AI changing journalism? (v. April 2024)How is AI changing journalism? (v. April 2024)
How is AI changing journalism? (v. April 2024)
 
Hire↠Young Call Girls in Tilak nagar (Delhi) ☎️ 9205541914 ☎️ Independent Esc...
Hire↠Young Call Girls in Tilak nagar (Delhi) ☎️ 9205541914 ☎️ Independent Esc...Hire↠Young Call Girls in Tilak nagar (Delhi) ☎️ 9205541914 ☎️ Independent Esc...
Hire↠Young Call Girls in Tilak nagar (Delhi) ☎️ 9205541914 ☎️ Independent Esc...
 
Enjoy Night⚡Call Girls Dlf City Phase 3 Gurgaon >༒8448380779 Escort Service
Enjoy Night⚡Call Girls Dlf City Phase 3 Gurgaon >༒8448380779 Escort ServiceEnjoy Night⚡Call Girls Dlf City Phase 3 Gurgaon >༒8448380779 Escort Service
Enjoy Night⚡Call Girls Dlf City Phase 3 Gurgaon >༒8448380779 Escort Service
 
Lucknow ❤CALL GIRL 88759*99948 ❤CALL GIRLS IN Lucknow ESCORT SERVICE❤CALL GIRL
Lucknow ❤CALL GIRL 88759*99948 ❤CALL GIRLS IN Lucknow ESCORT SERVICE❤CALL GIRLLucknow ❤CALL GIRL 88759*99948 ❤CALL GIRLS IN Lucknow ESCORT SERVICE❤CALL GIRL
Lucknow ❤CALL GIRL 88759*99948 ❤CALL GIRLS IN Lucknow ESCORT SERVICE❤CALL GIRL
 
GDG Cloud Southlake 32: Kyle Hettinger: Demystifying the Dark Web
GDG Cloud Southlake 32: Kyle Hettinger: Demystifying the Dark WebGDG Cloud Southlake 32: Kyle Hettinger: Demystifying the Dark Web
GDG Cloud Southlake 32: Kyle Hettinger: Demystifying the Dark Web
 

Pdfcode

  • 1. import matplotlib.pyplot as plt import numpy as np from scipy.stats import norm,binom,poisson,uniform,expon from math import sqrt,exp ####Loi uniforme N = 100 a = 0 b = 5 t=0.5 v = (exp(t*b)-exp(t*a))/(t*(b-a)) u = (a+b)/2 sigma = ((b-a)**2)/12 s = np.random.uniform(a,b,N) def uni(k,N,s): x3,x4 = 0,0 for i in range(N): if np.abs(s[i]-u)>= k: x3 += 1 x4=x3/N return x4 def uni2(k,N,s): x2 = 0 x1 = 0 for i in range(N): if s[i]>= k: x1 += 1 x2 = x1/N return x2 xlist=np.arange(0.5,5,0.01) def chebyshev(u,sigma,k): return sigma/k**2 chebylist=[] def markov(u,k): return u/k markovlist=[] def chernoff(v,k,t): return v/exp(t*k) chernofflist = [] pklist = [] difflist= [] difflist2= []
  • 2. difflist3= [] for k in xlist: chebylist.append(chebyshev(u,sigma,k)) markovlist.append(markov(u,k)) chernofflist.append(chernoff(v,k,t)) pklist.append(uni(k,N,s)) difflist.append(np.abs(uni(k,N,s)-chebyshev(u,sigma,k))) difflist2.append(np.abs(uni2(k,N,s)-markov(u,k))) difflist3.append(np.abs(uni2(k,N,s)-chernoff(v,k,t))) uniflist = uniform.sf(xlist,a,b) #plt.plot(xlist,uniflist,label= 'Loi uniforme([{},{}])'.format(a,b)) #plt.plot(xlist,markovlist,label = 'Inégalité de Markov') #plt.plot(xlist,chernofflist,label = 'Inégalité de Chernoff') #plt.xlabel('k') #plt.ylabel('P(X>k)') #plt.plot(xlist,pklist,label = 'Loi uniforme([{},{}])'.format(a,b)) #plt.plot(xlist,chebylist,label = 'Inégalité de Chebyshev') #plt.xlabel('k') #plt.ylabel('P(|X-E(X)|>k)') plt.plot(xlist,difflist,label = 'Inégalité de Chebyshev') plt.plot(xlist,difflist2,label = 'Inégalité de Markov') plt.plot(xlist,difflist3,label = 'Inégalité de Chernoff') #plt.ylabel('Valeur de l'erreur') #plt.xlabel('k') plt.legend() plt.show() ###### Loi de Bernoulli N = 100 n = 1 p = 0.5 t=1 u = n*p sigma = n*p*(1-p) s = np.random.binomial(n,p,N) xlist=np.arange(0.5,50,1) v = (exp(t)*p + (1-p))**n chernofflist = []
  • 3. chebylist=[] markovlist=[] pklist = [] difflist= [] difflist2= [] difflist3= [] for k in xlist: chebylist.append(chebyshev(u,sigma,k)) markovlist.append(markov(u,k)) chernofflist.append(chernoff(v,k,t)) pklist.append(uni(k,N,s)) difflist.append(np.abs(uni(k,N,s)-chebyshev(u,sigma,k))) difflist2.append(np.abs(uni2(k,N,s)-markov(u,k))) difflist3.append(np.abs(uni2(k,N,s)-chernoff(v,k,t))) bernlist = binom.sf(xlist,1,p) plt.plot(xlist,bernlist,label = 'Loi de Bernoulli({})'.format(p)) plt.plot(xlist,markovlist,label = 'Inégalité de Markov') plt.plot(xlist,chernofflist,label = 'Inégalité de Chernoff') #plt.xlabel('k') #plt.ylabel('P(X>k)') #plt.plot(xlist,pklist,'Loi de Bernoulli({})'.format(p)) #plt.plot(xlist,chebylist,label = 'Inégalité de Chebyshev') #plt.xlabel('k') #plt.ylabel('P(|X-E(X)|>k)') #plt.plot(xlist,difflist,label = 'Inégalité de Chebyshev') #plt.plot(xlist,difflist2,label = 'Inégalité de Markov') #plt.plot(xlist,difflist3,label = 'Inégalité de Chernoff') #plt.ylabel('Valeur de l'erreur') #plt.xlabel('k') plt.legend() plt.show() ############ Loi Binomiale N = 100 n = 10 p = 0.5 t=0.5 u = n*p sigma = n*p*(1-p) v = (exp(t)*p + (1-p))**n
  • 4. s = np.random.binomial(n,p,N) xlist=np.arange(0.5,50,1) chernofflist = [] chebylist=[] markovlist=[] pklist = [] difflist3=[] difflist= [] difflist2= [] for k in xlist: chebylist.append(chebyshev(u,sigma,k)) markovlist.append(markov(u,k)) chernofflist.append(chernoff(v,k,t)) pklist.append(uni(k,N,s)) difflist.append(np.abs(uni(k,N,s)-chebyshev(u,sigma,k))) difflist2.append(np.abs(uni2(k,N,s)-markov(u,k))) difflist3.append(np.abs(uni2(k,N,s)-chernoff(v,k,t))) binomlist = binom.sf(xlist,n,p) plt.plot(xlist,binomlist,label='Loi Binomiale({},{})'.format(n,p)) plt.plot(xlist,markovlist,label = 'Inégalité de Markov') plt.plot(xlist,chernofflist,label = 'Inégalité de Chernoff') #plt.xlabel('k') #plt.ylabel('P(X>k)') #plt.plot(xlist,pklist,label='Loi Binomiale({},{})'.format(n,p)) #plt.plot(xlist,chebylist,label = 'Inégalité de Chebyshev') #plt.xlabel('k') #plt.ylabel('P(|X-E(X)|>k)') #plt.plot(xlist,difflist,label = 'Inégalité de Chebyshev') #plt.plot(xlist,difflist2,label = 'Inégalité de Markov') #plt.plot(xlist,difflist3,label = 'Inégalité de Chernoff') #plt.ylabel('Valeur de l'erreur') #plt.xlabel('k') plt.legend() plt.show() ###### Loi de Poisson N = 100 lam = 0.3 t=1 u = lam sigma = lam**2
  • 5. s = np.random.poisson(lam,N) v = exp(lam*(exp(t)-1)) xlist=np.arange(0.5,10,0.01) chebylist=[] markovlist=[] pklist = [] chernofflist = [] difflist= [] difflist2= [] difflist3= [] for k in xlist: chebylist.append(chebyshev(u,sigma,k)) markovlist.append(markov(u,k)) chernofflist.append(chernoff(v,k,t)) pklist.append(uni(k,N,s)) difflist.append(np.abs(uni(k,N,s)-chebyshev(u,sigma,k))) difflist2.append(np.abs(uni2(k,N,s)-markov(u,k))) difflist3.append(np.abs(uni2(k,N,s)-chernoff(v,k,t))) poisslist = poisson.sf(xlist,u) plt.plot(xlist,poisslist,label= 'Loi de Poisson({})'.format(lam)) plt.plot(xlist,markovlist,label = 'Inégalité de Markov') #plt.plot(xlist,chernofflist,label='Inégalité de Chernoff') #plt.xlabel('k') #plt.ylabel('P(X>k)') #plt.plot(xlist,pklist,label='Loi de Poisson({})'.format(lam)) #plt.plot(xlist,chebylist,label='Inégalité de Chebyshev') #plt.xlabel('k') #plt.ylabel('P(|X-E(X)|>k)') #plt.plot(xlist,difflist,label = 'Inégalité de Chebyshev') #plt.plot(xlist,difflist2,label = 'Inégalité de Markov') #plt.plot(xlis,difflist3,label = 'Inégalité de Chernoff') #plt.ylabel('Valeur de l'erreur') #plt.xlabel('k') plt.legend() plt.show() ##### Loi exponentille N = 100 lam = 2
  • 6. #t>lam t=3 u = 1/lam sigma = 1/lam**2 s = np.random.exponential(u,N) v=lam/(t-lam) xlist=np.arange(0.5,10,0.01) explist = expon.sf(xlist,u) chebylist=[] markovlist=[] chernofflist=[] pklist = [] difflist= [] difflist2= [] difflist3=[] for k in xlist: chebylist.append(chebyshev(u,sigma,k)) markovlist.append(markov(u,k)) pklist.append(uni(k,N,s)) chernofflist.append(chernoff(v,k,t)) difflist.append(np.abs(uni(k,N,s)-chebyshev(u,sigma,k))) difflist2.append(np.abs(uni2(k,N,s)-markov(u,k))) difflist3.append(np.abs(uni2(k,N,s)-chernoff(v,k,t))) plt.plot(xlist,explist,label='Loi Exponentielle({})'.format(lam)) plt.plot(xlist,markovlist,label = 'Inégalité de Markov') plt.plot(xlist,chernofflist,label = 'Inégalité de Chernoff') plt.xlabel('k') plt.ylabel('P(X>k)') #plt.plot(xlist,pklist,label = 'Loi Exponentielle({})'.format(lam)) #plt.plot(xlist,chebylist,label = 'Inégalité de Chebyshev') #plt.xlabel('k') #plt.ylabel('P(|X-E(X)|>k)') #plt.plot(xlist,difflist,label = 'Inégalité de Chebyshev') #plt.plot(xlist,difflist2,label = 'Inégalité de Markov') #plt.plot(xlist,difflist3,label = 'Inégalité de Chernoff') #plt.ylabel('Valeur de l'erreur') #plt.xlabel('k') plt.legend() plt.show()
  • 7. #############"" Loi normale standard N = 100 u=0 sigma=1 s = np.random.normal(u,sigma,N) t=1 xlist=np.arange(0.5,5,0.01) v = exp(-u*t-0.5*sigma*(t**2)) chebylist=[] markovlist=[] chernofflist=[] pklist = [] difflist= [] difflist2= [] difflist3=[] for k in xlist: chebylist.append(chebyshev(u,sigma,k)) markovlist.append(markov(u,k)) pklist.append(uni(k,N,s)) chernofflist.append(chernoff(v,k,t)) difflist.append(np.abs(uni(k,N,s)-chebyshev(u,sigma,k))) difflist2.append(np.abs(uni2(k,N,s)-markov(u,k))) difflist3.append(np.abs(uni2(k,N,s)-chernoff(v,k,t))) normlist = norm.sf(xlist,u) plt.plot(xlist,normlist,label = 'Loi Normale({},{})'.format(u,sigma)) plt.plot(xlist,markovlist,label = 'Inégalité de Markov') plt.plot(xlist,chernofflist,label = 'Inégalité de Chernoff') #plt.xlabel('k') #plt.ylabel('P(X>k)') #plt.plot(xlist,pklist,label='Loi Normale({},{})'.format(u,sigma)) #plt.plot(xlist,chebylist,label = 'Inégalité de Chebyshev') #plt.xlabel('k') #plt.ylabel('P(|X-E(X)|>k)') #plt.plot(xlist,difflist,label = 'Inégalité de Chebyshev') #plt.plot(xlist,difflist2,label = 'Inégalité de Markov') #plt.plot(xlist,difflist3,label = 'Inégalité de Chernoff') #plt.ylabel('Valeur de l'erreur') #plt.xlabel('k') plt.legend() plt.show()