• Keine Ergebnisse gefunden

Theoretical Computer Science - Bridging Course Exercise Sheet 8

N/A
N/A
Protected

Academic year: 2022

Aktie "Theoretical Computer Science - Bridging Course Exercise Sheet 8"

Copied!
2
0
0

Wird geladen.... (Jetzt Volltext ansehen)

Volltext

(1)

University of Freiburg Dept. of Computer Science Prof. Dr. F. Kuhn

S. Faour, P. Schneider

Theoretical Computer Science - Bridging Course Exercise Sheet 8

Due:Wednesday, 23rd of June 2021, 12:00 pm

Exercise 1: Questions about class N P (6 Points)

• Give two equivalent definitions of the classN P.

• Is the3-Cliqueproblem from the previous sheet in classN P ? Is it decidable? Justify.

• Is the halting problem inN P? Justify.

Exercise 2: Proving Problems in N P (9 Points)

Show that the following problems are in the classN P

• A clique in a graphG= (V, E) is a setQ⊆V such that for allu, v∈Q:{u, v} ∈E.

Given a graph Gand integer k, it is required to determine whether Gcontains a clique of size at leastk, hence consider the following problem:

Clique:={hG, ki |Ghas a clique of size at least k}.

• Given a collection S of integers x1, . . . , xk and a target t, it is required to determine whetherS contains a sub-collection that adds up tot, hence consider the following problem:

SUBSET-SUM= (

hS, ti|S ={x1, . . . , xk},and for some {y1, . . . , yl} ⊆ {x1, . . . , xk}we have X

i

yi =t )

• A hitting set H ⊆ U for a given universe U and a set S ={S1, S2, . . . , Sm} of subsets Si ⊆ U, fulfills the property H∩Si 6=∅for 1≤i≤m (H ’hits’ at least one element of everySi).

Given a universe set U, a set S of subsets of U, and a positive integer k, it is required to determine whether U contains a hitting set of size at most k, hence consider the following problem: HittingSet:= {hU, S, ki |universe U has subset of size ≤ k that hits all sets in S⊆2U}.1

Exercise 3: From N P to N PC (5 Points)

A language is called N P-complete (⇔:L∈ N PC), if 1. L∈ N P and

2. L isN P-hard.

Recall what areN P-hard problems and how to show a problem N P-hard in the following.

1The power set 2U of some ground setU is the set ofall subsets ofU. SoS2U is a collection of subsets ofU.

(2)

• Language Lis called N P-hard, ifall languagesL0 ∈ N P are polynomially reducible toL, i.e.

L isN P-hard⇐⇒ ∀L0 ∈ N P :L0p L.

Recall let L1, L2 be languages (problems) over alphabets Σ12. Then L1p L2 (L1 is polyno- mially reducible toL2), iff a functionf : Σ1 → Σ2 exists, that can be calculated in polynomial time and

∀s∈Σ1 :s∈L1 ⇐⇒f(s)∈L2.

• The reduction relation ’≤p’ is transitive (L1p L2 and L2p L3 ⇒ L1p L3). Therefore, in order to show that L is N P-hard, it suffices to reduce a known N P-hard problem ˜L toL, i.e.

L˜ ≤p L.

Given a graphG= (V, E), an independent set of sizekofG= (V, E) is a subsetI ⊆V of nodes, such that|I|=kand {u, v}∈/ E for all u, v∈I.

Show thatIndependentSet:={hG, ki |G is a simple graph and has an independent set of size at leastk}

is in N PC. Use that theCliqueproblem from the above exercise is∈ N PC.

Hint: For the poly. transformation (≤p) you have to describe an algorithm (with poly. run-time!) that transforms an instance hG, ki of Clique into an instance hG0, k0i of IndependentSet s.t. a clique of size at least k in G becomes a independent set ofG0 of size at least k0 and vice versa!.

Referenzen

ÄHNLICHE DOKUMENTE

(1) Es gibt nicht-elementare Probleme, bei denen Entscheidungsverfahren mit Eingaben der Länge n eine Laufzeit haben, die f (n) -fach exponentiell ist, wobei f eine

Hint: Construct 2 n words that lie in L n such that the following holds: After a fixed number of steps in the accepting runs, A has to enter distinct states for these words,

Write down the induced equation system and determine its least solution using Kleene’s fixed-point theorem.. Aufgabe 4: Data flow

The following problems are about sanitization of input. Note that the automaton A det is completely deterministic since for every pair of states Q and every input symbol a, there is

c) [3 points] We call a transducer deterministic if in any state and for any input, the transducer has at most one possible, and hence unique, transition; this transition may