Mandarin Dragonettes generally starve in captivity unless provided with lots of live food (usually the amphipods and copepods living in/on liverock). Many people recommend at least
100 lbs of liverock per dragonette, or a well stocked refugium (in either case the system should be allowed to mature for about a year with no predators eating the 'pods).
Melev has a great "quick info" page on Mandarins:
http://www.melevsreef.com/mandarin_care.html
Bob Fenner's WetWebMedia has a bit more in-depth info here:
http://www.wetwebmedia.com/mandarins.htm
In my opinion you will have a problem getting a mandarin to live 4 months in even a 20g tank (and thats assuming you start the 20g up with 20lbs of liverock, and run it fishless for 6 months or more before putting the mandarin in, letting the 'pod population grow to high levels before the mandarin wipes them out).
sorry