Binomial: Unterschied zwischen den Versionen

Aus Augenbit
Wechseln zu: Navigation, Suche
 
(Binomialverteilung)
 
Zeile 4: Zeile 4:
 
== Binomialverteilung ==
 
== Binomialverteilung ==
 
> B:= proc (n, p, k)
 
> B:= proc (n, p, k)
 +
 
>      binomial(n,k) * p^k * (1-p)^(n-k):
 
>      binomial(n,k) * p^k * (1-p)^(n-k):
 +
 
>    end;
 
>    end;
>
+
 
 
>  
 
>  
 
B := proc (n, p, k) binomial(n,k)*p^k*(1-p)^(n-k) end proc
 
B := proc (n, p, k) binomial(n,k)*p^k*(1-p)^(n-k) end proc
 +
 
> n:= 10:
 
> n:= 10:
> p:= 0.4:  
+
 
>
+
> p:= 0.4:  
 +
 
 
> seq ([k,B (n, p, k)], k = 0..n);
 
> seq ([k,B (n, p, k)], k = 0..n);
 +
 
[0, .60466176e-2], [1, .403107840e-1], [2, .1209323520], [3, .2149908480], [4, .2508226560], [5, .2006581248], [6, .1114767360], [7, .424673280e-1], [8, .106168320e-1], [9, .15728640e-2], [10, .1048576e-3]
 
[0, .60466176e-2], [1, .403107840e-1], [2, .1209323520], [3, .2149908480], [4, .2508226560], [5, .2006581248], [6, .1114767360], [7, .424673280e-1], [8, .106168320e-1], [9, .15728640e-2], [10, .1048576e-3]
> 11!;
 
>
 
39916800
 
>
 

Aktuelle Version vom 2. Oktober 2007, 16:02 Uhr

Binomialkoeffizient

> binomial(n,k);

Binomialverteilung

> B:= proc (n, p, k)

> binomial(n,k) * p^k * (1-p)^(n-k):

> end;

> B := proc (n, p, k) binomial(n,k)*p^k*(1-p)^(n-k) end proc

> n:= 10:

> p:= 0.4:

> seq ([k,B (n, p, k)], k = 0..n);

[0, .60466176e-2], [1, .403107840e-1], [2, .1209323520], [3, .2149908480], [4, .2508226560], [5, .2006581248], [6, .1114767360], [7, .424673280e-1], [8, .106168320e-1], [9, .15728640e-2], [10, .1048576e-3]