Sum of subset products

01262014, 09:14 AM
Post: #1




Sum of subset products
I hope somebody here can think of an elegant way of calculating the sum of the products of all the (n1) element subsets of an nelement set in PPL. In other words:
{A B} > A+B {A B C} > AB+AC+BC {A B C D} > ABC+ABD+ACD+BCD etc. Brute force by looping is ... brutish. There must be an elegant way of doing this on the HP Prime, since it has so many list and array functions. Thanks in advance! <0ɸ0> Joe 

01262014, 10:03 AM
Post: #2




RE: Sum of subset products
Found it: SumList(PiList(list)/list)). I'll write this up for a more accurate "parallel resistors" program in the Prime Program Library.
<0ɸ0> Joe 

« Next Oldest  Next Newest »

User(s) browsing this thread: 1 Guest(s)