{"id":23232,"date":"2023-03-20T09:27:27","date_gmt":"2023-03-20T09:27:27","guid":{"rendered":"https:\/\/www.booksofall.com\/?post_type=product&#038;p=23232"},"modified":"2023-03-20T09:35:50","modified_gmt":"2023-03-20T09:35:50","slug":"discrete-structures-for-computer-science-counting-recursion-and-probability","status":"publish","type":"product","link":"https:\/\/www.booksofall.com\/pt\/discrete-structures-for-computer-science-counting-recursion-and-probability\/","title":{"rendered":"Discrete Structures for Computer Science &#8211; Counting, Recursion, and Probability"},"content":{"rendered":"<h2>Chapter 1 &#8211; Introduction<\/h2>\n<p>In this chapter, we introduce some problems that will be solved later in this book. Along the way, we recall some notions from <a href=\"https:\/\/en.wikipedia.org\/wiki\/Discrete_mathematics\">discrete mathematics<\/a> that you are assumed to be familiar with. These notions are reviewed in more detail in Chapter 2.<\/p>\n<h3>1.1 Ramsey Theory<\/h3>\n<p><a href=\"https:\/\/mathworld.wolfram.com\/RamseyTheory.html\">Ramsey Theory<\/a> studies problems of the following form: How many elements of a given type must there be so that we can guarantee that some property holds? In this section, we consider the case when the elements are people and the property is \u201cthere is a large group of friends or there is a large group of strangers\u201d.<\/p>\n<p>Theorem 1.1.1 In any group of six people, there are<\/p>\n<ul>\n<li>three friends, i.e., three people who know each other,<\/li>\n<li>or three strangers, i.e., three people, none of which knows the other two.<\/li>\n<\/ul>\n<p>In order to prove this theorem, we denote the six people by P1, P2, . . . , P6. Any two people Pi and Pj are either friends or strangers. We define the complete graph G = (V,E) with vertex set<\/p>\n<p>V = {Pi : 1 \u2264 i \u2264 6}<\/p>\n<p>and edge set<\/p>\n<p>E = {PiPj : 1 \u2264 i &lt; j \u2264 6}.<\/p>\n<p>Observe that |V | = 6 and |E| = 15. We draw each edge PiPj as a straight-line segment according to the following rule:<\/p>\n<ul>\n<li>If Pi and Pj are friends, then the edge PiPj is drawn as a solid segment.<\/li>\n<li>If Pi and Pj are strangers, then the edge PiPj is drawn as a dashed segment.<\/li>\n<\/ul>\n<p>In the example below, P3 and P5 are friends, whereas P1 and P3 are strangers.<\/p>\n<p id=\"oiyTpvI\"><img loading=\"lazy\" decoding=\"async\" width=\"315\" height=\"224\" class=\"alignnone size-full wp-image-23235 \" src=\"https:\/\/www.booksofall.com\/wp-content\/uploads\/2023\/03\/img_641823dbdbe6d.png\" alt=\"\" \/><\/p>\n<p>Observe that a group of three friends corresponds to a solid triangle in the graph G, whereas a group of three strangers corresponds to a dashed triangle. In the example above, there is no solid triangle and, thus, there is no group of three friends. Since the triangle P2P4P5 is dashed, there is a group of three strangers.<\/p>\n<p>Using this terminology, Theorem 1.1.1 is equivalent to the following:<\/p>\n<p><strong>Theorem 1.1.2<\/strong> Consider a complete graph on six vertices, in which each edge is either solid or dashed. Then there is a solid triangle or a dashed triangle.<\/p>\n<p><strong>Proof.<\/strong> As before, we denote the vertices by P1, . . . , P6. Consider the five edges that are incident on P1. Using a proof by contradiction, it can easily be shown that one of the following two claims must hold:<\/p>\n<ul>\n<li>At least three of these five edges are solid.<\/li>\n<li>At least three of these five edges are dashed.<\/li>\n<\/ul>\n<p>We may assume, without loss of generality, that the first claim holds. (Do you see why?) Consider three edges incident on P1 that are solid and denote them by P1A, P1B, and P1C.<\/p>\n<p>If at least one of the edges AB, AC, and BC is solid, then there is a solid triangle. In the left figure below, AB is solid and we obtain the solid triangle P1AB.<\/p>\n<p id=\"tnHkVQH\"><img loading=\"lazy\" decoding=\"async\" width=\"409\" height=\"116\" class=\"alignnone size-full wp-image-23236 \" src=\"https:\/\/www.booksofall.com\/wp-content\/uploads\/2023\/03\/img_6418240b3eae3.png\" alt=\"\" \/><\/p>\n<p>Otherwise, all edges AB, AC, and BC are dashed, in which case we obtain the dashed triangle ABC; see the right figure above.<\/p>\n<p>You should convince yourself that Theorem 1.1.2 also holds for complete graphs with more than six vertices. The example below shows an example of a complete graph with five vertices without any solid triangle and without any dashed triangle. Thus, Theorem 1.1.2 does not hold for complete graphs with five vertices. Equivalently, Theorem 1.1.1 does not hold for groups of five people.<\/p>\n<p id=\"lWoXcNT\"><img loading=\"lazy\" decoding=\"async\" width=\"254\" height=\"225\" class=\"alignnone size-full wp-image-23237 \" src=\"https:\/\/www.booksofall.com\/wp-content\/uploads\/2023\/03\/img_64182413920c0.png\" alt=\"\" \/><\/p>\n<p>What about larger groups of friends\/strangers? Let k \u2265 3 be an integer. The following theorem states that even if we take b2k\/2c people, we are not guaranteed that there is a group of k friends or a group of k strangers.<\/p>\n<p>A k-clique in a graph is a set of k vertices, any two of which are connected by an edge. For example, a 3-clique is a triangle.<\/p>\n<p><strong>Theorem 1.1.3<\/strong> Let k \u2265 3 and n \u2265 3 be <a href=\"https:\/\/www.techtarget.com\/whatis\/definition\/integer\">integers<\/a> with n \u2264 b2k\/2c. There exists a <a href=\"https:\/\/en.wikipedia.org\/wiki\/Complete_graph\">complete graph<\/a> with n vertices, in which each edge is either solid or dashed, such that this graph does not contain a solid k-clique and does not contain a dashed k-clique.<\/p>\n<p>We will prove this theorem in Section 7.2, using elementary counting techniques and probability theory. This probably sounds surprising to you, because Theorem 1.1.3 does not have anything to do with probability. In fact, in Section 7.2, we will prove the following claim: Take k = 20 and n = 1024. If you go to the <a href=\"https:\/\/www.byward-market.com\/\">ByWard Market<\/a> in downtown <a href=\"https:\/\/en.wikipedia.org\/wiki\/Ottawa\">Ottawa<\/a> and take a random group of n people, then with very high probability, this group does not contain a subgroup of k friends and does not contain a subgroup of k strangers. In other words, with very high probability, every subgroup of k people contains two friends and two strangers.<\/p>\n","protected":false},"excerpt":{"rendered":"<p><iframe style=\"width: 100%; height: 750px; border: none;\" src=\"https:\/\/online.visual-paradigm.com\/share\/book\/discrete-structures-for-computer-science-counting-recursion-and-probability-1amjrpdep2?p=1\" frameborder=\"0\" allowfullscreen=\"allowfullscreen\"><\/iframe><\/p>\n","protected":false},"featured_media":23239,"template":"","meta":{"_yoast_wpseo_title":"","_yoast_wpseo_metadesc":"Discrete structures for computer science focuses on the study of discrete objects and their properties. Learn more in this book!"},"product_brand":[],"product_cat":[373],"product_tag":[],"class_list":{"0":"post-23232","1":"product","2":"type-product","3":"status-publish","4":"has-post-thumbnail","6":"product_cat-mathematics-for-computer-science","8":"first","9":"instock","10":"shipping-taxable","11":"product-type-simple"},"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.1.1 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Discrete Structures for Computer Science - Counting, Recursion, and Probability - BooksOfAll Portuguese<\/title>\n<meta name=\"description\" content=\"Discrete structures for computer science focuses on the study of discrete objects and their properties. Learn more in this book!\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.booksofall.com\/pt\/discrete-structures-for-computer-science-counting-recursion-and-probability\/\" \/>\n<meta property=\"og:locale\" content=\"pt_PT\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Discrete Structures for Computer Science - Counting, Recursion, and Probability - BooksOfAll Portuguese\" \/>\n<meta property=\"og:description\" content=\"Discrete structures for computer science focuses on the study of discrete objects and their properties. Learn more in this book!\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.booksofall.com\/pt\/discrete-structures-for-computer-science-counting-recursion-and-probability\/\" \/>\n<meta property=\"og:site_name\" content=\"BooksOfAll Portuguese\" \/>\n<meta property=\"article:modified_time\" content=\"2023-03-20T09:35:50+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.booksofall.com\/pt\/wp-content\/uploads\/sites\/8\/2023\/03\/Discrete-Structures-for-Computer-Science.jpg\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:image\" content=\"https:\/\/www.booksofall.com\/pt\/wp-content\/uploads\/sites\/8\/2023\/03\/Discrete-Structures-for-Computer-Science.jpg\" \/>\n<meta name=\"twitter:label1\" content=\"Tempo estimado de leitura\" \/>\n\t<meta name=\"twitter:data1\" content=\"4 minutos\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.booksofall.com\/pt\/discrete-structures-for-computer-science-counting-recursion-and-probability\/\",\"url\":\"https:\/\/www.booksofall.com\/pt\/discrete-structures-for-computer-science-counting-recursion-and-probability\/\",\"name\":\"Discrete Structures for Computer Science - Counting, Recursion, and Probability - BooksOfAll Portuguese\",\"isPartOf\":{\"@id\":\"https:\/\/www.booksofall.com\/pt\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.booksofall.com\/pt\/discrete-structures-for-computer-science-counting-recursion-and-probability\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.booksofall.com\/pt\/discrete-structures-for-computer-science-counting-recursion-and-probability\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.booksofall.com\/pt\/wp-content\/uploads\/sites\/8\/2023\/03\/Discrete-Structures-for-Computer-Science.jpg\",\"datePublished\":\"2023-03-20T09:27:27+00:00\",\"dateModified\":\"2023-03-20T09:35:50+00:00\",\"description\":\"Discrete structures for computer science focuses on the study of discrete objects and their properties. Learn more in this book!\",\"breadcrumb\":{\"@id\":\"https:\/\/www.booksofall.com\/pt\/discrete-structures-for-computer-science-counting-recursion-and-probability\/#breadcrumb\"},\"inLanguage\":\"pt-PT\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.booksofall.com\/pt\/discrete-structures-for-computer-science-counting-recursion-and-probability\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"pt-PT\",\"@id\":\"https:\/\/www.booksofall.com\/pt\/discrete-structures-for-computer-science-counting-recursion-and-probability\/#primaryimage\",\"url\":\"https:\/\/www.booksofall.com\/pt\/wp-content\/uploads\/sites\/8\/2023\/03\/Discrete-Structures-for-Computer-Science.jpg\",\"contentUrl\":\"https:\/\/www.booksofall.com\/pt\/wp-content\/uploads\/sites\/8\/2023\/03\/Discrete-Structures-for-Computer-Science.jpg\",\"width\":\"827\",\"height\":\"1169\",\"caption\":\"Discrete Structures for Computer Science - Counting, Recursion, and Probability\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.booksofall.com\/pt\/discrete-structures-for-computer-science-counting-recursion-and-probability\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.booksofall.com\/pt\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Categories\",\"item\":\"https:\/\/www.booksofall.com\/pt\/categories\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Discrete Structures for Computer Science &#8211; Counting, Recursion, and Probability\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.booksofall.com\/pt\/#website\",\"url\":\"https:\/\/www.booksofall.com\/pt\/\",\"name\":\"BooksOfAll Portuguese\",\"description\":\"Biggest IT eBooks library and learning resources - Free eBooks for programming, computing, artificial intelligence and more.\",\"publisher\":{\"@id\":\"https:\/\/www.booksofall.com\/pt\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.booksofall.com\/pt\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"pt-PT\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.booksofall.com\/pt\/#organization\",\"name\":\"BooksOfAll Portuguese\",\"url\":\"https:\/\/www.booksofall.com\/pt\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"pt-PT\",\"@id\":\"https:\/\/www.booksofall.com\/pt\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.booksofall.com\/pt\/wp-content\/uploads\/sites\/8\/2022\/06\/booksofall-logo-2.png\",\"contentUrl\":\"https:\/\/www.booksofall.com\/pt\/wp-content\/uploads\/sites\/8\/2022\/06\/booksofall-logo-2.png\",\"width\":166,\"height\":30,\"caption\":\"BooksOfAll Portuguese\"},\"image\":{\"@id\":\"https:\/\/www.booksofall.com\/pt\/#\/schema\/logo\/image\/\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Discrete Structures for Computer Science - Counting, Recursion, and Probability - BooksOfAll Portuguese","description":"Discrete structures for computer science focuses on the study of discrete objects and their properties. Learn more in this book!","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.booksofall.com\/pt\/discrete-structures-for-computer-science-counting-recursion-and-probability\/","og_locale":"pt_PT","og_type":"article","og_title":"Discrete Structures for Computer Science - Counting, Recursion, and Probability - BooksOfAll Portuguese","og_description":"Discrete structures for computer science focuses on the study of discrete objects and their properties. Learn more in this book!","og_url":"https:\/\/www.booksofall.com\/pt\/discrete-structures-for-computer-science-counting-recursion-and-probability\/","og_site_name":"BooksOfAll Portuguese","article_modified_time":"2023-03-20T09:35:50+00:00","og_image":[{"url":"https:\/\/www.booksofall.com\/pt\/wp-content\/uploads\/sites\/8\/2023\/03\/Discrete-Structures-for-Computer-Science.jpg","type":"","width":"","height":""}],"twitter_card":"summary_large_image","twitter_image":"https:\/\/www.booksofall.com\/pt\/wp-content\/uploads\/sites\/8\/2023\/03\/Discrete-Structures-for-Computer-Science.jpg","twitter_misc":{"Tempo estimado de leitura":"4 minutos"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.booksofall.com\/pt\/discrete-structures-for-computer-science-counting-recursion-and-probability\/","url":"https:\/\/www.booksofall.com\/pt\/discrete-structures-for-computer-science-counting-recursion-and-probability\/","name":"Discrete Structures for Computer Science - Counting, Recursion, and Probability - BooksOfAll Portuguese","isPartOf":{"@id":"https:\/\/www.booksofall.com\/pt\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.booksofall.com\/pt\/discrete-structures-for-computer-science-counting-recursion-and-probability\/#primaryimage"},"image":{"@id":"https:\/\/www.booksofall.com\/pt\/discrete-structures-for-computer-science-counting-recursion-and-probability\/#primaryimage"},"thumbnailUrl":"https:\/\/www.booksofall.com\/pt\/wp-content\/uploads\/sites\/8\/2023\/03\/Discrete-Structures-for-Computer-Science.jpg","datePublished":"2023-03-20T09:27:27+00:00","dateModified":"2023-03-20T09:35:50+00:00","description":"Discrete structures for computer science focuses on the study of discrete objects and their properties. Learn more in this book!","breadcrumb":{"@id":"https:\/\/www.booksofall.com\/pt\/discrete-structures-for-computer-science-counting-recursion-and-probability\/#breadcrumb"},"inLanguage":"pt-PT","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.booksofall.com\/pt\/discrete-structures-for-computer-science-counting-recursion-and-probability\/"]}]},{"@type":"ImageObject","inLanguage":"pt-PT","@id":"https:\/\/www.booksofall.com\/pt\/discrete-structures-for-computer-science-counting-recursion-and-probability\/#primaryimage","url":"https:\/\/www.booksofall.com\/pt\/wp-content\/uploads\/sites\/8\/2023\/03\/Discrete-Structures-for-Computer-Science.jpg","contentUrl":"https:\/\/www.booksofall.com\/pt\/wp-content\/uploads\/sites\/8\/2023\/03\/Discrete-Structures-for-Computer-Science.jpg","width":"827","height":"1169","caption":"Discrete Structures for Computer Science - Counting, Recursion, and Probability"},{"@type":"BreadcrumbList","@id":"https:\/\/www.booksofall.com\/pt\/discrete-structures-for-computer-science-counting-recursion-and-probability\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.booksofall.com\/pt\/"},{"@type":"ListItem","position":2,"name":"Categories","item":"https:\/\/www.booksofall.com\/pt\/categories\/"},{"@type":"ListItem","position":3,"name":"Discrete Structures for Computer Science &#8211; Counting, Recursion, and Probability"}]},{"@type":"WebSite","@id":"https:\/\/www.booksofall.com\/pt\/#website","url":"https:\/\/www.booksofall.com\/pt\/","name":"BooksOfAll Portuguese","description":"Biggest IT eBooks library and learning resources - Free eBooks for programming, computing, artificial intelligence and more.","publisher":{"@id":"https:\/\/www.booksofall.com\/pt\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.booksofall.com\/pt\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"pt-PT"},{"@type":"Organization","@id":"https:\/\/www.booksofall.com\/pt\/#organization","name":"BooksOfAll Portuguese","url":"https:\/\/www.booksofall.com\/pt\/","logo":{"@type":"ImageObject","inLanguage":"pt-PT","@id":"https:\/\/www.booksofall.com\/pt\/#\/schema\/logo\/image\/","url":"https:\/\/www.booksofall.com\/pt\/wp-content\/uploads\/sites\/8\/2022\/06\/booksofall-logo-2.png","contentUrl":"https:\/\/www.booksofall.com\/pt\/wp-content\/uploads\/sites\/8\/2022\/06\/booksofall-logo-2.png","width":166,"height":30,"caption":"BooksOfAll Portuguese"},"image":{"@id":"https:\/\/www.booksofall.com\/pt\/#\/schema\/logo\/image\/"}}]}},"_links":{"self":[{"href":"https:\/\/www.booksofall.com\/pt\/wp-json\/wp\/v2\/product\/23232","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.booksofall.com\/pt\/wp-json\/wp\/v2\/product"}],"about":[{"href":"https:\/\/www.booksofall.com\/pt\/wp-json\/wp\/v2\/types\/product"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.booksofall.com\/pt\/wp-json\/wp\/v2\/media\/23239"}],"wp:attachment":[{"href":"https:\/\/www.booksofall.com\/pt\/wp-json\/wp\/v2\/media?parent=23232"}],"wp:term":[{"taxonomy":"product_brand","embeddable":true,"href":"https:\/\/www.booksofall.com\/pt\/wp-json\/wp\/v2\/product_brand?post=23232"},{"taxonomy":"product_cat","embeddable":true,"href":"https:\/\/www.booksofall.com\/pt\/wp-json\/wp\/v2\/product_cat?post=23232"},{"taxonomy":"product_tag","embeddable":true,"href":"https:\/\/www.booksofall.com\/pt\/wp-json\/wp\/v2\/product_tag?post=23232"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}