Candice's trip to the candy shop

Computer Science Level 5

Candice enjoys candy like any other girl her age. One day, she asks her mother to lend her money to buy candy.

Her mother agrees and lends her \($40\) but specifies a few rules first.

  • Candice needs to use all \( $40\) and should not have any remaining money.
  • Her mother doesn't want her to get carried away so Candice can buy a minimum of 1 and a maximum of 10 candies in total.
  • Candice can buy as many of each type of candy she wants provided the above conditions are satisfied.

She agrees and heads over to the candy shop.Over there she notices that the shop offers candies of 4 different types, which are priced at \( $1 , $2, $5 \text{ and } $10\) respectively.

If Candice picks each candy one at a time, In how many ways can Candice make her selection?

Details and Assumptions

  • As an explicit example, Candice can buy 4 candies of \($10\) each so that she would be left with no money extra.
  • Order of purchase matters. If Candice buys the candies as \( (5,5,10,10,10) \) and \( (5,10,10,10,5) \) both should be considered.
Image Courtsey : animekida
Check out Candice's Other Adventures!

Problem Loading...

Note Loading...

Set Loading...