There are four parts to this problem, numbered 0 to 3:
#0 You have four pots, each with three balls. All the balls are different. You may think of them as having the numbers 1-12 written on them. You are to remove all 12 balls one at a time. The only rule: you must not remove twice in a row from the same pot.
How many different ways are there to remove all 12? (solving w/out computer simulation).
#1 The same as #0, but once, and only once, you must replace a ball, returning it to its pot immediately after the removal. So you draw-out 13 times, each time from a different pot. How many possible ways are there?
#2 This time you must replace two balls, replacing each immediately after its removal and replacing each into its pot of origin. It could happen to be the same ball more than once, but you must always move on to a different pot for the next draw, if not done with all 14 draws. How many ways?
#3 Same as #2 but now 3 mandatory replacements are done at some times in the process, again, never drawing from the same pot twice.