zero value in beronoulli trials !!!
Show older comments
Hi sir,I want to know,why some values in my program equal to zero
This is my program
N=10;
P=0.5;
for K=0:N;
format long e
M =exp((P)^K*((1-P)^N-K)*(factorial(N)/factorial(K)*factorial(N-K)))
display(M)
end
Thanks in advance
Accepted Answer
More Answers (2)
Oleg Komarov
on 10 Apr 2011
Some other parenthesis mistakes corrected:
N=10;
P=0.5;
K=0:N;
M =exp(P.^K.*(1-P).^(N-K).*factorial(N)./(factorial(K).*factorial(N-K)))
Categories
Find more on MATLAB in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!