Counting, Probability & Sets

Answer & solution
Official answer: B
Approach: Represent a purchase by the number of scoops of each flavour, not by an ordered sequence.
Let x1,x2,x3,x4 be the non-negative integer counts. Every purchase corresponds uniquely to x1+x2+x3+x4=3. With three stars for scoops and three separators for the four flavours, stars and bars gives C(3+4−1,4−1)=C(6,3)=20, option B.
An independent case count checks this: three identical scoops give 4 choices; a pair of one flavour plus a different flavour gives 4×3=12 choices; three different flavours give C(4,3)=4 choices. Total 4+12+4=20.
Using 4³ would count ordered selections and overcount many purchases. Using only C(4,3) would forbid repeated flavours, contrary to the question.