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 571: 33

Answer

No

Work Step by Step

No, the given algorithm is not deterministic. Deterministic algorithms produce the same output for a given input every time they are run and they follow a predictable sequence of steps without randomness or ambiguity.. However, in the given algorithm, if the input number is greater than 5, it will always return "yes," but if the input number is less than or equal to 5, it will give a different output each time as it randomly picks a value less than 5. This randomness makes the algorithm non-deterministic.
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.