Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Education > Math Recreational > Re: Looking for...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 2 of 4 Topic 2779 of 2885
Post > Topic >>

Re: Looking for I don't know what to call it

by magidin@[EMAIL PROTECTED] (Arturo Magidin) May 12, 2008 at 03:41 PM

In article <PMKdnewsJbCz_bXVnZ2dnUVZ_tTinZ2d@[EMAIL PROTECTED]
>,
Jeff Dege  <jdege@[EMAIL PROTECTED]
> wrote:
>I'm looking for a way to generate all of the possible complete partitions

>of a string.
>
>That is, if I have a string "ABCD", I want to generate the list:
>
>"ABCD"
>"ABC" "D"
>"AB" "CD"
>"AB" "C" "D"
>"A" "BCD"
>"A" "BC" "D"
>"A" "B" "CD"
>"A" "B" "C" "D"

This is the same as the problem of "picking" some (or all) of the
spaces "in between" the letters. So the problem is isomorphic to the
problem of generating all possible subsets of the set {1,...,n-1},
where the string has n letters. For instance, your first string
corresponds to the empty subset of {1,2,3}, the second to {3} (only
the third inter-letter space is chosen), then {2}, {2,3}, {1}, {1,3},
{1,2}, and finally {1,2,3}.

You will probably find it treated under that guise.

--
======================================================================
"It's not denial. I'm just very selective about
 what I accept as reality."
    --- Calvin ("Calvin and Hobbes" by Bill Watterson)
======================================================================

Arturo Magidin
magidin-at-member-ams-org
 




 4 Posts in Topic:
Looking for I don't know what to call it
Jeff Dege <jdege@[EMAI  2008-05-12 10:20:14 
Re: Looking for I don't know what to call it
magidin@[EMAIL PROTECTED]  2008-05-12 15:41:11 
Re: Looking for I don't know what to call it
Jeff Dege <jdege@[EMAI  2008-05-12 11:00:09 
Re: Looking for I don't know what to call it
Mensanator <mensanator  2008-05-12 12:25:19 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Sat Oct 11 22:31:50 CDT 2008.