SlideShare a Scribd company logo
1 of 3
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
from scipy.integrate import quad
def uni2(n,N,s):
x1,x2 = 0,0
for i in range(N):
if s[i]>= (n+sqrt(n))/2: #P(X >= n+sqrt(n))/2)
x1 += 1
x2 = x1/N
return x2
def uni(n,N,s):
x3,x4 = 0,0,
for i in range(N):
if np.abs(s[i]-u)>= sqrt(n)/2:
x3 += 1
x4=x3/N
return x4
def uni3(n,N,s,x):
x5,x6=0,0
for i in range(N):
if np.abs(s[i]-u)>= x*sqrt(n):
x5+=1
x6=x5/N
return x6
def chebyshev(u,sigma,n):
return sigma/((sqrt(n))/2)**2
chebylist=[]
def markov(u,n):
return u/((n+sqrt(n))/2)
markovlist=[]
def chernoff(v,n,t):
return v/exp(t*((n+sqrt(n))/2))
chernofflist = []
def hoeffding(x):
return 2*exp(-x**2)
def chebyshev2(p,x):
return p*(1-p)/x**2
###### X suit B(n,1/2)
N= 100
p=0.5
t=0.5
x= 1
xlist = np.arange(0.5,100,0.1)
binom1=[]
binom2=[]
binom3=[]
chernofflist = []
chebylist=[]
chebylist2=[]
markovlist=[]
hoeffdinglist=[]
for n in xlist:
u=n*p
s = np.random.binomial(n,p,N)
sigma = n*p*(1-p)
v = (exp(t)*p + (1-p))**n
binom1.append(uni(n,N,s))
binom2.append(uni2(n,N,s))
binom3.append(uni3(n,N,s,x))
chebylist.append(chebyshev(u,sigma,n))
markovlist.append(markov(u,n))
chernofflist.append(chernoff(v,n,t))
hoeffdinglist.append(hoeffding(x))
chebylist2.append(chebyshev2(p,x))
plt.plot(xlist,binom1,label='P(|X- 'r'$frac {n}{2}| geqslantfrac {sqrt{n}} {2})$')
plt.plot(xlist,chebylist,label = 'Chebyshev')
plt.xlabel('n')
plt.ylabel('Probabilité')
plt.legend()
plt.show()
###############Chebyshev = 1 inutile et on remarque numériquement que : P(|X-n/2|⩾√n/2)⩽1/2
########*Chernoff et markov loin d'être optimaux et on remarque numériquement que :
P(X⩾(n+√n)/2)⩽1/4
plt.plot(xlist,binom2,label='P(X'r'$ geqslant frac {n+sqrt{n}} {2})$')
plt.plot(xlist,chernofflist, label = 'Chernoff')
plt.plot(xlist,markovlist,label = 'Markov')
plt.xlabel('n')
plt.ylabel('Probabilité')
plt.ylim(ymax=1)
plt.legend()
plt.show()
##############
### P(|X- n/2|⩾x√n)⩽p(1−p)/x²: Chebyshev
###P(|X- n/2|⩾x√n)⩽2exp(−2x²): Hoeffding
plt.plot(xlist,binom3,label='P(|X- 'r'$frac {n}{2}| geqslant xsqrt{n})$' )
plt.plot(xlist,hoeffdinglist,label = 'Hoeffding')
plt.plot(xlist,chebylist2,label = 'Chebyshev')
plt.xlabel('n')
plt.ylabel('P(|X- 'r'$frac {n}{2}| geqslant xsqrt{n})$')
plt.legend()
plt.show()
####### Comparaison Chebyshev et Hoeffding en fonction de x
blist = np.arange(0.5,10,0.1)
chebylist3=[]
hoeffdinglist2=[]
for x in blist :
hoeffdinglist2.append(hoeffding(x))
chebylist3.append(chebyshev2(p,x))
plt.plot(blist,hoeffdinglist2,label = 'Hoeffding')
plt.plot(blist,chebylist3,label = 'Chebyshev')
plt.xlabel('x')
plt.legend()
plt.show()

More Related Content

What's hot

Noise detection from the signal matlab code, Signal Diagnosis
Noise detection from the signal matlab code, Signal Diagnosis Noise detection from the signal matlab code, Signal Diagnosis
Noise detection from the signal matlab code, Signal Diagnosis Bharti Airtel Ltd.
 
Applications of maxima and minima
Applications of maxima and minimaApplications of maxima and minima
Applications of maxima and minimarouwejan
 
Lesson20 Tangent Planes Slides+Notes
Lesson20   Tangent Planes Slides+NotesLesson20   Tangent Planes Slides+Notes
Lesson20 Tangent Planes Slides+NotesMatthew Leingang
 
Python.St.Petersburg Paradox sim
Python.St.Petersburg Paradox simPython.St.Petersburg Paradox sim
Python.St.Petersburg Paradox simTianqi Huang, CFA
 
Equation plane
Equation planeEquation plane
Equation planecmnell
 
Statistics for Economics Final Exam Cheat Sheet
Statistics for Economics Final Exam Cheat SheetStatistics for Economics Final Exam Cheat Sheet
Statistics for Economics Final Exam Cheat SheetLaurel Ayuyao
 
Infrome 7 matlab
Infrome 7 matlabInfrome 7 matlab
Infrome 7 matlabWasho Ramos
 
The Moore-Spiegel Oscillator
The Moore-Spiegel OscillatorThe Moore-Spiegel Oscillator
The Moore-Spiegel OscillatorAbhranil Das
 
Statistics Powerpoint Standard Dev.
Statistics Powerpoint Standard Dev.Statistics Powerpoint Standard Dev.
Statistics Powerpoint Standard Dev.arm74
 
EJERCICIOS PROPUESTOS DE BOOLE
EJERCICIOS PROPUESTOS DE BOOLEEJERCICIOS PROPUESTOS DE BOOLE
EJERCICIOS PROPUESTOS DE BOOLEYosel97
 
Perforacion de pozos, grupo d3 b, tarea numero 1
Perforacion de pozos, grupo d3 b, tarea numero 1Perforacion de pozos, grupo d3 b, tarea numero 1
Perforacion de pozos, grupo d3 b, tarea numero 1Kt Silva
 

What's hot (20)

Noise detection from the signal matlab code, Signal Diagnosis
Noise detection from the signal matlab code, Signal Diagnosis Noise detection from the signal matlab code, Signal Diagnosis
Noise detection from the signal matlab code, Signal Diagnosis
 
Applications of maxima and minima
Applications of maxima and minimaApplications of maxima and minima
Applications of maxima and minima
 
Lec 3-mcgregor
Lec 3-mcgregorLec 3-mcgregor
Lec 3-mcgregor
 
Lesson20 Tangent Planes Slides+Notes
Lesson20   Tangent Planes Slides+NotesLesson20   Tangent Planes Slides+Notes
Lesson20 Tangent Planes Slides+Notes
 
Tangent plane
Tangent planeTangent plane
Tangent plane
 
Vcs9
Vcs9Vcs9
Vcs9
 
Python.St.Petersburg Paradox sim
Python.St.Petersburg Paradox simPython.St.Petersburg Paradox sim
Python.St.Petersburg Paradox sim
 
Equation plane
Equation planeEquation plane
Equation plane
 
DISTANCE FORMULA
DISTANCE FORMULADISTANCE FORMULA
DISTANCE FORMULA
 
Statistics for Economics Final Exam Cheat Sheet
Statistics for Economics Final Exam Cheat SheetStatistics for Economics Final Exam Cheat Sheet
Statistics for Economics Final Exam Cheat Sheet
 
Infrome 7 matlab
Infrome 7 matlabInfrome 7 matlab
Infrome 7 matlab
 
The Moore-Spiegel Oscillator
The Moore-Spiegel OscillatorThe Moore-Spiegel Oscillator
The Moore-Spiegel Oscillator
 
Quadratic formula 2
Quadratic formula 2Quadratic formula 2
Quadratic formula 2
 
ppt of Calculus
ppt of Calculusppt of Calculus
ppt of Calculus
 
Seg code
Seg codeSeg code
Seg code
 
Python Tidbits
Python TidbitsPython Tidbits
Python Tidbits
 
Statistics Powerpoint Standard Dev.
Statistics Powerpoint Standard Dev.Statistics Powerpoint Standard Dev.
Statistics Powerpoint Standard Dev.
 
EJERCICIOS PROPUESTOS DE BOOLE
EJERCICIOS PROPUESTOS DE BOOLEEJERCICIOS PROPUESTOS DE BOOLE
EJERCICIOS PROPUESTOS DE BOOLE
 
MATHS SYMBOLS - PROPERTIES of EXPONENTS
MATHS SYMBOLS - PROPERTIES of EXPONENTSMATHS SYMBOLS - PROPERTIES of EXPONENTS
MATHS SYMBOLS - PROPERTIES of EXPONENTS
 
Perforacion de pozos, grupo d3 b, tarea numero 1
Perforacion de pozos, grupo d3 b, tarea numero 1Perforacion de pozos, grupo d3 b, tarea numero 1
Perforacion de pozos, grupo d3 b, tarea numero 1
 

Similar to Codecomparaison

Algorithm Design and Analysis - Practical File
Algorithm Design and Analysis - Practical FileAlgorithm Design and Analysis - Practical File
Algorithm Design and Analysis - Practical FileKushagraChadha1
 
Open GL T0074 56 sm4
Open GL T0074 56 sm4Open GL T0074 56 sm4
Open GL T0074 56 sm4Roziq Bahtiar
 
SPDE presentation 2012
SPDE presentation 2012SPDE presentation 2012
SPDE presentation 2012Zheng Mengdi
 
curve fitting lecture slides February 24
curve fitting lecture slides February 24curve fitting lecture slides February 24
curve fitting lecture slides February 24TaiwoD
 
PROBABILITY DISTRIBUTION
PROBABILITY DISTRIBUTIONPROBABILITY DISTRIBUTION
PROBABILITY DISTRIBUTIONshahzadebaujiti
 
When running the code below I am getting some errors (see image)- The.docx
When running the code below I am getting some errors (see image)- The.docxWhen running the code below I am getting some errors (see image)- The.docx
When running the code below I am getting some errors (see image)- The.docxmaximapikvu8
 
Numerical Method Assignment
Numerical Method AssignmentNumerical Method Assignment
Numerical Method Assignmentashikul akash
 
Rasterisation of a circle by the bresenham algorithm
Rasterisation of a circle by the bresenham algorithmRasterisation of a circle by the bresenham algorithm
Rasterisation of a circle by the bresenham algorithmKALAIRANJANI21
 
Rasterisation of a circle by the bresenham algorithm
Rasterisation of a circle by the bresenham algorithmRasterisation of a circle by the bresenham algorithm
Rasterisation of a circle by the bresenham algorithmKALAIRANJANI21
 
Computer Aided Manufacturing Design
Computer Aided Manufacturing DesignComputer Aided Manufacturing Design
Computer Aided Manufacturing DesignV Tripathi
 
Tutorial on convolutional neural networks
Tutorial on convolutional neural networksTutorial on convolutional neural networks
Tutorial on convolutional neural networksHojin Yang
 
Informe laboratorio n°1
Informe laboratorio n°1Informe laboratorio n°1
Informe laboratorio n°1luisescobedo38
 
Statistical inference formulasheet
Statistical inference formulasheetStatistical inference formulasheet
Statistical inference formulasheetPimsat University
 
Finite elements : basis functions
Finite elements : basis functionsFinite elements : basis functions
Finite elements : basis functionsTarun Gehlot
 
Computer Graphics Lab File C Programs
Computer Graphics Lab File C ProgramsComputer Graphics Lab File C Programs
Computer Graphics Lab File C ProgramsKandarp Tiwari
 

Similar to Codecomparaison (20)

Algorithm Design and Analysis - Practical File
Algorithm Design and Analysis - Practical FileAlgorithm Design and Analysis - Practical File
Algorithm Design and Analysis - Practical File
 
Cs580
Cs580Cs580
Cs580
 
Open GL T0074 56 sm4
Open GL T0074 56 sm4Open GL T0074 56 sm4
Open GL T0074 56 sm4
 
Simple Neural Network Python Code
Simple Neural Network Python CodeSimple Neural Network Python Code
Simple Neural Network Python Code
 
SCIPY-SYMPY.pdf
SCIPY-SYMPY.pdfSCIPY-SYMPY.pdf
SCIPY-SYMPY.pdf
 
SPDE presentation 2012
SPDE presentation 2012SPDE presentation 2012
SPDE presentation 2012
 
curve fitting lecture slides February 24
curve fitting lecture slides February 24curve fitting lecture slides February 24
curve fitting lecture slides February 24
 
PROBABILITY DISTRIBUTION
PROBABILITY DISTRIBUTIONPROBABILITY DISTRIBUTION
PROBABILITY DISTRIBUTION
 
When running the code below I am getting some errors (see image)- The.docx
When running the code below I am getting some errors (see image)- The.docxWhen running the code below I am getting some errors (see image)- The.docx
When running the code below I am getting some errors (see image)- The.docx
 
Numerical Method Assignment
Numerical Method AssignmentNumerical Method Assignment
Numerical Method Assignment
 
Rasterisation of a circle by the bresenham algorithm
Rasterisation of a circle by the bresenham algorithmRasterisation of a circle by the bresenham algorithm
Rasterisation of a circle by the bresenham algorithm
 
Rasterisation of a circle by the bresenham algorithm
Rasterisation of a circle by the bresenham algorithmRasterisation of a circle by the bresenham algorithm
Rasterisation of a circle by the bresenham algorithm
 
Computer Aided Manufacturing Design
Computer Aided Manufacturing DesignComputer Aided Manufacturing Design
Computer Aided Manufacturing Design
 
Tutorial on convolutional neural networks
Tutorial on convolutional neural networksTutorial on convolutional neural networks
Tutorial on convolutional neural networks
 
5.n nmodels i
5.n nmodels i5.n nmodels i
5.n nmodels i
 
Practicle 1.docx
Practicle 1.docxPracticle 1.docx
Practicle 1.docx
 
Informe laboratorio n°1
Informe laboratorio n°1Informe laboratorio n°1
Informe laboratorio n°1
 
Statistical inference formulasheet
Statistical inference formulasheetStatistical inference formulasheet
Statistical inference formulasheet
 
Finite elements : basis functions
Finite elements : basis functionsFinite elements : basis functions
Finite elements : basis functions
 
Computer Graphics Lab File C Programs
Computer Graphics Lab File C ProgramsComputer Graphics Lab File C Programs
Computer Graphics Lab File C Programs
 

Recently uploaded

定制(CC毕业证书)美国美国社区大学毕业证成绩单原版一比一
定制(CC毕业证书)美国美国社区大学毕业证成绩单原版一比一定制(CC毕业证书)美国美国社区大学毕业证成绩单原版一比一
定制(CC毕业证书)美国美国社区大学毕业证成绩单原版一比一3sw2qly1
 
✂️ 👅 Independent Andheri Escorts With Room Vashi Call Girls 💃 9004004663
✂️ 👅 Independent Andheri Escorts With Room Vashi Call Girls 💃 9004004663✂️ 👅 Independent Andheri Escorts With Room Vashi Call Girls 💃 9004004663
✂️ 👅 Independent Andheri Escorts With Room Vashi Call Girls 💃 9004004663Call Girls Mumbai
 
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
 
A Good Girl's Guide to Murder (A Good Girl's Guide to Murder, #1)
A Good Girl's Guide to Murder (A Good Girl's Guide to Murder, #1)A Good Girl's Guide to Murder (A Good Girl's Guide to Murder, #1)
A Good Girl's Guide to Murder (A Good Girl's Guide to Murder, #1)Christopher H Felton
 
Complet Documnetation for Smart Assistant Application for Disabled Person
Complet Documnetation   for Smart Assistant Application for Disabled PersonComplet Documnetation   for Smart Assistant Application for Disabled Person
Complet Documnetation for Smart Assistant Application for Disabled Personfurqan222004
 
Call Girls in East Of Kailash 9711199171 Delhi Enjoy Call Girls With Our Escorts
Call Girls in East Of Kailash 9711199171 Delhi Enjoy Call Girls With Our EscortsCall Girls in East Of Kailash 9711199171 Delhi Enjoy Call Girls With Our Escorts
Call Girls in East Of Kailash 9711199171 Delhi Enjoy Call Girls With Our Escortsindian call girls near you
 
Call Girls in Uttam Nagar Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Uttam Nagar Delhi 💯Call Us 🔝8264348440🔝Call Girls in Uttam Nagar Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Uttam Nagar Delhi 💯Call Us 🔝8264348440🔝soniya singh
 
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
 
Low Rate Call Girls Kolkata Avani 🤌 8250192130 🚀 Vip Call Girls Kolkata
Low Rate Call Girls Kolkata Avani 🤌  8250192130 🚀 Vip Call Girls KolkataLow Rate Call Girls Kolkata Avani 🤌  8250192130 🚀 Vip Call Girls Kolkata
Low Rate Call Girls Kolkata Avani 🤌 8250192130 🚀 Vip Call Girls Kolkataanamikaraghav4
 
VIP Call Girls Pune Madhuri 8617697112 Independent Escort Service Pune
VIP Call Girls Pune Madhuri 8617697112 Independent Escort Service PuneVIP Call Girls Pune Madhuri 8617697112 Independent Escort Service Pune
VIP Call Girls Pune Madhuri 8617697112 Independent Escort Service PuneCall girls in Ahmedabad High profile
 
Russian Call Girls Thane Swara 8617697112 Independent Escort Service Thane
Russian Call Girls Thane Swara 8617697112 Independent Escort Service ThaneRussian Call Girls Thane Swara 8617697112 Independent Escort Service Thane
Russian Call Girls Thane Swara 8617697112 Independent Escort Service ThaneCall girls in Ahmedabad High profile
 
Russian Call girls in Dubai +971563133746 Dubai Call girls
Russian  Call girls in Dubai +971563133746 Dubai  Call girlsRussian  Call girls in Dubai +971563133746 Dubai  Call girls
Russian Call girls in Dubai +971563133746 Dubai Call girlsstephieert
 
VIP Call Girls Kolkata Ananya 🤌 8250192130 🚀 Vip Call Girls Kolkata
VIP Call Girls Kolkata Ananya 🤌  8250192130 🚀 Vip Call Girls KolkataVIP Call Girls Kolkata Ananya 🤌  8250192130 🚀 Vip Call Girls Kolkata
VIP Call Girls Kolkata Ananya 🤌 8250192130 🚀 Vip Call Girls Kolkataanamikaraghav4
 
Call Girls South Delhi Delhi reach out to us at ☎ 9711199012
Call Girls South Delhi Delhi reach out to us at ☎ 9711199012Call Girls South Delhi Delhi reach out to us at ☎ 9711199012
Call Girls South Delhi Delhi reach out to us at ☎ 9711199012rehmti665
 
Networking in the Penumbra presented by Geoff Huston at NZNOG
Networking in the Penumbra presented by Geoff Huston at NZNOGNetworking in the Penumbra presented by Geoff Huston at NZNOG
Networking in the Penumbra presented by Geoff Huston at NZNOGAPNIC
 
Best VIP Call Girls Noida Sector 75 Call Me: 8448380779
Best VIP Call Girls Noida Sector 75 Call Me: 8448380779Best VIP Call Girls Noida Sector 75 Call Me: 8448380779
Best VIP Call Girls Noida Sector 75 Call Me: 8448380779Delhi Call girls
 
On Starlink, presented by Geoff Huston at NZNOG 2024
On Starlink, presented by Geoff Huston at NZNOG 2024On Starlink, presented by Geoff Huston at NZNOG 2024
On Starlink, presented by Geoff Huston at NZNOG 2024APNIC
 

Recently uploaded (20)

Call Girls In South Ex 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SERVICE
Call Girls In South Ex 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SERVICECall Girls In South Ex 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SERVICE
Call Girls In South Ex 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SERVICE
 
定制(CC毕业证书)美国美国社区大学毕业证成绩单原版一比一
定制(CC毕业证书)美国美国社区大学毕业证成绩单原版一比一定制(CC毕业证书)美国美国社区大学毕业证成绩单原版一比一
定制(CC毕业证书)美国美国社区大学毕业证成绩单原版一比一
 
✂️ 👅 Independent Andheri Escorts With Room Vashi Call Girls 💃 9004004663
✂️ 👅 Independent Andheri Escorts With Room Vashi Call Girls 💃 9004004663✂️ 👅 Independent Andheri Escorts With Room Vashi Call Girls 💃 9004004663
✂️ 👅 Independent Andheri Escorts With Room Vashi Call Girls 💃 9004004663
 
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...
 
Vip Call Girls Aerocity ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Aerocity ➡️ Delhi ➡️ 9999965857 No Advance 24HRS LiveVip Call Girls Aerocity ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Aerocity ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
 
A Good Girl's Guide to Murder (A Good Girl's Guide to Murder, #1)
A Good Girl's Guide to Murder (A Good Girl's Guide to Murder, #1)A Good Girl's Guide to Murder (A Good Girl's Guide to Murder, #1)
A Good Girl's Guide to Murder (A Good Girl's Guide to Murder, #1)
 
Complet Documnetation for Smart Assistant Application for Disabled Person
Complet Documnetation   for Smart Assistant Application for Disabled PersonComplet Documnetation   for Smart Assistant Application for Disabled Person
Complet Documnetation for Smart Assistant Application for Disabled Person
 
Call Girls in East Of Kailash 9711199171 Delhi Enjoy Call Girls With Our Escorts
Call Girls in East Of Kailash 9711199171 Delhi Enjoy Call Girls With Our EscortsCall Girls in East Of Kailash 9711199171 Delhi Enjoy Call Girls With Our Escorts
Call Girls in East Of Kailash 9711199171 Delhi Enjoy Call Girls With Our Escorts
 
Call Girls in Uttam Nagar Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Uttam Nagar Delhi 💯Call Us 🔝8264348440🔝Call Girls in Uttam Nagar Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Uttam Nagar Delhi 💯Call Us 🔝8264348440🔝
 
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
 
Low Rate Call Girls Kolkata Avani 🤌 8250192130 🚀 Vip Call Girls Kolkata
Low Rate Call Girls Kolkata Avani 🤌  8250192130 🚀 Vip Call Girls KolkataLow Rate Call Girls Kolkata Avani 🤌  8250192130 🚀 Vip Call Girls Kolkata
Low Rate Call Girls Kolkata Avani 🤌 8250192130 🚀 Vip Call Girls Kolkata
 
Model Call Girl in Jamuna Vihar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in  Jamuna Vihar Delhi reach out to us at 🔝9953056974🔝Model Call Girl in  Jamuna Vihar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Jamuna Vihar Delhi reach out to us at 🔝9953056974🔝
 
VIP Call Girls Pune Madhuri 8617697112 Independent Escort Service Pune
VIP Call Girls Pune Madhuri 8617697112 Independent Escort Service PuneVIP Call Girls Pune Madhuri 8617697112 Independent Escort Service Pune
VIP Call Girls Pune Madhuri 8617697112 Independent Escort Service Pune
 
Russian Call Girls Thane Swara 8617697112 Independent Escort Service Thane
Russian Call Girls Thane Swara 8617697112 Independent Escort Service ThaneRussian Call Girls Thane Swara 8617697112 Independent Escort Service Thane
Russian Call Girls Thane Swara 8617697112 Independent Escort Service Thane
 
Russian Call girls in Dubai +971563133746 Dubai Call girls
Russian  Call girls in Dubai +971563133746 Dubai  Call girlsRussian  Call girls in Dubai +971563133746 Dubai  Call girls
Russian Call girls in Dubai +971563133746 Dubai Call girls
 
VIP Call Girls Kolkata Ananya 🤌 8250192130 🚀 Vip Call Girls Kolkata
VIP Call Girls Kolkata Ananya 🤌  8250192130 🚀 Vip Call Girls KolkataVIP Call Girls Kolkata Ananya 🤌  8250192130 🚀 Vip Call Girls Kolkata
VIP Call Girls Kolkata Ananya 🤌 8250192130 🚀 Vip Call Girls Kolkata
 
Call Girls South Delhi Delhi reach out to us at ☎ 9711199012
Call Girls South Delhi Delhi reach out to us at ☎ 9711199012Call Girls South Delhi Delhi reach out to us at ☎ 9711199012
Call Girls South Delhi Delhi reach out to us at ☎ 9711199012
 
Networking in the Penumbra presented by Geoff Huston at NZNOG
Networking in the Penumbra presented by Geoff Huston at NZNOGNetworking in the Penumbra presented by Geoff Huston at NZNOG
Networking in the Penumbra presented by Geoff Huston at NZNOG
 
Best VIP Call Girls Noida Sector 75 Call Me: 8448380779
Best VIP Call Girls Noida Sector 75 Call Me: 8448380779Best VIP Call Girls Noida Sector 75 Call Me: 8448380779
Best VIP Call Girls Noida Sector 75 Call Me: 8448380779
 
On Starlink, presented by Geoff Huston at NZNOG 2024
On Starlink, presented by Geoff Huston at NZNOG 2024On Starlink, presented by Geoff Huston at NZNOG 2024
On Starlink, presented by Geoff Huston at NZNOG 2024
 

Codecomparaison

  • 1. import matplotlib.pyplot as plt import numpy as np from scipy.stats import norm,binom,poisson,uniform,expon from math import sqrt,exp from scipy.integrate import quad def uni2(n,N,s): x1,x2 = 0,0 for i in range(N): if s[i]>= (n+sqrt(n))/2: #P(X >= n+sqrt(n))/2) x1 += 1 x2 = x1/N return x2 def uni(n,N,s): x3,x4 = 0,0, for i in range(N): if np.abs(s[i]-u)>= sqrt(n)/2: x3 += 1 x4=x3/N return x4 def uni3(n,N,s,x): x5,x6=0,0 for i in range(N): if np.abs(s[i]-u)>= x*sqrt(n): x5+=1 x6=x5/N return x6 def chebyshev(u,sigma,n): return sigma/((sqrt(n))/2)**2 chebylist=[] def markov(u,n): return u/((n+sqrt(n))/2) markovlist=[] def chernoff(v,n,t): return v/exp(t*((n+sqrt(n))/2)) chernofflist = [] def hoeffding(x): return 2*exp(-x**2) def chebyshev2(p,x): return p*(1-p)/x**2
  • 2. ###### X suit B(n,1/2) N= 100 p=0.5 t=0.5 x= 1 xlist = np.arange(0.5,100,0.1) binom1=[] binom2=[] binom3=[] chernofflist = [] chebylist=[] chebylist2=[] markovlist=[] hoeffdinglist=[] for n in xlist: u=n*p s = np.random.binomial(n,p,N) sigma = n*p*(1-p) v = (exp(t)*p + (1-p))**n binom1.append(uni(n,N,s)) binom2.append(uni2(n,N,s)) binom3.append(uni3(n,N,s,x)) chebylist.append(chebyshev(u,sigma,n)) markovlist.append(markov(u,n)) chernofflist.append(chernoff(v,n,t)) hoeffdinglist.append(hoeffding(x)) chebylist2.append(chebyshev2(p,x)) plt.plot(xlist,binom1,label='P(|X- 'r'$frac {n}{2}| geqslantfrac {sqrt{n}} {2})$') plt.plot(xlist,chebylist,label = 'Chebyshev') plt.xlabel('n') plt.ylabel('Probabilité') plt.legend() plt.show() ###############Chebyshev = 1 inutile et on remarque numériquement que : P(|X-n/2|⩾√n/2)⩽1/2 ########*Chernoff et markov loin d'être optimaux et on remarque numériquement que : P(X⩾(n+√n)/2)⩽1/4 plt.plot(xlist,binom2,label='P(X'r'$ geqslant frac {n+sqrt{n}} {2})$') plt.plot(xlist,chernofflist, label = 'Chernoff') plt.plot(xlist,markovlist,label = 'Markov')
  • 3. plt.xlabel('n') plt.ylabel('Probabilité') plt.ylim(ymax=1) plt.legend() plt.show() ############## ### P(|X- n/2|⩾x√n)⩽p(1−p)/x²: Chebyshev ###P(|X- n/2|⩾x√n)⩽2exp(−2x²): Hoeffding plt.plot(xlist,binom3,label='P(|X- 'r'$frac {n}{2}| geqslant xsqrt{n})$' ) plt.plot(xlist,hoeffdinglist,label = 'Hoeffding') plt.plot(xlist,chebylist2,label = 'Chebyshev') plt.xlabel('n') plt.ylabel('P(|X- 'r'$frac {n}{2}| geqslant xsqrt{n})$') plt.legend() plt.show() ####### Comparaison Chebyshev et Hoeffding en fonction de x blist = np.arange(0.5,10,0.1) chebylist3=[] hoeffdinglist2=[] for x in blist : hoeffdinglist2.append(hoeffding(x)) chebylist3.append(chebyshev2(p,x)) plt.plot(blist,hoeffdinglist2,label = 'Hoeffding') plt.plot(blist,chebylist3,label = 'Chebyshev') plt.xlabel('x') plt.legend() plt.show()