• Keine Ergebnisse gefunden

Algorithmic Discrete Mathematics 2. Exercise Sheet

N/A
N/A
Protected

Academic year: 2022

Aktie "Algorithmic Discrete Mathematics 2. Exercise Sheet"

Copied!
2
0
0

Wird geladen.... (Jetzt Volltext ansehen)

Volltext

(1)

Algorithmic Discrete Mathematics 2. Exercise Sheet

Department of Mathematics SS 2013

Andreas Paffenholz 2 May 2013

Silke Horn

Groupwork

Exercise G1

(a) Show that every treeT has at least∆(T)leaves.

(b) Show that a tree without a vertex of degree2has more leaves than other vertices.

Exercise G2

Recall that an automorphism of a graphG= (V,E)is a bijective mapφ:VV such that{u,v} ∈E⇔ {φ(u),φ(v)} ∈ Efor anyu,vV.

Show that every automorphism of a tree fixes a vertex or an edge.

Exercise G3

Let f,g:N→Nbe two functions such that g∈Ω(f). Assume that two algorithms are given:

• AlgorithmAhas a running time ofO(f).

• AlgorithmB has a running time ofO(g). Consider the following two algorithms:

Algorithm 1:

Input: n∈N s←0

for i=0, . . . , 100 do Run AlgorithmA for i=0, . . . , 2ndo

Run AlgorithmB

Algorithm 2:

Input: n∈N if n≥100then

Run AlgorithmA else

Run AlgorithmB

Estimate the running times as accurately as possible.

Exercise G4

Let f,g:N→Nbe two functions andaa constant. Prove:

(a) f ∈O(f) (b) a·O(f)⊆O(f)

(c) O(f) +O(f)⊆O(f) (d) O(f)·O(g)⊆O(f g)

(e) f ·O(g)⊆O(f g) (f) max(f,g)∈Θ(f +g)

Hint: For two sets A, B addition and multiplication are defined point-wise, e.g. for A= {a,b} and B = {c,d}: A+B={a+c,a+d,b+c,b+d},A·B={ac,ad,bc,bd}.

1

(2)

Homework

Exercise H1 (5 points)

Recall that asubgraph of a graphG= (V,E)is a graph H= (W,F)withWV,FE. H isinduced if F=EW2 . Assume that a graphG= (V,E)with|V|=nand|E| ≥3without isolated vertices does not have an induced subgraph with two edges. Show thatG=Kn,n≥3,i.e.,G is a complete graph onnvertices.

Exercise H2 (5 points) Sort the functions

n, n3, p

n, n!, 2n, nn according to their complexity in ascending order usingo-notation.

Reminder:

fo(g) ⇐⇒ ∀c>0∃n0∈N∀nn0: 0≤ f(n)<c g(n)

Exercise H3 (5 points)

Consider the following algorithm:

Algorithm 3:

Input: n∈N d←2 qn

whileq>d do qn/d if q=qthen

returnd else

dd+1 return0

What does it do? Estimate its running time.

Exercise H4 (5 points)

Let G = (V,E) be a connected Eulerian graph. Devise an algorithm that returns an Eulerian tour in G, prove its correctness and estimate its running time inO-notation.

Optimierung sucht HiWis:

http://www3.mathematik.tu-darmstadt.de/hp/optimierung/mars-sonja/optimierung-sucht-hilfskraefte.html 2

Referenzen

ÄHNLICHE DOKUMENTE

A walk in a connected graph G = ( V, E ) is called an Eulerian trail if it contains each edge of G exactly once?. A closed Eulerian trail is called an

To this end, we could store adjacency lists as linked lists (so that deletion works in constant time) and endow each entry v 0 of an adjacency list A ( v ) with a pointer to the

Show that a graph G = ( V, E ) is bipartite if and only if it does not contain cycles of odd length.

But participants of the Wednesday group are encouraged to also come on Friday since there will be a short discussion on Prim’s algorithm in the

For each of the following families of sets determine whether the condition of the theorem on SDRs is met.. If so, then find an SDR and the corresponding

(a) Devise an equal length code (i.e., every symbol is encoded with a code word of equal length) for this problem and encode the following sentence using your code (without

Nešetˇril, Invitation to Discrete Mathematics, Springer (German translation: Diskrete Mathematik, Springer,

Wednesday, 31 July 2013, 10:30 – 11:30 in S1|01 A1 (Audimax).. If you registered for the English exam, you must answer