• Non ci sono risultati.

Algorithm Engineering [midterm] 11 November 2020 – time 45 minutes

N/A
N/A
Protected

Academic year: 2021

Condividi "Algorithm Engineering [midterm] 11 November 2020 – time 45 minutes"

Copied!
1
0
0

Testo completo

(1)

Algorithm Engineering [midterm]

11 November 2020 – time 45 minutes

Question #1 [ranks 4+3+1]. Consider the Snow Plow technique with memory M=2.

• Simulate Snow Plow over the sequence S = (1, 3, 9, 10, 7, 6, 5, 4, 3, 8).

• Provide an example of sequence of length 10 that generates exactly 5 runs, when the memory has size M=2.

• Show the average length of the run produced by Snow Plow, if we assume that the probability that an item goes to the Heap is ¾ rather than ½.

Question #2 [rank 3]. Given a Universal class of hash functions that map keys from a universe U to the range [0,22]. Compute the average number of collisions induced by a function h drawn randomly from that class and mapping a set of 10 keys.

Question #3 [rank 2]. Prove that the probability of having a 0 in a position of the binary array of the Bloom Filter is ½, when the number of hash functions is set to the optimal one.

Question #4 [rank 4]. Show the first 8 codewords of the (s,c)-code with s=3 and c=1, hence s+c = 4 (briefly explain your calculations).

Question #5 [rank 4]. Decompress the 8th integer encoded via Elias-Fano in the two arrays:

L = 0111000101001111001100 and H= 110 110 10 0 10 10 10 110 0 0 10 0 0 0 0 0 where the original encoding of the integers is in 6 bits. (hint: derive first the number of keys, and then the length of the low and high part)

Question #6 [rank 4]. Show the binary succinct encoding of the tree T = { aàb (left child); bàc (left child); bàe (right child); càd (right child) } of root “a”.

Question #7 [rank 5]. Given the set of strings (aa, ba, bb, bc, ca) and you wish to construct a minimal ordered perfect hash function where rank(a,b,c) = (2, 3, 4) and h1(c’ c’’) = 2 * rank(c’) * rank(c’’) mod 11, and

h2(c’ c’’) = 5 * rank(c’) + rank(c’’) + 1 mod 11.

Construct the final h(t).

Riferimenti

Documenti correlati

The settlement phase, placed by the legislator as a guarantee to creditors, is a step in which the company continues to exist by mutating the original social object

With a focus on the renowned Italian–Armenian novelist Antonia Arslan’s Genocide narrative La masseria delle allodole (2004; English translation Skylark Farm, Arslan 2006), I’ll

One can easily verify that every element of ~ is a right tail of 5 preordered withrespect to relation defined 1n (j).. A CHARACTERIZATION DF V-PRIME ANO 5TRONGLY V-PRIME ELHlrtHS OF

The resulting binary images are input into the spline-based algorithm for diameter estimates and the measurements performance against REVIEW is reported in Table 8.. The removal

In the second stage the class sequence, generated by the first one, is computed in order to minimize the delays between the actual and estimated take-off time of each

Eine solche Kette alles Seins wird im Dickicht der Silvae weder gesucht noch gefunden, die einzelnen Entdeckungen werden eben nicht sofort in einen klar gegliederten Kosmos

Among 100 patients, 5 requested termination of pregnancy because of the detection of associated major anomalies, while five fetuses died spontaneously in utero (2

Sono i due nuovi coinquilini della vecchia casa di Thomas e Emma, che sentono “the piano playing / Just as a ghost might play”, infatti, il poeta