Mathematica 9 is now available
Student Support Forum
-----
Student Support Forum: 'combinatorics' topicStudent Support Forum > General > "combinatorics"

< Previous Comment | Next Comment >Help | Reply To Comment | Reply To Topic
Author Comment/Response
Michael
11/15/12 8:01pm

Try this:

Module[{cnt},
Select[Tuples[Range[6],
5], (Do[cnt[i] = 0, {i, 6}]; cnt[#]++ & /@ #;
Sort[Table[cnt[i], {i, 6}]] === {0, 0, 0, 1, 2,
2}) &]]

There may be a faster way. I can't think how to incorporate the built-in pattern matching....

URL: ,

Subject (listing for 'combinatorics')
Author Date Posted
combinatorics Max 11/14/12 12:59pm
Re: combinatorics Bill Simpson 11/15/12 12:33pm
Re: combinatorics yehuda 11/15/12 2:06pm
Re: combinatorics Michael 11/15/12 8:01pm
Re: combinatorics yehuda 11/18/12 12:44pm
< Previous Comment | Next Comment >Help | Reply To Comment | Reply To Topic