Generating r-combination or r-permutations with replacement.

*To*: mathgroup at smc.vnet.net*Subject*: [mg51248] Generating r-combination or r-permutations with replacement.*From*: "phil" <enfo at ucla.edu>*Date*: Sun, 10 Oct 2004 01:57:19 -0400 (EDT)*Organization*: University of California, Los Angeles*Sender*: owner-wri-mathgroup at wolfram.com

Is there an easy function in mathematica that generates a set/list that consists of r-combinations or r-permutations with replacement? e.g. I want the set of all possible sets with 3 elements, with entries from {1,2,3,4}, and also the set of all possible unordered sets with 3 elements, with entries from {1,2,3,4}. Any help is appreciated, -Philip Lu

**Follow-Ups**:**Re: Generating r-combination or r-permutations with replacement.***From:*Andrzej Kozlowski <akoz@mimuw.edu.pl>