Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!cornell!rochester!rutgers!att!ihlpl!canoura From: canoura@ihlpl.ATT.COM (jlcanoura) Newsgroups: comp.lang.lisp Subject: lisp problem Keywords: help Message-ID: <10053@ihlpl.ATT.COM> Date: 10 Apr 89 23:57:11 GMT Organization: AT&T Bell Laboratories - Naperville, Illinois Lines: 27 PLEASE, does anybody know how to solve this problem in LISP. By using recursion and the Append function, Given a list of nondistinct elements and a positive number K where K is <= the size of the list, I need to write a function which returns a list, the element of whose are the combinations of the element of the given list taken K at a time. e.g.(COMB '(n1 n2 ....n) K) Examples. ( COMB is the name of the function) (COMB '(1 2 3 ) 2) should return ((1 2) (1 3) (2 3)) (COMB '(1 2 3) 3) should return ((1 2 3)) (COMB '(1 2 3) 1) should return ((1) (2) (3)) etc. any help will be apreciated. ihlpl!canoura