A community for students.

Here's the question you clicked on:

55 members online
  • 0 replying
  • 0 viewing

anonymous

  • 5 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
  1. maitre_kaio
    • 5 years ago
    Best Response
    You've already chosen the best response.
    Medals 1

    I 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 :)

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

    lol! 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 ...

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

    I 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.

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

    You 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 :(

  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.