Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Modify the yesOnStringViaMod - template.py . A positive instance of the decision procedure Mod 2 InMod 3 Out ( P ) I ( P (
Modify the yesOnStringViaModtemplate.py
A positive instance of the decision procedure ModInModOutPIPI I such that II That is the length of Ps output mod equals the length of
its input mod plus Consider these examples:
def inString: return inString
def inString:
if leninString: return C
else: return CGT
is a negative instance of ModInModOut, because if instring GT lenGT lenGT
is also a negative instance of ModInModOut, although it does handle even length input correctly. However, if instring A lenA lenCGT Show that ModInModOutP is undecidable by modifying yesOnStringViaModtemplate.py included HW materials to implement YesOnStringPIT ModInModOutP In the multiline comment at the end of the file, argue that you have shown that ModInModOutP is undecidable.
yesOnStringViaModtemplate.py:
# "Oracle" function assume exists to show contradiction
#
import ModInModut
import utils
from utils import
from universal import universal
# Complete for the final exam by filling in the ellipses
def alterYesToModinString:
result universal progString newInString
# Complete for the final exam by filling in the ellipses. For the
# call to modInModut supply a nd argument if needed.
def yesViaModprogString inString:
result mod InModut
alterYesToMod.py:dots
ModInModut is undecidable because...
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started