CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Beginner: Re: [histrung] n Choose k: Edit Log



perlfarmer
User

Feb 1, 2012, 3:06 PM


Views: 1476
Re: [histrung] n Choose k

Thanks. But what I need is a way to extract all of the combinations from a set and, say, print them as opposed to just counting them. For example:


Code
nCk(4, 3, (e1, e2, e3, e4))


would return:


Code
(e1, e2, e3), (e1, e2, e4), (e1, e3, e4), (e2, e3, e4)


Regards.


(This post was edited by perlfarmer on Feb 1, 2012, 3:11 PM)


Edit Log:
Post edited by perlfarmer (User) on Feb 1, 2012, 3:11 PM


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives