I answered these questions recently by the way. I've never actually heard of stirling numbers before but i see Chris has answered part B easily using stirling numbers so maybe I should do some homework.
Part A is fairly easy just using stars and bars which is a method that I often use.
(a) While travelling abroad, I bought 7 identical bags of candy for 3 friends. How many ways can I distribute the candy to my 3 friends, so that each friend gets at least one bag of candy?
I'd give one bag of candy to each friend leaving 4 bags to distribut between the 3 of them.
I'd use stars and bars method now.
there are 4 bags which are the stars.
I want them divided into 3 groups which means inerting 2 bars somewhere within the 4 stars
Person one gets the bags at the front, person 3 gets the bags at the end and person 2 gets the bags in the middle
eg
*|***| person1 =1bag person 2 = 3 bags person 3=0 bags.
There will be 6C2 = 15 ways to do this.
----------------
Part b is much harder and I was not sure if my answer last time was correct.