From: Stanimir Peev
Subject: Combination Algorithm
Date: 
Message-ID: <3905a2d3@pcs-gw.customer.0rbitel.net>
Hi,
if I wan't to generate & print out  all combinations of N elements,
each combination K elements long, how can I do it , in the simplest
posible way in Lisp.( I really need the simplest algorithm, not the most
efficient )

10x in advance for bothering to answer this question.

Stanimir Peev

From: Christopher Browne
Subject: Re: Combination Algorithm
Date: 
Message-ID: <slrn8gb94p.3oj.cbbrowne@knuth.brownes.org>
Centuries ago, Nostradamus foresaw a time when Stanimir Peev would say:
>if I wan't to generate & print out  all combinations of N elements,
>each combination K elements long, how can I do it , in the simplest
>posible way in Lisp.( I really need the simplest algorithm, not the most
>efficient )
>
>10x in advance for bothering to answer this question.

When is the assignment due?  And what is the email address of the
instructor?  My preference would be to submit the solution directly to
ensure proper attribution of academic credit.
-- 
Rules of the Evil Overlord #69. "The deformed mutants and odd-ball
psychotics will have their place in my Legions of Terror. However
before I send them out on important covert missions that require tact
and subtlety, I will first see if there is anyone else equally
qualified who would attract less attention." 
<http://www.eviloverlord.com/lists/overlord.html>
········@hex.net - - <http://www.hex.net/~cbbrowne/lisp.html>
From: Ian Wild
Subject: Re: Combination Algorithm
Date: 
Message-ID: <3905A8F1.65CD8935@cfmu.eurocontrol.be>
Stanimir Peev wrote:
> 
> Hi,
> if I wan't to generate & print out  all combinations of N elements,
> each combination K elements long, how can I do it , in the simplest
> posible way in Lisp.( I really need the simplest algorithm, not the most
> efficient )

This is simple, and "not the most efficient":
Print all the permutations of N elements, and
pipe the output through "cut -f" and "sort -u".