{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

CS351 FinalExam Solutions

# CS351 FinalExam Solutions - COMPUTER ENGINEERING DEPARTMENT...

This preview shows pages 1–4. Sign up to view the full content.

COMPUTER ENGINEERING DEPARTMENT Bilkent University CS 351: Data Organization and Management Final Exam (Section 2 & 3) Dec. 23, 2005 – 12:15 – 14:15 NAME/Section: GOOD LUCK! Notes: 1. There are 100 points, 9 questions on 8 pages. 2. Please first READ the questions and then provide short answers. 3. Show your work. 4. You are not allowed to use your cell phone or PDA for any purpose. 5. Before proceeding with the questions please read the last page, Appendix, for IBM 3380 parameters and further instructions. 1 . (10 pts.) In this question consider an inverted file-based search engine environment. No. of Query Terms 1 2 3 4 5 Probability .2 .4 .2 .1 .1 The above table indicates that 20% of the queries contain 1 term (i.e., their probability is .2), similar interpretations are valid for the other entries of the table. In the same environment, the posting lists have the following characteristics in terms of their length (in number of thousand disk blocks). Posting list Length (in 1000 blocks) 1 2 3 4 Probability .4 .4 .1 .1 The above table indicates that, for example, 40% of the posting lists occupy 1000 disk block. a . Determine the expected number of terms in an average query. Answer: Expected number of terms = 1 x 0.2 + 2 x 0.4 + 3 x 0.2 + 4 x 0.1 + 5 x 0.1 = 2.5 Thus, an average query has about 3 terms. b. What is the expected number of posting disk blocks to be accessed for an average query? Answer: For each term the number of posting disk blocks to be accessed is : 1000 x (1 x 0.4 + 2 x 0.4 + 3 x 0.1 + 4 x 0.1) = 1900

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
CS 351: Data Organization and Management, Fall 2005, Final Exam p. 2 As we have 3 terms in an average query, the expected number of posting disk blocks to be accessed is : 3 x 1900 = 5700 c. What is the expected query processing time if we assume that in a posting list 80% of the disk blocks are allocated sequentially and the rest randomly. Assume an IBM3380 environment. Answer: Let the number of sequentially allocated blocks be b s and randomly allocated blocks be b r . Then the expected query processing time is calculated with the formula b s x ebt + b r x (s + r + btt) Using the average number of blocks to be accessed (calculated in b) and the IBM 3380 specifications we get query processing time = 5700 x 0.8 x 0.84 + 5700 x 0.2 x (16 + 8.3 + 0.8) = 32444 ms = 32 sec. 2 . (10 In a university database we have information about professors (with SSN), courses (with courseid). Professors teach courses. Between these two items, there is Teaches relationship. (This question is tricky, and some of the drawings may not match the specifications.) a. Professors can teach the same course in several semesters, and each offering must be recorded. Draw an ER diagram for this specification. Answer:
CS 351: Data Organization and Management, Fall 2005, Final Exam p. 3 b. Consider the following specification and the following ER diagram and state if the given diagram matches the specification given below. If you’re answer is "No." Explain the problem.

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### What students are saying

• As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

Kiran Temple University Fox School of Business ‘17, Course Hero Intern

• I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

Dana University of Pennsylvania ‘17, Course Hero Intern

• The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

Jill Tulane University ‘16, Course Hero Intern