The following warnings occurred:
Warning [2] count(): Parameter must be an array or an object that implements Countable - Line: 795 - File: showthread.php PHP 7.4.33 (FreeBSD)
File Line Function
/showthread.php 795 errorHandler->error





Post Reply 
Sum of subset products
01-26-2014, 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 (n-1) element subsets of an n-element 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-
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
Sum of subset products - Joe Horn - 01-26-2014 09:14 AM
RE: Sum of subset products - Joe Horn - 01-26-2014, 10:03 AM



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