I want to generate the following Table which shows the distribution of 3 balls in 3 cells. But so far I have had no luck using Permutations, Tuples, or even IntegerPartitions.
Output can be in the following form for each item in the table:
{{a,b,c},{},{}} for {abc|-|-} and {{},{a,b},{c}} for {-|ab|c}
Edit: Solution based on Daniel Huber's accepted solution. Do let me know if I can simplify this further. It is a simple Mapper function that maps each tuple whose index corresponds to the ball letter (a,b, or c) and the element itself corresponds to the cell in which the ball lies (eg. tuple {1,2,2} maps to{{a},{b,c},{}}). Then we simply find all such tuples and translate them. All such tuples are Tuples[{1,2,3},3].
Mapper[i_List] := Module[{t = {{}, {}, {}}},
Map[AppendTo[t[[i[[#]]]], {a, b, c}[[#]]] &, Range[3]]; t];
Multicolumn[Map[Mapper, Tuples[{1, 2, 3}, 3]], 3]
Output:
{{a,b,c},{},{}} {{b,c},{a},{}} {{b,c},{},{a}}
{{a,b},{c},{}} {{b},{a,c},{}} {{b},{c},{a}}
{{a,b},{},{c}} {{b},{a},{c}} {{b},{},{a,c}}
{{a,c},{b},{}} {{c},{a,b},{}} {{c},{b},{a}}
{{a},{b,c},{}} {{},{a,b,c},{}} {{},{b,c},{a}}
{{a},{b},{c}} {{},{a,b},{c}} {{},{b},{a,c}}
{{a,c},{},{b}} {{c},{a},{b}} {{c},{},{a,b}}
{{a},{c},{b}} {{},{a,c},{b}} {{},{c},{a,b}}
{{a},{},{b,c}} {{},{a},{b,c}} {{},{},{a,b,c}}












