D
is defined by giving a set of instances, codified in a suitable way, and a question over it with yes or no answer.
P
:
Given an integerA decision problemm
, find the integern
such thatn^2 = m
D
is:
Given two integersThe language associated to a decision problemm
andn
, ism = n^2
?
D
is the set of strings that are images of instances with yes answer.
P
can be transformed into a closely related decision problem D
and viceversa the algorithm of the decision problem can be used to solve the original problem.
D
in a membership problem: under a given representation r
, an instance of a decision problem gives answer true
iff its representation belongs to the language of yes instances of the problem D
under r
.