{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

CS351 FinalExam Solutions

CS351 FinalExam Solutions - COMPUTER ENGINEERING DEPARTMENT...

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

View Full Document Right Arrow Icon
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
Image of page 1

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

View Full Document Right Arrow Icon
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:
Image of page 2
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.
Image of page 3

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

View Full Document Right Arrow Icon
Image of page 4
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    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.

    Student Picture

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

  • Left Quote Icon

    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.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    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.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern