A community for students.
Here's the question you clicked on:
 0 viewing
anonymous
 5 years ago
Problem set 2, problem 4
anonymous
 5 years ago
Problem set 2, problem 4

This Question is Closed

anonymous
 5 years ago
Best ResponseYou've already chosen the best response.0I'm having trouble with problem four. For problem three, I exploited the fact that because the GCD of 6 and 9 is 3 and because 6 and 9 are three apart, any multiple of 3 > 6 is a buyable number of mcnuggets. And if the number is greater than 20, you can just subtract twenty and repeat that test. But for problem four, I'm trying to write a program that asks the user for the values of x, y, and z. Basically, it starts by asking you to set the values of the small, medium, and large sizes of mcnuggets, then proceeds to do the same test. At least, I'd like it to perform the same test. Can any advise me on a mathematical strategy/method for how solve a diophantine equation? I'm fine with doing an "exhaustive search" as the instructions say, basically looking at every possible combination of x, y, and z, but I can't figure our a way to represent that logically. Make sense?

anonymous
 5 years ago
Best ResponseYou've already chosen the best response.0I used a series of nested loops to test various quantities of smalls, mediums, and larges

anonymous
 5 years ago
Best ResponseYou've already chosen the best response.0The thing that I used to limit the loop was the total number of possible McNuggetsthe problem says "find the largest number (less than 200) of McNuggets that cannot be bought in exact quantity," so if you get up to 200, you can stop. Then for me the relevant question became "If I can test total numbers of McNuggets up to a certain number, how can I test each possible combination of sizequantities that might total that number of McNuggets?"
Ask your own question
Sign UpFind more explanations on OpenStudy
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
 Engagement 19 Mad Hatter
 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.