A community for students.
Here's the question you clicked on:
 0 viewing
anonymous
 4 years ago
Hey guys,
I'm having trouble with question 5 from the first quiz. I thought 'guess and check' was covered in lecture 5 in relation to calculating square roots so I tried this speculatively (it'll only work with ints so I kind of knew it was wrong):
1. calculate a max poss value for the answer
2. calculate a min poss value for the answer
3. set guess = minimum
4. while guess<= maximum
if guess = answer +/ epsilon
return guess
increment guess
Obviously this is absolutely nothing like the real answer which I can't make any sense of .... any help much appreciated ...
anonymous
 4 years ago
Hey guys, I'm having trouble with question 5 from the first quiz. I thought 'guess and check' was covered in lecture 5 in relation to calculating square roots so I tried this speculatively (it'll only work with ints so I kind of knew it was wrong): 1. calculate a max poss value for the answer 2. calculate a min poss value for the answer 3. set guess = minimum 4. while guess<= maximum if guess = answer +/ epsilon return guess increment guess Obviously this is absolutely nothing like the real answer which I can't make any sense of .... any help much appreciated ...

This Question is Closed

maitre_kaio
 4 years ago
Best ResponseYou've already chosen the best response.1I would have answered something like this. Since the question says exhaustive, one have to enumerate through all the solutions, and test every guess. When you say it works only with int, you're right, but think of the solutions space like a totally ordered space. You always have a way to say that a guess is before or after another one. So it's similar to integers. I give you an A :)

anonymous
 4 years ago
Best ResponseYou've already chosen the best response.0lol! thanks maitre_kaio! That's what I thought, hence my confusion :) Having thought about it some more, I've realized that the answer they've given is more like the McNuggets problem set than the square roots example. Perhaps the question is just ambiguous, although that seems strange. Perhaps both answers are valid even though they haven't indicated it in the answers ... unless I'm still missing something ...

maitre_kaio
 4 years ago
Best ResponseYou've already chosen the best response.1I didn't realize the answers were given in the course materials :) It seems to me that most of the quizz questions have several answers, and some questions (like this one) are pretty vague. I think the professort would have been glad with our answer.

anonymous
 4 years ago
Best ResponseYou've already chosen the best response.0You may well be right. I was a bit more concerned that I didn't really understand the answer that they gave; although I think I've figured it out ... I guess I'll just have to live with the ambiguity :(
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.