% file name: binomial_prob.m
% the program asks the user to enter the values
% of N and k and returns p(k).
%
% created Jan. 18, 2000, F. Elguibaly
%
N = input('Enter the value of N please:');
K = input('Enter the value of K please: ');
p = input('Enter the value of p please: ');
q = 1 - p;
probability = nchoosek(N,K) * p^K * q^(N-K)

 


Go back to book Homepage Go back to book's matlab Homepage Go back to book's Chapter 1 Homepage

Copyright © 2001 Northstar Digital Design, Inc.