Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.soft-sys.math.mathematica > #1984
| From | Mala Jozsef <mala_jozsef@freemail.hu> |
|---|---|
| Newsgroups | comp.soft-sys.math.mathematica |
| Subject | Re: How to create such a list |
| Date | 2011-04-29 11:32 +0000 |
| Organization | Steven M. Christensen and Associates, Inc and MathTensor, Inc. |
| Message-ID | <ipe7kj$r01$1@smc.vnet.net> (permalink) |
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@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
>
Back to comp.soft-sys.math.mathematica | Previous | Next | Find similar | Unroll thread
Re: How to create such a list Mala Jozsef <mala_jozsef@freemail.hu> - 2011-04-29 11:32 +0000
csiph-web