



Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!




Let f (x) = a 0 + a 1 x + · · · + anxn, an 6 = 0, be a univariate polynomial with integer coefficients. Let amax = max 0 ≤i≤n {|ai|} be the largest absolute values of all coefficients ai’s. Suppose that f (α) = 0 and |α| ≥ 1. Show that
|α| ≤ n · amax |an|
Based on this fact, give an algorithm that decides whether any given uni- variate polynomial with integer coefficients has an integer root.
Proof: Suppose f (α) = 0. Then we have
f (α) = 0 = a 0 + a 1 α + a 2 α^2 +... + anαn
=
a 0 an
a 1 an
α +
a 2 an
α^2 +... +
an− 1 an
αn−^1 + αn
αn^ = −
a 0 an
a 1 an
α +
a 2 an
α^2 +... +
an− 1 an
αn−^1
a = −
a 0 an
α−(n−1)^ +
a 1 an
α−(n−2)^ +
a 2 an
α−(n−3)^ +... +
an− 1 an
|a| =
a 0 an
α−(n−1)^ +
a 1 an
α−(n−2)^ +
a 2 an
α−(n−3)^ +... +
an− 1 an
|a 0 | |an|
∣∣α−(n−1)
∣∣ + |a 1 | |an|
∣∣α−(n−2)
∣∣ + |a 2 | |an|
∣∣α−(n−3)
∣∣ +... + |an− 1 | |an|
≤
|a 0 | |an|
|a 1 | |an|
|a 2 | |an|
|an− 1 | |an| ≤ amax |an|
amax |an|
amax |an|
amax |an| = n · amax |an| The above fact leads to a simple algorithm for deciding whether or not the univariate polynomial f (x) = a 0 +a 1 x+· · · +anxn^ has any integer roots. First find amax by examining the absolute value of each coefficient. Then for each α in the range −n · a |maxan| ≤ α ≤ n · a |maxan| , test if f (α) = 0. Since we know all zeros of f lie in this range, if there is one, we will find it, and furthermore, we can guarantee that if we do not find a zero, then there are no integer roots.
Note: Although this algorithm is guaranteed to terminate, it does not necessarily run in polyomial-time. Do you see why?
A state of a Turing machine is said to be useless if it is never entered on any input string. Prove that the language
{〈M 〉 : M is a TM that has a useless state}
is undecidable.
Proof: Let L = {〈M 〉 : M is a TM that has a useless state}. We show that AT M reduces to L. Suppose that T is a Turing-Machine that decides L. We will construct a Turing-Machine D that decides AT M.
D(< M, w >):
(a) run M on w. (b) if M accepts w, then cycle through all states of Q
To see that D decides AT M observe if M accepts w then by construction NM,w will not have any useless states. Furthermore, if M does not accept w, then since we assume that the number of states of NM,w is some non- trivial superset of those of M , then NM,w must have some useless state. We conclude that NM,w does not have a useless state if and only if M accepts w. Thus D decides AT M , a contradiction. It follows that L is undecidable.
For a language L, an enumerator for L is an algorithm that outputs a se- quence w 1 , w 2 ,... , wi,... of strings in Σ∗, such that wi ∈ L for each i ∈ N, and each w ∈ L eventually appears in the sequence (that is, for each w ∈ L, there is some i ∈ N such that w = wi). It is well known that a language is Turing-recognizable if and only if it has an enumerator. (For this reason a Turing-recognizable language is said to be recursively enumerable.)
Proof: (⇒) Let L be a decidable language and M a decider of L. Then the following Turing machine E enumerates L in the lexicographic order:
For each w ∈ Σ∗^ in the lexicographic order:
Clearly E is an enumerator of L that outputs each member of L in the lexicographic order.
(⇐) Conversely, let E be an enumerator of L that outputs elements of L in the lexicographic order L = {w 1 , w 2 , w 3 ,.. .}. Then the following Turing machine M decides L:
On input x ∈ Σ∗: For i = 1, 2 , 3 ,.. .: