±Û¾´ÀÌ: dskim (dskim)
³¯ Â¥: Wed Mar 11 13:11:03 1998
Á¦ ¸ñ: qbin
# Modified on Nov. 30, 1996.
# Note that qbin is different from binomial for k<0 or n<0.
#qbin(n,k) or qbin(n,k,q):
qbin:=proc(n,k) local i, x;
if nargs=3 then x:=args[3] else x:='q' fi;
if nargs<2 or nargs>3 then ERROR(`usage: qbin(n,k) or qbin(n,k,q)`) fi;
if not (type(n,integer) and type(k,integer)) then RETURN('procname(args)') fi;
if k>0 and n>=k then product(1-x^(n+1-i),i=1..k)/product(1-x^i,i=1..k)
elif k=0 and n>=0 then 1 else 0 fi; sort(normal(")); end: