Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.math.mathematica

Topic: List help needed
Replies: 2   Last Post: Oct 30, 1996 12:21 AM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
John Rowney

Posts: 2
Registered: 12/11/04
List help needed
Posted: Oct 25, 1996 10:21 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

Hi,

I need a little help with lists. What I would like to do is the
following:

From a list of length N, construct all possible lists of length n<N from
N by combining adjacent elements of the original list into sub lists.
This might become clearer with an example.

Given {a,b,c,d,e} of length 5, ALL possible length 4 lists subject to
the conditions above are:

{{a,b},c,d,e}, {a,{b,c},d,e}, {a,b,{c,d},e} and {a,b,c,{d,e}}

two of the possible length 3 lists are

{a,{b,c,d},e} and {{a,b},c,{d,e}}

I hope you get the picture.

In the "real" problem, N would be around 20 and n would be around 10.

Thanks in advance


John
jrowney@arco.com







Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.