Does Algorithm Terminate when Input is not in the Finite Set?

  • Context: MHB 
  • Thread starter Thread starter agapito
  • Start date Start date
  • Tags Tags
    Algorithm
Click For Summary

Discussion Overview

The discussion revolves around the termination of an algorithm designed to check membership in a finite set of natural numbers, particularly when the input number is not included in that set. The scope includes theoretical aspects of decidability and algorithmic behavior.

Discussion Character

  • Technical explanation
  • Debate/contested

Main Points Raised

  • One participant references a theorem stating that any finite set of natural numbers is effectively decidable and questions the termination of an algorithm when the input is not in the set.
  • Another participant asks for clarification on the theorem and the concept of decidability, expressing confusion over how a number can be said to "decide" anything.
  • A later reply clarifies that the theorem is from a textbook and defines decidability as the ability to construct an algorithm to check membership in the set.
  • One participant asserts that for any given number, it only needs to be checked against the finite set, suggesting that the algorithm will terminate after a finite number of comparisons, regardless of whether the number is in the set or not.

Areas of Agreement / Disagreement

Participants express differing views on the termination of the algorithm, with some asserting that it will terminate after a finite number of checks, while others remain uncertain about the implications of the algorithm's behavior when the input is not in the set.

Contextual Notes

The discussion includes assumptions about the nature of decidability and the behavior of algorithms, which may not be fully articulated or agreed upon by all participants.

agapito
Messages
46
Reaction score
0
A theorem states: Any finite set of natural numbers is effectively decidable. I understand the construction of the (brute force) algorithm to check every input for inclusion in the set. However, if the input is not included in the set, the algorithm would not terminate, and we require algorithms to terminate. What am I missing here?
 
Technology news on Phys.org
agapito said:
A theorem states: Any finite set of natural numbers is effectively decidable. I understand the construction of the (brute force) algorithm to check every input for inclusion in the set. However, if the input is not included in the set, the algorithm would not terminate, and we require algorithms to terminate. What am I missing here?

Hi agapito, welcome to MHB, (Wave)

When you say 'a theorem states', can you please clarify which theorem you're referring to?
And when you say 'Any finite set of natural numbers is effectively decidable', can you clarify what you mean by natural numbers being decidable? As I see it, a number does not decide anything.
 
I like Serena said:
Hi agapito, welcome to MHB, (Wave)

When you say 'a theorem states', can you please clarify which theorem you're referring to?
And when you say 'Any finite set of natural numbers is effectively decidable', can you clarify what you mean by natural numbers being decidable? As I see it, a number does not decide anything.

1.- Theorem is from my textbook in section named "Effectively decidable properties and sets". I have quoted it in its entirety
2.- Decidability means that an algorithm can be constructed to check whether a given number belongs to the set.

I am unclear in the case that a number is input to the algorithm that does not belong to the set, it seems to me like the algorithm would not terminate as it's supposed to.

I certainly appreciate your help with this.
 
What ever number is given, you only need to check it against the "n" numbers in the finite set. If the number is in the set that might be determined in less than n comparisons. If the number is not in the set that will be determined in n comparisons.
 
Country Boy said:
What ever number is given, you only need to check it against the "n" numbers in the finite set. If the number is in the set that might be determined in less than n comparisons. If the number is not in the set that will be determined in n comparisons.

Many thanks for the clarification, very helpful to me. am
 

Similar threads

Replies
3
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 11 ·
Replies
11
Views
4K
Replies
29
Views
5K
Replies
1
Views
2K
  • · Replies 9 ·
Replies
9
Views
2K
  • · Replies 4 ·
Replies
4
Views
4K
  • · Replies 3 ·
Replies
3
Views
3K
  • · Replies 8 ·
Replies
8
Views
2K
  • · Replies 5 ·
Replies
5
Views
1K