1 / 16

Problem

Problem.

smithnorman
Download Presentation

Problem

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Problem A man leaves his camp by traveling due north for 1 mile. He then makes a right turn (90 degrees) and travels due east for 1 mile. He makes another right turn and travels dues south for 1 mile and finds himself precisely at the point he departed from, that is, back at his campsite. Where is the campsite located? This is searching the space of the solutions for special cases. What are the special cases worth considering?

  2. Go to Extremes • Manipulate the problem space • Look at extreme limits of the problem space.

  3. The “analyze extreme cases” heuristic is often useful in testing of solutions/algorithms. • Example problem: find the illumination I (amount of energy ) that light brings into the room. Here Q is the angle that the blades of the blinds make with the window plane. Choices: cos^2(theta), sin^2(theta), cos(2theta), sin(theta). Q Light

  4. Eliminate wrong choices.

  5. N-bit string example: N-bit string: a string that contains a total of N elements, each being either “0” or “1”.

  6. N-bit string example (solution)

  7. Example Problem Two flagpoles are standing, each 100 feet tall. A 150-foot rope is strung from the top of one of the flagpoles to the top of the other and hangs freely between them. The lowest point of the rope is 25 feet above the ground. How far apart are the two flagpoles? Hint: Start by drawing pictures.

  8. The two extreme cases are:

  9. Another example • What is the length of k? • Important fact: k remains the same no matter what rectangle is inscribed. k r = 1 inch

  10. Another Example You have a large, solid sphere of gold. A cylinder of space is “bored” (drilled) through this sphere, producing a ring. The length of that cylindrical line is 6 inches. You want to know how much gold you have left in the ring. Specifically, what is the volume of the ring? Fact: the amount of gold in the ring does not depend on the width of the bored cylinder. Note: For any sphere, V = pD3/6.

  11. Solution sketch: Can choose any ring width W – the amount of gold is the same. Choose W = 0. The entire sphere becomes the ring.

  12. Yet another one (difficult): • Let {B} and {W} be finite stes of black and white points, respectively, in the plane, with the property that every line segment that joins two points of the same color contains a point of the other color. Prove that both sets must lie on a single line segment.

  13. Yet another one: • Let {B} and {W} be finite stes of black and white points, respectively, in the plane, with the property that every line segment that joins two points of the same color contains a point of the other color. Prove that both sets must lie on a single line segment. • Experiment. Draw a few examples.

  14. Yet another one: • Let {B} and {W} be finite stes of black and white points, respectively, in the plane, with the property that every line segment that joins two points of the same color contains a point of the other color. Prove that both sets must lie on a single line segment. • Experiment. Draw a few examples. • Solution: Assume the opposite: at least 3 points do not lie on the line. • Then, there exists a triangle made from these points (shown). Choose the one with smallest possible area (extreme case). • But, according to the problem statement, there is always a white point between two black ones, so there exist two even smaller triangle. Contradiction with the choice made!

  15. Find the Diagonal • You are given A, B, C. Calculate X. • What is the simpler problem? • How does it relate? x C A B

  16. Real Interview Questions http://www.sellsbrothers.com/fun/msiview/default.aspx?content=question.htm Thanks to Val Komarov for pointing it out to me.

More Related