A community for students.

Here's the question you clicked on:

55 members online
  • 0 replying
  • 0 viewing


  • 5 years ago

Hey I'm on pset4 problem 4 and I don't know how to implement the guessing procedure into the script please help. Here is what I have so far http://dpaste.com/hold/528870/ .

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

    I used the bisection method of successive approximation that was taught in one of the lectures. According to this method, you set a high and low value for the expenses and guess half way in between. The code will look something like this: high = savings low = 0 expenses = (high + low) / 2 If your guess is too high, then you know the right answer must be somewhere between your guess and 0, so expenses becomes the new upper bound: high = expenses Likewise, if a guess is too low, expenses becomes the lower bound for the next guess, and you repeat this process until you get a result whose absolute value is less than epsilon, which means you will probably have to use a while-loop involving epsilon: while abs(final_result) > epsilon: expenses = (high + low) / 2 etc....

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

    O thanks for actually replying and sorry for not going back and saying this earlier but i reposted my question and people helped me. Thanks anyway though.

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


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