[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"doc-detail-114785-en":3,"doc-seo-114785-105":29,"detail-sidebar-cat-0-en-105":91},{"code":4,"msg":5,"data":6},0,"success",{"doc_id":7,"user_id":8,"nickname":9,"user_avatar":10,"doc_module":4,"category_id":11,"category_name":12,"doc_title":13,"doc_description":14,"doc_content":15,"file_id":16,"file_url":17,"file_type":18,"file_size":19,"view_count":20,"is_deleted":4,"is_public":20,"is_downloadable":20,"audit_status":20,"page_count":21,"language":22,"language_code":23,"site_id":24,"html_lang":23,"table_of_contents":25,"faqs":26,"seo_title":13,"seo_description":14,"update_tm":27,"read_time":28},114785,1374391974564,"Clementine","https://ap-avatar.wpscdn.com/avatar/14000253aa45c000a9e?x-image-process=image/resize,m_fixed,w_180,h_180&k=1779874745381141002",8,"Research & Report","An Introduction to Information Retrieval - Solutions to Exercises","This document provides solutions for most exercises from Introduction to Information Retrieval by Manning, Raghavan, and Schütze. It focuses on core information retrieval techniques using concrete examples, including building an inverted index, constructing term-document incidence matrices, and translating between Boolean and index representations. It also addresses Boolean query evaluation strategies, such as intersection/union approaches with AND, OR, and NOT, and analyzes time complexity implications for different query structures.","An Introduction to Information Retrieval  \nChristopher D. Manning Prabhakar Raghavan Hinrich Schütze  \nCambridge University Press Cambridge, England  \nPreliminary draft (c)􀀀2007 Cambridge UP  \nDRAFT!  \nDO NOT DISTRIBUTE WITHOUT PRIOR PERMISSION © 2007 Cambridge University Press  \nBy Christopher D. Manning, Prabhakar Raghavan & Hinrich Schütze  \nPrinted on December 12 , 2007  \nWebsite: [http://www.informationretrieval.org/](http://www.informationretrieval.org/)  \nComments, corrections, and other feedback most welcome at: [informationretrieval@yahoogroups.com](informationretrieval@yahoogroups.com)  \nPreliminary draft (c)􀀀2007 Cambridge UP  \nv  \nSolutions to exercises  \nThis document contains solutions to most exercises in Introduction to Information Retrieval. The solutions were provided by a student and many have not been checked by the authors yet. Please send comments and corrections to informationretrieval (at) [yahoogroups.com](yahoogroups.com) .  \nRequests for this document should be directed to the address given in the section “Problem sets” at [http://informationretrieval.org](http://informationretrieval.org).  \nPlease do not distribute these solutions without prior permission.  \nPreliminary draft (c)􀀀2007 Cambridge UP  \nPreliminary draft (c)􀀀2007 Cambridge UP  \n?  \nDRAFT! © December 12 , 2007 Cambridge University Press. Feedback welcome. vii  \nBoolean retrieval  \nExercise 0.1 [!]  \nDraw the inverted index that would be built for the following document collection.(See Figure 1 .3 for an example.)  \nDoc 1 new home sales top forecasts Doc 2 home sales rise in july Doc 3 increase in home sales in july Doc 4 july new home sales rise  \nSOLUTION. Inverted Index: forecast->1 home->1->2->3->4 in->2->3 increase->3 july->2->3 new->1->4 rise->2->4 sale->1->2->3->4 top->1  \nExercise 0.2 [!]  \nConsider these documents:  \nDoc 1 breakthrough drug for schizophrenia Doc 2 new schizophrenia drug  \nDoc 3 new approach for treatment of schizophrenia Doc 4 new hopes for schizophrenia patients  \na. Draw the term-document incidence matrix for this document collection.  \nb. Draw the inverted index representation for this collection, as in Figure 1 .3 (page 7) .  \nSOLUTION.  \nTerm-Document matrix: d1 d2 d3 d4 Approach 0 0 1 0 breakthrough 1 0 0 0 drug 1 1 0 0 for 1 0 1 1 hopes 0 0 0 1 new 0 1 1 1 of 0 0 1 0 patients 0 0 0 1 schizophrenia 1 1 1 1 treatment 0 0 1 0  \nInverted Index: Approach -> 3 breakthrough->1 drug ->1->2 for ->1->3->4 hopes->4 new- .>2->3->4 of->3 patients->4 schizophrenia->1->2->3->4 treatment >3  \nExercise 0.3 [!]  \nFor the document collection shown in Exercise 1.2, what are the returned results for these queries:  \na. schizophrenia AND drug  \nPreliminary draft (c)􀀀2007 Cambridge UP  \nviii Boolean retrieval  \nb. for AND NOT(drug OR approach)  \nSOLUTION.  \n(i) doc1, doc2 (ii) doc4  \n?  \nExercise 0.4 [!]  \nFor the queries below, can we still run through the intersection in time O (x + y), where x and y are the lengths of the postings lists for Brutus and Caesar? If not, what can we achieve?  \na. Brutus AND NOT Caesar  \nb. Brutus OR NOT Caesar  \nSOLUTION. a. Time is O(x+y) . Instead of collecting documents that occur in both postings lists, collect those that occur in the ﬁrst one and not in the second. b. Time is O(N) (where N is the total number of documents in the collection) assuming we need to return a complete list of all documents satisfying the query. This is because the length of the results list is only bounded by N, not by the length of the postings lists.  \nExercise 0.5 [!]  \nExtend the postings merge algorithm to arbitrary Boolean query formulas. What is its time complexity? For instance, consider:  \nc. (Brutus OR Caesar) AND NOT (Anthony OR Cleopatra)  \nCan we always merge in linear time? Linear in what? Can we do better than this?  \nSOLUTION. We can always intersect in O (qN) where q is the number of query terms and N the number of documents, so the intersection time is linear in the number of documents and query t","cbCaieo9gpb73Y3S","https://ap.wps.com/l/cbCaieo9gpb73Y3S","pdf",2765893,1,119,"English","en",105,"# Solutions to exercises\n## Boolean retrieval\n## Exercise 0.1: Inverted index\n## Exercise 0.2: Term-document matrix and inverted index\n## Exercise 0.3: Boolean query results\n## Exercise 0.4: Intersection time complexity\n## Exercise 0.5: Posting merge for Boolean formulas\n## Exercise 0.6: Disjunctive normal form efficiency\n## Exercise 0.7: Query processing order","[{\"question\":\"What does the document contain?\",\"answer\":\"The document contains solutions to most exercises in Introduction to Information Retrieval.\"},{\"question\":\"How does it approach Boolean retrieval problems?\",\"answer\":\"It uses example document collections to build inverted indexes and term-document matrices, then derives query results and evaluation strategies using AND/OR/NOT operators.\"},{\"question\":\"Why are time complexity considerations emphasized for Boolean queries?\",\"answer\":\"Because different query structures change how postings lists are merged or intersected, affecting runtime bounds such as O(x + y), O(N), or O(qN).\"}]",1785403794,300,{"code":4,"msg":30,"data":31},"ok",{"site_id":24,"language":23,"slug":32,"title":13,"keywords":33,"description":14,"schema_data":34,"social_meta":86,"head_meta":88,"extra_data":90,"updated_unix":27},"an-introduction-to-information-retrieval-solutions-to-exercises","",{"@graph":35,"@context":85},[36,53,68],{"@type":37,"itemListElement":38},"BreadcrumbList",[39,43,47,50],{"item":40,"name":41,"@type":42,"position":20},"https://docshare.wps.com","Home","ListItem",{"item":44,"name":45,"@type":42,"position":46},"https://docshare.wps.com/document/","Document",2,{"item":48,"name":12,"@type":42,"position":49},"https://docshare.wps.com/document/research-report/",3,{"item":51,"name":13,"@type":42,"position":52},"https://docshare.wps.com/document/an-introduction-to-information-retrieval-solutions-to-exercises/114785/",4,{"url":51,"name":13,"@type":54,"author":55,"headline":13,"publisher":57,"fileFormat":60,"inLanguage":23,"description":14,"dateModified":61,"datePublished":62,"encodingFormat":60,"isAccessibleForFree":63,"interactionStatistic":64},"DigitalDocument",{"name":9,"@type":56},"Person",{"url":40,"name":58,"@type":59},"DocShare","Organization","application/pdf","2026-07-31","2026-07-30",true,{"@type":65,"interactionType":66,"userInteractionCount":20},"InteractionCounter",{"@type":67},"ViewAction",{"@type":69,"mainEntity":70},"FAQPage",[71,77,81],{"name":72,"@type":73,"acceptedAnswer":74},"What does the document contain?","Question",{"text":75,"@type":76},"The document contains solutions to most exercises in Introduction to Information Retrieval.","Answer",{"name":78,"@type":73,"acceptedAnswer":79},"How does it approach Boolean retrieval problems?",{"text":80,"@type":76},"It uses example document collections to build inverted indexes and term-document matrices, then derives query results and evaluation strategies using AND/OR/NOT operators.",{"name":82,"@type":73,"acceptedAnswer":83},"Why are time complexity considerations emphasized for Boolean queries?",{"text":84,"@type":76},"Because different query structures change how postings lists are merged or intersected, affecting runtime bounds such as O(x + y), O(N), or O(qN).","https://schema.org",{"og:url":51,"og:type":87,"og:title":13,"og:site_name":58,"og:description":14},"article",{"robots":89,"canonical":51},"index,follow",{"doc_id":7,"site_id":24},{"code":4,"msg":5,"data":92},[93,97,101,105,110,115,120,123,128,131,135],{"id":20,"doc_module":4,"doc_module_name":45,"category_name":94,"show_sort_weight":95,"slug":96},"Story & Novel",90,"story-novel",{"id":46,"doc_module":4,"doc_module_name":45,"category_name":98,"show_sort_weight":99,"slug":100},"Literature",80,"literature",{"id":52,"doc_module":4,"doc_module_name":45,"category_name":102,"show_sort_weight":103,"slug":104},"Exam",70,"exam",{"id":106,"doc_module":4,"doc_module_name":45,"category_name":107,"show_sort_weight":108,"slug":109},5,"Comic",60,"comic",{"id":111,"doc_module":4,"doc_module_name":45,"category_name":112,"show_sort_weight":113,"slug":114},6,"Technology",50,"technology",{"id":116,"doc_module":4,"doc_module_name":45,"category_name":117,"show_sort_weight":118,"slug":119},7,"Healthcare",40,"healthcare",{"id":11,"doc_module":4,"doc_module_name":45,"category_name":12,"show_sort_weight":121,"slug":122},30,"research-report",{"id":124,"doc_module":4,"doc_module_name":45,"category_name":125,"show_sort_weight":126,"slug":127},9,"Religion & Spirituality",20,"religion-spirituality",{"id":126,"doc_module":4,"doc_module_name":45,"category_name":129,"show_sort_weight":126,"slug":130},"World Cup","world-cup",{"id":132,"doc_module":4,"doc_module_name":45,"category_name":133,"show_sort_weight":132,"slug":134},10,"Lifestyle","lifestyle",{"id":136,"doc_module":4,"doc_module_name":45,"category_name":137,"show_sort_weight":106,"slug":138},19,"General","general"]