Computer Science: An Overview: Global Edition (12th Edition)

Published by Pearson Higher Education
ISBN 10: 1292061162
ISBN 13: 978-1-29206-116-0

Chapter 12 - Theory of Computation - Chapter Review Problems - Page 572: 34

Answer

No

Work Step by Step

An algorithm is deterministic if each step’s outcome is completely determined by the algorithm’s description and its inputs — there is no element of chance, choice, or external unpredictability. If some step depends on external input not specified by the algorithm, then the algorithm is non-deterministic. Let's analyze the algorithm: Step 1: Drive straight ahead → deterministic. Step 2: "Ask the person standing on the corner" → depends on the person’s response, which is not fixed or predictable by the algorithm. Different people could give different answers. Step 3: The direction (right or left) depends on that unpredictable response. Step 4: Drive two more blocks and stop → deterministic once the direction is set. Because the outcome of Step 2 depends on an external, unpredictable input (the person’s response), the overall behavior of the algorithm is not completely determined by its own rules.
Update this answer!

You can help us out by revising, improving and updating this answer.

Update this answer

After you claim an answer you’ll have 24 hours to send in a draft. An editor will review the submission and either publish your submission or provide feedback.