Hi, need help with Problem Set 2 (Problem2). I dont have any difficulties with programming exercises, but stuck on this one. Theorem: If it is possible to buy x, x+1,…, x+5 sets of McNuggets, for some x, then it is possible to buy any number of McNuggets >= x, given that McNuggets come in 6, 9 and 20 packs. Problem 2. Explain, in English, why this theorem is true.
Hoot! You just asked your first question! Hang tight while I find people to answer it for you. You can thank people who give you good answers by clicking the 'Good Answer' button on the right!
it's easy if you can buy x, x+1,..., x+5 then notice the sequence: 50, 51, 52, 53, 54, 55 and then notice the equation: 6*a+9*b+20*c = 50 if b = 0 and c = 0 then you have 6*a = 50 and every time you increase a by one the number of nuggets increases by 6 which means that if you can buy 50 nuggets, then you can buy 56 :-) now, if you can buy 50, 51, 52, 53, 54 and 55... you can also buy 56 and so on... this is why there is a minimum number of nuggets you can buy and once you found this minimum you can, actually, buy any number that is bigger than the minimum :-) hope this helps ;-) cheers
thx :) it was easy
listen dont be insecure, its ok to have difficulties with programming exercises. if you had trouble on this one, you sure as hell had difficulty on other ones. but its cool thats learning LD
Join our real-time social learning platform and learn together with your friends!