Barrels can hold 60 prepared meals. Dwarfs (and I assume humans) eat 1 meal a month. 1 barrel == 5 years of food for one dwarf. You would need 6 barrels for 30 years. I agree that it would be easier (that is to say, trivial) to set up a small plump helmet farm. You would only need 1 tile for the farm. You should probably have a bag so that you can store the plump helmet spawn in a single tile too. You should probably have a few tiles for the plump helmet storage because once you run out of storage space, I think you won't be able to harvest, which means you won't be able to plant. On average each harvest is likely to give them 4-6 months of food, so it's not a massive problem anyway.
If you made a still, a barrel and a chair, you could also set up a quick manager job to make alcohol, so I *think* even a dwarf would be unlikely to go crazy (2 barrels might be smarter, though, because then they don't have to run out of alcohol to make more). Dwarfs drink twice a month, but each plump helmet will produce 5 alcohol, so you don't need to increase your farm to accommodate it.
To make it even more interesting, you could put an weapon rack in the jail and have your prisoner train every second month so that 30 years later they would be a fearsome fighter and exact revenge on the society that jailed them (which is, I suspect, the point of this exercise???)
Edit: Since this is such a fun idea, I decided to try it (after months of vacationing from DF). Made a single tile embark, struck the earth to make a jail, found the mother of all coal seams :-) There will be a slight delay in building the jail. I *am* a dwarf after all...
Edit 2: And hematite... Armok, you are a fickle god!