Data update
This commit is contained in:
parent
72eb4943cb
commit
4d5544505c
2347 changed files with 62432 additions and 16731 deletions
|
|
@ -0,0 +1,29 @@
|
|||
for n = 0 to 14
|
||||
for k = 0 to n
|
||||
print rjust(binomial(n, k), 5);
|
||||
next k
|
||||
print
|
||||
next n
|
||||
end
|
||||
|
||||
function factorial(n)
|
||||
if n < 1 then return 1
|
||||
|
||||
product = 1
|
||||
for i = 2 to n
|
||||
product *= i
|
||||
next
|
||||
|
||||
return product
|
||||
end function
|
||||
|
||||
function binomial(n, k)
|
||||
if n < 0 or k < 0 or n <= k then return 1
|
||||
|
||||
product = 1
|
||||
for i = n - k + 1 to n
|
||||
product *= i
|
||||
next
|
||||
|
||||
return int(product / factorial(k))
|
||||
end function
|
||||
Loading…
Add table
Add a link
Reference in a new issue