Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uunet!cs.dal.ca!aucs!solid From: solid@aucs.uucp (Tomasz Muldner) Newsgroups: comp.edu Subject: Generating combinations Message-ID: <1990Jun7.181249.26447@aucs.uucp> Date: 7 Jun 90 18:12:49 GMT Reply-To: solid@acadia.bitnet, solid@aucs.UUCP (Tomasz Muldner) Distribution: na Organization: School of Computer Science, Acadia Univ., Nova Scotia Lines: 20 I need to write a program to generate all sequences of k letters, each letter has to occur exactly n times, for example for k=2, n=2 we have AABB ABAB ABBA BAAB BABA BBAA I'm interested in a case where k=7 and n=5, so the program should not consider all (n*k)! permutations. I would be happy to get any suggestions as to what algorithm should be used. -- Dr. Tomasz Muldner, Professor, Jodrey School of Computer Science Acadia University, Wolfville, NS, Canada B0P1X0 UUCP: {seismo|watmath|utai|garfield}!dalcs!aucs!solid BITNET: solid@Acadia