YesOnEmpty is UncomputableOctober 27, 2025
“Ignore Input Trick”
Explain and show a turing reduction proving that YesOnEmpty is uncomputable from reducing YesOnString
Explain the results of this reduction
Let F and G be computational problems. We say that F has a Turing reduction to G if we can write a python program solving F, after first assuming the existence of a program solving G.
"""yesOnString function."""
def returnYesOnString(some_string: str) -> str:
"""This function always says yes."""
return "yes"
def yesOnString(program_input: str, input_string: str):
"""Return yes on valid P, if input is defined and P(I) is yes."""
if program_input == 'returnYesOnString.py' and isinstance(input_string, str):
return returnYesOnString(input_string)
if not program_input.endswith(".py"):
error = f"{program_input} either does not exist or is not a valid Python program."
return error
if not isinstance(input_string, str):
error = f"no"
return error
print(yesOnString("returnYesOnString.py", "Hello World!"))
print(yesOnString("returnYesOnString.py", 4))
## yesonempty
def returnYesOnEmpty(some_string: str) -> str:
"""This function says yes only if the string is empty."""
if some_string == "":
return "yes"
else:
return "no"
def yesOnEmpty(program_input: str, input_string: str):
"""Return yes on valid P, if input is defined and P(I) is empty."""
if program_input == "returnYesOnEmpty.py" and isinstance(input_string, str):
return returnYesOnEmpty(input_string)
if not program_input.endswith(".py"):
error = f"{program_input} either does not exist or is not a valid Python program."
return error
if not isinstance(input_string, str):
error = f"{input_string} is not a string!"
return error
print(yesOnEmpty("returnYesOnEmpty.py", ""))
print(yesOnEmpty("returnYesOnEmpty.py", "not empty"))
Proved that YesOnEmpty in uncomputable by reducing YesOnString to it
Illustrated the use of the “Ignore Input Trick”
YesOnEmpty is no harder than YesOnString
Proofgrammers