Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Show that Professor Amundsen's algorithm does not correctly tell whether a given polygon is convex by giving a counterexample. Show how to modify the algorithm

image text in transcribed

  1. Show that Professor Amundsen's algorithm does not correctly tell whether a given polygon is convex by giving a counterexample.

  2. Show how to modify the algorithm so that it always gives the correct answer.

33.1-5 A polygon is a piecewise-linear, closed curve in the plane. That is, it is a curve ending on itself that is formed by a sequence of straight-line segments, called the sides of the polygon. A point joining two consecutive sides is a vertex of the poly- gon. If the polygon is simple, as we shall generally assume, it does not cross itself. The set of points in the plane enclosed by a simple polygon forms the interior of 33.2 Determining whether any pair of segments intersects 1021 the polygon, the set of points on the polygon itself forms its boundary, and the set of points surrounding the polygon forms its exterior. A simple polygon is conver if, given any two points on its boundary or in its interior, all points on the line segment drawn between them are contained in the polygon's boundary or interior A vertex of a convex polygon cannot be expressed as a convex combination of any two distinct points on the boundary or in the interior of the polygon Professor Amundsen proposes the following method to determine whether a se- quence (Po. P P-1 of n points forms the consecutive vertices of a convex polygon. Output "yes" if the set ZpiPi+ii+2 0,1.n script addition is performed modulo n, does not contain both left turns and right turns; otherwise, output "no." Show that although this method runs in linear time, it does not always produce the correct answer. Modify the professor's method so that it always produces the correct answer in linear time -, where sub

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Beyond Big Data Using Social MDM To Drive Deep Customer Insight

Authors: Martin Oberhofer, Eberhard Hechler

1st Edition

0133509796, 9780133509793

More Books

Students also viewed these Databases questions

Question

1. What are the major sources of stress in your life?

Answered: 1 week ago