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
SUMMARY

The discussion centers on the decidability of finite sets of natural numbers and the termination of algorithms designed to check membership within these sets. It is established that any finite set is effectively decidable, meaning an algorithm can be constructed to determine if a number belongs to the set. The algorithm will terminate after a maximum of 'n' comparisons, where 'n' is the size of the finite set. If the input number is not included in the set, the algorithm will still terminate after checking all elements.

PREREQUISITES
  • Understanding of decidability in computational theory
  • Familiarity with algorithms and their termination conditions
  • Knowledge of finite sets and natural numbers
  • Basic concepts of algorithm complexity and comparisons
NEXT STEPS
  • Study the concept of decidability in computational theory
  • Learn about algorithm termination and complexity analysis
  • Explore the properties of finite sets in mathematics
  • Investigate brute force algorithms and their applications
USEFUL FOR

Students and professionals in computer science, particularly those interested in algorithms, computational theory, and mathematical logic.

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