A community for students.

Here's the question you clicked on:

55 members online
  • 0 replying
  • 0 viewing

anonymous

  • 4 years ago

I'm on ps2 problem 1 and 2. I wrote some code that prompts the user to enter a range and finds the first combination of 6,9, and 20 packs that will that adds up to that. I've found that you get at least one combination from 43 on, but I don't really understand the math behind it, specifically what the theorem is asking for. Basically i understand it in practice, but not in theory. Below is a link to the code i've come up with http://codepad.org/ooVDsOzJ

  • This Question is Closed
  1. anonymous
    • 4 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    I found the best way to understand the math is work the problem out on paper. By combining possible solutions by hand the math will reveal itself. I made a chart with three columns and just started showing how putting 6pc 9pc 20pc in different amounts would come up with a given number and how smaller values would be impossible to reach as in 1,2,3,4,5,7,8pc and how large numbers would always be possible. You will see very quickly that after 43 every number higher is possible using combinations of lesser values. Chart it out and it becomes very clear what is going on. with 6x+9y+20z=n

  2. anonymous
    • 4 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    Will do, thank you for your response.

  3. maitre_kaio
    • 4 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    That one could be in the FAQ (if there was one :P ). Here's my answer, sorry for those who have already read it in previous questions: Basically, it is just a proof by recursion. I would explain it this way in english: Say I want to buy an arbitrary number x of nuggets and i know that it is possible to buy x, x+1,..., x+5 nuggets. I can always buy c boxes of 20 (c >=0) plus n others (0 < n < 20). Now I just need to demonstrate that can I buy n nuggets I can buy x + 6, x + 11 just by adding a box of 6. I can buy x + 12, ... x + 14 by adding a box of 9. I can buy x + 15, ..., x + 19 by adding a box of 6 and a box of 9. I can buy x + 20 by adding a box of 20. For any number greater than x + 20, I can buy a number of boxes containing 20 nuggets, and go back to the previous demonstration. So I can buy any number of nuggets greater than x. Maybe not the more elegant proof, but I think it's very visual.

  4. anonymous
    • 4 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    Once you have six consecutive answers, you know you can get the rest because 6 is the smallest unit of nuggets.

  5. Not the answer you are looking for?
    Search for more explanations.

    • Attachments:

Ask your own question

Sign Up
Find more explanations on OpenStudy
Privacy Policy

Your question is ready. Sign up for free to start getting answers.

spraguer (Moderator)
5 → View Detailed Profile

is replying to Can someone tell me what button the professor is hitting...

23

  • Teamwork 19 Teammate
  • Problem Solving 19 Hero
  • You have blocked this person.
  • ✔ You're a fan Checking fan status...

Thanks for being so helpful in mathematics. If you are getting quality help, make sure you spread the word about OpenStudy.

This is the testimonial you wrote.
You haven't written a testimonial for Owlfred.