Exercise 4

You might also like

Download as doc, pdf, or txt
Download as doc, pdf, or txt
You are on page 1of 2

4 ‫אחזור מידע – תרגיל‬

207500448 ‫מוטלק חג'אזי‬


:4 ‫תרגיל‬
‫ על מנת שתוכלו לערוך אותו) שלחו‬WORD ‫אנא שלחו כפתרון את טופס התרגיל הכולל את הפתרונות (קבלתם אותו כמסמך‬
‫ או מודפס במחשב כאשר לכל שאלה צרפו הסבר קצר בעברית המתאר את מה‬,‫סרוק‬-‫ הגישו פתרון בכתב יד‬,‫את הפתרון במודל‬
.‫שעשיתם ולמה‬
,‫בהצלחה‬
‫צביקה‬

Exercise 4.5
Can spelling correction compromise document-level security?
Consider the case where a spelling correction is based on documents to which the user does not have access.

Suggesting a spelling correction that only occurs in documents the user does
not have access to is a security violation.

Exercise 5.4 [ ]
Compute variable byte codes for the numbers in Tables 5.3 and 5.5.
Table 5.3:
<34,35,17> <1> <1> <1> <2> <105> <7> <43> <96,48,15> <36,18,15>
0100010 00100011 10010001 10000001 10000001 10000010 11101001 10000111 10101011 01100000
00110000 10001111 00100100 00010010 10001111

Table 5.5:
1 2 3 4 9 13 24 511 1025
<1> 10000001
<2> 10000001
<4> 10000001
<9>10001001
<13>10001011
<24>10000011
<127,3>01111111 10000011
<1,8> 00000001 10000001

Exercise 5.5 [ ]
Compute variable byte and γ codes for the postings list: 777, 17743, 294068, 31251336_. Use gaps instead of
docIDs where possible. Write binary codes in 8-bit blocks.
Gaps : 777, 16966, 276325, 30957268
<9,6><70,4,1><101,110,16><84,61,97,14>
00001001 10000011 00110001 00000001 10000001 00101011 00111011 10000001 00010101 00101111
01000011 10000111

777: 1111111110,001000011
16966: 1111111111110,11000100100001
294068:1111111111111111110, 000111110010110100
30957268: 1111111111111111111111110,110110000101111011010100

Exercise 5.6 Consider the postings list: 4, 10, 11, 12, 15, 62, 63, 265, 268,270, 400 with a corresponding list of
gaps: 4, 6, 1, 1, 3, 47, 1, 202,3, 2, 130. Assume that the length of the postings list is stored separately, so the
system knows when a postings list is complete. Using variable byte encoding: (i) What is the largest gap you
can encode in 1 byte? (ii) What is the largest gap you can encode in 2 bytes?
i- 2^7 -1 =127
ii- 2^14-1 = 16383

Exercise 5.8 [ ]
From the following sequence of γ -coded gaps, reconstruct first the gap sequence and then the postings
sequence:
1110001 11010 101 11111011011 11011.
1110, 001: 9
110, 10: 6
10, 1:3
111110,11011:59
110,11:7

You might also like