MathGroup Archive 2012

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Sum of Products

  • To: mathgroup at smc.vnet.net
  • Subject: [mg126674] Re: Sum of Products
  • From: Bob Hanlon <hanlonr357 at gmail.com>
  • Date: Wed, 30 May 2012 04:11:26 -0400 (EDT)
  • Delivered-to: l-mathgroup@mail-archive0.wolfram.com
  • References: <201205290948.FAA06747@smc.vnet.net>

SymmetricPolynomial, for example,

SymmetricPolynomial[2, {a, b, c}] ==
  Total[Times @@@ Subsets[{a, b, c}, {2}]] // Simplify

True


SymmetricPolynomial[2, {a, b, c, d}] ==
  Total[Times @@@ Subsets[{a, b, c, d}, {2}]] // Simplify

True


SymmetricPolynomial[4, {a, b, c, d, e, f}] ==
  Total[Times @@@ Subsets[{a, b, c, d, e, f}, {4}]] // Simplify

True


Bob Hanlon


On Tue, May 29, 2012 at 5:48 AM, Harvey P. Dale <hpd1 at nyu.edu> wrote:
>        If I have a list and want to sum the products of each possible
> grouping of two elements in the list, this program will do that:
>
>                Total[Times @@@ Subsets[{a, b, c}, {2}]]
>
> Is there any other, shorter, built-in Mathematica object that will
> produce the same result?
>
>        Thanks.
>
>        Harvey



  • Prev by Date: I can not find all the contexts through the command "Contexts[]".
  • Next by Date: How to add axis labels in bubblechart?
  • Previous by thread: Sum of Products
  • Next by thread: Re: Sum of Products