MathGroup Archive 2011

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

Search the Archive

Re: How to create such a list

  • To: mathgroup at smc.vnet.net
  • Subject: [mg118478] Re: How to create such a list
  • From: Mala Jozsef <mala_jozsef at freemail.hu>
  • Date: Fri, 29 Apr 2011 07:32:44 -0400 (EDT)

In[22]:= n=5;
s=Subsets[Range[n]];
Total[Map[w,s,{2}],{2}]  Out[24]={0,w[1],w[2],w[3],w[4],w[5],w[1]+w[2],w[1]+w[3],w[1]+w[4],w[1]+w[5],w[2]+w[3],w[2]+w[4],w[2]+w[5],w[3]+w[4],w[3]+w[5],w[4]+w[5],w[1]+w[2]+w[3],w[1]+w[2]+w[4],w[1]+w[2]+w[5],w[1]+w[3]+w[4],w[1]+w[3]+w[5],w[1]+w[4]+w[5],w[2]+w[3]+w[4],w[2]+w[3]+w[5],w[2]+w[4]+w[5],w[3]+w[4]+w[5],w[1]+w[2]+w[3]+w[4],w[1]+w[2]+w[3]+w[5],w[1]+w[2]+w[4]+w[5],w[1]+w[3]+w[4]+w[5],w[2]+w[3]+w[4]+w[5],w[1]+w[2]+w[3]+w[4]+w[5]}
  
Dominic Woerner <dominic.woerner at mpi-hd.mpg.de> =EDrta:
>Hi,
>
>I like to create a list of the form:
>0,w[1],...,w[n],w[1]+w[2],...,w[1]+w[n],w[2]+w[3],......,w[1]+...+w[n]
>for arbitrary n
>Is there a neat way to do this?
>
>Cheers,
>Dominic
>


  • Prev by Date: Solve / Reduce isolating results.
  • Next by Date: Re: MachinePrecision vs. Arbitrary Precision
  • Previous by thread: Re: How to create such a list
  • Next by thread: Re: How to create such a list