Presentation is loading. Please wait.

Presentation is loading. Please wait.

Storage Review Questions

Similar presentations


Presentation on theme: "Storage Review Questions"— Presentation transcript:

1 Storage Review Questions

2 Heaps Law Heaps’ law: M = kTb
Compute the vocabulary size M for this scenario: Looking at a collection of web pages, you find that there are 3000 different terms in the first 10,000 tokens and 30,000 different terms in the first 1,000,000 tokens. Assume a search engine indexes a total of 20,000,000,000 (2 × 1010) pages, containing 200 tokens on average What is the size of the vocabulary of the indexed collection as predicted by Heaps’ law?

3 Zipf’s Law Remember: If the most frequent term (the) occurs cf1 times
then the second most frequent term (of) occurs cf1/2 times the third most frequent term (and) occurs cf1/3 times … Suppose that t2 , the second most common word in the text, appears 10,000 times How many times will t10 appear?

4 Dictionary as a Trie This tree is called a trie
Each node can have a child for each letter of the alphabet Circled nodes indicate the end of words The following words are stored in this trie: a, as, are, do, dot, new, news, no, not, zen

5 Dictionary as a Trie How would you implement a trie on disk?
What would the runtime be for word lookup? Assuming: 400,000 words Average length of 8 Average common prefix of length 3 What is the size of the structure you suggested?

6 Blocking of a Dictionary-as-a-String
Size of a Dictionary ברצוננו לבנות מילון בשיטה של Blocking of a Dictionary-as-a-String כאשר כל בלוק מכיל k מילים. לא נעשת שימוש ב-Front-Coding. נתון: ישנם W מילים. מילה ממוצעת הינה באורך n אותיות והמלה הארוכה ביותר באורך x אותיות. אות דורשת בייט אחד של זכרון. ערכי תדירות ומצביעים לאינדקס המהופך דורשים 4 בייטים של זכרון, כל אחד. כל הנתונים נשמרים בכמויות שלמות של בייטים. ברצוננו למצוא את הערך הקטן ביותר של k שניתן לבחור כאשר ישנו m MB של זכרון פנוי עבור המילון. מהו הנוסחה בעזרתו ניתן לחשב את k?

7 Gamma Codes and Delta Codes
Encode 7 Decode 11001 Given a series of bits, divide into separate Gamma Codes: Delta Codes: Encode 57

8 Canonical Huffman Codes
אות תדירות A 0.2 B C 0.4 D Give a Canonical Huffman code for this alphabet. How many different solutions are there?

9 Arithmetic Coding Suppose that we have symbols
A with probability 0.2 B with probability 0.3 C with probability 0.5 Encode ACB using arithmetic coding Encode AAB using adaptive arithmetic coding


Download ppt "Storage Review Questions"

Similar presentations


Ads by Google