Combinatorics question ...
Hi, I'm beginer in Lisp programming and I'm trying to write a Lisp version of the function that I managed to code in Haskel using list comprehensions. The function given the list and the number x should return all subsets (without repetitions) of the given list that are exactly x element long - I think it's called variation without repetitions. For example : (variations 2 '(1 2 3)) => ((1 2) (1 3) (2 3)) (variations 1 '(1 2 3)) => ((1) (2) (3)) (variations 3 '(1 2 3)) => ((1 2 3)) (variations 3 '(1 2 3 4)) => ((1 2 3) (1 2 4) (1 3 4) (2 3 4)) and so on... I'm getting confused with mapcar's, mapcan's, maplist's - so can anybody help, event if it's just pointing the direction for research regards Krzys