Multinomial Coefficient
|
05-15-2015, 08:37 PM
Post: #1
|
|||
|
|||
Multinomial Coefficient
hi all,
two version of a program to calculate Multinomial Coefficient. This program accept an integer for "n" (total of k) and a list with brackets {} for the list of the k (like {1,4,4,2}) and give a integer that represent permutations in a multi set. Enjoy! Salvo Micciché Code:
A version in CAS, without input routine... Code:
This program has a control if user doesn't input 2 arguments (no more, no less), if the second argument is not a list and rounds both arguments, to get integers. Caveat: with this version (#cas program) integer part command -ip()- must be lowercase or ip(k) doesn't works for the list giving wrong results. (Thanks Parisse for hint about the CAS version!) ∫aL√0mic (IT9CLU) :: HP Prime 50g 41CX 71b 42s 39s 35s 12C 15C - DM42, DM41X - WP34s Prime Soft. Lib |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 1 Guest(s)