Scilab 5.3.0
- Scilab Online Help
- Elementary Functions
- Discrete mathematics
- Floating point
- Integer representation
- Trigonometry
- abs
- amell
- and
- &
- binomial
- bitand
- bitor
- bloc2exp
- bloc2ss
- cat
- cell2mat
- cellstr
- char
- cumprod
- cumsum
- delip
- diag
- diff
- dsearch
- exp
- eye
- flipdim
- gsort
- imag
- imult
- ind2sub
- intersect
- inttrap
- isdef
- isempty
- isequal
- isequalbitwise
- isreal
- isvector
- kron
- lex_sort
- linspace
- log
- log10
- log1p
- log2
- logm
- logspace
- lstsize
- max
- maxi
- meshgrid
- min
- mini
- modulo
- ndgrid
- ndims
- nextpow2
- norm
- ones
- or
- |
- pen2ea
- permute
- pertrans
- prod
- rand
- real
- resize_matrix
- setdiff
- sign
- signm
- size
- solve
- sort
- sqrt
- sqrtm
- squarewave
- ssrand
- sub2ind
- sum
- sysconv
- sysdiag
- syslin
- toeplitz
- trfmod
- trianfml
- tril
- trisolve
- triu
- typeof
- union
- unique
- vectorfind
- zeros
Please note that the recommended version of Scilab is 2025.0.0. This page might be outdated.
See the recommended documentation of this function
binomial
2項分布確率
呼び出し手順
pr=binomial(p,n)
パラメータ
- pr
n+1 個の要素の行ベクトル
- p
[0,1]の範囲の実数
- n
整数 >= 1
説明
pr=binomial(p,n)
は,
二項分布確率ベクトルを返します.
これは,
pr(k+1)
が n
回の成功率p
の独立ベルヌーイ試行において
k
回成功する確率となる分布です.
言い換えると,,
XをB(n,p)分布に従うランダム変数とする時の
pr(k+1) = probability(X=k)
で,
数値的には以下のようになります :
例
// first example n=10;p=0.3; clf(); plot2d3(0:n,binomial(p,n)); // second example n=50;p=0.4; mea=n*p; sigma=sqrt(n*p*(1-p)); x=( (0:n)-mea )/sigma; clf() plot2d(x, sigma*binomial(p,n)); deff('y=Gauss(x)','y=1/sqrt(2*%pi)*exp(-(x.^2)/2)') plot2d(x, Gauss(x), style=2); // by binomial formula (Caution if big n) function pr=binomial2(p, n) x=poly(0,'x');pr=coeff((1-p+x)^n).*horner(x^(0:n),p); endfunction p=1/3;n=5; binomial(p,n)-binomial2(p,n) // by Gamma function: gamma(n+1)=n! (Caution if big n) p=1/3;n=5; Cnks=gamma(n+1)./(gamma(1:n+1).*gamma(n+1:-1:1)); x=poly(0,'x'); pr=Cnks.*horner(x.^(0:n).*(1-x)^(n:-1:0),p); pr-binomial(p,n)
<< & | Elementary Functions | bitand >> |