Poissonfordeling.
Figuren viser tæthedsfunktionen for Poisson-fordelingen. Du kan variere på parameteren λ. Læg mærke til, hvordan kurven ændrer sig.
Læg også mærke til, hvordan den approksimerende normalfordeling er tæt på Poisson-fordelingen for store λ.
Figure figure = Position [0,0] Size[x,y*6/7] Origin[x/12,y*3/4] Unit x/24 Color "white";
Axes axes = Color "black";
Grid grid = Color "blue";
//Units units = Color "black";
Label x5 = "5" At [5,0] Offset [0,15] Color "black";
Label x10 = "10" At [10,0] Offset [0,15] Color "black";
Label x15 = "15" At [15,0] Offset [0,15] Color "black";
Label x20 = "20" At [20,0] Offset [0,15] Color "black";
Label y05 = "0.5" At [0,5] Offset [-30,-5] Color "black";
Label y10 = "1.0" At [0,10] Offset [-30,-5] Color "black";
SlidePot lambda = From 0.1 To 15 Initial 5 Position [20,y-20] Size [300,0];
Text lambda_txt = "λ = lambda,2" Offset [350,y-15] Color "blue";
State normal_on = From 0 To 1 Initial 0;
RadioButton show_normal = Text [ "normalfordeling"; "normalfordeling" ]
Action [ set normal_on 1; set normal_on 0]
Position [450,y-35] Size [130,25];
Variable my = lambda;
Variable sigma = sqrt(lambda);
Function normalfct( Number x, Number sigma, Number my ) =
1/(sigma*sqrt(2*pi))*exp(-.5*((x-my)/sigma)^2);
Function poisson( Number k, Number lambda ) =
lambda^k/k!*exp(-lambda);
Line l0 = Start [0,0] Dir 10*[0,poisson(0,lambda)] Size 5 Color "red";
Line l1 = Start [1,0] Dir 10*[0,poisson(1,lambda)] Size 5 Color "red";
Line l2 = Start [2,0] Dir 10*[0,poisson(2,lambda)] Size 5 Color "red";
Line l3 = Start [3,0] Dir 10*[0,poisson(3,lambda)] Size 5 Color "red";
Line l4 = Start [4,0] Dir 10*[0,poisson(4,lambda)] Size 5 Color "red";
Line l5 = Start [5,0] Dir 10*[0,poisson(5,lambda)] Size 5 Color "red";
Line l6 = Start [6,0] Dir 10*[0,poisson(6,lambda)] Size 5 Color "red";
Line l7 = Start [7,0] Dir 10*[0,poisson(7,lambda)] Size 5 Color "red";
Line l8 = Start [8,0] Dir 10*[0,poisson(8,lambda)] Size 5 Color "red";
Line l9 = Start [9,0] Dir 10*[0,poisson(9,lambda)] Size 5 Color "red";
Line l10 = Start [10,0] Dir 10*[0,poisson(10,lambda)] Size 5 Color "red";
Line l11 = Start [11,0] Dir 10*[0,poisson(11,lambda)] Size 5 Color "red";
Line l12 = Start [12,0] Dir 10*[0,poisson(12,lambda)] Size 5 Color "red";
Line l13 = Start [13,0] Dir 10*[0,poisson(13,lambda)] Size 5 Color "red";
Line l14 = Start [14,0] Dir 10*[0,poisson(14,lambda)] Size 5 Color "red";
Line l15 = Start [15,0] Dir 10*[0,poisson(15,lambda)] Size 5 Color "red";
Line l16 = Start [16,0] Dir 10*[0,poisson(16,lambda)] Size 5 Color "red";
Line l17 = Start [17,0] Dir 10*[0,poisson(17,lambda)] Size 5 Color "red";
Line l18 = Start [18,0] Dir 10*[0,poisson(18,lambda)] Size 5 Color "red";
Line l19 = Start [19,0] Dir 10*[0,poisson(19,lambda)] Size 5 Color "red";
Line l20 = Start [20,0] Dir 10*[0,poisson(20,lambda)] Size 5 Color "red";
Line l21 = Start [21,0] Dir 10*[0,poisson(21,lambda)] Size 5 Color "red";
Line l22 = Start [22,0] Dir 10*[0,poisson(22,lambda)] Size 5 Color "red";
Tex tx1 = "p(k)=\\large{\\frac{\\lambda^k}{k!}e^{-k}}" Offset [320,60] Color "black";
Tex tx2 = "\\mu= \\lambda = " Offset [320,100] Color "black";
Tex tx3 = "\\sigma = \\sqrt{ \\lambda } = " Offset [320,130] Color "black";
Text tx21 = "my,2" Offset [393,115] Color "black" Style "font-size:110%;";
Text tx31 = "sigma,2" Offset [405,148] Color "black" Style "font-size:110%;";
Visibility vis = normal_on == 1;
Graph normalgr = 10*normalfct(x,sigma,my) Size 1.5 Color "black";