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

  • Thread starter Thread starter agapito
  • Start date Start date
  • Tags Tags
    Algorithm
AI Thread Summary
The discussion centers on the concept of decidability in relation to finite sets of natural numbers. A theorem asserts that any finite set of natural numbers is effectively decidable, meaning an algorithm can determine whether a given number belongs to the set. The initial concern raised is about the algorithm's termination when checking for numbers not included in the set. Clarification reveals that for any input number, the algorithm only needs to compare it against a finite number of elements in the set. If the number is present, it may be found in fewer than the total comparisons, while if it is absent, the algorithm will complete after checking all elements, thus ensuring termination. This understanding resolves the confusion regarding the algorithm's behavior when the input number is not part of the set.
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
 
Thread 'Star maps using Blender'
Blender just recently dropped a new version, 4.5(with 5.0 on the horizon), and within it was a new feature for which I immediately thought of a use for. The new feature was a .csv importer for Geometry nodes. Geometry nodes are a method of modelling that uses a node tree to create 3D models which offers more flexibility than straight modeling does. The .csv importer node allows you to bring in a .csv file and use the data in it to control aspects of your model. So for example, if you...
Back
Top