• Keine Ergebnisse gefunden

Algorithmic Discrete Mathematics 7. Exercise Sheet

N/A
N/A
Protected

Academic year: 2022

Aktie "Algorithmic Discrete Mathematics 7. Exercise Sheet"

Copied!
1
0
0

Wird geladen.... (Jetzt Volltext ansehen)

Volltext

(1)

Algorithmic Discrete Mathematics 7. Exercise Sheet

Department of Mathematics SS 2013

Andreas Paffenholz 10/11 July 2013

Silke Horn

Groupwork

Exercise G1

You are given twelve coins, eleven of which have identical weight, one is lighter or heavier. How many weighings with a binary scale do you need to find the deviating coin (and the sign of the deviation)? Draw the decision tree and prove that your number of weighings is optimal.

Extra puzzle: Find a solution without case distinctions.

Exercise G2

Let n≥1,q≥2,`1, . . . ,`n∈Z≥0. Prove:

(a) IfTT(n,q)has leaves of lengths`1, . . . ,`nthenPn

i=1q−`i≤1. Equality occurs if and only ifT is complete.

(b) Given lengths `1, . . . ,`nsuch thatPn

i=1q−`i ≤1, there is TT(n,q)with these lengths.

Exercise G3

Assume you want to encode the symbolsa, . . . ,z over the alphabetA={0, 1, 2}.

(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 punctuation and case sensitivity):

The lecturer’s name is Andreas Paffenholz.

(b) Now construct an optimal prefix code for the above sentence using Huffman’s Algorithm by counting the oc- currences of the letters, encode the sentence again and compare the length of the output with the equal length code above.

Exercise G4

Given p1, . . . ,p6=10, 11, 14, 15, 20, 30 show that the following decision trees are both optimal. Which one is also a Huffman tree?

20 30

11 10 15 14

30 20

10 14 11 15

Exercise G5

Consider the following game for two players: Start with a natural number n>1. Each player takes turns to divide the current number by a power of a prime number (different from1). If the current number is1at the beginning of one player’s round, then that player loses.

(a) Draw the game tree forn=12. What is the best strategy for the first player?

(b) Play the number game using different values of n. Can you find a game (i.e.,an n) for which the second player always wins?

1

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.

Devise an algorithm that returns an Eulerian tour in G, prove its correctness and estimate its running time in O-notation.. Optimierung

Generalize the breadth-first-search algorithm so that it computes a spanning forest of a not necessarily connected graph... To this end, we have to verify whether inserting the edge

Describe an algorithm that finds all upwards critical edges and has a considerably better running time than solving m max flow problems.. (b) An edge e in a network ( G = ( V, E ),

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

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