{ "query": "Please summarize the whole context. It is important that you include a summary for each file. All files should be included, so please make sure to go through the entire context", "namespace": "924dbc22-31b1-4285-ad02-9f10843c9937", "messages": [], "stream": false, "language_level": "", "chat_channel": "", "language": "German", "tone": "neutral", "writing_style": "standard", "model": "gemini-1.5-flash", "knowledgebase": "ki-dev-large", "seed": 0, "client_id": 0, "all_context": true, "follow_up_for": null, "knowledgebase_files_count": 0, "override_command": "", "disable_clarity_check": true, "custom_primer": "", "logging": true, "query_route": "" } INITIALIZATION Knowledgebase: ki-dev-large Base Query: Please summarize the whole context. It is important that you include a summary for each file. All files should be included, so please make sure to go through the entire context Model: gemini-1.5-flash **Elapsed Time: 0.00 seconds** ROUTING Query type: summary **Elapsed Time: 1.66 seconds** RAG PARAMETERS Max Context To Include: 120 Lowest Score to Consider: 0 ================================================== **Elapsed Time: 0.00 seconds** ================================================== VECTOR SEARCH ALGORITHM TO USE Use MMR search?: True Use Similarity search?: False ================================================== **Elapsed Time: 0.10 seconds** ================================================== VECTOR SEARCH DONE ================================================== **Elapsed Time: 7.42 seconds** ================================================== PRIMER Primer: You are Simon, a highly intelligent personal assistant in a system called KIOS. You are a chatbot that can read knowledgebases through the "CONTEXT" that is included in the user's chat message. Your role is to act as an expert at summarization and analysis. In your responses to enterprise users, prioritize clarity, trustworthiness, and appropriate formality. Be honest by admitting when a topic falls outside your scope of knowledge, and suggest alternative avenues for obtaining information when necessary. Make effective use of chat history to avoid redundancy and enhance response relevance, continuously adapting to integrate all necessary details in your interactions. Use as much tokens as possible to provide a detailed response. **Elapsed Time: 0.22 seconds** FINAL QUERY Final Query: CONTEXT: ########## File: Algorithms%20and%20Complexity%20-%20Herbert%20S.%20Wilf%20%28PDF%29.pdf Page: 1 Context: # Algorithms and Complexity **Herbert S. Wilf** University of Pennsylvania Philadelphia, PA 19104-6395 ## Copyright Notice Copyright 1994 by Herbert S. Wilf. This material may be reproduced for any educational purpose; multiple copies may be made for classes, etc. Charges, if any, for reproduced copies must be just enough to recover reasonable costs of reproduction. Reproduction for commercial purposes is prohibited. This cover page must be included in all distributed copies. --- ## Internet Edition, Summer, 1994 This edition of *Algorithms and Complexity* is available at the web site [http://www.cis.upenn.edu/~wilf](http://www.cis.upenn.edu/~wilf). It may be taken at no charge by all interested persons. Comments and corrections are welcome and should be sent to [wilf@math.upenn.edu](mailto:wilf@math.upenn.edu). A Second Edition of this book was published in 2003 and can be purchased now. The Second Edition contains solutions to most of the exercises. #################### File: Algorithms%20and%20Complexity%20-%20Herbert%20S.%20Wilf%20%28PDF%29.pdf Page: 2 Context: # CONTENTS ## Chapter 0: What This Book Is About 0.1 Background . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 0.2 Hard vs. easy problems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 0.3 A preview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4 ## Chapter 1: Mathematical Preliminaries 1.1 Orders of magnitude . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 1.2 Positional number systems . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 1.3 Manipulations with series . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 1.4 Recurrence relations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16 1.5 Counting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21 1.6 Graphs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24 ## Chapter 2: Recursive Algorithms 2.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30 2.2 Quicksort . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31 2.3 Recursive graph algorithms . . . . . . . . . . . . . . . . . . . . . . . . . . 38 2.4 Fast matrix multiplication . . . . . . . . . . . . . . . . . . . . . . . . . . 47 2.5 The discrete Fourier transform . . . . . . . . . . . . . . . . . . . . . . . 50 2.6 Applications of the FFT . . . . . . . . . . . . . . . . . . . . . . . . . . . 56 2.7 A review . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60 ## Chapter 3: The Network Flow Problem 3.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63 3.2 Algorithms for the network flow problem . . . . . . . . . . . . . . . . . . . 64 3.3 The algorithm of Ford and Fulkerson . . . . . . . . . . . . . . . . . . . . 65 3.4 The max-flow min-cut theorem . . . . . . . . . . . . . . . . . . . . . . . 69 3.5 The complexity of the Ford-Fulkerson algorithm . . . . . . . . . . . . . . 70 3.6 Layered networks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72 3.7 The MPM Algorithm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76 3.8 Applications of network flow . . . . . . . . . . . . . . . . . . . . . . . 77 ## Chapter 4: Algorithms in the Theory of Numbers 4.1 Preliminaries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81 4.2 The greatest common divisor . . . . . . . . . . . . . . . . . . . . . . . 82 4.3 The extended Euclidean algorithm . . . . . . . . . . . . . . . . . . . . 85 4.4 Primality testing . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87 4.5 Interlude: the ring of integers modulo n . . . . . . . . . . . . . . . . 89 4.6 Pseudoprimality tests . . . . . . . . . . . . . . . . . . . . . . . . . . 92 4.7 Proof of goodness of the strong pseudoprimality test . . . . . . . . . . 94 4.8 Factoring and cryptography . . . . . . . . . . . . . . . . . . . . . . . 97 4.9 Factoring large integers . . . . . . . . . . . . . . . . . . . . . . . . 99 4.10 Proving primality . . . . . . . . . . . . . . . . . . . . . . . . . . . 100 #################### File: Algorithms%20and%20Complexity%20-%20Herbert%20S.%20Wilf%20%28PDF%29.pdf Page: 3 Context: # Chapter 5: NP-completeness ## 5.1 Introduction ................................................ 104 ## 5.2 Turing machines ............................................. 109 ## 5.3 Cook's theorem .............................................. 112 ## 5.4 Some other NP-complete problems ............................. 116 ## 5.5 Half a loaf .................................................. 119 ## 5.6 Backtracking (I): independent sets ........................... 122 ## 5.7 Backtracking (II): graph coloring ............................ 124 ## 5.8 Approximate algorithms for hard problems ..................... 128 #################### File: Algorithms%20and%20Complexity%20-%20Herbert%20S.%20Wilf%20%28PDF%29.pdf Page: 5 Context: # Chapter 0: What This Book Is About ## 0.1 Background An algorithm is a method for solving a class of problems on a computer. The complexity of an algorithm is the cost, measured in running time, or storage, or whatever units are relevant, of using the algorithm to solve one of those problems. This book is about algorithms and complexity, and so it is about methods for solving problems on computers and the costs (usually the running time) of using those methods. Computing takes time. Some problems take a very long time, others can be done quickly. Some problems seem to take a long time, and then someone discovers a faster way to do them (a "faster algorithm"). The study of the amount of computational effort that is needed in order to perform certain kinds of computations is the study of computational complexity. Naturally, we would expect that a computing problem for which millions of bits of input data are required would probably take longer than another problem that needs only a few items of input. So the time complexity of a calculation is measured by expressing the running time of the calculation as a function of some measure of the amount of data that is needed to describe the problem to the computer. For instance, think about this statement: "I just bought a matrix inversion program, and it can invert an \( n \times n \) matrix in just \( 1.2 n^3 \) minutes." We see here a typical description of the complexity of a certain algorithm. The running time of the program is being given as a function of the size of the input matrix. A faster program for the same job might run in \( 0.8 n^3 \) minutes for an \( n \times n \) matrix. If someone were to make a really important discovery (see section 2.4), then maybe we could actually lower the exponent, instead of merely shaving the multiplicative constant. Thus, a program that would invert an \( n \times n \) matrix in only \( 7.2 n^3 \) minutes would represent a striking improvement of the state of the art. For the purposes of this book, a computation that is guaranteed to take at most \( c n^3 \) time for input of size \( n \) will be thought of as "easy" computation. One that needs at most \( n^{10} \) time is also easy. If a certain calculation on an \( n \times n \) matrix were to require \( 2^n \) minutes, then that would be a "hard" problem. Naturally some of the computations that we are calling "easy" may take a very long time to run, but still, from our present point of view, the important distinction to maintain will be the polynomial time guarantee or lack of it. The general rule is that if the running time is at most a polynomial function of the amount of input data, then the calculation is an easy one; otherwise, it’s hard. Many problems in computer science are known to be easy. To convince someone that a problem is easy, it is enough to describe a fast method for solving that problem. To convince someone that a problem is hard is hard, because you will have to prove to them that it is impossible to find a fast way of doing the calculation. It will not be enough to point to a particular algorithm and to lament its slowness. After all, that algorithm may be slow, but maybe there’s a faster way. Matrix inversion is easy. The familiar Gaussian elimination method can invert an \( n \times n \) matrix in time at most \( O(n^3) \). To give an example of a hard computational problem we have to go far afield. One interesting one is called the "tiling problem." Suppose we are given infinitely many identical floor tiles, each shaped like a regular hexagon. The new can tile the whole plane with them, i.e., we can cover the plane with no empty spaces left over. This can also be done if the tiles are identical rectangles, but not if they are regular hexagons. In Fig. 0.1 we show a tiling of the plane by identical rectangles, and in Fig. 0.2 a tiling by regular hexagons. * See, for instance, Martin Gardner’s article in *Scientific American*, January 1977, pp. 110-121. * R. Berger, "The undecidability of the domino problem," *Memor. Amer. Math. Soc.* 66 (1966), Amer. Image Analysis: ### Analysis of the Visual Content --- #### 1. **Localization and Attribution** - **Image 1**: The entire page is considered as a single image for this analysis. --- #### 2. **Object Detection and Classification** - **Image 1**: - **Objects Detected**: - Text blocks various sections. - Margins and typography elements. - **Classification**: Document/Textual Image --- #### 3. **Scene and Activity Analysis** - **Image 1**: - **Scene Description**: - The image depicts a page from a book or document titled "Chapter 0: What This Book Is About". - **Activities**: - The text discusses algorithms, computational complexity, and specific computational problems like the matrix inversion problem and the tiling problem. --- #### 4. **Text Analysis** - **Detected Text**: - **Title**: "Chapter 0: What This Book Is About" - **Sections**: - "0.1 Background" - "Computing takes time." - Various examples of algorithm complexities and mathematical problems. - **Significance**: - The text provides an introduction to the topics covered in the book, primarily focusing on algorithms and computational complexity. It provides foundational understanding and examples. --- #### 5. **Diagram and Chart Analysis** - Not available. --- #### 6. **Product Analysis** - Not available. --- #### 7. **Anomaly Detection** - None detected. --- #### 8. **Color Analysis** - **Dominant Colors**: - The picture is primarily black and white, typical of a document or book page. - **Impact on Perception**: - The monochromatic scheme is typical for dense textual information, aiding readability and focus on content. --- #### 9. **Perspective and Composition** - **Perspective**: - The image is taken from a top-down, straight-on perspective, which is common for document scanning or presentation. - **Composition**: - The text is arranged in traditional book format with headers, paragraphs, and footnotes. - Footnotes at the bottom of the page provide references. --- #### 10. **Contextual Significance** - **Contribution to Message**: - The image sets a foundational understanding of what the book covers, which is essential for providing the reader with context and aligning expectations about the content. --- #### 11. **Metadata Analysis** - Not available. --- #### 12. **Graph and Trend Analysis** - Not available. --- #### 13. **Graph Numbers** - Not available. --- #### **Prozessbeschreibungen (Process Descriptions)** - **Provided Process**: - Description of computational complexity and algorithm analysis processes. - Example of a matrix inversion program's computational requirements. --- #### **Typen Bezeichnung (Type Designations)** - **Designations**: - Easy computations: take at most cubic time in terms of input size. - Hard computations: require more than cubic time. --- #### **Trend and Interpretation** - **Identified Trends**: - Increase in complexity as input size grows. - Specific examples like matrix inversion problem and tiling problem to illustrate differences in complexity. - **Interpretation**: - The text underscores the importance of understanding computational limits and the inherent difficulty in certain problem-solving methods. --- #### **Tables** - Not available. --- #### **Ablaufprozesse (Process Flows)** - Examined processes involve measuring complexity of algorithms (running time, size of input). --- #################### File: Algorithms%20and%20Complexity%20-%20Herbert%20S.%20Wilf%20%28PDF%29.pdf Page: 6 Context: # Chapter 0: What This Book Is About ![Fig. 0.1: Tiling with rectangles](path/to/rectangles-image) ![Fig. 0.2: Tiling with hexagons](path/to/hexagons-image) The way to do it, so even looking for an algorithm would be fruitless. That doesn’t mean that the question is hard for every polygon. Hard problems can have easy instances. What has been proved is that no single method exists that can guarantee that it will decide this question for every polygon. The fact that a computational problem is hard doesn’t mean that every instance of it has to be hard. The problem is hard because we cannot devise an algorithm for which we can give a guarantee of fast performance for all instances. Notice that the amount of input data to the computer in this example is quite small. All we need to input is the shape of the basic polygon. Yet not only is it impossible to devise a fast algorithm for this problem, it has been proved impossible to devise any algorithm at all that is guaranteed to terminate with a Yes/No answer after finitely many steps. That’s really hard! ## 0.2 Hard vs. Easy Problems Let’s take a moment more to say in another way exactly what we mean by an ‘easy’ computation vs. a ‘hard’ one. Think of an algorithm as being a little box that can solve a certain class of computational problems. Into the box goes a description of a particular problem in that class, and then, after a certain amount of time, or of computational effort, the answer appears. A **fast** algorithm is one that carries a guarantee of fast performance. Here are some examples. **Example 1.** It is guaranteed that if the input problem is described with B bits of data, then an answer will be output after at most \(6B^3\) minutes. **Example 2.** It is guaranteed that every problem that can be input with B bits of data will be solved in at most \(O(B^{1.5})\) seconds. A performance guarantee, like the two above, is sometimes called a ‘worst-case complexity estimate,’ and it’s easy to see why. If we have an algorithm that will, for example, sort any given sequence of numbers into ascending order of size (see section 2.1) it may find that some sequences are easier to sort than others. For instance, the sequence `1, 2, 7, 11, 10, 15, 20` is nearly in order already, so our algorithm might, if it takes advantage of the near-order, sort it very rapidly. Other sequences might be a lot harder for it to handle, and might therefore take more time. Math. Soc., Providence, RI 2 Image Analysis: ### Image Analysis #### 1. Localization and Attribution - **Image 1** is at the top center of the page. - **Image 2** is below **Image 1**, also at the center of the page. #### 2. Object Detection and Classification - **Image 1:** - **Object:** Grid pattern - **Category:** Geometric figure - **Key Features:** Consists of several intersecting horizontal and vertical lines forming rectangles. - **Image 2:** - **Object:** Hexagonal tiling - **Category:** Geometric figure - **Key Features:** Composed of multiple hexagons arranged in a regular pattern. #### 3. Scene and Activity Analysis - **Image 1:** - **Scene Description:** The image shows a simple grid pattern created by perpendicular lines intersecting to form rectangles. - **Main Actors and Actions:** None. - **Image 2:** - **Scene Description:** The image depicts a pattern formed by multiple hexagons joined together. - **Main Actors and Actions:** None. #### 4. Text Analysis - **Detected Text:** - "Chapter 0: What This Book Is About" - "Fig. 0.1: Tiling with rectangles" - "Fig. 0.2: Tiling with hexagons" - Additional body text discusses the difference between hard and easy computational problems and examples of each. - **Text Content Analysis:** - The text explains computational complexity, differentiating between easy and hard problems. It provides a brief introduction to the chapter's content and uses figures to illustrate examples of tiling patterns, which likely relate to computational problem examples. - Significant extracts: - "Fig. 0.1: Tiling with rectangles" and "Fig. 0.2: Tiling with hexagons" are captions that explain the images of tiling patterns. - The body text refers to the problem of tiling patterns, implying some connection to algorithmic complexity and computational problems. #### 10. Contextual Significance - The images and text are part of a chapter introduction about computational problems, specifically focusing on examples that illustrate differences between easy and hard problems. The tiling patterns with rectangles and hexagons visually represent examples of problems that an algorithm might need to solve. #### 12. Graph and Trend Analysis - There are no traditional graphs with axes and data points, but the tiling patterns might be interpreted as visual "graphs" in the sense of theoretical computer science problems (e.g., tiling and coverage problems). #### 13. Graph Numbers - Not applicable as there are no numerically labeled graphs. #### Additional Aspects - **Ablaufprozesse (Process Flows):** - None depicted. - **Prozessbeschreibungen (Process Descriptions):** - Descriptions refer to computational problem definitions and characteristics in the text, not shown visually as processes. - **Typen Bezeichnung (Type Designations):** - Types of problems (hard vs. easy) defined and exemplified in the text. - **Trend and Interpretation:** - Trend towards explaining complexity through visual and textual examples, emphasizing how different problem types demonstrate computational difficulty. - **Tables:** - None present in the document. ### Summary The document's main focus is to introduce computational problems and distinguish between those that are considered hard and easy. The images are geometric figures showing tiling with rectangles and hexagons, correlating to examples mentioned in the text. The text provides context on the computational complexity of problems using these visual examples to help illustrate different types of computational challenges. #################### File: Algorithms%20and%20Complexity%20-%20Herbert%20S.%20Wilf%20%28PDF%29.pdf Page: 7 Context: The problem is this. Let \(n\) be a given integer. We want to find out if \(n\) is prime. The method that we choose is the following. For each integer \(m = 2, 3, \ldots, \sqrt{n}\)| we ask if \(m\) divides (evenly into) \(n\). If all of the answers are ‘No,’ then we declare \( n \) to be a prime number, else it is composite. First, we look at the computational complexity of this algorithm. That means that we are going to find out how much work is involved in doing the test. For a given integer \( n \) the work that we have to do can be measured in units of divisions of a whole number by another whole number. In those units, we obviously will do about \(\sqrt{n}\) units of work. It seems as though this is a tractable problem, because, after all, \(\sqrt{n}\) is of polynomial growth in \( n \). For instance, we do less than \( n \) units of work, and that’s certainly a polynomial in \( n \), isn’t it? So, according to our definition of fast and slow algorithms, the distinction was made on the basis of polynomial vs. faster-than-polynomial growth of the work done with the problem size, and therefore this problem must be easy. Right? Well, no not really. References to the distinction between fast and slow methods will show that we have to measure the amount of work done as a function of the number of bits of input to the problem. In this example, \( n \) is not the number of bits of input. For instance, if \( n = 59 \), we don’t need 59 bits to describe it, but only 6. In general, the number of binary digits in the bit string of an integer \( n \) is close to \(\log_2 n\). So in the problem of this example, testing the primality of a given integer \( n \), the length of the input bit string \( B \) is about \(\log_2n\). Seen in this light, the calculation suddenly seems very long. A string consisting of mere \(\log_2 n\) 0’s and 1’s has caused our mighty computer to do about \(\sqrt{n}\) units of work. If we express the amount of work done as a function of \( B \), we find that the complexity of this calculation is approximately \(2^{B/2}\), and that grows much faster than any polynomial function of \( B \). Therefore, the method that we have just discussed for testing the primality of a given integer is slow. See Chapter 4 for further discussions of this problem. At the present time no one has found a fast way to test for primality, nor has anyone proved that there isn’t a fast way. Primality testing belongs to the (well-populated) class of seemingly, but not provably, intractable problems. In this book we will deal with some easy problems and some seemingly hard ones. It’s the ‘seemingly’ that makes things very interesting. These are problems for which no one has found a fast computer algorithm, --- ### Scene and Activity Analysis: #### Described Scene and Activities: - The scene described in the image is a text-heavy document discussing computational problems, particularly focusing on the complexity and computational time of algorithms. - There are discussions of worst-case bounds, average case bounds, and the difference between fast and slow algorithms, followed by an example problem regarding the determination of whether a given integer is prime. #### Main Actors: - The main actors in the scene are algorithms and computational problems. - The text describes the actions of measuring computational complexity, evaluating polynomial vs. non-polynomial time, and testing algorithm efficiency. ### Contextual Significance: #### Contribution to Overall Message: - This text excerpt appears to be from a textbook or academic paper focusing on computational complexity, likely aimed at explaining the difference between easy and hard problems in computer science. - The example provided (primality testing) is used to illustrate these concepts and highlight the challenges associated with algorithm efficiency. ### Perspective and Composition: #### Perspective: - The perspective is that of a reader or student studying the material presented on the page. #### Composition: - The text is organized in a traditional scholarly format, with clear headings, paragraphs, and a structured presentation of concepts and examples. ### Anomaly Detection: - No anomalies were detected in the image; the text appears to be consistent with a standard academic document discussing computational complexity. ### Color Analysis: #### Color Composition: - The image consists entirely of black text on a white background. #### Dominant Colors: - The dominant colors are black and white. ### Graph and Trend Analysis: - There are no graphs present in this image. ### Diagram and Chart Analysis: - There are no diagrams or charts present in this image. ### Metadata Analysis: - There is no visible metadata within the image. ### Additional Aspects: #### Prozessbeschreibungen (Process Descriptions): - The described process is related to evaluating the computational complexity of algorithms, specifically mentioning worst-case and average-case scenarios and providing an example with testing for primality. #### Typen Bezeichnung (Type Designations): - Type designations include polynomial-time algorithms and non-polynomial-time algorithms, as well as tractable and intractable problems. ### Conclusion: This image contains a detailed section of text from what appears to be a textbook or academic paper on computational complexity, focusing on the difference between easy and hard computational problems, with a specific example relating to primality testing. The text touches upon polynomial-time guarantees, worst-case and average-case bounds, and the conceptual distinction between fast and slow algorithms. #################### File: Algorithms%20and%20Complexity%20-%20Herbert%20S.%20Wilf%20%28PDF%29.pdf Page: 7 Context: So in some problems whose input bit string has \( B \) bits, the algorithm might operate in time \( 6B \) and on others it might need, say, \( 100 \log B \) time units, and for still other problems instances of length \( B \) the algorithm might need \( 5B^2 \) time units to get the job done. Well then, what would the warranty card say? I would have to pick out the worst possibility; otherwise the guarantee wouldn’t be valid. It would assure me that if the input problem instance can be described by \( B \) bits, then an answer will appear after at most \( 5B^2 \) time units. Hence, a performance guarantee is equivalent to an estimation of the worst possible scenario: the longest possible calculation that might ensue if \( B \) were input to the program. ### Worst-case bounds Worst-case bounds are the most common kind, but there are other kinds of bounds for running time. We might give an average case bound instead (see section 5.7). That wouldn’t guarantee performance no worse than \( \varepsilon \); it would state that if the performance is averaged over all possible input bit strings of \( B \) bits, then the average amount of computing time will be so-and-so (as a function of \( B \)). Now let’s talk about the difference between easy and hard computational problems and between fast and slow algorithms. A warranty that would not guarantee ‘fast’ performance would contain some function of \( B \) that grows faster than any polynomial, like \( 2^B \), for instance, or like \( n^{\log n} \), etc. It is the polynomial time vs. necessarily polynomial time guarantee that makes the difference between the easy and hard classes of problems, or between the fast and the slow algorithms. It is highly desirable to work with algorithms such that we can give a performance guarantee for running time that is at most a polynomial function of the number of bits of input. An algorithm is slow if, whatever polynomial \( P \) we think of, there exists arbitrary large values of \( B \), such that the input data strings of \( B \) bits, that cause the algorithm to do more than \( P(B) \) units of work. A computational problem is **intractable** if it can be proved that there is no fast algorithm for it. ### Example 3 Here is a familiar computational problem and a method, or algorithm, for solving it. Let’s see if the method has a polynomial time guarantee or not. The problem is this. Let \( n \) be a given integer. We want to find out if \( n \) is prime. The method that we choose is the following. For each integer \( n = 2, 3, \ldots, \sqrt{n} \) we ask if \( n \) divides (evenly into) \( n \). If all the answers are ‘No,’ then we declare \( n \) to be a prime number; else it is composite. In this way, we look at the computational complexity of this algorithm. Therefore, we are going to find out how much work is involved in doing the test. For a given integer \( n \) that we have to do can be measured in units of divisions of a whole number by another whole number. In those units, we obviously will do about \( \sqrt{n} \) units of work. It seems as though this is a tractable problem, because, after all, \( \sqrt{n} \) is of polynomial growth in \( n \). For instance, we do less than \( n \) units of work, and that’s certainly a polynomial in \( n \), isn’t it? So, according to our definition of fast and slow algorithms, this distinction was made on the basis of polynomial vs. faster-than-polynomial growth of the work done with the problem size, and therefore this problem must be easy. Right? Well, not really. Reference to the distinction between fast and slow methods will show that we have to measure the amount of work done as a function of the number of bits of input to the problem. In this example, \( n \) is not the number of bits of input. For instance, if \( n = 59 \), we don’t need 59 bits to describe it, but only 6. In general, the number of binary digits in the bit string of an integer \( n \) is close to \( \log_2 n \). So in the problem of this example, testing the primality of a given integer \( n \), the length of the input bit string \( B \) is about \( 10 \log_2 n \). Seen in this light, the calculation suddenly seems very long, a string consisting of mere log \( 0 \)’s and 1’s has caused our mighty computer to do about \( \sqrt{n} \) units of work. If we express the amount of work done as a function of \( B \), we find that the complexity of this calculation is approximately \( 2^{B/2} \), and that grows much faster than any polynomial function of \( B \). Therefore, note that we have just discussed for testing the primality of a given integer is slow. See Chapter 6 for further discussion of this problem. At the present time no one has found a fast way to test for primality, nor has anyone proved that there isn’t a fast way. Primality testing belongs to the (well-publicized) class of seemingly, but not provably, intractable problems. In this book, we will deal with some easy problems and some seemingly hard ones. It’s the ‘seemingly’ that makes things very interesting. These are problems for which no one has found a fast computer algorithm. Image Analysis: ### Localization and Attribution - The image consists of a single page of a text document. - This can be referred to as **Image 1**. ### Text Analysis #### Extracted Text The main section of the image contains printed text. Below is the complete text extracted from the image: --- **0.2 Hard vs. easy problems** So in some problems whose input bit string has \(B\) bits the algorithm might operate in time \(6B\), and on others its input need, say, \(120\log B\) time units, and for still other problem instances of length \(B\) bits the algorithm might need \(5B^2\) time units to get the job done. Well then, what would the warranty card say? It would have to pick out the worst possibility, otherwise the guarantee wouldn’t be valid. It would assure a user that if the input problem instance can be described by \(B\) bits, then an answer will appear after at most \(5B^2\) time units. Hence a performance guarantee is equivalent to an estimation of the worst possible scenario: the longest possible calculation that might ensue if \(B\) bits are input to the program. Worst-case bounds are the most common kind, but there are other kinds of bounds for running time. We might give an average case bound instead (see section 5.7). That wouldn’t guarantee performance no worse than so-and-so; it would state that if the performance is averaged over all possible input bit strings of \(B\) bits, then the average amount of computing time will be so-and-so (as a function of \(B\)). Now let’s talk about the difference between easy and hard computational problems and between fast and slow algorithms. A warranty that would not guarantee ‘fast’ performance would contain some function of \(B\) that grows faster than any polynomial. Like \(B^B\), for instance, or like \(2^{2^B}\), etc. It is the polynomial time vs. not necessarily polynomial time guarantee that makes the difference between the easy and the hard classes of problems, or between the fast and the slow algorithms. It is highly desirable to work with algorithms such that we can give a performance guarantee for running time that is at most a polynomial \(P(B)\) of the number of bits of input. An algorithm is slow if, whatever polynomial \( P \) we think of, there exist arbitrarily large values of \( B \), and input data strings of \( B \) bits, that cause the algorithm to do more than \( P(B) \) units of work. A computational problem is trackable if there is a fast algorithm that will find all its instances of it. A computational problem is intractable if it can be proved that there is no fast algorithm for it. **Example 3.** Here is a familiar computational problem and a method, or algorithm, for solving it. Let’s see if the method has a polynomial time guarantee or not. #################### File: Algorithms%20and%20Complexity%20-%20Herbert%20S.%20Wilf%20%28PDF%29.pdf Page: 8 Context: # Chapter 0: What This Book Is About but also, no one has proved the impossibility of doing so. It should be added that the entire area is vigorously being researched because of the attractiveness and the importance of the many unanswered questions that remain. Thus, even though we just don't know many things that we'd like to know in this field, it isn't for lack of trying! ## 0.3 Preview Chapter 1 contains some of the mathematical background that will be needed for our study of algorithms. It is not intended that reading this book or using it as a text in a course must necessarily begin with Chapter 1. It’s probably a better idea to plunge into Chapter 2 directly, and then when particular skills or concepts are needed, to read the relevant portions of Chapter 1. Otherwise the definitions and ideas that are in that chapter may seem to be unmotivated, when in fact motivation in great quantity resides in the later chapters of the book. Chapter 2 deals with recursive algorithms and the analysis of their complexities. Chapter 3 is about a problem that seems as though it might be hard, but turns out to be easy, namely the network flow problem. Thanks to quite recent research, there are fast algorithms for network flow problems, and they have many important applications. In Chapter 4 we study algorithms in one of the oldest branches of mathematics, the theory of numbers. Remarkably, the connections between this ancient subject and the most modern research in computer methods are very strong. In Chapter 5 we will see that there is a large family of problems, including a number of very important computational questions, that are bound together by a good deal of structural unity. We don’t know if they’re hard or easy. We do know that we haven’t found a fast way to do them yet, and most people suspect that they’re hard. We also know that if any one of these problems is hard, then they all are, and if any one of them is easy, then they all are. We hope that, having found out something about what people know and what people don’t know, the reader will have enjoyed the trip through this subject and may be interested in helping to find out a little more. #################### File: Algorithms%20and%20Complexity%20-%20Herbert%20S.%20Wilf%20%28PDF%29.pdf Page: 10 Context: # Chapter 1: Mathematical Preliminaries Sharper because not only does it tell us that the function is bounded when \( x \) is large, we learn that the function actually approaches \( 0 \) as \( x \to -\infty \). This is typical of the relationship between \( O \) and \( o \). It often happens that a \( O \) result is sufficient for an application. However, that may not be the case, and we may need the more precise \( o \) estimate. ## Definition We say that \( f(x) = g(x) + o(g(x)) \) if there are constants \( c_1 > 0 \), \( c_2 > 0 \), such that for all \( x > x_0 \) it is true that \( c_1 g(x) < f(x) < c_2 g(x) \). We might then say that \( f \) and \( g \) are of the same rate of growth; only the multiplicative constants are uncertain. Some examples of the \( \sim \) at work are: - \( (x + 1)^2 = \Theta(3x^2) \) - \( (x^2 + 5x + 7)/(5x^3 + 7x + 2) = \Theta(1/x) \) - \( \sqrt{3x} = \Theta(x^{1/2}) \) - \( (1 + 3/x) = \Theta(1) \) The \( \Theta \) is much more precise than either the \( O \) or the \( o \). If we know that \( f(x) = \Theta(x^2) \), then we know that \( f(x)/g(x) \) stays between two nonzero constants for all sufficiently large values of \( x \). The rate of growth of \( f \) is established: it grows quadratically with \( x \). The notation \( g \sim f \) indicates that as \( x \to -\infty \), \( f(x)/g(x) \to 1 \). Here are some examples: - \( x^2 + x^2 \) - \( (3x + 1)^n = \Omega(x^n) \) - \( \sin(1/x) \sim 1/x \) Observe the importance of getting the multiplicative constants exactly right when the \( \sim \) symbol is used. While it is true that \( 2x^2 = \Theta(x^2) \), it is not true that \( 2x^2 \sim x^2 \). It’s, by the way, also true that \( 2x^2 = \Omega(x^2) \), but to make such an assertion is to use bad style since there is no more reasoning available with the \( \sim \) symbol. The last symbol in the asymptotic set that we will need is the \( \Omega \). In a sense, \( f(x) \in \Omega(g(x)) \) means that it is true that \( f(x) \geq c g(x) \) for some \( c > 0 \). In the study of algorithms for computing, the \( \Omega \) is used when we want to express the thought that a certain calculation takes at least \( \Omega \)-so-long to do. For instance, we can multiply together two \( n \times n \) matrices in time \( O(n^{2.81}) \). Later on in this book, we will see how to multiply two matrices even faster, in time \( O(n^2) \). People know of even faster ways to do that job, but one thing that we can be sure of is this: nobody will ever be able to write a matrix multiplication program that will multiply pairs \( n \times n \) matrices with fewer than \( n^2 \) computational steps, because whatever program we write will have to look at the input data, and there are \( 2n^2 \) entries in the input matrices. Thus, a computing time of \( \Omega(n^2) \) is certainly a lower bound on the speed of any possible general matrix multiplication program. We might say, therefore, that the problem of multiplying two \( n \times n \) matrices requires \( \Omega(n^3) \) time. Image Analysis: ## Comprehensive Examination of the Attached Image ### 1. Localization and Attribution - **Document Position**: The visual content is a single page from a broader document, labeled as "Chapter 1: Mathematical Preliminaries". - **Image Number**: Image 1 (only one image). ### 2. Object Detection and Classification - **Detected Objects**: - Text blocks - Mathematical formulas - Heading and subheadings - **Classification**: - Textual content - Mathematical notation and formatting ### 4. Text Analysis - **Extracted Text**: - **Heading**: "Chapter 1: Mathematical Preliminaries" - Large body of text discussing mathematical concepts. - Key terms include "limits", "asymptotics", "symbols of asymptotics", "Ω" (Big Omega), "Θ" (Big Theta), "O" (Big O). - Examples of mathematical notations like: - \((x + 1)^2 = \Theta (3x^2)\) - \((2x^4 + 5x + 7)/(4x^4 + 2) \sim x\) - \( x^2 + x \sim x^2 \) - \( 3x+1/x \sim 3x\) - \(\sin 1/x \sim 1/x \) - **Content Analysis**: - The text is educational and focuses on preliminary concepts in mathematics, particularly asymptotic notation. - Definitions and examples for \(\Theta\), \(\sim\), and \(\Omega\) notations are provided. - Emphasizes on understanding the growth of functions and their limits, which are critical for studying algorithms and their efficiencies. - Discusses the importance of precise asymptotic notation for comparing the growth rates of functions. ### 6. Product Analysis - **No products depicted** in the image. ### 8. Color Analysis - **Dominant Colors**: - Predominantly **black** text on a **white** background. - **Gray** shading used for some example blocks to distinguish or highlight specific parts of the text. - **Impact on Perception**: - The black-and-white scheme is typical for educational and scientific texts, ensuring clarity and readability. - Gray shading helps in emphasizing the example blocks without distracting from the main content. ### 9. Perspective and Composition - **Perspective**: - The image appears to be a direct scan or screenshot of a textbook page, ensuring a head-on view. - **Composition**: - Structured in a logical flow starting with definitions, moving to examples, and then to deeper explanations. - Text is separated by headings, subheadings, and example blocks, making it easy to follow the structure. ### 11. Metadata Analysis - **Metadata Unavailable**: No metadata visible from the provided image. ### 10. Contextual Significance - **Overall Significance**: - This page lays the groundwork for understanding more complex algorithm analysis in subsequent chapters. - It provides crucial definitions and examples that will be referenced throughout the text, establishing a common language and baseline understanding for readers. ### 12. Graph and Trend Analysis - **Not Applicable**: No graphs or trends presented in the image. ### 13. Graph Numbers - **Not Applicable**: No graphs with data points present. ### Abschlussprozesse (Process Flows) - **No process flows** depicted in the image. ### Prozessbeschreibungen (Process Descriptions) - **Description of Mathematical Processes**: - The primary focus is on the process of evaluating the limits of functions and their asymptotic behaviors. - Discusses how to compare the growth rates of different functions using Big O, Theta, and Omega notations. ### Typen Bezeichnung (Type Designations) - **Types Classified**: - Asymptotic notations: Big O (\(O\)), Big Theta (\(\Theta\)), Big Omega (\(\Omega\)) - Descriptions provided for each type’s significance and usage in mathematical analyses. ### Trend and Interpretation - **Identified Trend**: - The trend discussed in the text revolves around the precise characterization of function growth and performance. - **Interpretation**: - Emphasis on the need for accurate asymptotic notation to adequately predict and compare algorithm efficiency. ### Tables - **No Tables** present in the image. ### Final Observation The text serves as an introductory segment to more advanced topics in algorithm analysis. It is crucial for foundational understanding and sets a precedent for the methodology and precision needed in the study of algorithms. The examples and definitions provided are integral for students or readers to gain a firm grasp on the theoretical aspects before diving into practical applications. #################### File: Algorithms%20and%20Complexity%20-%20Herbert%20S.%20Wilf%20%28PDF%29.pdf Page: 11 Context: # 1.1 Orders of magnitude **Definition.** We say that \( f(x) = \Omega(g(x)) \) if there is an \( \epsilon > 0 \) and a sequence \( x_1, x_2, \ldots \) such that \( \forall j: f(x_j) > \epsilon g(x_j) \). Now let's introduce a hierarchy of functions according to their rates of growth when \( x \) is large. Among commonly occurring functions of \( x \) that grow without bound as \( x \to \infty \), perhaps the slowest growing ones are functions like \( \log x \) or maybe \( (\log x)^3 \) or things of that sort. It is certainly true that \( \log \log x \to \infty \), but it takes its time about it. When \( x = 1{,}000{,}000 \), for example, \( \log_2 x \) has the value 19.3. Just a bit faster growing than the ‘snails’ above is \( x^{\frac{1}{10}} \). After all, for \( x = 1{,}000 \), we have \( 1{,}000^{\frac{1}{10}} \approx 2.5 \). If we had a computer algorithm that could do \( n \) things in time \( \log n \) and someone found another method that could do the same job in time \( O(\log \log n) \), then the second method, other things being equal, would indeed be an improvement, but it might have to be extremely large before you would notice the improvement. Next on the scale of rapidity of growth we might mention the powers of \( x \). For instance, think about \( x^{0.1} \). It grows faster than \( \log x \), although you wouldn’t believe it if you tried to substitute a few values of \( x \) and to compare the answers (see exercise 1 at the end of this section). **How could we prove that \( x^{0.1} \) grows faster than \( \log x \)?** By using L'Hôpital's rule. **Example.** Consider the limit \( \lim_{x \to \infty} \frac{x^{0.1}}{\log x} \) as \( x \to \infty \). As \( x \to \infty \) assumes the indeterminate form \( \infty/\infty \), and it is therefore a candidate for L'Hôpital's rule, which tells us that if we want to find the limit then we can differentiate the numerator, differentiate the denominator, and try again to let \( x \to \infty \). If we do this, then instead of the original ratio, we find the ratio \[ \frac{(-0.1)x^{-0.9}}{1/x} = -0.1x^{0.1} \] which obviously grows without bound as \( x \to \infty \). Therefore the original ratio \( \frac{x^{0.1}}{\log x} \) also grows without bound. What we have proved, precisely, is that \( x^{0.1} \) grows faster than \( \log x \). To continue up the scale of rates of growth, we meet \( x^2, x^3, x^{15} \log^2 x \), etc., and then encounter functions that grow faster than every fixed power of \( x \) just as \( x^2 \) grows faster than every fixed power of \( x \). Consider \( e^{x^2} \). Since this is the same as \( e^{x \cdot x} \), it will obviously grow faster than \( x^{1000} \), in fact it will be larger than \( x^{1000} \) as soon as \( x > 1000 \), i.e., as soon as \( x > e^{1000} \) (don’t hold your breath!). Hence \( e^{x^2} \) is an example of a function that grows faster than every fixed power of \( x \). Another such example is \( e^{\sqrt{x}} \). **Definition.** A function that grows faster than \( x^n \) for every constant \( n \), but grows slower than \( e^c \) for every constant \( c \) is said to be of moderately exponential growth if for every \( \epsilon > 0 \) we have \( f(x) = \Omega(x^n) \) and for every \( c > 0 \) we have \( f(x) = O(e^c) \). Beyond the range of moderately exponential growth are the functions that grow exponentially fast. Typical of such functions are \( 10^{n} \), \( 2^{n^2} \), and so forth. Formally, we have the: **Definition.** A function \( f \) is of exponential growth if there exists \( c > 1 \) such that \( f(x) = \Omega(c^x) \) and there exists \( d \) such that \( f(x) = O(d^x) \). If we truncate up a function of exponential growth with smaller functions then we will not change the fact that it is of exponential growth. The series \( e^{x^2/(n^2 + 37)} \) remains of exponential growth, because \( e^{x^2} \) is by itself, and it resists the efforts of the smaller functions to change its mind. Beyond the exponentially growing functions there are functions that grow as fast as you might please. Like \( n! \), for instance, which grows faster than \( c^n \) for every fixed constant \( c \) and like \( 2^{n!} \), which grows much faster than \( n! \). The growth ranges that are the most common to computer scientists are ‘between’ the very slowly, logarithmically growing functions and the functions that are of exponential growth. The reason is simple: if a computer algorithm requires more than an exponential amount of time to do its job, then it will probably not be used, or at any rate it will be used only in highly unusual circumstances. In this book, the algorithms that we will deal with fall in this range. Now we have discussed the various symmetries and asymptotes that are used to compare the rates of growth of pairs of functions, and we have dismissed the pecking order of rapidity of growth, so that we have a small catalogue of functions that grow slowly, medium-fast, fast, and super-fast. Next, let’s look at the growth of sums that involve elementary functions, with a view toward discovering the rates at which the sums grow. Image Analysis: **Text Analysis:** 1. **Text Detection and Extraction:** - The page contains a significant amount of text discussing mathematical functions and their rates of growth. 2. **Content Analysis and Significance:** - **Definitions and Explanations:** - The text defines the notation \(f(x) = \Omega(g(x))\) for functions that grow without bound. - It discusses functions growing faster than linear, such as logarithmic, polynomial, and exponential functions. - Examples illustrate the concepts further using L'Hôpital's rule to compare growth rates. - **Function Hierarchy:** - It introduces a hierarchy of functions according to their growth rates when \(x \to \infty\). - Examples include \(\log \log x\), \(\log x\), \(x^c\), and various polynomial and exponential functions. - **Moderately Exponential and Exponential Growth:** - Definitions around moderately exponential growth (\(f(x) = \Omega(a^{(\gamma x)}\))) - Explanation involving exponential growth (\(f(x) = \Theta(e^{cx})\)) and functions of faster growth beyond exponential. - **General Discussion:** - The importance of comparing growth rates is emphasized, particularly for understanding computational complexity. - Techniques such as L'Hôpital's rule are presented for proving and understanding these contrasts in growth rates. **Localization and Attribution:** 1. **Page Layout:** - Single page visual, holding multiple sections of text with definitions, explanations, and examples all centered around mathematical functions and growth rates. **Scene and Activity Analysis:** 1. **Scene Description:** - The entire scene is text-based with mathematical formulas and theoretical explanations filling the content. - The activity involves explanations, definitions, and examples intended to educate readers on the rates of growth for functions in mathematical terms. There are no human actors; the main component is the academic content. **Diagram and Chart Analysis:** - There are no diagrams or charts in this section of text. **Product Analysis:** - No products are depicted. **Anomaly Detection:** - No anomalies are apparent. **Color Analysis:** 1. **Color Composition:** - The text is black on a white background, creating high readability and a standard academic format. #################### File: Algorithms%20and%20Complexity%20-%20Herbert%20S.%20Wilf%20%28PDF%29.pdf Page: 11 Context: **Perspective and Composition:** 1. **Perspective:** - Standard straight-on view of the page, as commonly found in scanned documents or electronic texts. 2. **Composition:** - Text is organized into sections with headings for definitions, examples, and specific types of function growth. - Each paragraph builds on the previous, contributing to the overall understanding of function growth rates. **Contextual Significance:** 1. **Overall Document Context:** - Likely part of a mathematical textbook or academic paper. - The content plays a crucial role in teaching or explaining the complexity related to function growth rates, which is relevant in fields like computer science, mathematics, and related disciplines focusing on algorithm complexity. **Tables:** - No tables are included in the image. **Metadata Analysis:** - No metadata can be analyzed from the visual. **Graph and Trend Analysis:** - No graphs are included in the image. **Graph Numbers:** - No graphs to provide data points for. **Ablaufprozesse (Process Flows):** - No process flows depicted. **Prozessbeschreibungen (Process Descriptions):** - No detailed processes depicted beyond the instructional explanations about different function growth rates. **Typen Bezeichnung (Type Designations):** - Discusses types of function growth (e.g., polynomial, exponential). **Trend and Interpretation:** 1. **Trend Identification:** - The trend focuses on the increasing complexity and rates of growth in mathematical functions. 2. **Interpretation:** - Understanding these trends is crucial for comparing algorithms and their efficiencies. In summarizing the visual content, the focus is academic, dissecting different types of functions and their growth rates, benefiting professionals and students in mathematics and computer science. #################### File: Algorithms%20and%20Complexity%20-%20Herbert%20S.%20Wilf%20%28PDF%29.pdf Page: 12 Context: # Chapter 1: Mathematical Preliminaries Think about this one: $$ f(n) = \sum_{j=0}^{n} j^2 = 1^2 + 2^2 + 3^2 + \ldots + n^2 \tag{1.1} $$ Thus, \( f(n) \) is the sum of the squares of the first \( n \) positive integers. How fast does \( f(n) \) grow when \( n \) is large? Notice at once that among the \( n \) terms in the sum that defines \( f(n) \), the biggest one is the last one, namely \( n^2 \). Since there are \( n \) terms in the sum and the biggest one is only \( n^2 \), it is certainly true that \( f(n) = O(n^3) \), and even more, that \( f(n) \sim \frac{n^3}{3} \) for all \( n \geq 1 \). Suppose we wanted more precise information about the growth of \( f(n) \), such as a statement like \( f(n) \sim \frac{n^3}{3} \). The best way to begin is to visualize the sum in (1.1) as shown in Fig. 1.1.1. ![Fig. 1.1.1: How to overestimate a sum](./path_to_your_image_here) In that figure we see the graph of the curve \( y = x^2 \) in the \( x-y \) plane. Further, there is a rectangle drawn over every interval of unit length in the range from \( x = 1 \) to \( x = n \). The rectangles all lie under the curve. Consequently, the total area of all of the rectangles is smaller than the area under the curve, which is to say that $$ \sum_{j=1}^{n-1} j^2 \leq \int_1^n x^2 \, dx \tag{1.2} $$ If we compare (1.2) and (1.1.1) we notice that we have proved that \( f(n) \leq \left( (n+1)^2 - 1 \right)/3 \). Now we’re going to get a lower bound on \( f(n) \) in the same way. This time we use the setup in Fig. 1.2, where we again show the curve \( y = x^2 \), but this time we have drawn the rectangles so they lie above the curve. From the picture we see immediately that $$ 1^2 + 2^2 + \ldots + n^2 \geq \frac{1}{3} n^3 \tag{1.3} $$ Now our function \( f(n) \) has been bounded on both sides, rather tightly. What we know about it is that for all \( n \geq 2 \): $$ \frac{n^3}{3} \leq f(n) \leq \frac{(n+1)^3 - 1}{3} $$ From this we have immediately that \( f(n) \sim \frac{n^3}{3} \), which gives us quite a good idea of the rate of growth of \( f(n) \) when \( n \) is large. The reader will also have noticed that the \( \sim \) gives a much more satisfying estimate of growth than the \( O \) does. Image Analysis: ### Analysis of the Visual Content #### Localization and Attribution: - **Image 1**: - Location: Center of the page. - Caption: "Fig. 1.1.1: How to overestimate a sum" #### Object Detection and Classification: - **Image 1 (Graph)**: - Detected Objects: Graph with plotted rectangles. - Classification Categories: Mathematical graph, geometric figures. #### Scene and Activity Analysis: - **Image 1**: - Scene Description: A graph of the function \( y = x^2 \) on the \( x-y \) plane. Rectangles are drawn over intervals from \( x = 1 \) to \( x = n \) showing the area under the curve. - Activities: Demonstration of mathematical overestimation. #### Text Analysis: - **Text Content**: 1. "Think about this one:" 2. \( f(n) = \sum_{j=0}^n j^2 = 1^2 + 2^2 + 3^2 + ... + n^2 \) 3. Explanation text discussing bounds and growth of \( f(n) \). 4. Caption: "Fig. 1.1.1: How to overestimate a sum" - **Significance**: - The text introduces a mathematical function \( f(n) \) and discusses its growth. - The explanation provides bounding techniques and visual methods to understand \( f(n) \). #### Diagram and Chart Analysis: - **Image 1 (Diagram)**: - Axes: \( x \) and \( y \) axes with the function \( y = x^2 \). - Scales: Not explicitly mentioned, implied unit intervals on the \( x \)-axis. - Legends: No legends, but visual elements such as rectangles indicate the area calculation. - Key Insights: The diagram visualizes the overestimation method for the sum of squares, showing the higher bound compared to the curve \( y = x^2 \). #### Color Analysis: - **Image 1**: - Dominant Colors: Monochrome (black and white). - Impact: The simplicity and contrast help focus on the mathematical concepts being presented. #### Perspective and Composition: - **Image 1**: - Perspective: Standard front view for graphical representation. - Composition: The graph is neatly centered with clear labels and aligned accurately with explanatory text. #### Contextual Significance: - **Image's Role in the Document**: - Context: The image is part of a mathematical textbook, likely in a chapter discussing preliminary information. - Contribution: It aids in visually demonstrating abstract mathematical concepts, enhancing understanding through visual representation. ### Conclusion: The visual content on the page includes a mathematical explanation of bounding a sum of squares \( f(n) \) using graphical methods. The graph in the center, labeled as "Fig. 1.1.1", illustrates the upper bound of the sum via an overestimation technique. The text supports the graph by providing mathematical justifications and bounds, enriching the reader's conceptual understanding. The monochrome color scheme and structured composition align with educational content, directing focus on the mathematical demonstration. #################### File: Algorithms%20and%20Complexity%20-%20Herbert%20S.%20Wilf%20%28PDF%29.pdf Page: 13 Context: # 1.1 Orders of magnitude ## Fig. 1.1.2: How to underestimate a sum Let’s formulate a general principle for estimating the size of a sum that will make estimates like the above for us without requiring us each time to visualize pictures like Figs. 1.1.1 and 1.1.2. The general idea is that when one is faced with estimating the rates of growth of sums, then one should try to compare the sums with integrals because they’re usually easier to deal with. Let a function \( g(n) \) be defined for nonnegative integer values of \( n \), and suppose that \( g(n) \) is nondecreasing. We want to estimate the growth of the sum \[ G(n) = \sum_{j=1}^{n} g(j) \quad (n = 1, 2, \ldots). \] Consider a diagram that looks exactly like Fig. 1.1.1 except that the curve that is shown there is now the curve \( y = g(x) \). The sum of the areas of the rectangles is exactly \( G(n - 1) \), while the area under the curve between 1 and \( n \) is \( \int_{1}^{n} g(t) \, dt \). Since the rectangles lie wholly under the curve, their combined areas cannot exceed the area under the curve, and we have the inequality \[ G(n - 1) \leq \int_{1}^{n} g(t) \, dt \quad (n \geq 1). \] On the other hand, if we consider Fig. 1.1.2, where the gap is once more the graph of \( y = g(x) \), the fact that the combined areas of the rectangles is now not less than the area under the curve yields the inequality \[ G(n) \geq \int_{1}^{n} g(t) \, dt \quad (n \geq 1). \] If we combine (1.5) and (1.6) we find that we have completed the proof of ### Theorem 1.1.1. Let \( g(t) \) be nondecreasing for nonnegative \( t \). Then \[ \int_{1}^{n} g(t) \, dt \leq \sum_{j=1}^{n} g(j) \leq \int_{1}^{n+1} g(t) \, dt. \] The above theorem is capable of producing quite satisfactory estimates with rather little labor, as the following example shows. Let \( g(n) = \log n \) and substitute in (1.7). After doing the integrals, we obtain \[ n \log n - n \leq \sum_{j=1}^{n} \log(j) \leq (n + 1) \log(n + 1) - n. \] Image Analysis: ### Image 1: Graph Analysis #### Object Detection and Classification - **Graph**: The primary object in the image is a graph. - **Axes**: - The x-axis is labeled with numbers 1 through 7. - The y-axis has numerical values increasing from bottom to top. - **Data Points**: Plotted points connected by a line to form a curve. #### Text Analysis - **Title**: "Fig. 1.1.2: How to underestimate a sum" - **Equations**: - (1.1.4): \(G(n) = \sum_{j=1}^{n}g(j)\) - (1.1.5): \(G(n - 1) \le \int_{1}^{n} g(t) dt \text{ } (n \ge 1)\) - (1.1.6): \(G(n) \ge \int_{1}^{n+1} g(t) dt \text{ } (n \ge 1)\) - Theorem 1.1.1: \(\int_{1}^{n} g(t) dt \le \sum_{j=1}^{n} G(j) \le \int_{1}^{n+1} g(t) dt\) - (1.1.7): Another integral equation expanding on the theorem. - (1.1.8): \(n \log n - n \le \sum_{j=1}^{n} \log j \le (n + 1) \log (n + 1) - n\). #### Diagram and Chart Analysis - **Graph**: - **X-Axis**: Represents discrete points from 1 to approximately 7. - **Y-Axis**: Represents the magnitude values. - **Curve**: Non-linear, appears to increase and then slightly decrease, showing a peak around a specific value. - **Data Points**: Indicate measurements or computed values. #### Contextual Significance - **Mathematical Explanation**: The graph and accompanying text provide a mathematical approach to estimating sums by comparing them with integrals. This is fundamental in calculus, particularly in understanding the behavior of sequences and series. ### Detailed Description of the Content - **Content Description**: The page discusses a general principle for estimating sums and visualizing those sums with graphs. Using integrals to estimate the growth of sums offers simpler and more manageable techniques. #### Process and Type Designations - **Processes**: The text includes mathematical processes for estimating and proving inequalities involving sums and integrals. #### Interpretation and Trends - **Estimation Strategy**: It explains how using integrals can yield satisfactory estimates for sums. ### Color and Composition - **Color**: Monochrome, usually black and white, typical for mathematical text and diagrams. ### Perspectives - **Orthogonal Perspective**: Standard view for mathematical graphs, giving a clear view of both axes and data points. ### Conclusion: The provided image focuses on explaining a mathematical theorem and showing how integrals can be used to estimate sums. This is demonstrated through a graph and rigorous equation analysis, contributing significantly to understanding summation techniques. #################### File: Algorithms%20and%20Complexity%20-%20Herbert%20S.%20Wilf%20%28PDF%29.pdf Page: 15 Context: # 1.2 Positional number systems is a function \( h \) such that \( h = o(h) \) and \( h = \Theta(g) \). Give an explicit construction for the function \( h \) in terms of \( g \). 6. (This exercise is a warmup for exercise 7.) Below there appear several mathematical propositions. In each case, write a proposition that is the negation of the given one. Furthermore, in the negation, do not use the word 'not' or any negation symbols. In each case the question is, “If this isn’t true, then what is true?” (a) \( \forall x > 0, f(x) \neq 0 \) (b) \( \forall y > 0, f(y) > 0 \) (c) \( \forall z \in \mathbb{R}, \, f(z) < f(x) \) (d) \( \exists y > 3 \, \forall z < f(y) \) (e) \( \forall x \exists z \, z < f(y) \) Can you formulate a general method for negating such propositions? Given a proposition that contains \( \forall, \exists \), what rule would apply in order to negate the proposition and leave the result in positive form (containing no negation symbols or ‘not’s)? 7. In this exercise we will work out the definition of the \( \Omega \): (a) Write out the precise definition of the statement \( \lim_{n \to \infty} h(n) = 0 \) (use `\varepsilon`). (b) Write out the negation of your answer to part (a) as a positive assertion. (c) Use your answer to part (b) to give a positive definition of the assertion \( f(n) \neq o(g(n)) \), and thereby justify the definition of the \( \Omega \) symbol that was given in the text. 8. Arrange the following functions in increasing order of their rates of growth, for large \( n \). List them so that each one is ‘little o’ of its successor: \[ 2^{\sqrt{n}}, n^{3.01}, n^{2}, n^{1.6}, \log^{3} n + 1, \sqrt{n}, n \log n, n^{3} \log(\log n), n^{2}, (n + 4)^{12} \] 9. Find a function \( f(x) \) such that \( f(x) = O(2^{x}) \) is true for every \( \varepsilon > 0 \), but for which it is not true that \( f(x) = O(1) \). 10. Prove that the statement \( f(n) = O(2^{\varepsilon}) \) for every \( \varepsilon > 0 \) is equivalent to the statement \( f(n) = \Omega(2^{\varepsilon}) \) for every \( \varepsilon > 0 \). ## 1.2 Positional number systems This section will provide a brief review of the representation of numbers in different bases. The usual decimal system represents numbers by using the digits \( 0, 1, \ldots, 9 \). For the purpose of representing whole numbers we can imagine that the powers of 10 are displayed below like this: \[ \cdots, 100000, 10000, 1000, 100, 10, 1. \] Then, to represent an integer we can specify how many copies of each power of 10 we would like to have. If we write 237, for example, then that means that we want 2 copies of \( 10^2 \) and 3 copies of \( 10^1 \) and 7 copies of \( 10^0 \). In general, if we write out the string of digits that represents a number in the decimal system, as \( d_m d_{m-1} \ldots d_1 d_0 \), then the number that is being represented by that string of digits is \[ n = \sum_{i=0}^{m} d_i \cdot 10^i. \] Now let’s try the binary system. Instead of using \( 10 \)’s we’re going to use \( 2 \)’s. So we imagine that the powers of \( 2 \) are displayed below as: \[ \cdots, 512, 256, 128, 64, 32, 16, 8, 4, 2, 1. \] Image Analysis: ### Comprehensive Examination of the Visual Content #### 1. Localization and Attribution: - The entire content is one cohesive image displaying a single document page. - The page includes both text and mathematical notation, interspersed with explanations. #### 2. Object Detection and Classification: - **Detected Objects:** - Text: The page is predominantly filled with textual content. - Mathematical Notations: Various mathematical expressions and equations are present. #### 3. Scene and Activity Analysis: - **Scene:** The image represents a textbook page. - **Activities:** - The text appears to be an explanation of mathematical concepts, problems, and theorems. - The page is broken down into several exercises or sections (labelled 6, 7, 8, 9, etc.). #### 4. Text Analysis: - **Extracted Text:** The text includes exercises and explanations regarding functions, propositions in mathematics, the definition and application of the 'Ω' (big-Omega) notation, and a brief discussion on positional number systems. - **Key Text Components:** - **Exercise 6:** Deals with understanding the concepts of functions with respect to 'o(h)' and 'o(g)'. - **Exercise 7:** Focuses on the definition of the 'Ω' notation and its implications. - **Exercise 8:** Sorting functions based on their growth rates. - **Exercise 9:** Finding a function \( f(n) \) relative to growth orders. - **Section 1.2:** Discusses positional number systems and their representation. #### 5. Diagram and Chart Analysis: - **No diagrams or charts are present in the content.** #### 7. Anomaly Detection: - **None detected.** The page content appears consistent with typical textbook formatting. #### 8. Color Analysis: - **Color Composition:** The page is in grayscale, predominantly black text on a white background. #### 9. Perspective and Composition: - **Perspective:** Standard head-on view of the document page. - **Composition:** The text is well-organized with structured sections and numbered exercises, typical of textbook formatting. #### 10. Contextual Significance: - **Context:** The image is part of a mathematical or computer science textbook. - **Contributions:** It serves an educational purpose, likely aimed at undergraduate students studying algorithms or theoretical computer science. #### 13. Graph Numbers: - **Data Points:** - **Functions arranged by growth rates:** \( 2^{\sqrt{\log n}}, e^{(\log n)^2}, n^{3\log \log n}, 2^n, n^2, n^{2^n}, \log^2 n + \sqrt{n}, n^{1.6}, \log^2 n + 1, \sqrt{n}, n^{\log \log n}, n^3 \log n, (\log \log n)^3, n^{1.52}, (\pi + 4)^{\log n}, n^3 log n, n (log \log n)^{3/2}, (\pi + 4)^2 \). - These descriptions categorize various functions by their growth rates, providing a foundational understanding of algorithmic efficiency and complexity. #### Textual Breakdown and Analysis: - **Mathematical Propositions:** Exercise 6 gives multiple scenarios of logical and mathematical propositions, exploring negations and defining related terms. - **Growth Rates:** Exercise 8 asks to organize various functions by their growth rates, critical for algorithm analysis. - **Positional Number Systems:** The section 1.2 provides an introduction to positional number systems, a fundamental concept in number theory and computer science. #### Tables: - **No explicit tables are present.** This analysis helps to understand the content of the page thoroughly, laying out detailed insights into the educational content it presents and its structural components. #################### File: Algorithms%20and%20Complexity%20-%20Herbert%20S.%20Wilf%20%28PDF%29.pdf Page: 16 Context: # Chapter 1: Mathematical Preliminaries To represent a number we will now specify how many copies of each power of \(2\) we would like to have. For instance, if we write \(1101\), then we want an \(8\), a \(4\), and a \(1\), so this must be the decimal number \(13\). We will write \[ (13)_{10} = (1101)_{2} \] to mean that the number \(13\) in the base \(10\) is the same as the number \(1101\) in the base \(2\). In the binary system (base \(2\)) the only digits we will ever need are \(0\) and \(1\). What that means is that if we use only \(0\)’s and \(1\)’s then we can represent every number in exactly one way. The unique representation of every number is, after all, what we must expect and demand of any proposed system. Let’s elaborate on this last point. If we were allowed to use more digits than just \(0\)’s and \(1\)’s then we would be able to represent the number \(13\) as a binary number in a whole lot of ways. For instance, we might make the mistake of allowing digits \(0, 1, 2\), \(3\), \(4\), etc. Then \(13\) would be representable as \(3 \cdot 2^{2} + 1 \cdot 2^{1} + 0 \cdot 2^{0}\) etc. So if we were to allow too many different digits then numbers would be representable in more than one way as a string of digits. If we were to allow too few different digits then we would find that some numbers have no representation at all. For instance, if we were to use the decimal system with only the digits \(0, 1, \ldots, 9\), then infinitely many numbers would not be able to be represented, so we had better keep the \(9\)s. The general proposition is this. ### Theorem 1.2.1 Let \(b > 1\) be a positive integer (the 'base'). Then every positive integer \(n\) can be written in one and only one way in the form \[ n = d_k b^k + d_{k-1} b^{k-1} + d_{k-2} b^{k-2} + \ldots \] if the digits \(d_0, d_1, \ldots\) lie in the range \(0 \leq d_i < b - 1\) for all \(i\). **Remark:** The theorem says, for instance, that in the base \(10\) we need the digits \(0, 1, 2, \ldots, 9\); in the base \(2\) we need only \(0\) and \(1\), in the base \(16\) we need sixteen digits, etc. **Proof of the theorem:** If \(b\) is fixed, the proof is by induction on \(n\), the number being represented. Clearly, the number \(1\) can be represented in one and only one way with the available digits (why?). Suppose, inductively, that every integer \(1, 2, \ldots, n - 1\) is uniquely representable. Now consider the integer \(n\). Define \(d = n \mod b\). Then \(d\) is one of the permissible digits. By induction, the number \(n' = (n - d) / b\) is uniquely representable, say \[ n' = d_k b^k + d_{k-1} b^{k-1} + d_{k-2} b^{k-2} + \ldots \] Then clearly, \[ n = d + n' b = d + d_k b^{k+1} + d_{k-1} b^{k} + d_{k-2} b^{k-1} + \ldots \] is a representation of \(n\) that uses only the allowed digits. Finally, suppose that \(n\) has some other representation in this form also. Then we would have \[ n = a_0 + a_1 b + a_2 b^{2} + \ldots = c_0 + c_1 b + c_2 b^{2} + \ldots \] Since \(a_0\) and \(c_0\) are both equal to \(n \mod b\), they are equal to each other. Hence the number \(n' = (n - a_0) / b\) has two different representations, which contradicts the inductive assumption, since we have assumed the truth of the result for all \(n < m\). The bases \(b\) that are the most widely used are, aside from \(2\) (binary system), \(8\) (octal system) and \(16\) (hexadecimal system). The binary system is extremely simple because it uses only two digits. This is very convenient if you’re a computer or a computer designer because the digits can be determined by some component being either ‘on’ (digit \(1\)) or ‘off’ (digit \(0\)). The binary digits of a number are called its bits or its bit string. Image Analysis: ### Analysis of the Attached Visual Content #### 1. Localization and Attribution - **Image Position**: The provided image is positioned on a single page with continuous textual content. #### 2. Object Detection and Classification - **Detected Objects**: - Textual content with mathematical expressions and explanations. - Equations and formulas. #### 3. Scene and Activity Analysis - **Scene Description**: The scene is a page from a mathematical textbook or an academic paper. - **Activities**: Mathematical explanation and theorem proof demonstration. #### 4. Text Analysis - **Extracted Text**: - Chapter heading: "Chapter 1: Mathematical Preliminaries" - Explanation on binary number representation. - Theorem discussion: "Theorem 1.2.1. Let b > 1 be a positive integer (the ‘base’). ..." - Mathematical proof and associated equations. - Remarks on different base representations and their implications. - **Text Content Analysis**: - This text is a part of a mathematical discussion about number representation in different bases. - It starts with an introduction to binary numbers and extends to a general theorem concerning the representation of numbers in any base greater than 1. - Theorem 1.2.1 is stated and proved utilizing induction. - Remarks provide practical insights into the utility of different bases, particularly the binary system. #### 9. Perspective and Composition - **Perspective**: The image is captured from a straight-on perspective, typical of scanned or digitized documents. - **Composition**: The page is well-structured with headings, paragraphs, and equations clearly demarcated and logically arranged. #### 11. Metadata Analysis - **Captured Metadata**: Not available in the provided visual content. ### Additional Aspects: #### Prozessbeschreibungen (Process Descriptions): - **Description**: - **Binary Representation**: Explanation of how the number 13 is represented in binary as (1101)_2. - **General Theorem**: Step-by-step proof demonstrates that any number can be uniquely represented in a given base. - **Inductive Proof**: The proof involves demonstrating that any integer can be represented using a set of permissible digits from 0 to b-1. ### Summary The document is a detailed excerpt from a mathematical text that focuses on number representation in various bases, specifically emphasizing binary, decimal, and hexadecimal systems. It provides theoretical explanations, theorem proofs, and practical remarks on the applications and representations of numbers in different bases, particularly within computer science and numerical analysis. #################### File: Algorithms%20and%20Complexity%20-%20Herbert%20S.%20Wilf%20%28PDF%29.pdf Page: 17 Context: # 1.2 Positional Number Systems The octal system is popular because it provides a way to remember and deal with the long bit strings that binary systems create. According to the theorem, in the octal system the digits that we need are \(0, 1, \ldots, 7\). For instance, \[ (735)_8 = (477)_{10} \] The captivating feature of the octal system is the ease with which we can convert between octal and binary. If we are given the bit string of an integer \(n\), to convert it to octal, all we have to do is group the bits together in groups of three, starting with the least significant bit, then convert each group of three bits independently of the others, into a single octal digit. Conversely, if the octal form of \(n\) is given, then the binary form is obtainable by converting each octal digit independently into the three bits that represent it in the binary system. For example, given \( (11011001101)_2 \). To convert this binary number to octal, we group the bits in threes, \[ (1)(101)(100)(101) \] starting from the right, and then we convert each triple into a single octal digit, thereby getting \[ (11011001101)_2 = (1545)_8. \] If you’re a working programmer, it’s very handy to use the shorter octal strings to remember, or to write down, the longer binary strings because of the space saving, coupled with the ease of conversion back and forth. The hexadecimal system (base 16) is like octal, only more so. The conversion back and forth to binary now uses groups of four bits, rather than three. In hexadecimal we will need, according to the theorem above, 16 digits. We have handy names for the first 10 of these, but what shall we call the ‘digits 10 through 15’? The names that are conventionally used for them are ‘A’, ‘B’, ‘C’, ‘D’, ‘E’, and ‘F’. We have, for example, \[ (A52C)_{16} = 10(4096) + 5(256) + 2(16) + 12 \] \[ = (42284)_{10} \] \[ = (10010)(01001)(00100)(1100)_2 \] \[ = (10100101001110)_2 \] \[ = (1)(010)(010)(100)(101)(100) \] \[ = (122454)_8. \] ## Exercises for Section 1.2 1. Prove that conversion from octal to binary is correctly done by converting each octal digit to a binary triple and concatenating the resulting triples. Generalize this theorem to other pairs of bases. 2. Carry out the conversions indicated below. - (a) \( (73)_{10} = (??)_{8} \) - (b) \( (100)_{8} = (??)_{16} \) - (c) \( (337)_{8} = (??)_{16} \) - (d) \( (ABCD)_{16} = (??)_{10} \) - (e) \( (BEEF)_{16} = (??)_{8} \) 3. Write a procedure `convert(n: integer, digits: string)`, that will find the string of digits that represents \(n\) in the base \(b\). #################### File: Algorithms%20and%20Complexity%20-%20Herbert%20S.%20Wilf%20%28PDF%29.pdf Page: 18 Context: # Chapter 1: Mathematical Preliminaries ## 1.3 Manipulations with Series In this section we will look at operations with power series, including multiplying them and finding their sums in simple form. We begin with a little catalogue of some power series that are good to know. First we have the finite geometric series: \[ \frac{1 - x^{n}}{1 - x} = 1 + x + x^{2} + \ldots + x^{n-1}. \tag{1.3.1} \] This equation is valid certainly for all \( x \neq 1 \), and it remains true when \( x = 1 \) also if we take the limit indicated on the left side. Why is \( 1 - x^{n} \) true? Just multiply both sides by \( 1 - x \) to clear of fractions. The result is: \[ 1 - x^{n} = (1 + x + x^{2} + \ldots + x^{n-1})(1 - x) = (1 + x + x^{2} + \ldots + x^{n-1}) - (x + x^{2} + \ldots + x^{n}) = 1 - x^{n}. \] And the proof is finished. Now try this one. What is the value of the sum: \[ \sum_{j=0}^{\infty} j? \] Observe that we are looking at the right side of (1.3.1) with \( x = 3 \). Therefore the answer is \( (3-1)/2 \). Try to get used to the idea that a series in powers of \( x \) becomes a number if \( x \) is replaced by a number, and if we know a formula for the sum of the series then we know the number that it becomes. Here are some more series to keep in your zoo. A parenthetical remark like \( |x| < 1 \) shows the set of values of \( x \) for which the series converges: \[ \sum_{k=0}^{\infty} x^{k} = \frac{1}{1 - x} \quad (|x| < 1). \tag{1.3.2} \] \[ e^{x} = \sum_{m=0}^{\infty} \frac{x^{m}}{m!} \tag{1.3.3} \] \[ \sin x = \sum_{n=0}^{\infty} (-1)^{n} \frac{x^{2n+1}}{(2n + 1)!} \tag{1.3.4} \] \[ \cos x = \sum_{n=0}^{\infty} (-1)^{n} \frac{x^{2n}}{(2n)!} \tag{1.3.5} \] \[ \log \left( \frac{1}{1 - x} \right) = \sum_{j=1}^{\infty} \frac{x^{j}}{j} \quad (|x| < 1). \tag{1.3.6} \] Can you find a simple form for the sum (the logarithms are 'natural')? \[ 1 + \log 2 + \frac{(\log 2)^{2}}{2!} + \frac{(\log 2)^{3}}{3!} + \ldots \] Hint: Look at (1.3.3), and replace \( x \) by \( \log 2 \). Aside from merely substituting values of \( x \) into known series, there are many other ways of using known series to express sums in simple form. Let’s think about the sum: \[ 1 + 2 + 2 + 3 + 4 + 4 + 5 + 16 + \ldots + N2^{N-1}. \tag{1.3.7} \] #################### File: Algorithms%20and%20Complexity%20-%20Herbert%20S.%20Wilf%20%28PDF%29.pdf Page: 19 Context: We are reminded of the finite geometric series (1.3.1), but (1.3.7) is a little different because of the multipliers \(1, 2, 3, 4, \ldots, N\). The trick is this. When confronted with a series that is similar to, but not identical with, a known series, write down the known series as an equation, with the series on one side and its sum on the other. Even though the unknown series involves a particular value of \(x\), in this case \(x = 2\), keep the known series with its variable unrestricted. Then reach for an appropriate tool that will be applied to both sides of that equation, and whose result will be that the known series will have been changed into the one whose sum we need. In this case, since (1.3.7) reminds us of (1.3.1), we’ll begin by writing down (1.3.1) again, \[ (1 - x)^{-n} = 1 + x + x^2 + \cdots + x^{n-1} \tag{1.3.8} \] Don’t replace \(x\) by \(2\) yet, just walk up to the equation (1.3.8) carrying your tool kit and ask what kind of surgery you could do to both sides of (1.3.8) that would be helpful in evaluating the unknown (1.3.7). We are going to reach into our tool kit and pull out the \(d/dx\). In other words, we are going to differentiate (1.3.8). The reason for choosing differentiation is that it will put the missing multipliers \(1, 2, 3, \ldots, N\) into (1.3.8). After differentiation, (1.3.8) becomes \[ 1 + 2x + 3x^2 + 4x^3 + \cdots + (n - 1)x^{n-2} = \frac{1 - n x^{n-1} + (n - 1)x^n}{(1-x)^2} \tag{1.3.9} \] Now it’s easy. To evaluate the sum (1.3.7), all we have to do is to substitute \(x = 2\), \(n = N + 1\) in (1.3.9), to obtain, after simplifying the right-hand side, \[ 1 + 2 + 2^2 + 4 + 8 + \cdots + 2^{N-1} = 1 + (N - 1)2^N. \tag{1.3.10} \] Next try this one: \[ \frac{1}{2^3} + \frac{1}{3^3} + \cdots \tag{1.3.11} \] If we rewrite the series using summation signs, it becomes \[ \sum_{j=1}^\infty \frac{1}{j^3}. \] Comparison with the series \(200\) shows great resemblance to the species (1.3.6). In fact, if we put \(x = \frac{1}{3}\) in (1.3.6), it tells us that \[ \sum_{j=1}^\infty \frac{1}{j^3} = 1 - \log(3/2). \tag{1.3.12} \] The desired sum (1.3.11) is the result of dropping the term with \(j = 1\) from (1.3.12), which shows that the sum in (1.3.11) is equal to \(\log(3/2) - 1\). In general, suppose that \(f(x) = \sum a_n x^n\) is some series that we know. Then \(\sum n a_n x^{n-1} = f'(x)\) and \(\sum a_n x^n = x f'(x)\). In other words, if the \(n\)-th coefficient is multiplied by \(n\), then the function changes from \(f(x)\) to \(x f'(x)\). If we apply the rule again, we find that multiplying the \(n\)-th coefficient of a power series by \(n^2\) changes the sum from \(f(x)\) to \(\frac{d^2}{dx^2} f(x)\). That is, \[ \sum_{j=0}^\infty j^2 x^j = \left( x \frac{d}{dx} \right)^2 f(x) = \left(x \frac{d}{dx} \right) f(x) = \frac{d}{dx} \left( x f'(x) \right) = (x^2 + x) f'. \] Image Analysis: ### Analysis of the Visual Content #### 1. Localization and Attribution - The content consists of a single page. - There is one image with text and mathematical notations, which will be referred to as **Image 1**. #### 2. Object Detection and Classification - **Image 1**: The main objects in the image are text and mathematical equations. #### 4. Text Analysis - **Image 1**: The text discusses manipulation of series and differentiation in calculus. Specific equations and their derivations are presented to explain mathematical concepts. #### 5. Diagram and Chart Analysis - There are no diagrams or charts present in **Image 1**. #### 7. Anomaly Detection - There are no anomalies or unusual elements detected in **Image 1**. #### 10. Contextual Significance - **Image 1** appears to be part of a mathematical textbook or academic material focused on manipulations with series. This image contributes to the educational aim of explaining mathematical series and their manipulations. #### 12. Graph and Trend Analysis - There are no graphs present in **Image 1**. #### 14. Process Descriptions (Prozessbeschreibungen) - The process involves manipulating known series equations to solve or rewrite unknown series, starting with specific series summations and applying differentiation. - The steps are clearly outlined, starting from equation (1.3.7) and manipulating it by using equation (1.3.8). The process then involves evaluating the series by substituting values and summing the series using known properties. #### 15. Type Designations (Typen Bezeichnung) - Equation designations such as (1.3.8), (1.3.9), (1.3.10), etc., represent different steps and equations discussed in the text. #### 16. Trend and Interpretation - The trend in the mathematical content emphasized is the transition from a general form of a series to more workable forms through manipulation and differentiation, showing the interconnectedness of various series manipulations. #### 18. Tables - There are no tables present in **Image 1**. ### Detailed Breakdown of Text Content in Image 1 - **Introduction to Series Manipulations**: The image starts by setting up a series and its similarity to another series, emphasizing the manipulation of the series by differentiation. - **Mathematical Equations and Derivations**: - Equation (1.3.8) shows the general form of a finite geometric series. - Equation (1.3.9) presents the series after differentiation. - Equation (1.3.10) illustrates the process further, with substitutions leading to simplified series sums. - Additional equations discuss summing series with specific properties, such as summation signs and comparing the series with known results. - **Result and Analysis**: The final part of the text derives outcomes from sum manipulations and differentiations, explaining the steps and their implications in mathematical series. ### Conclusion Overall, this image page focuses on educating the reader about mathematical series manipulations, using clear step-by-step mathematical derivations and explanations. The context is purely educational, likely extracted from an academic resource dedicated to calculus or series in mathematics. #################### File: Algorithms%20and%20Complexity%20-%20Herbert%20S.%20Wilf%20%28PDF%29.pdf Page: 20 Context: # Chapter 1: Mathematical Preliminaries Similarly, multiplying the \( n \)th coefficient of a power series by \( r^n \) will change the sum from \( f(x) \) to \((x-r)f(r)\), but that’s not all. What happens if we multiply the coefficient of \( x^n \) by, say, \( 3n^2 + 2n + 5 \)? If the sum previously was \( f(x) \), then it will be changed to \((3x^2 + 2x + 5)f(x)\). The sum \[ \sum_{j=0}^{\infty} (2j^2 + 5j) \] is therefore equal to \( (2\cdot\frac{d^2}{dx^2} + 5)\frac{1}{(1-x)} \), and after doing the differentiations we find the answer in the form \(\frac{1}{x^2 - 8x + 5}(1 - x^{-2})\). Here is the general rule: if \( P(x) \) is any polynomial then \[ \sum_{j=0}^{\infty} P(j)x^j = P\left(\frac{d}{dx}\right)\sum_{j=0}^{\infty} x^j. \] ## Exercises for section 1.3 1. Find simple, explicit formulas for the sums of each of the following series. - \( \sum_{j=1}^{\infty} \log(j)/j \) - \( \sum_{j=1}^{\infty} (2n + 7)/5^n \) - \( \sum_{j=0}^{\infty} j^2/(2^j) \) - \( \sum_{j=1}^{\infty} 1/(1 - x^j) \) - Explain why \( \sum_{n=0}^{\infty} (-1)^n x^{n+1}/(2n + 1) = 0 \). - (a) \( (1 + t^2)/t \) - (b) \( (3 + 2^2)/n^2 \) - (c) \( (1 + t^2)/(t - 1)^2 \) ## 4 Recurrence relations A recurrence relation is a formula that permits us to compute the members of a sequence once after another, starting with one or more given values. Here is a small example. Suppose we are to find an infinite sequence of numbers \( x_0, x_1, \ldots \) by means of: \[ x_{n+1} = Cx_n, \quad (n \geq 0; x_0 = 1). \] This relation tells us that \( x_1 = Cx_0 \), and \( x_2 = Cx_1 \), etc., and therefore \( x_n = C^n x_0 \). We say that the solution of the recurrence relation (e.g., ‘difference equation’) (1.41) is given by \( x_n = C^n \) for all \( n \geq 0 \). Equation (1.41) is a first-order recurrence relation because a new value of the sequence is computed from just one preceding value (i.e., \( x_{n+1} \) is obtained solely from \( x_n \) and does not involve \( x_{n-1} \) or any earlier values). Observe the format of the equation (1.41). The parenthetical remarks are essential. The first one \( x_2 > 0 \) tells us for what values of the recurrence formula is valid, and the second one ‘\( x_0 = 1 \)’ gives the starting value. If one of these is missing, the solution may not be uniquely determined. The recurrence relation \[ x_{n+1} = x_n + x_{n-1} \] needs two starting values in order to ‘get going’; but it is missing both of those starting values and the range of \( n \). Consequently, (1.42) (which is a second-order recurrence) does not uniquely determine the sequence. Image Analysis: ### Analysis of the Attached Visual Content #### Localization and Attribution: - **Page Layout:** - The visual content consists of a single page. - The page is divided into several sections with text and formulas. #### Text Analysis: - **Content:** - The text appears to be an excerpt from a mathematical textbook or academic paper, touching on mathematical preliminaries. - The main topics covered on the page include the manipulation of power series coefficients, exercises related to the section, and an introduction to recurrence relations. - **Sections and Content Description:** - **Title:** - "**Chapter 1: Mathematical Preliminaries**" - **Power Series Coefficient Manipulation:** - Theorem and explanation about how multiplying the \(n\)th coefficient of a power series by \(n^r\) alters the sum \[f(x)\]. - Specifically, multiplying the coefficient of \(x^n\) by \(3n^2 + 2n + 5\) transforms the sum to \[3\left( \frac{x^3}{(1 - x)^4} \right) + 2\left( \frac{x^2}{(1 - x)^3} \right) + 5 \left( \frac{x}{(1 - x)^2} \right).\] - Further simplification leads to the form \[(7x^2 - 8x + 5) / (1 - x)^3\]. - **General Rule:** - If \(P(x)\) is any polynomial, \[\sum_{j} P(j) a_j x^j = P \left(x \frac{d}{dx} \right) \sum_{j} a_j x^j.\] - **Exercises for Section 1.3:** - Explicit formulas for series sums. - Example exercises include: 1. \(\sum_{j \geq 0} \log^6 j / j!\) 2. \(\sum_{m \geq 0} (2m + 7)^5 / 5^m\) 3. etc. - **Recurrence Relations:** - Definition and examples of recurrence relations. - Introduction to both first-order and second-order recurrence relations. - General form of recurrence relations and necessary initial values for solutions. #### Diagram and Chart Analysis: - **Mathematical Formulas:** - Various mathematical formulas and series expansions are provided. - No graphical diagrams or charts are present. #### Contextual Significance: - **Relevance:** - The content serves as foundational material, likely intended for students or researchers in mathematics. - This page seems to be part of a larger chapter on mathematical preliminaries, contributing to a broader understanding of power series and recurrence relations. ### Conclusion: The examined visual content is a detailed segment from a mathematical textbook, focusing on the manipulation of power series coefficients, providing exercises for the reader, and introducing the concept of recurrence relations. The structured explanations and examples are designed to help develop a deeper understanding of these mathematical concepts. #################### File: Algorithms%20and%20Complexity%20-%20Herbert%20S.%20Wilf%20%28PDF%29.pdf Page: 21 Context: The situation is rather similar to what happens in the theory of ordinary differential equations. There, if we omit initial or boundary values, then the solutions are determined only up to arbitrary constants. Beyond the simple (1.41), the next level of difficulty occurs when we consider a first-order recurrence relation with a variable multiplier, such as \[ x_{n+1} = b_n x_n \quad (n \geq 0 \text{ given}). \tag{1.43} \] Now \( \{ b_n, b_{n-1}, \ldots \} \) is a given sequence, and we are being asked to find the unknown sequence \( \{ x_n \} \). In an easy case like this we can write out the first few \( x_n \) and then guess the answer. We find, successively, that \( x_1 = b_1 x_0 \), then \( x_2 = b_2 x_1 = b_2 b_1 x_0 \), and \( x_3 = b_3 x_2 = b_3 b_2 b_1 x_0 \), etc. At this point we can guess that the solution is \[ x_n = \left( \prod_{i=1}^{n} b_i \right) x_0 \quad (n = 0, 1, 2, \ldots). \tag{1.44} \] Since that wasn't hard enough, we'll raise the ante a step further. Suppose we want to solve the first-order inhomogeneous (because \( x_0 = 0 \) for all \( n \) is not a solution) recurrence relation \[ x_{n+1} = b_n x_n + c_n \quad (n \geq 0; x_0 \text{ given}). \tag{1.45} \] Now we are being given two sequences \( b_n, c_n \), and we want to find the \( x_n \). Suppose we follow the strategy that has so far won the game, that is, writing down the first few \( x_n \) and trying to guess the pattern. Then we would find that \( x_1 = b_0 x_0 + c_0 \), \( x_2 = b_1 x_1 + c_1 \), \( x_2 = b_2 x_1 + c_2 \), and we would probably tire rapidly. Here is a somewhat more orderly approach to (1.45). Though no approach will provide a simple form of the general answer, the one that we are about to describe at least gives a method that is much simpler than the guessing strategy, for many examples that arise in practice. In this book we are going to run into several equations of the type of (1.45), so a unified method will be a definite asset. The first step is to define a new unknown function as follows: \[ x_n = b_{n-1} b_{n-2} \cdots b_0 (n \geq 1; x_0 = k). \tag{1.46} \] Define a new unknown sequence \( y_1, y_2, \ldots \). Now substitute for \( x_n \) in (1.45), getting \[ b_0 y_1 + b_1 y_2 + \ldots + b_{n-1} y_n = c_n + c_{n-1} + \ldots + c_0. \] We notice that the coefficients of \( y_{n+1} \) and \( y_n \) are the same, and so we divide both sides by that coefficient. The result is the equation \[ y_{n+1} = y_n + d_n \quad (n \geq 0; x_0 \text{ given}) \tag{1.47} \] where we have written \( d_n = c_n/(b_n - b_{n-1}) \). Notice that the \( c_n \) are known. We haven't yet solved the recurrence relation. We have only changed to a new unknown function that satisfies a simpler recurrence (1.47). Now the solution of (1.47) is quite simple, because it says that each \( y \) is obtained from its predecessor by adding the next one of the \( d's \). It follows that \[ y_n = y_0 + \sum_{j=1}^{n} d_j \quad (n \geq 0). \] We can now use (1.46) to reverse the change of variables to get back to the original unknowns \( x_0, x_1, \ldots \), and find that \[ x_n = (b_{n-1} b_{n-2} \cdots b_0) x_0 + \sum_{j=1}^{n} d_j \quad (n \geq 1). \tag{1.48} \] It is not recommended that the reader memorize the solution that we have just obtained. It is recommended that the method by which the solution was found be mastered. It involves: (a) make a change of variables that leads to a new recurrence of the form (1.46), then. #################### File: Algorithms%20and%20Complexity%20-%20Herbert%20S.%20Wilf%20%28PDF%29.pdf Page: 22 Context: #### Additional Aspects: - **Ablaufprozesse (Process Flows)**: - Recurrence relation solving methods, from first-order equations to Fibonacci sequence solutions. - **Prozessbeschreibungen (Process Descriptions)**: - Detailed description of deriving general solutions for recurrence relations and solving quadratic characteristic equations. - **Typen Bezeichnung (Type Designations)**: - Various types of recurrence relations and quadratic characteristic equations addressed (first-order, second-order, homogeneous equations). ### Summary The image is a page from an academic text on mathematical preliminaries, focusing on solving first and second-order recurrence relations. It includes several mathematical notations and equations, as well as detailed explanations of solving techniques, particularly relating to the Fibonacci sequence. The text is well-organized with numbered equations and contexts clearly defined for educational purposes. #################### File: Algorithms%20and%20Complexity%20-%20Herbert%20S.%20Wilf%20%28PDF%29.pdf Page: 23 Context: # 1.4 Recurrence Relations The Fibonacci numbers are in fact 1, 1, 2, 3, 5, 8, 13, 21, 34, ... It isn't even obvious that the formula (1.4.15) gives integer values for the \( F_n \). The reader should check that the formula indeed gives the first few \( F_n \) correctly. Just to exercise our newly acquired skills in asymptotics, let's observe that since \( (1 + \sqrt{5})/2 > 1 \) and \( |(1 - \sqrt{5})/2| < 1 \), it follows that when \( n \) is large we have: \[ F_n \sim \left( \frac{(1 + \sqrt{5})}{2} \right)^{n+1} \frac{1}{\sqrt{5}} \] The process of looking for a solution in a certain form, namely in the form \( \alpha^n \), is subject to the same kind of special treatment, in the case of repeated roots, that we find in differential equations. Corresponding to a double root of the associated quadratic equation \( a^2 - \alpha a + \beta = 0 \), we would find two independent solutions \( \alpha^n \) and \( n\alpha^n \), so the general solution would be in the form \( \alpha^n (c_1 + c_2 n) \). ## Example Consider the recurrence: \[ x_{n+1} = 2x_n - x_{n-1} \quad (n \geq 1; \, x_0 = 5; \, x_1 = 5) \tag{1.4.16} \] If we try a solution of the type \( x_n = \alpha^n \), then we find that it satisfies the quadratic equation \( a^2 - 2a + 1 = 0 \). Hence the two roots are \( a = 1 \). The general solution is \( x_n = c_1(\alpha^n) + c_2(n\alpha^n) \). After inserting the given initial conditions, we find that: \[ x_0 = 1 = c_1; \quad x_1 = 5 = c_1 + c_2 \] If we solve for \( c_1 \) and \( c_2 \), we obtain \( c_1 = 1, c_2 = 4 \), and therefore the complete solution of the recurrence (1.4.16) is given by: \[ x_n = 4n + 1 \] Now let's look at recurrent inequalities, like this one: \[ x_{n+1} \leq x_n + x_{n-1} + n^2 \quad (n \geq 1; \, x_0 = 0; \, x_1 = 0) \tag{1.4.17} \] The question is, what restriction is placed on the growth of the sequence \( \{x_n\} \) by (1.4.17)? By analogy with the case of difference equations with constant coefficients, the thing to try here is to set \( x_n \leq K \cdot n^t \). So suppose it is true that \( x_n \leq K n^t \) for \( n = 0, 1, 2, \ldots, N \). Then from (1.4.17) with \( n = N \), we find: \[ x_{N+1} \leq K N^t + K N^{t-1} + N^2 \] Let \( c \) be the positive real root of the equation \( \alpha^2 - c = 1 \) and suppose that \( \alpha > c \). Then \( \alpha^2 > c + 1 \); say, where \( t > 0 \). Hence: \[ x_{N+1} \leq K N^{t-1}(1 + t) + N^2 = K n^{t-1} \left( K n^{t-1} \right) \tag{1.4.18} \] In order to ensure that \( x_{N+1} < K n^{t+1} \), we need to fix \( K < \max_{n \geq 2} \left( \frac{N^2}{N^{t-1}} \right) \). As long as we choose: \[ K < \max_{n \geq 2} \left( \frac{N^2}{N^{t-1}} \right) \tag{1.4.19} \] In which the right member is clearly finite, the inductive step will go through. The conclusion is that (1.4.17) implies that for every fixed \( t > 0 \), \( x_n = O(n^{t+ε}) \), where \( ε = (1 + \sqrt{5})/2 \). The same argument applies to the general situation that is expressed in: Image Analysis: ### Analysis of the Attached Visual Content #### 1. Localization and Attribution - **Image Positioning:** The document contains a single image occupying the entire visible area of the page. It will be referred to as **Image 1**. #### 2. Object Detection and Classification - **Categories Detected:** - **Text Sections:** The image contains various sections of text including paragraphs and mathematical equations. - **Mathematical Equations:** Displayed prominently within the text. #### 3. Scene and Activity Analysis - **Description:** Image 1 depicts a page from an academic or educational document likely related to mathematics or computer science. - **Main Activities:** The main activity includes the explanation of mathematical recurrence relations and the exploration of the Fibonacci numbers. #### 4. Text Analysis - **Text Extraction:** - Title/Header: "1.4 Recurrence relations" - Paragraphs explaining the concept of recurrence relations and their properties. - Example recurrence relation shown as \( x_{n+1} = 2x_n - x_{n-1} \) and subsequent mathematical steps. - Additional explanations about the growth of sequences and inferences from specific equations. - Concluding text about general cases and implications of mathematical findings. - **Content Significance:** - **Educational Value:** The text is highly educational, explaining sophisticated mathematical concepts and recurrence relations. It is written to enhance the reader's understanding of solving recurrence relations using mathematical examples and proofs. - **Instructional Examples:** Provides clear mathematical examples and step-by-step solutions to illustrate important points. #### 5. Diagram and Chart Analysis - **Mathematical Equations:** Several equations are included throughout the text to explain and demonstrate the properties of recurrence relations. #### 7. Anomaly Detection - **Unusual Elements:** No anomalies detected in the page content; the text appears to follow logical and expected formatting for an academic document. #### 8. Color Analysis - **Color Scheme:** The page is predominantly black and white, typical of printed or digital academic documents. This maintains clarity and legibility. #### 9. Perspective and Composition - **Perspective:** The image is shown from a top-down, direct view, allowing full visibility of the page. - **Composition:** The page is well-organized, with clear sections for titles, text, and equations. The use of bold sections and mathematical notation contributes to a structured layout. #### 10. Contextual Significance - **Overall Contribution:** This page contributes significantly to a larger educational text by laying the groundwork for understanding recurrence relations. It positions itself as an informational and foundational piece within the studied subject. #### 13. Graph Numbers - **Data Points:** Not applicable for this image as it does not contain graph data points but rather textual and mathematical content. ### Additional Aspects #### Ablaufprozesse (Process Flows) - **Described Processes:** The text describes the process of solving recurrence relations and analyzing their properties. #### Prozessbeschreibungen (Process Descriptions) - **Detailed Descriptions:** The document elaborates on how to derive solutions for recurrence relations and the resulting sequence behavior. ### Conclusion Image 1 is an academic document page focused on recurrence relations in mathematics. It provides comprehensive text and mathematical examples to explain the concept, making it an educational resource for students or readers interested in advanced mathematical topics. The page layout is clear and well-structured to facilitate understanding. #################### File: Algorithms%20and%20Complexity%20-%20Herbert%20S.%20Wilf%20%28PDF%29.pdf Page: 24 Context: # Chapter 1: Mathematical Preliminaries ## Theorem 1.4.1. Let a sequence \((x_n)\) satisfy a recurrent inequality of the form \[ x_{n+1} \leq b_0 x_n + b_1 x_{n-1} + \cdots + b_p x_{n-p} + G(n) \quad (n \geq p) \] where \(b_i \geq 0 \; (\forall i), \; \sum_{i=0}^p b_i > 1\). Further, let \(c\) be the positive real root of the equation \(x^{\alpha} = b_0 x^{p+1} + \cdots + b_p\). Finally, suppose \(G(n) = o(n^{\epsilon})\). Then for every fixed \(\epsilon > 0\) we have \(x_n = O(c^n)\). **Proof:** Fix \(\epsilon > 0\), and let \(\alpha = c + \epsilon\), where \(c\) is the root of the equation shown in the statement of the theorem. Since \(\alpha > c\), if we let \[ t = a^{p+1} - b_0^p - \ldots - b_p, \] then \[ K = \max \left\{ \frac{|x_1|}{a_0}, \frac{|x_2|}{a_1}, \max_{n \geq 2} \frac{G(n)}{a_{n-1}} \right\}. \] Then \(K\) is finite, and clearly \(|x_j| \leq K a^j\) for \(j \leq p\). We claim that \(|x_n| \leq K a^n\) for all \(n\), which will complete the proof. Indeed, if the claim is true for \(0, 1, 2, \ldots, n\), then \[ |x_{n+1}| \leq b_0 |x_n| + \cdots + b_p |x_{n-p}| + G(n) \] \[ \leq K a^n b_0 + \ldots + K a^{n-p} b_p + G(n) \] \[ = K a^n \left(b_0 a^{-1} + \ldots + b_p a^{-(p-1)}\right) + G(n) \] \[ = K a^n \left(b_0 a^{-1} + \ldots + b_p a^{-(p-1)} + o(1)\right) = K a^{n+1}. \] Thus, we have \[ |x_{n+1}| \leq K a^{n+1} \leq K a^{n+1}. \] ## Exercises for section 1.4 1. Solve the following recurrence relations - (i) \(x_{n} = 2n + 3 \quad (n \geq 0; \; x_0 = 2)\) - (ii) \(x_{n} = 2n/3 + 2 \quad (n \geq 0; \; x_0 = 0)\) - (iii) \(x_{n+1} = 2x_n + 1 \quad (n \geq 0; x_0 = 0)\) - (iv) \(x_{n+1} = (n + 1)x_n + 1 \quad (n \geq 1; \; x_1 = 5)\) - (v) \(x_{n+1} = x_n + x_{n-1} \quad (n \geq 1; \; x_0 = 2; \; x_1 = 3)\) - (vi) \(x_{n+1} = 4x_n - 4x_{n-1} \quad (n \geq 1; \; x_1 = 1)\) 2. Find \(x_n\) if the sequence \(x_n\) satisfies the Fibonacci recurrence relation and if furthermore \(x_0 = 1\) and \(x_1 = 1\) \((n \to \infty)\). 3. Let \(b_n\) be the average number of trailing 0's in the binary expansions of all integers \(0, 1, 2, \ldots, n - 1\). Find a recursive relation satisfied by the sequence \((b_n)\), solve it, and evaluate \(\lim_{n \to \infty} b_n\). 4. For what values of \(c\) and \(d\) is it true that no matter what the initial values are, the solution of the recurrence relation \(x_{n+1} = ax_n + bx_{n-1} \quad (n \geq 1)\) is guaranteed to be \(O(1) \; (n \to \infty)\)? 5. Suppose \(a_0 = 1, a_1 = 1\), and for all \(n \geq 2\) it is true that \(x_{n+1} \leq F_n x_n\). Prove your answer. 6. Generalize the result of exercise 5, as follows. Suppose \(x_0 = x_1 = y\), where \(y_1 = a_0\) and \(y_n = b_n\) \((n \geq 1)\). If furthermore, \(x_n \leq a_{n-1}\) \((n \geq 2)\), can we conclude that \(\forall n, \; x_n \leq y_n\)? If not, describe conditions on \(a_n\) and \(b_n\) under which that conclusion would follow. 7. Find the asymptotic behavior in the form \(x_n \sim \; (n \to \infty)\) of the right side of (1.4.10). * See exercise 10, below. Image Analysis: Certainly! Here's a detailed examination of the given visual content based on the specified aspects: ### 1. Localization and Attribution 1. **Image 1**: - Location: The image encompasses the entire content displayed. - Attributes: The image appears to be a scan or reproduction of a page from a textbook or academic paper. ### 2. Object Detection and Classification - **Object Detected**: - Text blocks - Mathematical notations - Exercises list - **Classification**: - The text blocks are divided into a theorem with its proof and an exercise section. ### 3. Scene and Activity Analysis - **Scene**: - The image is a page from an academic book or a paper likely related to mathematics. - **Activities**: - Presenting a theorem and its proof. - Listing exercises for practice. ### 4. Text Analysis - **Extracted Text**: - **Theorem Section**: - Theorem 1.4.1 discusses a recurrent inequality of the form involving sequences `{x_n}` and functions `G(n)`. - The theorem is accompanied by a mathematical proof detailing the steps to establish the boundedness of the sequence. - **Exercises Section**: - A list of eight problems related to the theorem. These exercises involve finding recurrence relations, solving recurrence equations, and proving asymptotic behavior, among other tasks. ### 9. Perspective and Composition - **Perspective**: - The perspective is a straightforward top-down view as one would see a page laid flat on a table. - **Composition**: - The page is clearly divided into sections: - Theorem and Proof: Takes the upper half of the page. - Exercises: Located at the bottom half of the page, formatted as a bullet-point list. ### 10. Contextual Significance - **Contribution to Overall Document/Website**: - The selected page serves as an essential learning resource in the context of mathematical sequences and recurrent inequalities. - The presence of the theorem and related exercises forms an educational routine for readers, valuable for both theoretical learning and practical application. ### 12. Graph and Trend Analysis - **Textual Interpretations**: - There's no graph present on this page, but the trend can be interpreted through the exercises, which progressively guide the reader from basic to more complex applications of the theorem. ### 13. Graph Numbers - **Data Points**: - Theorems and their proofs are supported by a series of inequalities and bounds as part of mathematical steps. - The exercise questions involve evaluating and solving recurrent sequences numerically and analytically. ### Additional Aspects: #### Ablaufprozesse (Process Flows): - Theorem 1.4.1 and its proof describe a process flow for the derivation of the inequality and the boundedness. This includes steps like fixing constants, defining bounds, and systematically proving the claim. #################### File: Algorithms%20and%20Complexity%20-%20Herbert%20S.%20Wilf%20%28PDF%29.pdf Page: 24 Context: #### Prozessbeschreibungen (Process Descriptions): - The process involves defining a specific inequality, assuming bounds, and deriving a general solution that is verified at each step to ensure correctness. #### Typen Bezeichnung (Type Designations): - The notation `{x_n}` designates sequences, while `b_0, b_1, ..., b_p` and `G(n)` are specific functions and constants used in the theoretical framework. #### Trend and Interpretation: - The sequence analysis methodologies facilitate understanding the behavior of complex recurrence relations, offering insights on their long-term behavior and convergence properties. #### Tables: - No tables are present in the image. ### Summary: The image is from a mathematical textbook or academic paper detailing Theorem 1.4.1 about recurrent inequalities and its proof. It includes a range of exercises meant to deepen the reader's understanding through direct application of the theoretic concepts discussed. The main features include structured mathematical arguments, proofs, and problems presented to elucidate complex ideas systematically. The context is fundamentally educational, aimed at learners and researchers in mathematics. #################### File: Algorithms%20and%20Complexity%20-%20Herbert%20S.%20Wilf%20%28PDF%29.pdf Page: 25 Context: ```markdown # 1.5 Counting 8. Write out a complete proof of theorem 1.4.1. 9. Show by an example that the conclusion of theorem 1.4.1 may be false if the phrase "for every fixed \( \epsilon > 0 \) . . . " were replaced by "for every fixed \( \epsilon \geq 0 \) . . . " 10. In theorem 1.4.1 we find the phrase: "the positive real root of . . ." Prove that this phrase is justified, in that the equation shown always has exactly one positive real root. Exactly what special properties of that equation did you use in your proof? ## 1.5 Counting For a given positive integer \( n \), consider the set \( \{1, 2, \ldots, n\} \). We will denote this set by the symbol \( [n] \), and we want to discuss the number of subsets of various kinds that it has. Here is a list of all of the subsets of \( [2] \): \( \emptyset, \{1\}, \{2\}, \{1, 2\} \). There are 4 of them. We claim that the set \( [n] \) has exactly \( 2^n \) subsets. To see why, notice that we can construct the subsets of \( [n] \) in the following way. Either choose, or don’t choose, the element \( 1 \); then either choose, or don’t choose, the element \( 2 \); etc., finally choosing, or not choosing, the element \( n \). Each of the choices that you encountered could have been made in either 2 ways. The totality of choices, therefore, might have been made in \( 2^n \) ways, so that is the number of subsets that are set of \( n \) objects has. Next, suppose we have \( n \) distinct objects, and we want to arrange them in a sequence. In how many ways can we do that? For the first object in our sequence we may choose any one of the \( n \) objects. The second element of that sequence can be any of the remaining \( n - 1 \) possible ways to make the first two decisions. Then there are \( n - 2 \) choices for the third element, and so we have \( n(n - 1)(n - 2) \cdots 2 \cdot 1 = n! \) ways to form the whole sequence. One of the subsets of \( [n] \), how many have exactly \( k \) objects in them? The number of elements in a set is called its **cardinality**. The cardinality of a set \( S \) is denoted by \( |S| \), so for example, \( |[6]| = 6 \). A set whose cardinality is \( k \) is called a **k-set**, and a subset of cardinality \( k \) is, naturally enough, a **k-subset**. The question is, for how many subsets \( S \) of \( [n] \) is it true that \( |S| = k \)? We can construct \( k \)-subsets \( S \) of \( [n] \) (written \( S \subseteq [n] \)) as follows. Choose an element \( a_1 \) (in possible choices). Of the remaining \( n - 1 \) elements, choose one \( a_2 \) (in \( n - 1 \) possible choices), etc., until a sequence of \( k \) different elements have been chosen. Obviously there were \( n(n - 1)(n - 2) \cdots (n - k + 1) \) ways in which we might have chosen that sequence, so the number of ways to choose an (ordered) sequence of \( k \) elements from \( [n] \) is: \[ n(n - 1)(n - 2) \cdots (n - k + 1) = \frac{n!}{(n - k)!} \] But there are more sequences of \( k \) elements than there are \( k \)-sets, because any particular \( k \)-subset will correspond to \( k! \) different ordered sequences, namely all possible rearrangements of the given subset. Hence the number of \( k \)-subsets of \( [n] \) is equal to the number of \( k \)-sequences divided by \( k! \). In other words, there are exactly \( \frac{n!}{k!(n - k)!} \) \( k \)-subsets of a set of \( n \) objects. The quantities \( \frac{n!}{k!(n - k)!} \) are the famous **binomial coefficients**, and they are denoted by: \[ \binom{n}{k} = \frac{n!}{k!(n - k)!} \quad (n \geq 0; 0 \leq k \leq n) \] Some of their special values are: \[ \binom{n}{0} = 1 \quad (n \geq 0); \] \[ \binom{n}{1} = n \quad (n \geq 0); \] \[ \binom{n}{2} = \frac{n(n - 1)}{2} \quad (n \geq 2); \] \[ \binom{n}{n} = 1 \quad (n \geq 0). \] It is convenient to define \( \binom{n}{k} \) to be 0 if \( k < 0 \) or if \( k > n \). We can summarize the developments so far with: ``` Image Analysis: ### Analysis of the Provided Visual Content #### 1. Localization and Attribution: - **Image 1**: This is the only image present on the page. #### 4. Text Analysis: - The text seems to be part of a mathematical and theoretical discussion. The sections include references to specific theorems (e.g., Theorem 1.4.1) and exercises related to counting subsets. - **Section 1.5 Counting**: - This section discusses the counting of subsets for a given set. It uses mathematical notation and examples to illustrate various ways to arrange and count subsets. - **Detected Text**: - The detected text includes tasks for the reader such as writing a complete proof of a theorem, examining results under different conditions, and proving statements using certain properties and sequences. - There are also references to particular equations and combinatorial problems, like the computation of binomial coefficients. #### 8. Color Analysis: - The image is primarily in black and white, typical for a text document. #### 11. Metadata Analysis: - No metadata was visible in the context of this visual. #### 13. Graph Numbers: - The image yields the following relevant binomial coefficient values: - \(\binom{n}{0} = 1\) - \(\binom{n}{1} = n\) - \(\binom{n}{2} = n(n - 1)/2\) - \(\binom{n}{n} = 1\) #### Additional Aspects: - **Ablaufprozesse (Process Flows)**: - There is a sequence described for how to systematically construct subsets and k-subsets from a given set, presenting a logical and step-by-step process of counting them. - **Prozessbeschreibungen (Process Descriptions)**: - Detailed descriptions are included about how to choose elements of a set to form subsets and how to count them systematically. This involves combinatorial logic. - **Typen Bezeichnung (Type Designations)**: - k-sets and k-subsets, where k denotes the cardinality or number of elements in the subset. - **Tables**: - While there isn't a formal table, tabular information is provided in the context of listings (cardinality and binomial coefficients). ### Summary: The image provides a thorough analysis rooted in combinatorial mathematics, specifically focusing on counting subsets of a set using binomial coefficients. It demonstrates the logical processes for constructing subsets and k-subsets. The discussions and exercises prompt verification through proofs and the application of theorem results. #################### File: Algorithms%20and%20Complexity%20-%20Herbert%20S.%20Wilf%20%28PDF%29.pdf Page: 26 Context: # Chapter 1: Mathematical Preliminaries ## Theorem 1.5.1 For each \( n \geq 0 \), a set of \( n \) objects has exactly \( 2^n \) subsets, and of these, exactly \( \binom{n}{k} \) have cardinality \( k \) (for \( k = 0, 1, \ldots, n \)). There are exactly \( n! \) different sequences that can be formed from a set of \( n \) distinct objects. Since every subset of \( [n] \) has some cardinality, it follows that \[ \sum_{k=0}^{n} \binom{n}{k} = 2^n \quad (n = 0, 1, 2, \ldots). \] In view of the convention that we adopted, we might have written (1.5.2) as \( \sum_{k} \binom{n}{k} = 2^n \), with no restriction on the range of the summation index \( k \). It would then have been understood that the range of \( k \) is from \( -\infty \) to \( \infty \), and that the binomial coefficient \( \binom{n}{k} \) vanishes unless \( 0 \leq k \leq n \). In Table 1.5.1, we show the values of some of the binomial coefficients \( \binom{n}{k} \). The rows of the table are thought of as labelled ‘\( n = 0\), \( n = 1\), etc., and the entries within each row refer, successively, to \( k = 0, 1, \ldots, n \). The table is called "Pascal's triangle." | | 0 | 1 | 2 | 3 | 4 | |----|-----|-----|-----|-----|-----| | 0 | 1 | | | | | | 1 | 1 | 1 | | | | | 2 | 1 | 2 | 1 | | | | 3 | 1 | 3 | 3 | 1 | | | 4 | 1 | 4 | 6 | 4 | 1 | | 5 | 1 | 5 | 10 | 10 | 5 | | 6 | 1 | 6 | 15 | 20 | 15 | | 7 | 1 | 7 | 21 | 35 | 21 | | 8 | 1 | 8 | 28 | 56 | 70 | **Table 1.5.1:** Pascal's triangle Here are some facts about the binomial coefficients: (a) Each row of Pascal's triangle is symmetric about the middle. That is, \[ \binom{n}{k} = \binom{n}{n-k} \quad (0 \leq k \leq n). \] (b) The sum of the entries in the \( n \)th row of Pascal’s triangle is \( 2^n \). (c) Each entry is equal to the sum of the two entries that are immediately above it in the triangle. The proof of (c) above can be interesting. What it says about the binomial coefficients is that \[ \binom{n}{k} = \binom{n-1}{k-1} + \binom{n-1}{k} \quad ((n,k) \neq (0,0)). \] There are (at least) two ways to prove (1.5.3). The hammer-and-tongs approach would consist of expanding each of the three binomial coefficients that appears in (1.5.3), using the definition (1.5.1) in terms of factorials, and then cancelling common factors to complete the proof. That would work (try it), but there’s another way. Contemplate (this proof is by contemplation) the totality of \( k \)-subsets of \( [n] \). The number of them is on the left side of (1.5.3). Sort them out into two piles: those \( k \)-subsets that contain ‘1’ and those that don’t. If a \( k \)-subset of \( [n] \) contains ‘1’, then \( k - 1 \) elements can be chosen in \( \binom{n-1}{k-1} \) ways, and that accounts for the first term on the right of (1.5.3). If a \( k \)-subset does not contain ‘1’, then its \( k \) elements are all chosen from \( [n-1] \), and that completes the proof of (1.5.3). Image Analysis: Certainly! Here's the comprehensive examination of the provided visual content: 1. **Localization and Attribution:** - **Image 1**: The entire content provided. - This image occupies a full page. 2. **Object Detection and Classification:** - Detected Objects: Text, Mathematical Formulae, Table. - Categories: Educational/Mathematical Content. 3. **Scene and Activity Analysis:** - Scene Description: The scene depicts a mathematical explanation from a textbook, specifically focusing on binomial coefficients and Pascal's triangle. It includes theorems, mathematical equations, explanatory text, and a table. - Main Actors: Mathematical symbols (e.g., Σ, binomial coefficients), textual explanations, and the table. 4. **Text Analysis:** - **Text Detected and Extracted:** **Theorem 1.5.1** - "For each \( n \geq 0 \), a set of \( n \) objects has exactly \( 2^n \) subsets, and of these, exactly \( \binom{n}{k} \) have cardinality \( k \) ( \( \forall k = 0, 1, \ldots, n ) \). There are exactly \( n! \) different sequences that can be formed from a set of \( n \) distinct objects." **Formula** - \( \sum_{k=0}^{n} \binom{n}{k} = 2^n \) **Table 1.5.1: Pascal's triangle** - A triangular arrangement of binomial coefficients. **Explanation of Binomial Coefficients:** - Symmetry, row sums equal \( 2^n \), sums of adjacent entries. **Proof Example:** - Two ways to prove the binomial coefficients formula. 5. **Diagram and Chart Analysis:** - **Table 1.5.1: Pascal's triangle** - The table visually represents the binomial coefficients arranged in a triangular form, where the sum of values in each row corresponds to powers of 2. - Key Features: - Symmetry: Each row is symmetric about its middle. - Summative Property: Each entry is the sum of the two entries directly above it. 6. **Anomaly Detection:** - There are no noticeable anomalies or unusual elements within the image. The content appears as standard mathematical text and tables. 8. **Color Analysis:** - The image is monochromatic (black and white), typical for printed or scanned textbook pages. The monochromatic scheme focuses the reader’s attention solely on the content without the distraction of colors. 9. **Perspective and Composition:** - Perspective: The image is seen from a direct front-on view, as if looking at an open book or a printed page. - Composition: The content is structured logically with a hierarchy: the theorem and explanations are at the top, followed by a centered table (Pascal's triangle) and further explanations beneath it. 10. **Contextual Significance:** - This page appears to be from a mathematics textbook, providing an understanding of binomial coefficients and Pascal's triangle. - Contribution to Overall Theme: The image contributes instructional value, aiding the reader’s comprehension of combinatorial mathematics by visually illustrating binomial coefficients through Pascal’s triangle. 13. **Graph Numbers:** - Listings of specific data points for the first seven rows of Pascal's triangle: - 1 - 1, 1 - 1, 2, 1 - 1, 3, 3, 1 - 1, 4, 6, 4, 1 - 1, 5, 10, 10, 5, 1 - 1, 6, 15, 20, 15, 6, 1 - And so on, continuing with the specified pattern. To summarize, the provided image is a detailed instructional page from a mathematical textbook, focusing on the theorem of binomial coefficients, visualized through Pascal's triangle, and providing related proofs and explanations. #################### File: Algorithms%20and%20Complexity%20-%20Herbert%20S.%20Wilf%20%28PDF%29.pdf Page: 29 Context: # 1.6 Graphs ![Fig. 1.6.1(a)](Fig.1.6.1(a)) ![Fig. 1.6.1(b)](Fig.1.6.1(b)) Given a graph \( G \) we have \[ \sum_{v \in V(G)} \deg(v) = 2|E(G)|. \] Since the right-hand side is an even number, there must be an even number of odd numbers on the left side of (1.6.1). We have therefore proved that every graph has an even number of vertices whose degrees are odd.* In Fig. 1.6.1 the degrees of the vertices are \{2, 2, 2, 2\}, and the sum of the degrees is \( 2 = 2|E(G)| \). Next we’re going to define a number of concepts of graph theory that will be needed in later chapters. A fairly large number of terms will now be defined, in rather a brief space. Don’t try to absorb them all now, but read through them and look them over again when the concepts are actually used, in the sequel. 1. **A path \( P \) in a graph \( G \)** is a walk from one vertex of \( G \) to another, where at each step the walk uses an edge of the graph. More formally, it is a sequence \( \{v_1, v_2, \ldots, v_k\} \) of vertices of \( G \) such that \( v_i v_{i+1} \in E(G) \). 2. **A graph is connected** if there is a path between every pair of its vertices. 3. **A path \( P \) is simple** if its vertices are all distinct, Hamiltonian if it is simple and visits every vertex of \( G \) exactly once, Eulerian if it uses every edge of \( G \) exactly once. 4. **A subgraph of a graph \( G \)** is a subset \( S \) of its vertices to gather with a subset of those edges of \( G \) both of whose endpoints lie in \( S \). An induced subgraph of \( G \) is a subset \( S \) of the vertices of \( G \) together with all edges of \( G \) both of whose endpoints lie in \( S \). We would then speak of "the subgraph induced by \( S \)." 5. In a graph \( G \) we can define an equivalence relation on the vertices as follows. Say that \( u \) and \( v \) are equivalent if there is a path of \( G \) that joins them. Let \( S \) be one of the equivalence classes of vertices of \( G \) under this relation. The subgraph of \( G \) that \( S \) induces is called a **connected component** of the graph \( G \). A graph is connected if and only if it has exactly one connected component. 6. **A cycle** is a closed path, i.e., one in which \( v_1 = v_k \). A cycle is a circuit if it is the only repeated vertex in it. We may say that a circuit is a simple cycle. We speak of Hamiltonian and Eulerian circuits of \( G \) as circuits of \( G \) that visit, respectively, every vertex or every edge of a graph \( G \). Not every graph has a Hamiltonian path. The graph in Fig. 1.6.2(a) has one and the graph in Fig. 1.6.2(b) doesn’t. ![Fig. 1.6.2(a)](Fig.1.6.2(a)) ![Fig. 1.6.2(b)](Fig.1.6.2(b)) *Did you realize that the number of people who shook hands an odd number of times yesterday is an even number of people?* Image Analysis: ### Comprehensive Examination of Attached Visual Content #### 1. **Localization and Attribution:** - **Identify and locate each image on the page:** - The page contains four distinct images, labeled Fig. 1.6.1(a), Fig. 1.6.1(b), Fig. 1.6.2(a), and Fig. 1.6.2(b). - **Image positions:** - **Image 1:** Fig. 1.6.1(a) - **Image 2:** Fig. 1.6.1(b) - **Image 3:** Fig. 1.6.2(a) - **Image 4:** Fig. 1.6.2(b) #### 2. **Object Detection and Classification:** - **Image 1:** Fig. 1.6.1(a) - **Objects:** Vertices labeled 1-4, and edges connecting the vertices. - **Classification:** Graph, vertices, edges. - **Key Features:** Simple graph structure with vertices (nodes) and edges (lines) labeled. - **Image 2:** Fig. 1.6.1(b) - **Objects:** Vertices labeled 1-6, and edges connecting the vertices. - **Classification:** Graph, vertices, edges. - **Key Features:** Simple graph structure with vertices (nodes) and edges (lines) labeled. - **Image 3:** Fig. 1.6.2(a) - **Objects:** Vertices labeled 1-5, and edges connecting the vertices. - **Classification:** Graph, vertices, edges. - **Key Features:** Simple graph structure with vertices (nodes) and edges (lines) labeled. - **Image 4:** Fig. 1.6.2(b) - **Objects:** Vertices labeled 1-5, and edges connecting the vertices. - **Classification:** Graph, vertices, edges. - **Key Features:** Simple graph structure with vertices (nodes) and edges (lines) labeled. #### 3. **Scene and Activity Analysis:** - **Image 1 and Image 2:** - **Scene:** Illustrates two graphs with different vertex and edge configurations. - **Activities:** Displays basic properties of graphs such as degree, connectedness. - **Image 3 and Image 4:** - **Scene:** Illustrates two additional graphs with different structures. - **Activities:** Depicts concepts of Hamiltonian path and cycle. #### 4. **Text Analysis:** - **Extracted Text:** - Includes mathematical notation for degree sequence, various graph theory definitions, and explanations. - Example: The formula for degree (\( \sum_{v \in V(G)} p(v) = 2|E(G)| \)) and definitions of path, cycle, connected graphs. - **Contextual Significance:** - **Text explains:** Mathematical concepts of graph theory, including properties and classifications such as paths, cycles, connected components, Hamiltonian paths, and circuits. #### 5. **Diagram and Chart Analysis:** - **Analyze attached diagrams:** - **Fig. 1.6.1(a) and (b):** Show different graph structures with clearly labeled vertices and edges to discuss concepts of even and odd degree vertices. - **Fig. 1.6.2(a) and (b):** Demonstrates concepts of Hamiltonian paths and cycles within the context of simple graph structures. - **Axes, scales, and legends are not relevant** as these are basic graph diagrams and not plotted on axes. #### 7. **Anomaly Detection:** - **No anomalies detected:** The graphs and accompanying text follow typical academic presentation norms for graph theory. #### 8. **Color Analysis:** - **Color composition:** Black and white. - **Dominant Colors:** Black text and diagrams on a white background, ensuring high contrast for readability. #### 9. **Perspective and Composition:** - **Perspective:** Frontal view (standard for text and diagram presentation in academic documents). - **Composition:** Structurally balanced with text surrounding and explaining the position of each diagram. #### 10. **Contextual Significance:** - **Overall Document Context:** - **Chapter Title:** "1.6 Graphs" indicating the section deals with introductory concepts of graph theory. - **Contribution:** Images and accompanying text build foundational understanding of graph properties and classifications essential for further mathematical discussions. By addressing these specific elements, the analysis provides a detailed understanding of the visual content in the context of graph theory, focusing on typical academic presentation and educational explanation. #################### File: Algorithms%20and%20Complexity%20-%20Herbert%20S.%20Wilf%20%28PDF%29.pdf Page: 31 Context: # 1.6 Graphs The two endpoints of e are different. Fig. 1.6.4(a) shows a graph \( G \) and an attempt to color its vertices properly in 3 colors \( \{ R, Y, B \} \). The attempt failed because one of the edges of \( G \) had the same color assigned to both of its endpoints. In Fig. 1.6.4(b) we show the same graph with a successful proper coloring of its vertices in 4 colors. ![Fig. 1.6.4(a)](1.6.4_a.png) ![Fig. 1.6.4(b)](1.6.4_b.png) ### The Chromatic Number The chromatic number \( \chi(G) \) of a graph \( G \) is the minimum number of colors that can be used in a proper coloring of the vertices of \( G \). A **bipartite graph** is a graph whose chromatic number is \( \leq 2 \), i.e., it is a graph that can be 2-colored. That means that the vertices of a bipartite graph can be divided into two classes \( R \) and \( Y \) such that no edge of the graph runs between two \( R \) vertices or between two \( Y \) vertices. Bipartite graphs are most often drawn, as in Fig. 1.6.5, in two layers, with all edges running between layers. ![Fig. 1.6.5](1.6.5.png) ### The Complement The complement \( \bar{G} \) of a graph \( G \) is the graph that has the same vertex set that \( G \) has and has an edge exactly where \( G \) does not have its edges. Formally, \[ E(\bar{G}) = \{(u, v) | u, v \in V(G); \: u \neq v \: \text{and} \: (u, v) \notin E(G)\} \] Here are some special families of graphs that occur so often that they rate special names. The **complete graph** \( K_n \) is the graph of \( n \) vertices in which every possible one of the \( \binom{n}{2} \) edges is actually present. Thus, \( K_2 \) is a single edge, \( K_3 \) looks like a triangle, etc. The **empty graph** \( K_n \) consists of \( n \) isolated vertices, i.e., it has no edges at all. The **complete bipartite graph** \( K_{m,n} \) has a set \( S \) of \( m \) vertices and a set \( T \) of \( n \) vertices. Its edge set is \( E(K_{m,n}) = S \times T \). It has \( |E(K_{m,n})| = mn \) edges. The \( n \)-cycle, \( C_n \), is a graph of \( n \) vertices that are connected to form a single cycle. A **tree** is a graph that (a) is connected and (b) has no cycles. A tree is shown in Fig. 1.6.6. ![Fig. 1.6.6](1.6.6.png) Image Analysis: ### Image Analysis Results #### 1. **Localization and Attribution:** - **Image 1 (Fig. 1.6.4(a)):** - located at the top left. - **Image 2 (Fig. 1.6.4(b)):** - located at the top right. - **Image 3 (Fig. 1.6.5):** - located at the middle of the page. - **Image 4 (Fig. 1.6.6):** - located at the bottom of the page. #### 2. **Object Detection and Classification:** - **Image 1 (Fig. 1.6.4(a)):** - Objects: Nodes (A, B, R, Y) and edges. - Key features: Graph with nodes named A, B, R, and Y with connecting edges. One edge shared the same color at both endpoints failing proper vertex coloring. - **Image 2 (Fig. 1.6.4(b)):** - Objects: Nodes (A, B, R, Y) and edges. - Key features: Graph with nodes named A, B, R, and Y with proper vertex coloring using 4 different colors. - **Image 3 (Fig. 1.6.5):** - Objects: Nodes and edges grouped into two distinct layers. - Key features: Bipartite graph with nodes divided into two sets having no intra-set edges. - **Image 4 (Fig. 1.6.6):** - Objects: Nodes and edges in a tree structure. - Key features: Tree graph showing hierarchical and non-cyclic connections among nodes. #### 3. **Scene and Activity Analysis:** - **Image 1 (Fig. 1.6.4(a)):** - Scene: Attempt to color a graph's vertices. - Activities: Failed vertex coloring due to a shared color on a single edge. - **Image 2 (Fig. 1.6.4(b)):** - Scene: Display of successful vertex coloring. - Activities: Proper 4-color vertex coloring of the graph. - **Image 3 (Fig. 1.6.5):** - Scene: Visualization of a bipartite graph. - Activities: Nodes divided into two layers, showing no intra-layer edges. - **Image 4 (Fig. 1.6.6):** - Scene: Diagram of a tree graph. - Activities: Displaying a connected, acyclic structure. #### 4. **Text Analysis:** - **General Text Analysis:** - **Contextual Information:** - Discusses graph theory concepts like chromatic number, bipartite graphs, complement graphs, and tree diagrams. - **Significance:** - Explains the proper and failed attempts of vertex coloring. - Highlights properties and special types of graphs like bipartite graphs and trees. #### 5. **Diagram and Chart Analysis:** - **Diagrams and associated graphs:** - **Axes and legends:** - Not applicable as these are conceptual diagrams illustrating graph structures without numerical axes. - **Key insights:** - Attempts and success of vertex coloring. - Structural properties of bipartite graphs and tree graphs. #### 6. **Product Analysis:** - Not applicable. #### 7. **Anomaly Detection:** - **Image 1 (Fig. 1.6.4(a)):** - Anomalous element: a failed attempt at proper vertex coloring due to shared colors at both endpoints of an edge. #### 8. **Color Analysis:** - **Dominant Colors:** - Visual differentiation of nodes using distinct colors for clarity in vertex coloring. #### 9. **Perspective and Composition:** - **Perspective:** - Straight-on, 2D view for all images. - **Composition:** - Clear and spaced arrangement of nodes and edges to illustrate graph properties and examples effectively. #### 10. **Contextual Significance:** - **Overall Document Context:** - These images contribute educational value to the concepts discussed in graph theory, aiding in understanding vertex coloring, bipartite graphs, and trees. #### 11. **Metadata Analysis:** - Not applicable. #### 12. **Graph and Trend Analysis:** - Not applicable within this context; focus is more on structural properties than trends. #### 13. **Graph Numbers:** - Not applicable as these are theoretical diagrams, not numeric graphs. ### Additional Aspects: - **Ablaufprozesse (Process Flows):** - Describes the process of graph coloring from an attempt to successful execution. - **Prozessbeschreibungen (Process Descriptions):** - Explains step-by-step the concept of proper vertex coloring and structure of graph types. - **Typen Bezeichnung (Type Designations):** - Identifies types of graphs (e.g., bipartite graphs, trees). - **Trend and Interpretation:** - Observes the importance of graph properties and successful coloring for understanding more complex graph theoretical concepts. - **Tables:** - Not applicable. #################### File: Algorithms%20and%20Complexity%20-%20Herbert%20S.%20Wilf%20%28PDF%29.pdf Page: 33 Context: ``` ## 1.6 Graphs 13. Let \( n \) be a multiple of 3. Consider a labeled graph \( G \) that consists of \( n/3 \) connected components, each of them a \( K_3 \). How many maximal independent sets does \( G \) have? 14. Describe the complement of the graph \( G \) in exercise 13 above. How many cliques does it have? 15. In how many labeled graphs of \( n \) vertices is the subgraph that is induced by vertices \( \{1, 2, 3\} \) a triangle? 16. Let \( H \) be a labeled graph of \( L \) vertices. In how many labeled graphs of \( n \) vertices is the subgraph that is induced by vertices \( \{1, \ldots, L\} \) equal to \( H \)? 17. Devise an algorithm that will decide if a given graph, of \( n \) vertices and \( m \) edges, does or does not contain a triangle, in time \( O(m \max(n^{2}, m)) \). 18. Prove that the number of labeled graphs of \( n \) vertices all of whose vertices have even degree is equal to the number of all labeled graphs of \( n - 1 \) vertices. ``` #################### File: Algorithms%20and%20Complexity%20-%20Herbert%20S.%20Wilf%20%28PDF%29.pdf Page: 34 Context: # Chapter 2: Recursive Algorithms ## 2.1 Introduction Here are two different ways to define \( n! \) if \( n \) is a positive integer. The first definition is nonrecursive, the second is recursive. 1. \( n! \) is the product of all of the whole numbers from 1 to \( n \), inclusive. 2. If \( n = 1 \) then \( n! = 1 \), else \( n! = n \cdot (n - 1)! \). Let’s concentrate on the second definition. At a glance, it seems illegal because we’re defining something, and in the definition the same ‘something’ appears. Another glance, however, reveals that the value of \( n! \) is defined in terms of the value of the same function at a smaller value of its argument, i.e., \( n - 1 \). So we’re really only using mathematical induction in order to validate the assertion that a function has indeed been defined for all positive integers \( n \). What is the practical import of the above? It’s monumental. Many modern high-level computer languages can handle recursive constructs directly, and when this is so, the programmer’s job may be considerably simplified. Among recursive languages are Pascal, PL/I, C, Lisp, APL, C, and many others. Programmers who use these languages should be aware of the power and versatility of recursive methods (conversely, people who like recursive methods should learn one of those languages!). A formal ‘function’ module that would calculate \( n! \) nonrecursively might look like this: ```pascal function fact(n: integer); { computes n! for given n > 0 } begin fact := 1; for i := 1 to n do fact := i * fact; end; ``` On the other hand, a recursive \( n! \) module is as follows: ```pascal function fact(n: integer); begin if n = 1 then fact := 1 else fact := n * fact(n - 1); end; ``` The hallmark of a recursive procedure is that it calls itself, with arguments that are in some sense smaller than before. Notice that there are no visible loops in the recursive routine. Of course there be loops in the compiled machine-language program, so in effect the programmer is shifting many of the bookkeeping problems to the compiler (but it doesn’t mind!). Another advantage of recursiveness is that the thought processes are helpful. Mathematicians have known for years that induction is a marvelous method for proving theorems, making constructions, etc. Now computer scientists and programmers can profitably think recursively too, because recursive compilers allow them to express such thoughts in a natural way, and as a result many methods of great power are being formulated recursively, methods which, in many cases, might not have been developed if recursion were not readily available as a practical programming tool. Observe next that the ‘trivial case’, when \( n = 1 \), is handled separately, in the recursive form of the \( n! \) program above. This trivial case is in fact essential, because it’s the only thing that stops the execution of the program. In effect, the computer will be caught in a loop, reducing \( n \) by 1, until it reaches 1; then it will actually know the value of the function fact, and after that it will be able to climb back up to the original input value of \( n \). The overall structure of a recursive routine will always be something like this: #################### File: Algorithms%20and%20Complexity%20-%20Herbert%20S.%20Wilf%20%28PDF%29.pdf Page: 35 Context: # 2.2 Quicksort ```markdown procedure calculate(list of variables); if (trivialcase) then do (triviatthing); else do {call calculate(smaller values of the variables)}; {maybe do a few more things} end. In this chapter we're going to work out a number of examples of recursive algorithms, of varying sophistication. We will see how the recursive structure helps us to analyze the running time, or complexity, of the algorithms. We will also find that there is a bit of art involved in choosing the list of variables that a recursive procedure operates on. Sometimes the first list we think of doesn't work because the recursive call seems to need more detailed information than we have provided for it. So we try a larger list, and then perhaps it works, or maybe we need a still larger list ..., but more of this later. ## Exercises for section 2.1 1. Write a recursive routine that will find the digits of a given integer n in the base b. There should be no visible loops in your program. ## 2.2 Quicksort Suppose that we are given an array \(x[1], \ldots, x[n]\) of n numbers. We would like to rearrange these numbers as necessary so that they end up in nondecreasing order of size. This operation is called sorting the numbers. For instance, if we are given \( \{9, 4, 7, 2, 1\} \), then we want our program to output the sorted array \( \{1, 2, 4, 7, 9\} \). There are many methods of sorting, but we are going to concentrate on methods that rely on only two kinds of basic operations, called comparisons and interchanges. This means that our sorting routine is allowed to: 1. pick up two numbers ('keys') from the array, compare them, and decide which is larger. 2. interchange the positions of two selected keys. Here is an example of a rather primitive sorting algorithm: 1. find, by successive comparisons, the smallest key 2. interchange it with the first key 3. find the second smallest key 4. interchange it with the second key, etc. Here is a more formal algorithm that does the job above. ```markdown procedure quicksort(X: array[1..n]); {sorts a given array into nondecreasing order} for i = 1 to n - 1 do for j = i + 1 to n do if (X[j] < X[i]) then swap(X[i], X[j]); end. If you are wondering why we called this method 'primitive', 'slowsort', and other pejorative names, the reason will be clearer after we look at its complexity. What is the cost of sorting n numbers by this method? We will look at two ways to measure that cost. First let's choose our unit of cost to be one comparison of two numbers, and then we will choose a different unit of cost, namely one interchange of position ('swap') of two numbers. ``` #################### File: Algorithms%20and%20Complexity%20-%20Herbert%20S.%20Wilf%20%28PDF%29.pdf Page: 36 Context: # Chapter 2: Recursive Algorithms How many paired comparisons does the algorithm make? Reference to *provide dissort* shows that it makes one comparison for each value of \( j = r+1, \ldots, n \) in the inner loop. This means that the total number of comparisons is \[ f(n) = \sum_{r=1}^{n-1} \sum_{j=r+1}^{n} 1 = \sum_{r=1}^{n-1} (n - r) = (n - 1)n/2. \] The number of comparisons is \(\Theta(n^2)\), which is quite a lot of comparisons for a sorting method to do. Not only that, but the method does that many comparisons regardless of the input array, i.e. its best case and worst case are equally bad. The Quicksort method, which is the main object of study in this section, does a minimum of \( c n \log n \) comparisons, but on the average it does far fewer, a neat \( O(n \log n) \) comparisons. This economy is much appreciated by those who sort, because sorting applications can be immense and time-consuming. One popular sorting application is in alphabetizing lists of names. It is easy to imagine that some of those lists are very long, and that the replacement of \( O(n^2) \) by an average of \( O(n \log n) \) comparisons is very welcome. An insurance company that wants to alphabetize its list of 5,000,000 policyholders will gratefully notice the difference between \( n^2 = 25,000,000,000,000 \) comparisons and \( n \approx 7,121,740 \) comparisons. If we choose as our unit of complexity the number of swaps of position, then the running time may depend strongly on the input array. In the ‘slowest’ method described above, some arrays will need no swaps at all while others might require the maximum number of \( (n - 1)/2 \) (which arrays need that many swaps?). If we average over all \( n! \) possible arrangements of the input data, assuming that the keys are distinct, then it is not hard to see that the average number of swaps that slowest needs is \(\Theta(n^2)\). Now let’s discuss Quicksort. In contrast to the sorting method above, the basic idea of Quicksort is sophisticated and powerful. Suppose we want to sort the following list: ``` 26, 18, 4, 9, 37, 119, 220, 47, 74 ``` The number 37 in the above list is in a very intriguing position. Every number that precedes it is smaller than it and every number that follows it is larger than it. What that means is that after sorting the list, the 37 will be in the same place it now occupies, the numbers to its left will have been sorted but still be on its left, and the numbers on its right will have been sorted but still be on its right. If we are fortunate enough to be given an array that has a ‘splitter,’ like 37, then we can - (a) sort the numbers to the left of the splitter, and then - (b) sort the numbers to the right of the splitter. Obviously we have the germ of a recursive sorting routine. The fly in the ointment is that most arrays don’t have splitters, so we won’t often be lucky enough to find the state of affairs that exists in (2.2.1). However, we can make our own splitters, with some extra work, and that is the idea of the Quicksort algorithm. Let’s state a preliminary version of the recursive procedure as follows (look carefully for how the procedure handles the trivial case where \( n=1 \)): ```markdown procedure quicksort(perm): {sorts the array x into nondescending order} if n ≤ 2 then permute the array elements so as to create a splitter; let z[i] be the splitter that was just created; quicksort(perm(subarray x[1],...,x[j-1])) in place; quicksort(perm(subarray x[j+1],...,x[n])) in place; end; ``` * C. A. R. Hoare, Comp. J., 5 (1962), 10-15. 32 Image Analysis: ## Comprehensive Examination of the Attached Visual Content ### 1. Localization and Attribution - **Image 1**: The entire page consists of only one image. - This single image is numbered **Image 1** for further analysis. ### 2. Object Detection and Classification - **Image 1**: - **Text Objects**: - Main body of text content describing recursive algorithms and the Quicksort method. - **Mathematical Formulas**: - Several mathematical equations related to the number of comparisons in sorting algorithms. - **Code Snippet**: - Pseudocode for the Quicksort algorithm. - **Table/List**: - Specific list of numbers given as an example to be sorted using Quicksort. ### 3. Scene and Activity Analysis - **Image 1**: - **Scene**: The image appears to be a page from a textbook or document on computer science, specifically discussing recursive algorithms and the Quicksort sorting method. - **Activities**: - The text explains concepts and methodologies related to sorting algorithms. - Mathematical analysis and theoretical explanation of the number of comparisons in the sorting process. - Presentation of pseudocode for implementing the Quicksort algorithm. - Example list of numbers provided for sorting using the Quicksort technique. ### 4. Text Analysis - **Main Content**: - **Title/Subsection**: Chapter 2: Recursive Algorithms - **Explanation**: - Discussion on the number of comparisons necessary for sorting algorithms. - The Quicksort method is highlighted, detailing its average and worst-case complexity. - Theoretical analysis presented using mathematical notation. - Practical explanation of the procedure for the Quicksort method. - Sample list and step-by-step pseudocode provided. - **Significance**: - Provides an understanding of the computational complexity of different sorting algorithms. - Demonstrates the implementation of the Quicksort sorting algorithm. - Explains the benefits and efficiency gains of Quicksort in practical use, despite its theoretical worst-case behavior. ### 9. Perspective and Composition - **Perspective**: - The image is captured directly from a top-down, eye-level perspective, typically how a reader would view a page from a book. - **Composition**: - The page is well-structured: it has a clear title at the top followed by a combination of paragraphs, mathematical equations, an example list of numbers, and pseudocode. - Each segment is neatly separated making the content easy to follow. - There is a footnote with a reference at the bottom. ### 12. Graph and Trend Analysis - **No Graphs Present**: There are no graphical trends or data points illustrated as graphs in the image. ### Additional Aspects #### Prozessbeschreibungen (Process Descriptions) - **Quicksort Algorithm**: - The process involves selecting a "splitter" element and sorting the array such that all elements less than the splitter are to its left and all elements greater are to its right. - Recursive calls are made to sort the sub-arrays formed around the splitter. #### Typen Bezeichnung (Type Designations) - **Types**: - Sorting methods discussed are classified. - Quicksort method is discussed in detail, differentiating it from "slowsort" and other sorting techniques by its efficiency and complexity. ### Contextual Significance - **Overall Document**: - Forms part of an educational chapter on recursive algorithms, aiding in the understanding of complex computer science concepts. - The image contributes significantly by providing both theoretical foundations and practical implementation details for one of the critical sorting algorithms, Quicksort. ### Conclusion The image encapsulates detailed educational content aimed at explaining recursive algorithms, specifically focusing on the Quicksort method. Through textual explanations, mathematical analysis, and pseudocode, it provides a comprehensive overview necessary for understanding both the theoretical and practical aspects of sorting algorithms. #################### File: Algorithms%20and%20Complexity%20-%20Herbert%20S.%20Wilf%20%28PDF%29.pdf Page: 38 Context: # Chapter 2: Recursive Algorithms ```markdown procedure split(x, left, right, t) {chooses at random an entry T of the subarray [x[left], x[right]], and splits the subarray around T} {the output integer i is the position of T in the output array x[left:right]} 1. L := a random integer in [left, right]; 2. swap(x[left], x[L]); 3. {now the splitter is first in the subarray} 4. T := x[left]; 5. i := left; 6. for j := left + 1 to right do begin 7. if x[j] < T then begin 8. i := i + 1; swap(x[i], x[j]); end; end; 9. swap(x[left], x[i]); 10. end.{split} Theorem 2.2.1. Procedure split correctly splits the array x around the chosen value T. **Proof:** We claim that as the loop in lines 7 and 8 is repeatedly executed for j := left + 1 to right, the following three assertions will always be true just after each execution of lines 7, 8: - (a) `x[left] = T` and - (b) `x[k] < T` for all `left < k < i` and - (c) `x[j] >= T` for all `i < j < right`. Fig. 2.1 illustrates the claim. ![Fig. 2.2.1: Conditions (a), (b), (c)](path_to_image) To see this, observe first that (a), (b), (c) are surely true at the beginning, when j = left + 1. Next, if for some j they are true, then the execution of lines 7, 8 guarantee that they will be true for the next value of j. Now look at (a), (b), (c) when j = right. It tells us that just prior to the execution of line 9 the condition of the array will be: - (a) `x[left] = T` and - (b) `x[k] < T` for all `left < k < i` and - (c) `x[j] >= T` for all `i < j < right`. When line 9 executes, the array will be in the correctly split condition. Now we can state a 'final' version of `qsort` (and therefore of Quicksort too). ``` Image Analysis: ### Image Analysis #### 1. Localization and Attribution - **Image 1**: Positioned at the top of the document. - **Image 2**: Positioned at the bottom of the page, marked as "Fig. 2.2.1". #### 4. Text Analysis - **Image 1**: - The text at the top indicates "Chapter 2: Recursive Algorithms". - The main text describes a procedure `split(x, left, right, t)` used in sorting algorithms. - The procedure is broken down into steps: 1. Chooses a random element `T` from the subarray. 2. Initialize the integer `i`. 3. Iterate through the subarray with conditions for swapping elements. 4. The output is the position of `T`. - **Theorem 2.2.1**: States that the procedure `split` correctly splits the array around the chosen value `T`. - **Image 2**: - Figure 2.2.1 illustrates the conditions (a), (b), and (c) visually: - (a) x[left] = T and - (b) x[i] ≤ T for all `left < i ≤ j` - (c) x[j] ≥ T for all `i < r ≤ j` - The diagram below visualizes the steps of the `split` procedure with an example array. #### 5. Diagram and Chart Analysis - **Image 2**: - The diagram presents an array split into different parts according to the procedure `split`. - Each segment of the array is labeled to show the changes after each iteration. - This visual aid helps clarify how the algorithm organizes elements around the pivot. #### 6. Product Analysis - There are no products depicted in the images. #### 9. Perspective and Composition - **Image 2**: - The diagram is presented in a simple linear array format. - Elements are split and rearranged to illustrate each step in the process clearly. #### 12. Graph and Trend Analysis - There are no traditional graphs in these images, but the condition analysis diagram in Image 2 can be considered a simple visual aid to understand trends in the distribution of array elements. #### 13. Graph Numbers - **Image 2**: - Initially: `T`, `T`, `>T`, `>T` - This sequence shows the order and dominance of elements relative to `T`. ### Additional Aspects #### Ablaufprozesse (Process Flows) - The document describes the flow of the `split` process in a sorting algorithm. This process flow is essential to understanding the quicksort algorithm's efficiency. #### Prozessbeschreibungen (Process Descriptions) - Detailed descriptions for the `split` process are given: - Choosing a pivot element, partitioning the array, and ensuring the elements are placed correctly around the pivot. #### Typen Bezeichnung (Type Designations) - The document describes the types of conditions (a), (b), and (c) in a sorting algorithm context. #### Trend and Interpretation - The trend shows how the array is divided and sorted progressively; understanding this is crucial for analyzing quicksort's behavior. #### Tables - There are no tables included in this document. By focusing on the text, diagrams, and explanations, this analysis highlights the key steps and logical flow of a critical algorithm within computer science, providing both a theoretical and visual understanding of the process. #################### File: Algorithms%20and%20Complexity%20-%20Herbert%20S.%20Wilf%20%28PDF%29.pdf Page: 40 Context: # Chapter 2: Recursive Algorithms is done first of all over all \( n! \) of the possible input orderings of the array elements, and second, for each such input ordering, we average also over all sequences of choices of the splitting elements. Now let's consider the behavior of the function \( F(n) \). What we are going to show is that \( F(n) = O(n \log n) \). The label that \( F(n) \) estimates has two components. First there are the pairwise comparisons involved in choosing a splitting element and rearranging the array about the chosen splitting value. Second there are the comparisons that are done in the two recursive calls that follow the creation of a splitter. As we have seen, the number of comparisons involved in splitting the array is \( n - 1 \). Hence it remains to estimate the number of comparisons in the recursive calls. For this purpose, suppose we have rearranged the array about the splitting element, and that it has turned out that the splitting entry now occupies the \( i \)th position in the array. Our next remark is that each value of \( i = 1, 2, \ldots, n \) is equally likely to occur. The reason for this is that we chose the splitter originally by choosing a random array entry. Since all orderings of the array entries are equally likely, the one that we happened to have chosen was just as likely to have been the largest entry as to have been the smallest, or the 17th-from-largest, or whatever. Since each value of \( i \) is equally likely, each \( i \) has a probability \( 1/n \) of being chosen as the residence of the splitter. If the splitting element lives in the \( i \)th array position, the two recursive calls to Quicksort will be on two subarrays, one of which has length \( i - 1 \) and the other of which has length \( n - i \). The average numbers of pairwise comparisons that are involved in such recursive calls are \( F(i - 1) \) and \( F(n - i) \), respectively. It follows that our average complexity function \( F \) satisfies the relation: \[ F(n) = n - 1 + \frac{1}{n} \sum_{i=1}^{n} [F(i - 1) + F(n - i)] \quad (n \geq 2) \] together with the initial value \( F(0) = 0 \). How can we find the solution of the recurrence relation (2.2.2)? First let's simplify it a little by noticing that \[ \sum_{i=1}^{n} [F(i - 1)] = F(n - 1) + F(n - 2) + \ldots + F(0) \] and so (2.2.2) can be written as \[ F(n) = n - 1 + \frac{2}{n} \sum_{i=1}^{n} F(i - 1). \] We can simplify (2.2.4) a lot by getting rid of the summation sign. This next step may seem like a trick at first (and it is!), but it’s a trick that is used in so many different ways that now we call it a 'method.' What we do is first to multiply (2.2.4) by \( n \), to get \[ nF(n) = n(n - 1) + 2 \sum_{i=1}^{n} F(i - 1). \] Next, in (2.2.5), we replace \( n \) by \( n - 1 \), yielding \[ (n - 1)F(n - 1) = (n - 1)(n - 1 - 2) + 2 \sum_{i=1}^{n - 1} F(i - 1). \] Finally, we subtract (2.2.6) from (2.2.5), and the summation sign obliquely disappears, leaving behind just \[ nF(n) - (n - 1)F(n - 1) = n(n - 1) - (n - 1)(n - 1 - 2) + 2F(n - 1). \] Image Analysis: **Localization and Attribution:** - There is one image on the page. - The image is located centrally and consists of a single continuous text block. **Text Analysis:** - **Detected Text:** The text discusses recursive algorithms, focusing on the analysis of a function \( F(n) \). The goal is to show that \( F(n) = O(n \log n) \). The text elaborates on the behavior of the function, breaking down the number of comparisons involved in recursive calls during the array splitting process. It explains the mathematical concept behind the average complexity function and provides a detailed derivation to find the solution of the recurrence relation. The specific details include the steps for simplification and manipulation of the summation, eventually leading to a reduced form of the original expression. - **Key Extracted Equations and Annotations:** 1. Recurrence Relation: \[ F(n) = n - 1 + \frac{1}{n} \sum_{i=1}^{n} [F(i - 1) + F(n - i)] \quad (n \geq 2) \tag{2.2.2} \] 2. Simplified Step: \[ \sum_{i=1}^{n} [F(n - i)] = F(n - 1) + F(n - 2) + \cdots + F(0) \] 3. Further Simplified Recurrence: \[ F(n) = n - 1 + \frac{2}{n} \sum_{i=1}^{n} F(i - 1) \tag{2.2.4} \] 4. Multiplication by \(n\): \[ nF(n) = n(n - 1) + 2 \sum_{i=1}^{n} F(i - 1) \tag{2.2.5} \] 5. Replacement and Rearrangement: \[ (n - 1)F(n - 1) = (n - 1)(n - 2) + 2 \sum_{i=1}^{n-1} F(i - 1) \tag{2.2.6} \] 6. Subtraction Result: \[ nF(n) - (n - 1)F(n - 1) = n(n - 1) - (n - 1)(n - 2) + 2F(n - 1) \tag{2.2.7} \] **Diagram and Chart Analysis:** - There are no diagrams or charts present in the image. **Process Descriptions:** - The image provides a detailed description of the steps involved in solving the recurrence relation for \( F(n) \). This includes simplifying the summation, multiplying through by \( n \), and then using the resulting equations to eliminate terms and simplify the recurrence. **Trend and Interpretation:** - The text shows a methodological approach to reduce a complex recursion problem into a simpler form. It highlights the significance of understanding the behavior of recursive functions and the mathematical techniques used for their analysis. **Contextual Significance:** - In the context of the overall document (assuming it is a textbook or academic paper on algorithms), this image serves to teach or demonstrate the process of analyzing the complexity of recursive functions. It demonstrates the skills necessary for solving such equations, emphasizing a method that is widely used in algorithm analysis. Therefore, this image provides a step-by-step guide with supportive equations that illustrate the simplification process of a recursive function's complexity analysis. This contributes to a comprehensive understanding of algorithm analysis techniques in the broader context of recursion and mathematical problem-solving. #################### File: Algorithms%20and%20Complexity%20-%20Herbert%20S.%20Wilf%20%28PDF%29.pdf Page: 44 Context: # Chapter 2: Recursive Algorithms ## 2.3.3 A tree-full of graphs is created A list of \( n(n-1)/2 \) 0's and 1's. Each 1 represents a pair that is an edge, each 0 represents one that isn’t an edge. Thus \( \Theta(n^2) \) bits describe a graph. Since \( n^2 \) is a polynomial in \( n \), any function of the number of input data bits that can be bounded by a polynomial in \( n \) can also be bounded by a polynomial in \( n \) itself. Hence, in the case of graph algorithms, the ‘easiness’ vs. ‘hardness’ judgment is not altered if we base the distinction on polynomials in \( n \) itself, rather than on polynomials in the number of bits of input data. Hence, with a clear conscience, we are going to estimate the running time or complexity of graph algorithms in terms of the number of vertices of the graph that is input. Now let’s do this for algorithm `maxwell` above. The first step is to find out if \( G \) has any edges. To do this we simply have to look at the input data. In the worst case we might look at all of the input data, all \( \Theta(n^2) \) bits of it. Then, if \( G \) actually has some edges, the additional labor needed to process \( G \) consists of two recursive calls on smaller graphs and one computation of the larger of two numbers. If \( F(G) \) denotes the total amount of computational labor that we do in order to find \( \max \) \( F(G) \), we see that \[ F(G) \leq cn^2 + F(G - \{v\}) + F(G - \{v\} - \text{Nbhd}(v)). \] Next, let \( f(n) = \max_{|G| = n} F(G) \), and take the maximum of (2.3.1) over all graphs \( G \) of \( n \) vertices. The result is that: \[ f(n) \leq cn^2 + f(n-1) + f(n-2). \] Because the graph \( G - \{v\} - \text{Nbhd}(v) \) might have as many as \( n-2 \) vertices, and would have that many if \( v \) had exactly one neighbor. Now it’s time to ‘solve’ the recurrent inequality (2.3.2). Fortunately, the hard work has all been done, and the answer is in theorem 1.4.1. That theorem was designed expressly for the analysis of recursive algorithms, and in this case, it tells us that \( f(n) = O(1.619^n) \). Indeed, the number in that theorem is \( (1 + \sqrt{5})/2 \approx 1.61803... \). We chose the ‘\( \epsilon \)’ that appears in the conclusion of the theorem simply by rounding \( c \) upwards. What have we learned? Algorithm `maxwell` will find the answer in a time of no more than \( O(1.619^n) \) units if the input graph \( G \) has \( n \) vertices. This is a little improvement of the most simple-minded possible. Image Analysis: ### Image Numbering and Location **Image 1:** - Located at the top half of the page, titled "Fig. 2.3.3: A tree-full of graphs is created." ### Object Detection and Classification **Image 1:** - Objects identified: Nodes, edges, and graphs consisting of various nodes and connecting lines. - Key Features: The nodes are labeled with numbers (such as 1, 2, 3, etc.), and edges are depicted as lines connecting these nodes. ### Scene and Activity Analysis **Image 1:** - Scene: The image represents a hierarchical tree structure composed of different subgraphs from top to bottom. - Activity: This tree structure exemplifies the recursive construction of graphs, starting from a single graph at the top and branching out into multiple smaller subgraphs. ### Text Analysis **Detected Text:** - The image caption reads: "Fig. 2.3.3: A tree-full of graphs is created." - The surrounding text discusses bit complexity of graph representation, the easiness or hardness of graph algorithms, and the running time complexity of the algorithm `mazest1`. **Content Analysis:** - The caption explains the visual representation of a tree structure created from graphs. - The surrounding text elaborates on the theoretical aspects of graph algorithms, focusing on the bits necessary to describe graphs and the time complexity of processing them. ### Diagram and Chart Analysis **Image 1:** - The diagram shows a hierarchical organization of graphs, where each level in the tree exhibits graphs derived from the previous level. - Key insights include the recursive nature of constructing graphs and the representation of different graph configurations using labeled nodes. ### Process Descriptions **Image 1:** - The described process in the text includes: - Estimating the running time or complexity of graph algorithms. - Finding if a graph has any edges and analyzing the input data. - Recursively computing the complexity of smaller graph components. ### Color Analysis **Image 1:** - The color composition: The entire image and surrounding text are in black and white. - Dominant colors: Black text and lines on a white background for high contrast and readability. ### Perspective and Composition **Image 1:** - Perspective: Front view of a schematic tree diagram. - Composition: The elements are arranged hierarchically from top to bottom, with each successive level showing further subdivisions of graphs. ### Contextual Significance **Image 1:** - The image contributes to the document's explanation of recursive algorithms, specifically providing a visual aid to understand the recursive construction and analysis of graph structures. - It emphasizes the theoretical aspects of graph complexity and algorithm efficiency discussed in the text. ### Tables **Image 1:** - No tables are included in the image. ### Graph Numbers **Image 1:** - Data points: Since this is a diagram with various graphs and nodes, specific numerical data points are not applicable. The structure and labels of the graphs (such as node numbers) are the key elements. By comprehensively analyzing the visual content, we gain a deeper understanding of the recursive construction and complexity of graph algorithms, as well as their theoretical implications in computational complexity. #################### File: Algorithms%20and%20Complexity%20-%20Herbert%20S.%20Wilf%20%28PDF%29.pdf Page: 45 Context: # 2.3 Recursive Graph Algorithms An algorithm that one might think of for this problem, which is to examine every single subset of the vertices of \( G \) and ask if it is an independent set or not. That algorithm would take \( O(2^n) \) time (this is because there are \( 2^n \) subsets of vertices to look at). Hence we have traded in a \( 2^n \) for a \( 1.619^n \) by being a little bit cagey about the algorithm. Can we do still better? There have in fact been a number of improvements of the basic maxest algorithm worked out. Of these, the most successful is perhaps the one of Tarjan and Trojanowski that is cited in the bibliography at the end of this chapter. We are not going to work out all of those ideas here, but instead we will show what kind of improvements on the basic idea will help us to do better in the time estimate. We can obviously do better if we choose \( v \) in such a way as to be certain that it has at least two neighbors. If we were to do that then although we wouldn’t affect the number of vertices of \( G - \{v\} \) (always \( n - 1 \)) we would at least reduce the number of vertices of \( G - \{v\} - \text{Nbhd}(v) \) as much as possible. So, as our instinct, we might replace the instruction "choose some nonisolated vertex \( v \) of \( G \) in maxest1" by an instruction "choose some vertex \( v \) of \( G \) that has at least two neighbors." Then we could be quite certain that \( G - \{v\} - \text{Nbhd}(v) \) would have at most \( n - 3 \) vertices. What if there isn’t any such vertex in the graph \( G \)? Then \( G \) could contain only vertices with 0 or 1 neighbors. Such a graph \( G \) would be a collection of \( E \) disjoint edges together with a number of isolated vertices. The size of the largest independent set of vertices in such a graph is easy to find. An maximum independent set contains one vertex from each of the edges and it contains all of the isolated vertices. Hence in this case, maxest = \( E + m = |V(G)| - |E(G)| \), and we obtain a second try at a good algorithm in the following form. ```plaintext procedure maxest2(G); {returns the size of the largest independent set of vertices of \( G \)} if \( G \) has no vertex of degree \( > 2 \) then maxest2 := \( |V(G)| - |E(G)| \); else choose a vertex \( v \) of degree \( \geq 2 \); \( n_1 = \) maxest2(\( G - \{ v \} \)); \( n_2 = \) maxest2(\( G - \{ v \} - \text{Nbhd}(v) \)); maxest2 := \( \max(n_1, n_2) \); end(maxest2); ``` How much have we improved the complexity estimate? If we apply to maximize the reasoning that led to (2.3.2) we find: \[ f(n) \leq cm^2 + f(n - 1) + f(n - 3) \quad (f(0) = 0; n = 2, 3, \ldots) \] where \( f(n) \) is once more the worst-case time bound for graphs of \( n \) vertices. Just as before, (2.3.3) is a recurrent inequality of the form that was studied at the end of section 1.4, in theorem 1.4.1. Using the conclusion of that theorem, we find from (2.3.3) that \( f(n) = O(c^2 + \varepsilon) \) where \( \varepsilon = 1.46557 \) is the positive root of the equation \( x^2 = c^2 + 1 \). The net result of our effort to improve maxest2 has been to reduce the running-time bound from \( O(1.619^n) \) to \( O(1.477^n) \), which isn’t a bad day’s work. In the exercises below we will develop maxest3, whose running time will be \( O(1.39^n) \). The idea will be that since in maxest2 we were able to ensure that at least two neighbors, why not try to ensure that \( v \) has at least 3? As long as we have been able to reduce the time bound more by insuring that the selected vertex has lots of neighbors, why don’t we keep it up, and insist that \( v \) should have 4 or more neighbors. Regrettably the method runs out of steam precisely at that moment. So why, ask the "trivial case" would look like. We would be working on a graph \( G \) in which vertices have at least more than 3 neighbors. Well, what "trivializing" shall we do, in this "trivial case"? The fact is that there isn’t any way of finding the maximum independent set in a graph where all vertices have \( \geq 3 \) neighbors that’s any faster than the general methods that we’ve already discussed. In fact, if one could find a fast method for that restricted problem it would have extremely important consequences, because we would then be able to do all graphs rapidly, not just those special ones. #################### File: Algorithms%20and%20Complexity%20-%20Herbert%20S.%20Wilf%20%28PDF%29.pdf Page: 47 Context: ### Conclusion: The visual content includes detailed diagrams and descriptive text related to graph theory, specifically planar graphs. The figures provide visual explanations, while the text offers theoretical context and practical insights into graph planarity and recursive algorithms. #################### File: Algorithms%20and%20Complexity%20-%20Herbert%20S.%20Wilf%20%28PDF%29.pdf Page: 48 Context: #### *Prozessbeschreibungen (Process Descriptions):* - **Description:** Detailed explanation of how the graph vertices are merged to form a new graph, maintaining the properties discussed in the lemmas. ### Conclusion: The visual content effectively illustrates the theoretical concepts discussed in the text, aiding in the understanding of graph colorings and vertex collapsing in a mathematical context. The diagrams are clear, labeled appropriately, and positioned to complement the textual explanations of the lemmas. #################### File: Algorithms%20and%20Complexity%20-%20Herbert%20S.%20Wilf%20%28PDF%29.pdf Page: 49 Context: 2.3 Recursive graph algorithms ============================== or if we solve for \( P(K; G) \), then we have \[ P(K; G) = P(K; G - \{e\}) - P(K; G / \{e\}) \tag{2.3.4} \] The quantity \( P(K; G) \), the number of ways of properly coloring the vertices of a graph \( G \) in \( K \) colors, is called the chromatic polynomial of \( G \). We claim that it is, in fact, a polynomial in \( K \) of degree \( |V(G)| \). For instance, if \( G \) is the complete graph on \( n \) vertices then obviously \( P(K; G) = K(K - 1) \cdots (K - n + 1) \), and that is indeed a polynomial in \( K \) of degree \( n \). **Proof of claim:** The claim is certainly true if \( G \) has just one vertex. Next suppose the assertion is true for graphs of \( < V \) vertices, then we claim it is true for graphs of \( V \) vertices also. This is surely true if \( G \) has \( V \) vertices and no edges at all. Hence, suppose it is true for all graphs of \( V \) vertices and fewer than \( E \) edges. Then (2.3.4) implies that \( P(K; G) \) is a polynomial of the required degree \( E \) because \( G - \{e\} \) has fewer edges than \( G \) does, so its chromatic polynomial is a polynomial of degree \( V \). \( G / \{e\} \) has fewer vertices than \( G \) has, and so \( P(K; G / \{e\}) \) is a polynomial of lower degree. The claim is proved, by induction. Equation (2.3.4) gives a recursive algorithm for computing the chromatic polynomial of a graph \( G \), since the two graphs that appear on the right are both ‘smaller’ than \( G \), one in the sense that it has fewer edges than \( G \) has, and the other in that it has fewer vertices. The algorithm is the following. ```plaintext function chromopoly(G: graph): polynomial; // computes the chromatic polynomial of a graph G if G has no edges then chromopoly = K^{|V(G)|} else choose an edge e of G; chromopoly = chromopoly(G - {e}) - chromopoly(G / {e}) end (chromopoly) ``` Next we are going to look at the complexity of the algorithm chromopoly (we will also refer to it as ‘the delete-and-identify’ algorithm). The graph \( G \) can be input in any one of a number of ways. For example, we might input the list of edges of \( G \), as a list of pairs of vertices. The first step of the computation is to choose the edge \( e \) and to create the edge list of the graph \( G - \{e\} \). The latter operation is trivial, since all we have to do is to ignore one edge in the list. Next we call chromopoly on the graph \( G - \{e\} \). The third step is to create the edge list of the collapsed graph \( G / \{e\} \) from the edge list of \( G \) itself. That involves some work, but it is rather routine, and the cost is linear in the number of edges of \( G \), say \( |E(G)| \). Finally we call chromopoly on the graph \( G / \{e\} \). Let \( F(V, E) \) denote the maximum cost of calling chromopoly on any graph of at most \( V \) vertices and at most \( E \) edges. Then we see at once that \[ F(V, E) \leq F(V, E - 1) + cE + F(V - 1, E - 1) \tag{2.3.5} \] together with \( F(V, 0) = 0 \). If we put, successively, \( E = 1, 2, 3, \) we find that \( F(V, 1) < c, F(V, 2) < 2c, \) and \( F(V, 3) \leq 3c \). Hence we seek a solution of (2.3.5) in the form \( F(V, E) \leq E(c) \), and we quickly find that if \[ f(E) = 2Ef(E - 1) + E \tag{2.3.6} \] then we will have such a solution. Since (2.3.6) is a first-order difference equation of the form (1.4.5), we find that \[ f(E) = 2E \sum_{j=0}^{E-1} j^2 \sim \frac{2E^3}{3} \tag{2.3.7} \] Image Analysis: ### Analysis of the Visual Content --- **Localization and Attribution:** - **Document Page Location:** This is a single page of the document shown in the image. - **Image Numbering:** This is Image 1 of the document. **Text Analysis:** - **Text Detected and Extracted:** - Section Title: "2.3 Recursive graph algorithms" - Mathematical Expressions: Present throughout the text (e.g., P(K;G) = P(K;G - {e}) - P(K;G/{e}), chrompoly(G), etc.) - Paragraph Descriptions: The text provides detailed explanations of recursive graph algorithms, focusing heavily on the chromatic polynomial of a graph and various procedures to compute it. - Pseudocode: A function named `chrompoly(G: graph): polynomial` described with conditional logic. - Equations: References to various equations such as (2.3.4), (2.3.5), (2.3.6), and (2.3.7). **Diagram and Chart Analysis:** - **No diagrams or charts present:** **Product Analysis:** - **No products present:** **Scene and Activity Analysis:** - **No scenes or activities present:** **Graph and Trend Analysis:** - **No graphs present:** **Tables:** - **No tables present:** **Anomaly Detection:** - **No anomalies or unusual elements detected:** **Color Analysis:** - **Color Composition:** The page primarily features black text on a white background. This standard color scheme provides clear readability and is commonly used for mathematical and academic documents. **Perspective and Composition:** - **Perspective:** The image is captured directly perpendicular to the page, providing a clear and straightforward view of the text. - **Composition:** The layout includes a mix of text, equations, and pseudocode. The text appears to be organized in a typical academic format with sections, definitions, and proofs arranged sequentially. **Contextual Significance:** - **Overall Document Context:** The image appears to be part of a textbook or academic paper related to graph theory and algorithms. The section is dealing specifically with recursive algorithms related to graph coloring problems. **Metadata Analysis:** - **No metadata available:** ### Additional Aspects --- **Ablaufprozesse (Process Flows):** - **Described Process Flows:** - The pseudocode for the function `chrompoly(G: graph): polynomial` describes the process of computing the chromatic polynomial. - Detailed steps are provided for computing chrompoly on different subsections of the graph through edge deletions. **Prozessbeschreibungen (Process Descriptions):** - **Detailed Process Descriptions:** - The process involves checking for edges in the graph and recursively computing the chromatic polynomial of subgraphs obtained by deleting edges. - Steps include choosing an edge, creating edge lists, and recursively calling the function. **Typen Bezeichnung (Type Designations):** - **Type Designations in Text:** - References to graph types and polynomial degrees (e.g., G, G - {e}, G/{e}, etc.). - Use of mathematical symbols to denote various graph structures and operations. **Trend and Interpretation:** - **No specific trend analysis required:** --- This comprehensive examination provides a detailed analysis based on the detected aspects of the provided image. The focus on graph algorithms, particularly the chromatic polynomial, is evident through the extracted text and process descriptions. #################### File: Algorithms%20and%20Complexity%20-%20Herbert%20S.%20Wilf%20%28PDF%29.pdf Page: 51 Context: # Exercises for section 2.3 1. Let \( G \) be a cycle of \( n \) vertices. What is the size of the largest independent set of vertices in \( V(G) \)? 2. Let \( G \) be a path of \( n \) vertices. What is the size of the largest independent set of vertices in \( V(G) \)? 3. Let \( G \) be a connected graph in which every vertex has degree 2. What must such a graph consist of? 4. Let \( G \) be a connected graph in which every vertex has degree \( \leq 2 \). What must such a graph look like? What is the size of the largest independent set of vertices in such a graph? How long would it take you to calculate that number for such a graph \( G \)? How would you do it? 5. Write out algorithm `maxset3`, which finds the size of the largest independent set of vertices in a graph. Its trivial case will occur if \( G \) has no vertices of degree \( \geq 3 \). Otherwise, it will choose a vertex \( v \) of degree \( \geq 3 \) and proceed as in master2. 6. Analyze the complexity of your algorithm `maxset3` from exercise 6 above. 7. Use (2.3.4) to prove by induction that \( P(K_i;G) \) is a polynomial in \( K \) of degree \( |V(G)| \). Then show that if \( G \) is a tree then \( P(K;G) = K(K - 1)^{|V(G)| - 1} \). 8. Write out an algorithm that will change the vertex adjacency matrix of a graph \( G \) to the vertex adjacency matrix of the graph \( G' \) (where \( e \) is a given edge of \( G \)). 9. How many edges must \( G \) have before the second quantity inside the ‘O’ in (2.3.12) is the smaller of the two? 10. Let \( \alpha(G) \) be the size of the largest independent set of vertices of a graph \( G \), let \( \chi(G) \) be its chromatic number, and let \( n = |V(G)| \). Show that, for every \( G \), \( \alpha(G) \geq n/\chi(G) \). ## 2.4 Fast matrix multiplication Everybody knows how to multiply two \( 2 \times 2 \) matrices. If we want to calculate \[ \begin{pmatrix} c_{11} & c_{12} \\ c_{21} & c_{22} \end{pmatrix} = \begin{pmatrix} a_{11} & a_{12} \\ a_{21} & a_{22} \end{pmatrix} \begin{pmatrix} b_{11} & b_{12} \\ b_{21} & b_{22} \end{pmatrix} \] (2.1) then, "of course," \[ c_{ij} = \sum_{k=1}^{2} a_{ik} b_{kj} \quad (i,j=1,2). \] (2.2) Now look at (2.4.2) a little more closely. In order to calculate each one of the \( c_{ij} \)'s we have to do 2 multiplications of numbers. The cost of multiplying two \( 2 \times 2 \) matrices is therefore 8 multiplications of numbers. If we measure the cost in units of additions of numbers, the cost is 4 such additions. Hence, the matrix multiplication method that is shown in (2.4.1) has a complexity of \( 8 \) multiplications of numbers and \( 4 \) additions of numbers. This may seem rather unsettling, but the best ideas often have humble origins. Suppose you could find another way of multiplying two \( 2 \times 2 \) matrices in which the cost was only 7 multiplications of numbers, together with more than 4 additions of numbers. What would be a cause for dancing in the streets, or would it be just a curiosity, of little importance? In fact, it would be extremely important, and the consequences of such a step were fully appreciated only in 1965 by V. Strassen, to whom the ideas that we are now discussing are due. What we’re going to do next in this section is the following: (a) Describe another way of multiplying two \( 2 \times 2 \) matrices in which the cost will be only 7 multiplications of numbers plus a bunch of additions of numbers, and (b) Convince you that it was worth the trouble. The usefulness of the ideas stems from the following amazing fact: if two \( 2 \times 2 \) matrices can be multiplied with only \( 7 \) multiplications of numbers, then two \( N \times N \) matrices can be multiplied using only \( O(N^{2.81}) \). * V. Strassen, Gaussian elimination is not optimal, Numerische Math. 13 (1969), 354-6. Image Analysis: ### Localization and Attribution 1. **Image 1:** - **Location:** Single page, top-to-bottom position. - **Image Number:** Image 1. ### Object Detection and Classification **Image 1:** - **Objects Detected:** - Mathematical notations and text. - Formulae and equations enclosed in parentheses. ### Text Analysis **Image 1:** - **Extracted Text:** - The text contains multiple mathematical exercises, specifically for section 2.3, discussing various graph theory problems. - There's also an excerpt for section 2.4 discussing "Fast matrix multiplication." - **Content Analysis:** - **Exercises for section 2.3:** - The questions revolve around determining sizes of the largest independent sets in different types of graphs like cycles, paths, and connected graphs. - Questions concerning algorithms and complexity analysis are also present. - Inductive proof and graph vertex adjacency matrix modification algorithms are mentioned. - **Section 2.4 Fast Matrix Multiplication:** - The calculation of matrix products is introduced with a basic example using 2x2 matrices. - Formulas \( c_{11}, c_{12}, c_{21}, c_{22} \) are elaborated upon. - A hypothesis about reducing the number of multiplications from 8 to 7 is discussed, referencing V. Strassen's work. ### Diagram and Chart Analysis **Image 1:** - **Diagrams Detected:** - A mathematical matrix multiplication diagram is present. - Matrix elements and multiplication processes are illustrated. ### Scene and Activity Analysis **Image 1:** - **Scene Description:** - The image illustrates a textbook-like page, with text-based exercises and explanations about graph theory and matrix multiplication. - **Activities:** - Reading mathematical exercises, solving graph theory problems, and understanding matrix multiplication concepts. ### Contextual Significance **Image 1:** - **Contribution to Overall Document:** - The image seems to be part of a mathematics textbook or academic publication, focusing on graph theory and matrix algorithms. - It aids in the understanding of complex mathematical concepts and provides practical problems for the reader to solve. ### Process Descriptions **Image 1:** - **Description:** - The process of calculating the size of the largest independent set for various types of graphs is broken down. - Basic matrix multiplication processes are described, highlighting both traditional methods and potential optimizations. ### Typen Bezeichnung (Type Designations) **Image 1:** - **Types Described:** - Different types of graphs (cycles, paths, connected graphs, and non-necessarily-connected graphs) and their properties are identified. - Types of vertices (degrees, vertex adjacency matrix) are also designated. ### Trend and Interpretation **Image 1:** - **Identified Trends:** - A focus on enhancing computational efficiency, particularly in matrix multiplication, is emphasized. - Analyzing the size of independent sets in various graph structures is a recurring theme. ### Tables **Image 1:** - **Detected Content:** - The page does not contain any structured tables but includes mathematical equations which are presented in a structured format resembling tables. By addressing different aspects, the analysis provides a comprehensive understanding of the mathematical concepts and exercises illustrated in the image. #################### File: Algorithms%20and%20Complexity%20-%20Herbert%20S.%20Wilf%20%28PDF%29.pdf Page: 53 Context: ``` ## 2.4 Fast Matrix Multiplication ```plaintext function MatProd(A, B: matrix: N:integer): matrix; { MatProd is AB, where A and B are N x N } { uses Strassen method } if N is not a power of 2 then border A and B by rows and columns of 0s until their size is the next power of 2 and change N; if N = 1 then MatProd := AB else partition A and B as shown in (2.4.5): I := MatProd(A11 + A22, B22 + B11, N/2); II := MatProd(A21 + A22, B11, N/2); III := MatProd(A11, B12 - B22, N/2); IV := MatProd(A22, B21 - B11, N/2); etc. etc., through all of the formulas shown in (2.4.3), (2.4.4), ending with ... C22 := II + III + IV - I; end; { MatProd } Note that this procedure calls itself recursively 7 times. The plus and minus signs in the program each represent an addition or subtraction of two matrices, and therefore each one of them involves a call to a matrix addition or subtraction procedure (just the usual method of adding, nothing fancy!). Therefore the function MatProd makes 25 calls, 7 of which are recursive to itself, and 18 of which are to a matrix addition/subtraction routine. We will study the complexity of the routine in two ways. We will count the number of multiplications of numbers that are needed to multiply two \(2^n \times 2^n\) matrices using MatProd (call that number \(f(n)\)), and then we will count the number of additions of numbers (call it \(g(n)\)) that MatProd needs in order to multiply two \(2^n \times 2^n\) matrices. The multiplications of numbers are easy to count. MatProd calls itself \(f(n)\) times, in each of which it does exactly \(f(n - 1)\) multiplications of numbers, hence \(f(n) = 7f(n - 1) + f(0) = 1\). Therefore we see that \(f(n) = 7^n\) for all \(n \geq 0\). Hence MatProd does \(7^n\) multiplications of numbers in order to do the multiplication of \(2^n \times 2^n\) matrices. Let's take the last sentence in the above paragraph and replace '2^n' by \(n\) throughout. It then tells us that MatProd does \(\log_2 N\) multiplications of numbers in order to do one multiplication of \(N \times N\) matrices. Since \(n \log n / \log 2 = n^{3.0}\), we see that Strassen's method uses only \(O(N^{\log_2 7})\) multiplications of numbers, in place of the \(N^3\) scalar multiplications that are required by the usual formulas. It remains to count the additions/subtractions of numbers that are needed by MatProd. In each call to it, itrecursive calls to itself MatProd does \(g(n - 1)\) additions of numbers. In each of its 18 calls to the procedure that adds or subtracts matrices it does a number of additions of numbers that is equal to the square of the size of the matrices that are being added or subtracted. That size is \(2^{n - 1}\), so it calls does \(2^{n - 2}\) additions of numbers. It follows that \(g(0) = 0\) and for \(n \geq 1\) we have \[ g(n) = 7g(n - 1) + 18 \cdot 2^{n - 2} \] We follow the method of section 1.4 on this first-order linear difference equation. Hence we make the change of variable \(g(n) = T_n\) (\(n \geq 0\) and we find that \(T_0 = 0\) and for \(n \geq 1\), \[ T_n = 7^{n - 1} \cdot \frac{4}{7}. \] If we sum over \(n\) we obtain \[ T_n = \frac{9}{2} \sum_{i=1}^{n} 7^{i - 1} \] \[ \leq \frac{9}{2} \sum_{i=0}^{\infty} \left(\frac{4}{7}\right)^i = \frac{21}{2}. \] 49 ``` Image Analysis: ### Comprehensive Analysis of the Provided Visual Content #### 1. Localization and Attribution - **Image Position:** There is a single image on the page. - **Image Numbering:** This image is labeled as Image 1. #### 4. Text Analysis - **Detected and Extracted Text:** ``` 2.4 Fast matrix multiplication function MatrProd(A, B: matrix; N:integer):matrix; {MatrProd is AB, where A and B are N × N} {uses Strassen method} if N is not a power of 2 then border A and B by rows and columns of 0’s until their size is the next power of 2 and change N; if N = 1 then MatrProd := AB else partition A and B as shown in (2.4.5); I := MatrProd(A11 + A22, B11 + B22, N/2); II := MatrProd(A21 + A22, B11, N/2); etc. etc., through all 11 of the formulas shown in (2.4.3), (2.4.4), ending with ... C32 := II + III + V - VI - I end.{MatrProd} Note that this procedure calls itself recursively 7 times. The plus and minus signs in the program each represent an addition or subtraction of two matrices, and therefore each one of them involves a call to a matrix addition or subtraction procedure (just the usual method of adding, nothing fancy!). Therefore the function MatrProd makes 25 calls, 7 of which are recursively to itself, and 18 of which are to a matrix addition/subtraction routine. We will now study the complexity of the routine in two ways. We will count the number of multiplications of numbers that are needed to multiply two 2^m × 2^m matrices using MatrProd (call that number f(n)), and then we will count the number of additions of numbers (call it g(n)) that MatrProd needs in order to multiply two 2^m × 2^m matrices. The multiplications of numbers are easy to count. MatrProd calls itself 7 times, in each of which it does exactly f(n – 1) multiplications of numbers, hence f(n) = 7f(n – 1) and f(0) = 1 (why?). Therefore we see that f(n) = 7^n for all n ≥ 0. Hence MatrProd does 7^m multiplications of numbers in order to do one multiplication of 2^m × 2^m matrices. Let’s take the last sentence in the above paragraph and replace ‘2^m’ by ‘N’ throughout. It then tells us that MatrProd does (log_2 N)^log_2 7 multiplications of numbers in order to do one multiplication of N × N matrices. Since n log_2 7/log_2 2 = n^log_2 7 log_2 2 = n^2.81..., we see that Strassen’s method uses only O(N^2.81) multiplications of numbers, in place of the N^3 such multiplications that are required by the usual formulas. It remains to count the additions/subtractions of numbers that are needed by MatrProd. In each of its 7 recursive calls to itself MatrProd does g(n – 1) additions of numbers. In each of its 18 calls to the procedure that adds or subtracts matrices it does a number of additions of numbers that is equal to the square of the size of the matrices that are being added or subtracted. That size is 2^n–1, so each of the 18 such calls does 2^n–2 additions of numbers. It follows that g(0) = 0 and for n ≥ 1 we have g(n) = 7g(n – 1) + 18 * 2 ^(n – 1) = 7g(n – 1) + 9 * 4^(n – 1) #################### File: Algorithms%20and%20Complexity%20-%20Herbert%20S.%20Wilf%20%28PDF%29.pdf Page: 53 Context: We follow the method of section 1.4 on this first-order linear difference equation. Hence we make the change of variable g(n) = 7 ^n y(n) (n ≥ 0) and we find that y0 = 0 and for n ≥ 1, y_n - 7y_n–1 + 2 ^(4/n^ n )= 9. If we sum over n we obtain y_n = 9 ∑_(i=1)^n (4/7)^i ≤ 9 ∑_(i=1)^∞ (4/7)^n = 9/((1 – 4/7)) = 21/2. ``` - **Analysis of Content:** The text is an excerpt from a mathematical or computer science document discussing the Strassen method for fast matrix multiplication. It includes a pseudocode function `MatrProd` for multiplying matrices and explains the recursive nature of the algorithm. The complexity analysis includes counting the number of multiplications and additions/subtractions necessary for the algorithm. Detailed recursive calls and complexity calculations are provided, illustrating the efficiency improvement from O(N^3) to O(N^2.81) for matrix multiplication. #### 8. Color Analysis - **Color Composition:** - The page has a predominantly white background with black text, typical of a printed or digital document. - There are no other significant colors present, which focuses the reader's attention on the textual content. #### 9. Perspective and Composition - **Perspective:** - The image is a top-down view of a text document, likely appearing in a book or a digitally scanned paper. - **Composition:** - The text is arranged in typical paragraph format. - The pseudocode and equations are indented and formatted distinctly to differentiate them from the main body of text, aiding readability. #### 14. Trend and Interpretation - **Trend in Visual Content:** - The visual content suggests a trend toward presenting complex mathematical and algorithmic concepts in a step-by-step manner, providing both theoretical explanations and practical pseudocode. - **Interpretation:** - The use of pseudocode and complexity analysis serves to educate readers on efficient matrix multiplication methods, specifically emphasizing the Strassen algorithm's recursive approach and reduced computational complexity. #### Additional Observations - **Prozessbeschreibungen (Process Descriptions):** - The text describes the recursive process of Strassen's matrix multiplication algorithm in detail, including its base case, recursive case, and the operations needed to combine intermediate results. - **Typen Bezeichnung (Type Designations):** - The algorithm categorizes its steps into multiplication and addition/subtraction processes, describing the type of operations performed at each recursive level. #################### File: Algorithms%20and%20Complexity%20-%20Herbert%20S.%20Wilf%20%28PDF%29.pdf Page: 55 Context: # 2.5 The discrete Fourier transform The interesting thing is that this particular problem is so important and turns up in so many different applications that it really pays to be very efficient about how the calculation is done. We will see in this section that if we use a fairly subtle method of doing this computation instead of the obvious method, then the work can be cut down from \(O(n^2)\\) to \(O(n \log n)\). In view of the huge arrays on which this program is often run, the saving is very much worthwhile. One can think of the Fourier transform as being a way of changing the descriptor, or coding, of a polynomial, so we will introduce the subject by discussing it from that point of view. Next we will discuss the obvious way of computing the transform. Then we will describe the ‘Fast Fourier Transform’, which is a rather un-obvious, but very fast, method of computing the same creature. Finally, we will discuss an important application of the subject, to the fast multiplication of polynomials. There are many different ways that might occur to describe (‘encode’) a particular polynomial. Take the polynomial \(f(t) = t^6 - 5t^4 + 7\), for instance. This can be uniquely described in any of the following ways (and a lot more): 1. It is the polynomial whose - (i) coefficients are \(0, 6, -5, 1\) or whose - (ii) roots are \(0, 2\) and \(3\), and whose highest coefficient is \(1\) or whose - (iii) values at \(t = 0, 1, 2, 3, 0, 0, 0\), respectively, or whose - (iv) values at the fourth-roots of unity \(1, i, -1, -i\) are \(2, 5 - 5i, -12.5, -5i\), etc. We want to focus on two of these ways of representing a polynomial. The first is by its coefficient sequence; the second is by its sequence of values at the \(n\)th roots of unity, where \(n\) is one more than the degree of the polynomial. The process by which we pass from the coefficient sequence to the sequence of values at the roots of unity is called forming the Fourier transform of the coefficient sequence. To use the example above, we would say that the Fourier transform of the sequence \[ 0, 6, -5, 1 \] is the sequence \[ 2, 5 + 5i, -12, 5 - 5i \] (2.1) In general, if we are given a sequence \[ x_0, x_1, \ldots, x_{n-1} \] (2.2) then we think of the polynomial \[ f(t) = x_0 + x_1 t + x^2 t^2 + \ldots + x_{n-1} t^{n-1} \] (2.3) and we compute its values at the \(n\)th roots of unity. These roots of unity are the numbers \[ \omega_j = e^{2 \pi i j / n} \quad (j = 0, 1, \ldots, n - 1) \] (2.4) Consequently, if we calculate the values of the polynomial (2.3) at the \(n\) numbers (2.4), we find the Fourier transform of the given sequence (2.2) to be the sequence \[ f(\omega_j) = \sum_{k=0}^{n-1} a_k \omega_j^k \] (2.5) or, equivalently, \[ = \sum_{k=0}^{n-1} x_k e^{2 \pi i j k / n} \quad (j = 0, 1, \ldots, n - 1) \] (2.6) Before proceeding, the reader should pause for a moment and make sure that the fact that (2.1)-(2.2) is a special case of (2.3)-(2.6) is clearly understood. The Fourier transform of a sequence of \(n\) numbers is another sequence of \(n\) numbers, namely the sequence of values at the \(n\)th roots of unity of the very same polynomial whose coefficients are the members of the original sequence. #################### File: Algorithms%20and%20Complexity%20-%20Herbert%20S.%20Wilf%20%28PDF%29.pdf Page: 60 Context: ### Summary The visual content is a page from an academic or technical text focused on recursive algorithms, specifically the Fast Fourier Transform (FFT). The text includes mathematical notations, theorems, proofs, and practical applications, emphasizing the efficiency of FFT in computational tasks. The included table illustrates the reduction in complexity provided by using the FFT. The document's formal structure and detailed mathematical content suggest it is intended for readers with a strong background in mathematics or computer science. #################### File: Algorithms%20and%20Complexity%20-%20Herbert%20S.%20Wilf%20%28PDF%29.pdf Page: 62 Context: - **Tables:** - No tables are included in the content. ### Conclusion This page presents a comprehensive discussion and procedural guide on using recursive algorithms and FFT for multiplying polynomials. It is academically oriented and contributes to the broader field of computer science and mathematics by offering an efficient methodology for polynomial multiplication. #################### File: Algorithms%20and%20Complexity%20-%20Herbert%20S.%20Wilf%20%28PDF%29.pdf Page: 62 Context: # Chapter 2: Recursive Algorithms In the second universe, multiplying two polynomials is a breeze. If we have in front of us the values \(f(\omega)\) of the polynomial \(f\) at the roots of unity, and the values \(g(\omega)\) of the polynomial \(g\) at the same roots of unity, what are the values \(f(g)(\omega)\) of the product polynomial \(f g\) at the roots of unity? To find each one requires only a single multiplication of two complex numbers, because the value of \(f g\) at \( \omega \) is simply \(f(\omega)g(\omega)\). Multiplying values is easier than finding the coefficients of the product. Since we live in a universe where people like to think about polynomials as being given by their coefficient arrays, we have to take a somewhat roundabout route in order to do an efficient multiplication. Given: A polynomial \(f\) of degree \(n\), and a polynomial \(g\) of degree \(m\); by their coefficient arrays. Wanted: The coefficients of the product polynomial \(fg\) of degree \(n + m\). 1. **Step 1:** Let \(N - 1\) be the smallest integer that is a power of 2 and is greater than \(n + m + 1\). 2. **Step 2:** Think of \(f\) and \(g\) as polynomials each of whose degrees is \(N - 1\). This means that we should pad \(N - 2\) more coefficients, all equal to \(0\), to the coefficient array of \(f\) and \(N - n\) more coefficients, all equal to \(0\), to the coefficient array of \(g\). 3. **Step 3:** Compute the FFT of the array of coefficients of \(f\). Now we are looking at the values of \(f\) at the \(N\)th roots of unity. Likewise compute the FFT of the array of coefficients of \(g\) to obtain the array of values of \(g\) at the same \(N\)th roots of unity. The cost of this step is \(O(N \log N)\). 4. **Step 4:** For each of the \(N\)th roots of unity, we multiply the number \(f(\omega)\) by the number \(g(\omega)\). We now have the numbers \(f(\omega) g(\omega)\), which are exactly the values of the unknown product polynomial \(fg\) at the \(N\)th roots of unity. The cost of this step is \(N\) multiplications of numbers, one for each. 5. **Step 5:** Now we are looking at the values of \(fg\) at the \(N\)th roots, and we want to get back to the coefficients of \(fg\) because that was what we were asked for. To go backwards, from values at roots of unity to coefficients, calls for the inverse Fourier transform, which we will describe in a moment. Its cost is also \(O(N \log N)\). The answer to the original question has been obtained at a cost of \(O(N \log N)\) = \(O((m + n) \log (m + n))\) arithmetic operations. It’s true that we did have to take a walk from our universe to the next one and back again, but the round trip was a lot cheaper than the \(O(n + m)^3\) cost of direct multiplication. It remains to discuss the inverse Fourier transform. Perhaps the neatest way to do that is to juxtapose the formulas for the Fourier transform and for the inverse transform, so as to facilitate comparison of the two, so here they are. If we are given a sequence \(x_0, x_1, \ldots, x_{n-1}\), then the Fourier transform of the sequence is given by: \[ f(j) = \frac{1}{n} \sum_{k=0}^{n-1} x_k e^{-2 \pi i jk/n} \quad (j = 0, 1, \ldots, n - 1) \tag{2.6.3} \] Conversely, if we are given the numbers \(f(j)\) \((j = 0, \ldots, n-1)\), then we can recover the coefficient sequence \(x_0, x_1, \ldots, x_{n-1}\) by the inverse formulas: \[ x_k = \frac{1}{n} \sum_{j=0}^{n-1} f(j) e^{2 \pi i jk/n} \quad (k = 0, 1, \ldots, n - 1) \tag{2.6.4} \] The differences between the inverse formulas and the original transform formulas are first the appearance of the \(1/n\) in front of the summation and second the \(-\) sign in the exponential. We leave it as an exercise for the reader to verify that these formulas really do invert each other. We observe that if we are already in possession of a computer program that will find the FFT, then we can use it to derive the inverse Fourier transforms as follows: 1. (i) Given a sequence \((f(j))\) of values of a polynomial at the \(n\)th roots of unity, form the complex conjugate of each member of the sequence. 2. (ii) Input the conjugated sequence to your FFT program. 3. (iii) Form the complex conjugate of each entry of the output array, and divide by \(n\). Now you have the inverse transform of the input sequence. The cost is obviously equal to the cost of the FFT plus a linear number of conjugations and divisions by \(n\). Image Analysis: ### Analysis of Attached Visual Content 1. **Localization and Attribution:** - The document appears to be a page from a book or lecture notes. It is a single page, and we'll refer to it as "Image 1." 2. **Object Detection and Classification:** - The image contains text with mathematical formulas and descriptions. No other objects such as images, diagrams, or charts are present. 3. **Scene and Activity Analysis:** - The scene is a textual content display. The primary activities involved are reading and studying recursive algorithms and related mathematical concepts. 4. **Text Analysis:** - **Detected Text:** - Chapter 2: Recursive Algorithms - The entire page describes methods related to multiplying polynomials using recursive algorithms and fast Fourier transform (FFT). - Key formulas include those for coefficients of product polynomials, the efficient multiplications using values at roots of unity, and detailed steps to compute these using FFT. - Detailed procedural steps for such calculations are provided. - Important formulas mentioned: - \[ f(\omega_j) = \sum_{k=0}^{n-1}f_k\omega_j^k \] - \[ x_k = \frac{1}{n}\sum_{j=0}^{n-1}f(\omega_j)\omega^{-jk/n} \] - Step-by-step processes for computing values and transforming them efficiently. 5. **Diagram and Chart Analysis:** - There are no diagrams or charts included in this image. 6. **Product Analysis:** - No physical products are depicted. 7. **Anomaly Detection:** - There are no noticeable anomalies or unusual elements in the image. The text and formulas are consistent with typical content found in academic books on algorithms and mathematics. 8. **Color Analysis:** - The image is in grayscale, indicating a standard printed page. Dominant colors are black text on a white background, which is typical for textbooks. 9. **Perspective and Composition:** - The image is a direct, top-down view of a page from a book. The composition is standard for text documents, with well-separated paragraphs and formulas in mathematical notation. 10. **Contextual Significance:** - This page is likely part of an educational textbook or lecture notes focused on algorithms, specifically discussing efficient multiplication of polynomials using FFT. It contributes to the overall understanding of recursive algorithms by presenting a structured methodology with clear mathematical steps and explanations. 11. **Metadata Analysis:** - No metadata is available from the image content itself. 12. **Graph and Trend Analysis:** - No graphs are included. 13. **Graph Numbers:** - Not applicable as there are no graphs. ### Additional Aspects - **Ablaufprozesse (Process Flows):** - The steps outlined for computing the products of polynomials using FFT represent a clear process flow for performing these calculations. - **Prozessbeschreibungen (Process Descriptions):** - The text provides detailed descriptions of processes and steps necessary to achieve polynomial multiplication using FFT, from transforming polynomial coefficients to working with roots of unity. - **Typen Bezeichnung (Type Designations):** - Types mentioned include polynomials and their coefficients, FFT, and inverse Fourier transform. - **Trend and Interpretation:** - The trend discussed is the efficiency gained by using FFT over direct multiplication of polynomials, highlighting the reduction in complexity. - **Tables:** - No tables are included in the content. ### Conclusion #################### File: Algorithms%20and%20Complexity%20-%20Herbert%20S.%20Wilf%20%28PDF%29.pdf Page: 63 Context: # 2.7 A review An outgrowth of the rapidity with which we can now multiply polynomials is a rethinking of the methods by which we do ultrahigh-precision arithmetic. How fast can we multiply two integers, each of which has ten million bits? By using ideas that developed directly (though not all trivially) from the ones that we have been discussing, Schönhage and Strassen found the fastest known method for doing large-scale multiplications of integers. The method relies heavily on the FFT, which may not be too surprising since an integer \( n \) is given in terms of its bits \( b_0, \ldots, b_m \) by the relation \[ n = \sum_{i=0}^{m} b_i 2^i. \tag{2.5} \] However, the sum in (2.5) is seen at once to be the value of a certain polynomial at \( x = 2 \). Hence in asking for the bits of the product of two such integers we are asking for something very similar to the coefficients of the product of two polynomials, and indeed the fastest known algorithms for this problem depend upon the Fast Fourier Transform. ## Exercises for section 2.6 1. Let \( \omega \) be an \( n \)th root of unity, and let \( k \) be a fixed integer. Evaluate \[ 1 + \omega^k + \omega^{2k} + \cdots + \omega^{(n-1)k}. \] 2. Verify that the relations (2.6.3) and (2.6.4) indeed are inverses of each other. 3. Let \[ f = \sum_{j=0}^{n-1} a_j \omega^j. \] Show that \[ \frac{1}{n} \sum_{n=1}^{n} |f(\omega)|^2 = |a_0|^2 + \cdots + |a_{n-1}|^2. \] 4. The values of a certain cubic polynomial at \( i, -i, -1, \) and \( 1 \) are \( 1, 1, 1, \) and \( 1 \), respectively. Find its value at 2. 5. Write a program that will do the FFT in the case where the number of data points is a power of 2. Organize your program so as to minimize additional array storage beyond the input and output arrays. 6. Prove that a polynomial of degree \( n \) is uniquely determined by its values at \( n + 1 \) distinct points. # 2.7 A review Here is a quick review of the algorithms that we studied in this chapter. Sorting is an easy computational problem. The most obvious way to sort an array elements takes time \( \Theta(n^2) \). We discussed a recursive algorithm that sorts in an average time of \( \Theta(n \log n) \). Finding a maximum independent set in a graph is a hard computational problem. The most obvious way to do it might take time \( O(2^{n}) \) if the graph \( G \) has \( n \) vertices. We discussed a recursive method that runs in time \( O(1.39^n) \). The best known methods run in time \( O(2^{0.5 n}) \). Finding out if a graph is \( k \)-colorable is a hard computational problem. The most obvious way to do it takes time \( O(k^n) \), if \( G \) has \( n \) vertices. We discussed a recursive method that runs in time \( O(1.5^n) \) if \( G \) has \( n \) vertices and \( E \) edges. One recently developed method \( * \) runs in time \( O(1.73^n) \). We will see in section 5.7 that this problem can be done in an average time that is \( O(n) \) for fixed \( k \). Multiplying two matrices is an easy computational problem. The most obvious way to do it takes time \( O(n^3) \) if the matrices are \( n \times n \). We discussed a recursive method that runs in time \( O(n^{2.81}) \). A recent method \( ** \) runs in time \( O(n^{2.5}) \) for some \( \epsilon < 2.5 \). 1. E. Lawler, A note on the complexity of the chromatic number problem, *Information Processing Letters* 5 (1976), 66-7. 2. D. Coppersmith and S. Winograd, On the asymptotic complexity of matrix multiplication, *SIAM J. Comput.* 11 (1980), 472-492. Image Analysis: ### Text Analysis #### Main Text: The primary content on the page consists of mathematical explanations and problems related to polynomial multiplication and Fourier Transforms. The text is broken into two main sections: a review of algorithms and exercises for section 2.6. #### Content Breakdown: **1. Review of Algorithms (Section 2.7 A review):** - Discusses the multiplication of large integers using Fast Fourier Transforms (FFT). - Mentions methods developed by Schönhage and Strassen. - Provides an example illustrating the calculation using a geometric series. - Describes sorting algorithms and computational problems involving graphs and matrix multiplication. **2. Exercises for Section 2.6:** - A series of six exercises exploring the concepts described, such as: - Evaluating sums of roots of unity. - Verifying the properties of certain mathematical relations. - Applications of polynomial roots and FFT. ### Scene and Activity Analysis **Scene Description:** - This image is a scan of a textbook page. - The layout is typical for academic textbooks, with a mix of theoretical explanations, mathematical notation, and exercises. **Key Activities:** - Theoretical explanations and mathematical derivations. - Application exercises for students to practice related concepts. ### Contextual Significance **Educational Purpose:** - The page serves as an educational resource for students studying advanced algorithms, particularly focused on polynomial multiplication and FFT. - The exercises provide hands-on applications to reinforce the theoretical content covered. ### Color Analysis **Color Composition:** - The image is monochromatic, primarily featuring black text on a white background. - This standard academic textbook format helps to ensure readability and focus on the content. ### Perspective and Composition **Perspective:** - Standard front-facing view, typical for scanned pages of a textbook. **Composition:** - Organized into clear sections with headings to guide the reader. - Exercises listed in a numbered format for easy reference. The overall document is structured to facilitate learning, with theoretical content supported by practical exercises. #################### File: Algorithms%20and%20Complexity%20-%20Herbert%20S.%20Wilf%20%28PDF%29.pdf Page: 64 Context: # Chapter 2: Recursive Algorithms Finding the discrete Fourier transform of an array of \( n \) elements is an easy computational problem. The most obvious way to do it takes time \( O(n^2) \). We discussed a recursive method that runs in time \( O(n \log n) \) if \( n \) is a power of 2. When we write a program recursively, we are making life easier for ourselves and harder for the compiler and the computer. A single call to a recursive program can cause it to execute a tree-full of calls to itself before it is able to respond to our original request. For example, if we call Quicksort to sort the array \[ \{5, 8, 13, 9, 15, 29, 44, 71, 67\} \] then the tree shown in Fig. 2.7.1 might be generated by the compiler. ![Fig. 2.7.1: A tree of calls to Quicksort](path/to/your/image1) Again, if we call `maxwell` on the 5-cycle, the tree in Fig. 2.3.3 of calls may be created. A single invocation of `chromoly`, where the input graph is a 4-cycle, might generate the tree of recursive calls that appears in Fig. 2.7.2. ![Fig. 2.7.2: A tree of calls to chromoly](path/to/your/image2) 60 Image Analysis: ### Analysis of Visual Content #### 1. Localization and Attribution: - **Image 1:** Located in the upper part of the page below a block of text. - **Image 2:** Positioned in the lower half of the page, also below a block of text. - **Numbering:** - **Image 1:** Fig. 2.7.1 - **Image 2:** Fig. 2.7.2 #### 2. Object Detection and Classification: - **Image 1 (Fig. 2.7.1):** - Objects: Nodes and branches indicating a tree structure. - Classification: Represents a decision tree used in the Quicksort algorithm. - **Image 2 (Fig. 2.7.2):** - Objects: More complex nodes and branches forming another type of tree structure. - Classification: Represents a tree of calls, possibly in a different recursive algorithm called "chrompoly." #### 3. Scene and Activity Analysis: - **Image 1 (Fig. 2.7.1):** - Scene: A tree-like diagram showing recursive calls when the Quicksort algorithm sorts an array. - Activity: Each node represents a step or call in the recursive process of sorting. - **Image 2 (Fig. 2.7.2):** - Scene: Another tree diagram, this time more complex, showing recursive calls for a method referred to as "chrompoly." - Activity: The nodes and branches illustrate the steps in the recursive computation for an operation involving a 4-cycle. #### 4. Text Analysis: - **Above Image 1:** - Text: "Chapter 2: Recursive Algorithms ... {5, 8, 13, 9, 15, 29, 44, 71, 67}" - Context: Introduces the concept of recursive algorithms and presents an example using the Quicksort algorithm. - **Caption of Image 1:** - Text: "A tree of calls to Quicksort." - Significance: Explains that the diagram represents the tree structure of recursive calls in Quicksort. - **Above Image 2:** - Text: Describes an invocation of "chrompoly" and the generation of a tree from a 4-cycle. - Context: Continues the discussion on recursive calls, now focusing on a different algorithm. - **Caption of Image 2:** - Text: "A tree of calls to chrompoly." - Significance: Indicates that the tree diagram represents recursive calls generated by the "chrompoly" method. #### 8. Color Analysis: - **Image 1 and 2:** - Dominant Colors: Black and white. - Impact: The simplicity of the color scheme focuses attention on the structure and flow of the recursive calls. #### 9. Perspective and Composition: - **Image 1:** - Perspective: Front view of a tree diagram. - Composition: Organized hierarchically from top to bottom, illustrating levels of recursive calls. - **Image 2:** - Perspective: Front view of a more complex diagram. - Composition: Similar hierarchical structure but with increased complexity and additional symbols. #### 12. Graph and Trend Analysis: - **Image 1:** - Shows a trend of decreasing subsets through recursive calls until single elements are sorted. - **Image 2:** - Displays a trend of complex recursive calls handling more specialized tasks. #### 13. Graph Numbers: - **Image 1:** - Data Points (nodes): {5, 8, 13, 9, 15, 29, 44, 71, 67} - **Image 2:** - No specific numerical data points are visible, but nodes depict recursive calls at various stages. #### Additional Aspects: - **Process Descriptions:** - **Image 1:** Describes the process of recursively dividing an array for sorting. - **Image 2:** Describes a recursive process handling a specific computational graph structure. - **Trend and Interpretation:** - **Image 1:** Trend shows the breakdown of a sorting problem into increasingly smaller subproblems. - **Image 2:** Illustrates a more complex trend, perhaps indicating interaction between multiple recursive subproblems. By accurately depicting these elements, the images contribute to the reader’s understanding of recursive algorithms, illustrating how they break down problems into smaller, manageable calls. #################### File: Algorithms%20and%20Complexity%20-%20Herbert%20S.%20Wilf%20%28PDF%29.pdf Page: 65 Context: # 2.7 A review ![Fig. 2.7.3: The recursive call tree for FFT](path/to/image) Finally, if we call the ‘power of 2’ version of the FFT algorithm on the sequence \( \{1, -1, i, -i\} \), then FFT will proceed to manufacture the tree shown in Fig. 2.7.3. It must be emphasized that the creation of the tree of recursions is done by the compiler without any further effort on the part of the programmer. As long as we’re here, how does a compiler go about making such a tree? It does it by using an auxiliary stack. It adopts the philosophy that if it is asked to do two things at once, well after all, it can’t do that, so it does one of those two things and drops the other request on top of a stack of unfinished business. When it finishes executing the first request, it goes to the top of the stack to find out what to do next. ## Example Let’s follow the compiler through its tribulations as it attempts to deal with our request for maximum independent set size that appears in Fig. 2.3.3. We begin by asking for the maxset of the 5-cycle. Our program immediately makes two recursive calls to maxset1, each of the two graphs that appear on the second level of the tree in Fig. 2.3.3. The stack is initially empty. The compiler says to itself ‘I can’t do these both at once’, and it puts the right-hand graph (involving vertices 3,4) on the stack, and proceeds to call itself on the left hand graph (vertices 2,3,4,5). When it tries to do that one, of course, two more graphs are generated, of which the right-hand one (4,5) is dropped onto the stack, on top of the graph that previously lived there, so now two graphs are on the stack, awaiting processing, and the compiler is dealing with the graph (3,4,5). This time the graph of just one vertex (5) is dropped onto the stack, which now holds three graphs, as the compiler works on (4,5). Next, that graph is broken up into (5), and an empty graph, which is dutifully dropped onto the stack, so the compiler can work on (5). Finally, something fruitful happens: the graph (5) has no edges, so the program maxset gives, in its trivial case, very specific instructions as to how to deal with this graph. We now know that the graph that consists of just the single vertex (5) has a maxset value of 1. The compiler next reacts for the graph on top of the stack, finds that it is the empty graph, which has no edges at all, and therefore its maxset size is 0. Now it knows the \( n_1 = 1 \) and \( n_2 = 0 \) values that appear in the algorithm maxset, and therefore it can execute the instruction `maxset = max(n1, n1 + 1 + n2)`, from which it finds that the value of maxset for the graph (4,5) is 1, and it continues from there, to dig itself out of the stack of unfinished business. In general, if it is trying to execute `maxset1` on a graph that has edges, it will drop the graph \( G - \{v^*\} \) on the stack and try to do the graph \( G - \{v\} \). The reader should try to write out, as a formal algorithm, the procedure that we have been describing, whereby the compiler deals with a recursive computation that branches into two sub-computations until a trivial case is reached. Image Analysis: ### Analysis of the Attached Visual Content #### 1. Localization and Attribution - **Image 1:** The diagram at the top of the page. - **Image 2:** The text below the diagram, continuing till the end of the page. #### 2. Object Detection and Classification **Image 1:** - **Object Detected:** Diagram representing a recursive call tree for FFT (Fast Fourier Transform). - **Key Features:** - Root node labeled “\( 1, i, -i, -1 \)” connected to two children. - Left child node labeled “\( 1, i \)” with further branches. - Right child node labeled “\( -i, -1 \)” with further branches. #### 3. Scene and Activity Analysis **Image 1:** - **Scene Description:** - The diagram shows the recursive division of the input sequence in the FFT algorithm. - The nodes break down the sequence into smaller subsequences until reaching single elements. - **Activity Taking Place:** - Recursive splitting of the sequence into smaller parts, a typical process in the FFT algorithm's implementation. #### 4. Text Analysis **Image 2:** - **Detected Text:** - The text explains how the recursive call tree is used in the FFT algorithm. - It mentions the use of an auxiliary stack and describes an example of the process. - Specific terms such as "mnascrll" and numbers such as "1, i, -i, -1" are highlighted. - **Text Significance:** - The text illustrates the practical execution and handling of recursion using an auxiliary stack, crucial for understanding the FFT algorithm's efficiency. #### 5. Diagram and Chart Analysis **Image 1:** - **Diagram Analysis:** - The diagram is a visual representation of the recursive breakdown in the FFT algorithm. - The axes in the context of a tree do not apply, but the tree levels indicate depth of recursion. - **Key Insights:** - Each recursive call splits the sequence, demonstrated by branching nodes, ultimately simplifying the computation process. #### 6. Product Analysis - **Not Applicable** #### 7. Anomaly Detection - **None Detected** #### 8. Color Analysis - **Color Composition:** - The diagram and text are primarily black and white, with may be some shades of gray for different elements. - The absence of color focuses attention on the details without distraction. #### 9. Perspective and Composition **Image 1:** - **Perspective:** - Standard 2D view commonly used for tree diagrams. - **Composition:** - The root node is centrally placed at the top, with child nodes symmetrically branching out below, aiding in clarity and readability. #### 10. Contextual Significance **Image 1 & Image 2:** - **Overall Document Context:** - Likely part of an educational or technical document discussing algorithms, specifically the FFT. - **Contribution to Message:** - The diagram (Image 1) and the explanatory text (Image 2) collectively illustrate and clarify the recursive structure and process of the FFT algorithm, enhancing understanding. #### 11. Metadata Analysis - **Not Available** #### 12. Graph and Trend Analysis - **Not Applicable** #### 13. Graph Numbers **Not Applicable** #### Additional Aspects - **Ablaufprozesse (Process Flows):** - Describes the detailed recursion process in the FFT algorithm, with actual traversal over nodes. - **Prozessbeschreibungen (Process Descriptions):** - Detailed in the text. The process includes using an auxiliary stack handling unfinished business, exemplified step-by-step. - **Typen Bezeichnung (Type Designations):** - Descriptions of recursive calls and edge cases (e.g., empty graph). - **Trend and Interpretation:** - Explanation of recursion, its breakdown into smaller sub-problems, and efficient computation using the stack. - **Tables:** - None detected in the image. The collective examination of the visual content provides a comprehensive understanding of the FFT algorithm's recursive call structure and practical implementation, essential for readers in technical fields. #################### File: Algorithms%20and%20Complexity%20-%20Herbert%20S.%20Wilf%20%28PDF%29.pdf Page: 66 Context: # Chapter 2: Recursive Algorithms ## Exercise for section 2.7 1. In Fig. 2.7.3, add to the picture the output that each of the recursive calls gives back to the box above it that made the call. ## Bibliography A definitive account of all aspects of sorting is in D. E. Knuth, *The Art of Computer Programming*, Vol. 3: *Sorting and Searching*, Addison Wesley, Reading, MA, 1973. All three volumes of the above reference are highly recommended for the study of algorithms and discrete mathematics. An \(O(2^{n/3})\) algorithm for the maximum independent set problem can be found in R. E. Tarjan and A. Trojanowski, "Finding a maximum independent set", *SIAM J. Computing*, 6 (1977), 537-546. Recent developments in fast matrix multiplication are traced in Victor Pan, *How to Multiply Matrices Faster*, Lecture notes in computer science No. 179, Springer-Verlag, 1984. The realization that the Fourier transform calculation can be speeded up has been traced back to C. Runge, *Zeits. Math. Phys.*, 48 (1903) p. 443. and also appears in C. Runge and H. König, *Die Grundlagen der math. Wissenchaft*, 11, Springer Verlag, Berlin 1924. The introduction of the method in modern algorithmic terms is generally credited to J. M. Cooley and J. W. Tukey, "An algorithm for the machine calculation of complex Fourier series", *Mathematics of Computation*, 19 (1965), 297-301. A number of statistical applications of the method are in J. M. Cooley, P. A. W. Lewis and P. D. Welch, "The Fast Fourier Transform and its application to time series analysis", in *Statistical Methods for Digital Computers*, Enslin, Ralston and Wilf eds., John Wiley & Sons, New York, 1977, 377-423. The use of the FFT for high precision integer arithmetic is due to A. Schönhage and V. Strassen, "Schnelle Multiplikation grosser Zahlen", *Computing*, 7 (1971), 281-292. An excellent account of the above as well as applications of the FFT to polynomial arithmetic is by A. V. Aho, J. E. Hopcroft and J. D. Ullman, *The Design and Analysis of Computer Algorithms*, Addison Wesley, Reading, MA, 1974 (chap. 7). #################### File: Algorithms%20and%20Complexity%20-%20Herbert%20S.%20Wilf%20%28PDF%29.pdf Page: 70 Context: # Chapter 3: The Network Flow Problem (a) The direction of the edge is coherent with the direction of the path from source to sink and the present value of the flow function on the edge is below the capacity of that edge; or (b) The direction of the edge is opposed to that of the path from source to sink and the present value of the flow function on the edge is strictly positive. Indeed, on all edges of a flow augmenting path that are coherently oriented with the path we can increase the flow along the edge, and on all edges that are incoherently oriented with the path we can decrease the flow on the edge, and in either case we will have increased the value of flow (think about that one until it makes sense). It is, of course, necessary to maintain the conservation of flow, i.e., to respect Kirchhoff's laws. To do this, it will augment the flow on every edge of an augmenting path by the same amount. If the conservation conditions were satisfied before the augmentation, then they will still be satisfied after such an augmentation. It may be helpful to remark that an edge is coherently or incoherently oriented only with respect to a given path from source to sink. That is, the coherence, or lack of it, is not only a property of the directed edge, but depends on how the edge sits inside a chosen path. Thus, in Fig. 3.3.1 the first edge is directed towards the source, i.e., incoherently with the path. Hence if we decrease the flow in that edge we will have increased the value of the flow function, namely the net flow out of the source. That particular edge can indeed have its flow decreased, but at most 8 units. The next edge carries 10 units of flow towards the source. Therefore if we decrease the flow on that edge, by up to 10 units, we will also have increased the value of the flow function. Finally, the edge into the sink carries 12 units of flow and is oriented towards the sink. Hence if we increase the flow on this edge, by at most 3 units since its capacity is 15, we will have increased the value of the flow in the network. Since every edge in the path that is shown in Fig. 3.3.1 can have its flow altered in one way or the other so as to increase the flow in the network, the path is indeed a flow augmenting path. The most that we might accomplish with this path would be to push 3 more units of flow through it from source to sink. We couldn't push more than 3 units through because one of the edges (the edge into the sink) will tolerate an augmentation of only 3 flow units before reaching its capacity. To augment the flow by 3 units we would diminish the flow by 3 units on each of the first two edges and increase it by 3 units on the last edge. The resulting flow in this path is shown in Fig. 3.3.2. The flow in the full network, after this augmentation, is shown in Fig. 3.3.3. Note carefully that if these augmentations are made then flow conservation at each vertex of the network will still hold (check this!). ![Fig. 3.3.3: The network, after augmentation of flow](image_link_here) After augmenting the flow by 3 units as we have just described, the resulting flow will be the one that is shown in Fig. 3.3.3. The value of the flow in Fig. 3.1.2 was 32 units. After the augmentation, the flow function in Fig. 3.3.3 has a value of 35 units. We have just described the main idea of the Ford-Fulkerson algorithm. It first finds a flow augmenting path. Then it augments the flow along that path as much as it can. Then it finds another flow augmenting path. 66 Image Analysis: ### Comprehensive Examination of the Attached Visual Content: #### 1. **Localization and Attribution:** - **Image Position:** - The page contains a single image located in the middle portion of the document between paragraphs of text. - **Image Number:** - Image 1 (as it is the only image on the page). #### 2. **Object Detection and Classification:** - **Image 1:** - **Objects Identified:** - Nodes labeled from 1 to 15. - Directed edges connecting these nodes. - Edge labels with capacities. - **Classification:** - Nodes represent network vertices. - Directed edges represent network flow paths with capacities. #### 3. **Scene and Activity Analysis:** - **Image 1:** - **Scene Description:** - The scene is a flow network diagram showing nodes connected by directed edges with various capacities. - **Activities:** - Illustrates the augmentation of flow in the network from a source node to a sink node following the Ford-Fulkerson algorithm. - **Main Actors and Actions:** - Nodes serve as actors in the network. - Actions involve the flow of units along directed edges between nodes. #### 4. **Text Analysis:** - **Detected Text:** - “Fig. 3.3.3: The network, after augmentation of flow.” - Numeric labels on nodes (e.g., 1, 2, 3, up to 15). - Numeric values on the edges indicating flow capacities (e.g., 8, 12, 7, etc.). - **Content Significance:** - The figure caption indicates that the diagram shows a network after flow augmentation. - Numeric labels and values are essential for understanding the specific capacities and alterations of flow paths in the network. #### 5. **Diagram and Chart Analysis:** - **Image 1:** - **Diagram Analysis:** - The diagram is a visual representation of a network flow problem showing the initial and augmented flow paths. - Nodes and directed edges with numeric labels indicate flow paths and their respective capacities. - **Axes, Scales, and Legends:** - There are no traditional axes or scales since it's a network flow diagram. - The numeric values on edges serve as the 'scale', showing the flow capacities. - **Key Insights:** - The network shows an increase in flow after augmentation, illustrating the path and capacity changes according to the Ford-Fulkerson method. #### 9. **Perspective and Composition:** - **Image 1:** - **Perspective:** - The diagram is presented from a straightforward, bird's-eye view, making it easy to follow the flow paths. - **Composition:** - Nodes are arranged logically in a network pattern with directed edges showing the direction of flow. - The layout is clear, ensuring that augmentations and flow changes are visibly highlighted. #### 13. **Graph Numbers:** - **Image 1:** - Nodes are numbered from 1 to 15. - Edge capacities are as follows (some examples provided): - Edge from node 1 to node 2: 8 units. - Edge from node 1 to node 3: 12 units. - Edge from node 2 to node 4: 4 units. - Edge from node 3 to node 4: 9 units. - Continues in this format for all edges shown in the diagram. ### Additional Context: - **Process Flows (Ablaufprozesse):** - The diagram represents a process flow in a network for augmenting flow using the Ford-Fulkerson method. - **Prozessbeschreibungen (Process Descriptions):** - Describes the step-by-step augmentation of flow through the network to increase overall flow from source to sink. ### Summary: The visual content is a detailed representation of a network flow problem post-augmentation, focusing on the application of the Ford-Fulkerson algorithm. The diagram is clear, showing all essential elements like nodes, directed edges with capacities, and the flow augmentation process. This illustration aids in understanding how network flow can be incrementally improved to optimize overall flow from source to sink. #################### File: Algorithms%20and%20Complexity%20-%20Herbert%20S.%20Wilf%20%28PDF%29.pdf Page: 71 Context: # 3.3 The algorithm of Ford and Fulkerson The algorithm terminates when no flow augmenting paths exist. We will prove that when that happens, the flow will be at the maximum possible value, i.e., we will have found the solution of the network flow problem. We will now describe the steps of the algorithm in more detail. ## Definition Let \( f \) be a flow function in a network \( X \). We say that an edge \( (u, v) \) of \( X \) is usable from \( u \) to \( v \) if either \( u \) is directed from \( v \) to \( u \) and the flow in \( e \) is less than the capacity of the edge, or \( e \) is directed from \( u \) to \( v \) and the flow in \( e \) is \( > 0 \). Now, given a network and a flow in that network, how do we find a flow augmenting path from the source to the sink? This is done by a process of labeling and scanning the vertices of the network, beginning with the source and proceeding out to the sink. Initially, all vertices are in the conditions 'unlabeled' and 'unscanned'. As the algorithm proceeds, various vertices will become labeled, and if a vertex is labeled, it may become scanned. To scan a vertex \( u \) means, roughly, that we stand at \( u \) and look around at all neighbors \( w \) of \( u \) that haven't yet been labeled. If there is some edge that joins \( u \) with a neighbor \( v \), and if the edge \( e \) is usable from \( u \) as defined above, then we will label \( v \) because any flow augmenting path that has already reached from the source to \( u \) can be extended another step, to \( v \). The label that every vertex \( v \) gets is a triple \( (a, +, z) \), and here is what the three items mean. - The \( a \) part of the label of \( v \) is the name of the vertex that was being scanned when \( v \) was labeled. - The \( + \) will be \( + \) if \( v \) was labeled because the edge \( (u, v) \) was usable from \( u \) (i.e., if the flow from \( u \) to \( v \) was less than the capacity of \( (u, v) \)) and it will be \( - \) if \( v \) was labeled because the edge \( (u, v) \) was usable from \( u \) (i.e., if the flow from \( u \) to \( v \) was \( > 0 \)). - Finally, the \( z \) component of the label represents the largest amount of flow that can be pushed from the source to the present vertex \( v \) along any augmenting path that has so far been found. At each step the algorithm will replace the current value of \( z \) by the amount of new flow that could be pushed through to \( z \) along the edge that is now being examined, if that amount is smaller than \( z \). So much for the meanings of the various labels. As the algorithm proceeds, the labels that get attached to the different vertices form a record of how much flow can be pushed through the network from the source to the various vertices, and exactly which routes. To begin with, the algorithm labels the source with \( (-\infty, +\infty) \). The source now has the label-status labeled and the scan-status unscanned. Next we will scan the source. Here is the procedure for scanning any vertex \( u \). ### Procedure: scan ``` procedure scan(u: vertex; X: network; flow: ); for every 'unlabeled' vertex \( v \) that is connected to \( u \) by an edge in either or both directions, do if the flow in \( (u, v) \) is less than \( cap(u, v) \) then label \( v \) with \( (u, +, min(cap(u, v) - flow(u, v)) \) else if the flow in \( (u, v) \) is \( > 0 \) then label \( v \) with \( (u, -, min(flow(u, v)) \) change the label-status of \( v \) to 'labeled'; change the scan-status of \( v \) to 'scanned' end; ``` We can use the above procedure to describe the complete scanning and labeling of the vertices of the network, as follows. #################### File: Algorithms%20and%20Complexity%20-%20Herbert%20S.%20Wilf%20%28PDF%29.pdf Page: 73 Context: ```markdown procedure fordFulkerson(X : network; f : flow; maxFlowValue : real); {finds maximum flow in a given network X} set f := 0 on every edge of X; maxFlowValue := 0; repeat labelAndScan(X, f, asPath); if asPath = 'it’s time to augment' then augment(flow[X, f], amount); maxFlowValue := maxFlowValue + amount until asPath = 'flow is maximum'; end. {fordFulkerson} Let’s look at what happens if we apply the labeling and scanning algorithm to the network and flow shown in Fig. 3.1.2. First vertex s gets the label (-∞, +∞). We then scan s. Vertex A gets the label (-, ∞, 8). B cannot be labeled, and C gets labeled with (s, +, 10), which completes the scan of s. Next we scan vertex A, during which D acquires the label (A, +, 8). Then C is scanned, which results in E getting the label (C, - , 10). Finally, the scan of D results in the label (D, +, 3) for the sink t. From the label of t we see that there is a flow augmenting path in the network along which we can push 3 more units of flow from s to t. We find the path as in procedure augment(flow, amount), following the labels backwards from t to D, A and s. The path in question will be seen to be exactly the one shown in Fig. 3.3.1, and further augmentation proceeds as we have discussed above. ## 3.4 The max-flow min-cut theorem Now we are going to look at the state of affairs that holds when the flow augmentation procedure terminates because it has not been able to label the sink. We want to show that then the flow will have a maximum possible value. Let W ⊆ V(X), and suppose that W contains the source and W does not contain the sink. Let W denote all other vertices of X, i.e., W = V(X) - W. **Definition.** By the cut (W, W̄) we mean the set of all edges of X whose initial vertex is in W and whose terminal vertex is in W̄. For example, one cut in a network consists of all edges whose initial vertex is the source. Now, every unit of flow that leaves the source and arrives at the sink must at some moment flow from a vertex of W to a vertex of W̄, i.e., must flow along some edge of the cut (W, W̄). We define the **capacity of a cut** to be the sum of the capacities of all edges in the cut; then it seems clear that the value of a flow can never exceed the capacity of any cut, and therefore the **minimum value of a flow** cannot exceed the minimum capacity of any cut. The main result of this section is the ‘max-flow min-cut’ theorem of Ford and Fulkerson, which we state as **Theorem 3.4.1.** The maximum possible value of any flow in a network is equal to the minimum capacity of any cut in that network. **Proof.** We will first do a little computation to show that the value of a flow can never exceed the capacity of a cut. Second, we will show that when the Ford-Fulkerson algorithm terminates it has been unable to label the sink, and that that moment there is a cut in the network whose edges are saturated with flow, i.e., such that the flow in each edge of the cut is equal to the capacity of that edge. Let U and V be two (not necessarily disjoint) sets of vertices of the network X, and let f be a flow function for X. By f(U | V) we mean the sum of the values of the flow function along all edges whose initial vertices lies in U and whose terminal vertices lies in V. Similarly, by cu(U | V) we mean the sum of the capacities of all those edges. Finally, by the net flow out of U we mean f(U | V) - f(V | U). ``` Image Analysis: ### Image Analysis #### 1. Localization and Attribution - **Image 1** is located at the upper part of the page and consists of a pseudocode and a procedural explanation. - **Image 2** is the lower part of the page containing a textual explanation and theorem proof. #### 2. Object Detection and Classification - **Image 1**: - Objects: Text content, pseudocode block. - Classification: Academic content, algorithm explanation. - **Image 2**: - Objects: Text content. - Classification: Theorem proof, explanatory text. #### 4. Text Analysis - **Image 1**: - **Pseudocode Content**: - Title: `procedure fordFulkerson(X: network; f: flow; maxflowvalue:real);` - Description of a maximum flow algorithm in a network. - Main steps involve initializing flow values, scanning vertices, and augmenting flow. - The psuedocode describes the Ford-Fulkerson method to find the maximum flow in a given network. - **Image 2**: - **Text Content**: - Discusses the application of the Ford-Fulkerson algorithm step by step. - Highlights labels and augmentation process for vertices spread across various steps of the algorithm. - Defines **The Max-Flow Min-Cut Theorem**: - Provides terms and definitions related to sets of vertexes. - Discusses the logical proof of the theorem. - Establishes the relationship between maximum flow and minimum cut in network flow problems. #### 8. Color Analysis - Both images are predominantly black and white, typical for academic or instructional text. There are no significant colors that impact the perception. #### 9. Perspective and Composition - **Image 1**: Composed with a top-down perspective focusing on the pseudocode block. - **Image 2**: Text is laid out in standard multi-paragraph, columnar format used in technical documents. ### Additional Aspects #### Ablaufprozesse (Process Flows) - **Image 1**: - Depicts steps in the Ford-Fulkerson algorithm to augment flow in a network. Identifies steps beginning with initialization, edge scanning, and augmentation until maximum flow is achieved. #### Prozessbeschreibungen (Process Descriptions) - **Image 2**: - Describes the application and logical steps of the Ford-Fulkerson method. - Discusses how labels are added to vertices and how augmenting paths are found, highlighting core algorithm operations. - The flow process continues with analyzing resulting flow from source to sink vertices. #### Typen Bezeichnung (Type Designations) - **Image 1**: Does not directly specify types, but implicitly categorizes operations such as initialization, scanning, and augmentation. - **Image 2**: Defines sets and functions relevant to network flow and capacity. #### Trend and Interpretation - The text demonstrates the relationship and trends between flow and cut in a network. The main insight is that the maximum flow in a network is equal to the capacity of the minimum cut. ### Summary The images collectively provide a comprehensive explanation of the Ford-Fulkerson algorithm and the Max-Flow Min-Cut Theorem, which are crucial concepts in network flow theory. The pseudocode and proof offer detailed steps and logical reasoning, highlighting important procedures and outcomes in network flow problems. #################### File: Algorithms%20and%20Complexity%20-%20Herbert%20S.%20Wilf%20%28PDF%29.pdf Page: 74 Context: # Chapter 3: The Network Flow Problem ## Lemma 3.4.1 Let \( f \) be a flow of value \( Q \) in a network \( X \), and let \( (W,T) \) be a cut in \( X \). Then \[ Q = f(W,T) - f(V(X),W) \leq \text{cap}(W,T). \tag{3.4.1} \] ### Proof of lemma: The net flow out of \( s \) is \( Q \). The net flow out of any other vertex \( w \in W \) is \( 0 \). Hence, if \( V(X) \) denotes the vertex set of the network \( X \), we obtain \[ Q = \sum_{w \in W} (f(W, V(X)) - f(V(X), w)) \] \[ = f(W, V(X)) - f(V(X), W) \] \[ = f(W, W) - f(W \cup T) - f(W, W) \] \[ = f(W, W) - f(W, T) - f(W, W) \] \[ = f(W, W) - f(W, W). \] This proves the ‘=’ part of (3.4.1), and the ‘≤’ part is obvious, completing the proof of lemma 3.4.1. We now know that the maximum value of the flow in a network cannot exceed the minimum of the capacities of the cuts in the network. To complete the proof of the theorem we will show that if a flow of maximum value, which surely exists, must saturate the edges of some cut. Hence, let \( f \) be a flow in \( X \) of maximum value, and call procedure `labelscan(X, f, v)`. Let \( W \) be the set of vertices of \( X \) that have been labeled when the algorithm terminates. Clearly \( s \in W \). Equally clearly, \( t \notin W \), for suppose the contrary. Then we would have termination with `labeled` = \( t \)’s time to augment; and if we were then to call procedure augment flow we would find a flow of higher value, contradicting the assumed maximality of \( f \). Since \( s \in W \) and \( t \notin W \), we find that \( W \) defines a cut \( (W,T) \). We claim that every edge of the cut \( (W,T) \) is saturated. Indeed, if \( (u,v) \) is in the cut, \( u \in W, v \in T \), then edge \( (u,v) \) is saturated, else we would have been labeled when we were scanning \( u \) and would have \( v \in X \), a contradiction. Similarly, if \( (v,y) \) is an edge where \( y \in T \) and \( v \in W \), then edge \( (v,y) \) would have been labeled when we were scanning \( v \), another contradiction. Therefore, every edge from \( T \) to \( W \) is carrying as much flow as its capacity permits, and every edge from \( T \) to \( W \) is carrying no flow at all. Hence the sign of equality holds in (3.4.1), the value of the flow is equal to the capacity of the cut \( (W,T) \), and the proof of theorem 3.4.1 is finished. ## 3.5 The complexity of the Ford-Fulkerson algorithm The algorithm of Ford and Fulkerson terminates if and when it arrives at a stage where the sink is not labeled but no more vertices can be labeled. If at that time we let \( W \) be the set of vertices that have been labeled, then we have seen that \( (W,T) \) is a minimum cut of the network, and the present value of the flow is the desired maximum for the network. The question now is, how long does it take to arrive at that stage, and indeed, is quartanteed that we will ever get there? We are asking if the algorithm is finite, surely the most primitive complexity question imaginable. First consider the case where every edge of the given network \( X \) has integer capacity. Then the labeling and flow augmentation algorithms, various additions and subtractions are done, but there is no way that any augmenting flows can be produced. It follows that the augmented flow is still integral. The value of the flow therefore increases by an integer amount during each augmentation. On the other hand if, say, \( C \) denotes the combined capacity of all edges that are outbound from the source, then it is eminently clear that the flow can never exceed \( C \). Since the value of the flow increases by at least 1 unit per augmentation, we see that no more than \( C \) flow augmentations will be needed before a maximum flow is reached. This yields 70. Image Analysis: ### Comprehensive Examination of the Attached Visual Content #### Localization and Attribution - **Document Location:** The image appears to be a single page from a document, specifically labeled as "page 70." - **Number of Images:** There is only one main image present on the page. #### Text Analysis - **Detected Text:** - **Document Title:** - Chapter 3: The Network Flow Problem - **Section Title:** - Lemma 3.4.1. Let f be a flow of value Q in a network X, and let (W,T) be a cut in X. Then Q = f(W,T) - f(T,W) ≤ cap(W,T). - **Proof of Lemma:** - Detailed mathematical proof provided, starting with: ``` Proof of lemma: The net flow out of s is Q. ``` - Concluding with: ``` This proves the '=' part of (3.4.1), and the '≤' part is obvious, completing the proof of lemma 3.4.1. ``` - **Additional Section:** - 3.5 The complexity of the Ford-Fulkerson algorithm - Discussion on the algorithm's termination and complexity - **Content Significance:** - The text primarily focuses on explaining a lemma (Lemma 3.4.1) related to the network flow problem, providing the proof for it. - The latter part delves into the complexity of the Ford-Fulkerson algorithm, discussing its runtime and conditions for termination. #### Scene and Activity Analysis - **Scene Description:** - The scene is a textbook or a mathematical document, specifically a chapter discussing "The Network Flow Problem." - No human actors or physical activities are depicted; instead, the primary activity is the presentation of theoretical and mathematical proofs. #### Diagram and Chart Analysis - **Diagrams and Charts:** - No diagrams or charts are visible within the provided image. #### Anomaly Detection - **Possible Anomalies:** - No noticeable anomalies or unusual elements were detected in the image. The page appears to be a standard, well-formatted excerpt from a textbook or academic paper. #### Perspective and Composition - **Perspective:** - The image is taken from a straight-on perspective, allowing a clear view of the entire page's content. - **Composition:** - The text is well-organized, with numbered sections and clearly delineated mathematical expressions. The layout follows academic formatting standards. #### Contextual Significance - **Overall Contribution:** - The image provides detailed information relevant to understanding network flow problems and the Ford-Fulkerson algorithm within the context of the larger document. It contributes to the theoretical foundation necessary for advanced studies in network theory. ### Additional Insights - **Process Descriptions (Prozessbeschreibungen):** - Description of the labeling and scanning procedures in the proof. - **Type Designations (Typen Bezeichnung):** - Types such as \(W\) (vertex set of X), \(T\) (cut in X), and Q (flow value) are discussed in mathematical context. #### Conclusion The provided page is a detailed theoretical exposition on network flow problems, specifically focusing on Lemma 3.4.1 and the complexity of the Ford-Fulkerson algorithm. The mathematical proof and algorithmic discussion are central to the image, making it a valuable resource for understanding these concepts. #################### File: Algorithms%20and%20Complexity%20-%20Herbert%20S.%20Wilf%20%28PDF%29.pdf Page: 77 Context: # 3.6 Layered networks The set of all such \( v \) will be called layer 1 of \( Y \). Next, we construct layer 2 of \( Y \). The vertex set of layer 2 consists of all vertices \( v \) that do not belong to any layer, and such that there is a helpful edge in \( X \) from some vertex \( u \) of layer 1 to \( v \). Next, we draw the edges from layer 1 to layer 2: for each vertex \( v \) in layer 2, we draw a single edge in \( Y \) directed from \( u \) to every vertex in layer 2 for which there is a helpful edge in \( X \) from \( u \) to \( v \). Note that the edge always goes from \( u \) to \( v \) regardless of the direction of the helpful edge in \( K \). Note also that in contrast to the Ford-Fulkerson algorithm, even after an edge has been drawn from \( u \) to \( v \), additional edges may be drawn to the same \( v \) from other vertices of layer 1. Assign capacities to the edges from layer 1 to layer 2 in the same way as described above, that is, the capacity in \( Y \) of the edge from \( u \) to \( v \) is \( c_{uv} = f(u) + f(v) \). This latter quantity is, of course, the total residual (unused) flow-carrying capacity of the edges in both directions between \( u \) and \( v \). The layering continues until we reach a layer \( L \) such that there is a helpful edge from some vertex of layer \( L \) to the sink \( t \), or else until no additional layers can be created (to say that no more layers can be created is to say that among the vertices that haven't yet been included in the layered network that we are building, there aren't any that are adjacent to a vertex that is in the layered network, a helpful edge). In the former case, we then create a layer \( L + 1 \) that consists solely of the sink \( t \). We connect \( t \) by edges directed from the appropriate vertices of layer \( L \), assigning capacities to those edges, and the layering process is complete. Observe that not all vertices of \( X \) need appear in \( Y \). In the latter case, where no additional layers can be created but the sink hasn't been reached, the present flow function \( f \) in \( X \) is maximum, and the network flow problem in \( X \) has been solved. Here is a formal statement of the procedure for layering a given network \( X \) with respect to a given flow function \( f \) in \( X \). Input are the network \( X \) and the present flow function \( f \) that is known. Output are the layered network \( Y \), and a logical variable \( \text{max flow} \) that will be True on output, if the flow is at a maximum value, False otherwise. ```plaintext procedure layer(X, f, Y, max flow); {forms the layered network Y with respect to the flow in X} max flow will be 'True' if the input flow f already has the maximum possible value for the network, else it will be 'False'} L := 0; layer(L) := {source}; max flow := false; repeat layer(L + 1) := ∅; for each vertex v in layer(L) do for each vertex u such that layer(v) = L + 1 or v is not in any layer do q := c_{ap}(u, v) - f(u, v) + f(v, u); if q > 0 then do draw edge u → v in Y; assign capacity q to that edge; assign vertex v to layer(L + 1); end; L := L + 1; until layer(L) is empty then exit with max flow := true; until sink is in layer(L); delete from layer(L) all vertices other than sink, and remove their incident edges from Y end.{layer} ``` In Fig. 3.6.1 we show the typical appearance of a layered network. In contrast to a general network, in a layered network every path from the source to some fixed vertex \( v \) has the same number of edges in it (the number of the layer of \( v \)), and all edges on such a path are directed the same way, from the source towards. #################### File: Algorithms%20and%20Complexity%20-%20Herbert%20S.%20Wilf%20%28PDF%29.pdf Page: 79 Context: # 3.6 Layered networks After augmenting the flow in the original network \( X \), we construct a new layered network, from \( X \) and the newly augmented flow function of \( X \). The various activities that are now being described may sound like some kind of thinly disguised repackaging of the Ford-Fulkerson algorithm, but they aren’t just that, because here is what can be proved to happen: 1. First, if we start with zero flow in \( X \), make the layered network \( Y \), find a blocking flow in \( Y \), augment the flow in \( X \), make a new layered network \( Y \), find a blocking flow, etc., and then, after at most \( V \) phases (“phase” = layer + block + augment) we will have found the maximum flow in \( X \) and the process will halt. 2. Second, each phase can be done very rapidly. The MPM algorithm, to be discussed in section 3.7, finds a blocking flow in a layered network in time \( O(V) \). By the height of a layered network \( Y \) we will mean the number of edges in any path from source to sink. The network of Fig. 3.6.1 has height 1. Let’s now show **Theorem 3.6.1.** The heights of the layered networks that occur in the consecutive phases of the solution of a network flow problem form a strictly increasing sequence of positive integers. Hence, for a network \( X \) with \( V \) vertices, there can be at most \( V \) places before a maximum flow is found. Let \( Y(p) \) denote the layered network that is constructed at the \( p^{th} \) phase of the computation and let \( H(p) \) denote the height of \( Y(p) \). We will first prove **Lemma 3.6.1.** If \[ v_0 \to v_1 \to v_2 \to \cdots \to v_m \quad (v_0 = \text{source}) \] is a path in \( Y(p + 1) \), and if every vertex \( v_i \) (for \( i = 1, \ldots, m \)) of that path also appears in \( Y(p) \), then for every \( a = 0, m \) it is true that if vertex \( v_a \) was in layer \( l \) of \( Y(p) \) then \( 2 \geq b \). **Proof of lemma:** The result is clearly true for \( a = 0 \). Suppose it is true for \( v_0, v_1, \ldots, v_k \), and suppose \( v_{k+1} \) was in layer \( c \) of network \( Y(p) \). We will show that \( a + 1 \leq c \). Indeed, if not then \( c > a + 1 \). Since \( v_a \) was not present in network \( Y(p) \) since the two vertices were not in the same layers. Hence the flow in \( Y \) between \( v_a \) and \( v_{k+1} \) could not have been affected by the augmentation procedure of phase \( p \). But edge \( v_i \) is in \( Y(p + 1) \). Therefore it represented an edge of \( Y \) that at the beginning of phase \( p + 1 \) was unaffected by phase \( p \), but was not helpful at the beginning of phase \( p \). This contradiction establishes the lemma. Now we will prove the theorem. Let \[ s \to v_1 \to v_2 \to \cdots \to v_{H(p)+1} \to t \] be a path from source to sink in \( Y(p + 1) \). Consider first the case where every vertex of the path also lies in \( Y(p) \) and let \( m = 1 \) (i.e. \( H(p + 1) = a \)). We conclude that \( H(p + 1) > H(p) \). Now we want to exclude the \( v_i \)’s from \( Y(p + 1) \) = \( H(p) \) in the entire path in \( Y(p) \) and \( Y(p + 1) \), and so all of the edges in \( Y \) that the edges of the path represent were helpful both before and after the augmentation step of phase \( p \), contradicting the fact that the blocking flow that was used for the augmentation saturated some edge of the chosen path. The theorem is now proved for the case where the path had all its vertices in \( Y(p) \). Now suppose that this was not the case. Let \( e' : v_k \to v_{k+1} \) be the first edge of the path whose terminal vertex \( v_{k+1} \) was not in \( Y(p) \). Then the corresponding edges of \( Y \) was unaffected by the augmentation in phase \( p \). It was helpful from \( v_{k} \) at the beginning of phase \( p + 1 \) because \( e' \in Y(p + 1) \) and was unaffected by phase \( p \), yet \( v_{k+1} \notin Y(p) \). The only possibility is that vertex \( v_{k+1} \) would have entered into \( Y \) in the layer \( H(p) \) that contains the sink, but that layer is special, and contains only. Hence, if \( v_a \) is layer of \( Y(p) \), then \( b + 1 = H(p) \). By the lemma once more, \( 2 \geq b + 1 \geq H(p) \), and therefore \( H(p + 1) > H(p) \), completing the proof of Theorem 3.6.1. Image Analysis: ### Analysis of the Attached Visual Content #### 1. Localization and Attribution: - **Image 1**: - Position: Single image that occupies the entire page. #### 4. Text Analysis: - **Detected Text**: - **Header**: "3.6 Layered networks" - **Sub-header**: "After augmenting the flow in the original network X, what then? We construct a new layered network, from X and the newly augmented flow function f on X." - **Main Text**: The text elaborates on various concepts related to layered networks, primarily focusing on the following: - Creating layered networks and augmenting flow. - Describing activities like processing and blocking flows in a network. - Introduction of Lemma 3.6.1 and its proof. - Explaining the height of a layered network and its implications. - **Text Significance**: - This segment appears to be from an academic or technical document, likely a textbook or research paper on network theory. The text describes advanced concepts related to network flows and provides a formal structure for understanding and proving the behavior of layered networks. #### 9. Perspective and Composition: - **Perspective**: - The image is captured from a bird’s-eye view, showing a top-down view of a document page. - **Composition**: - The layout is structured and organized in a standard document format with headers, sub-headers, main text, and mathematical formulae. - **Header**: Section number and title. - **Body**: Multiple paragraphs of text and mathematical notation. - **Mathematical Notations and Proofs**: Highlighted and formatted to distinguish from the main text. #### 14. Prozessbeschreibungen (Process Descriptions): - The document describes a process for constructing and analyzing layered networks in the context of network flow problems: - **Process Steps**: 1. Start with an original flow network \( X \). 2. Create a layered network \( Y \). 3. Identify and block flows sequentially. 4. Iterate through a maximum of \( V \) phases to augment flow. - **Proofs and Lemmas**: - Proof of Lemma 3.6.1, demonstrating the relation between the layers and vertices in the network. - Theorem proving the height of layered networks in successive phases. #### 15. Typen Bezeichnung (Type Designations): - The document categorizes types of networks and processes: - **Networks**: - Original network \( X \). - Layered network \( Y \). - **Phases**: Different stages in the augmentation process. - **Vertices**: Specific points within the networks and their levels. ### Summary: This image contains a detailed section from a technical document on layered networks, emphasizing construction, augmentation processes, and mathematical proofs. It is well-organized with clear headings, sub-headings, and structured mathematical content aiding in understanding advanced concepts within the domain of network theory. #################### File: Algorithms%20and%20Complexity%20-%20Herbert%20S.%20Wilf%20%28PDF%29.pdf Page: 81 Context: # 3.6 Layered networks The vertex itself has either all incoming edges or all outgoing edges, or both, at zero residual capacities. Hence no more flow will be pushed through \( Y \). Therefore we can delete \( Y \) from the network \( X \) together with all of its incident edges, incoming or outgoing. Further, we can delete from \( Y \) all of the edges that were saturated by the flow pushing process just completed. Next, we may now find that some vertex \( v \) has had all of its incoming or all of its outgoing edges deleted. That vertex will never be used again, so delete it and any other incident edges it may still have. Continue the pruning process until only vertices remain that have nonzero potential. If the source and the sink are still connected by some path, then repeat from (A) above. **Step 1: End the algorithm** The blocking flow function that we have just defined is the following: if \( e \) is an edge of the input layered network \( Y \), then \( f(e) \) is the sum of all of the flows that passed through edge \( e \) at all stages of the above algorithm. It is obviously a blocking flow; since no path between \( s \) and \( t \) remains, every path must have at least one of its edges saturated at some step of the algorithm. What is the complexity of this algorithm? Certainly we delete at least one vertex from the network at every pruning stage, because the vertex \( v \) that had minimum potential will surely have had either all of its incoming or all of its outgoing edges (or both) saturated. It follows that steps (A)–(E) can be executed at most \( V \) times before we halt with a blocking flow. The cost of saturating all edges that get saturated, since every edge has but one saturation to give to its network, is \( O(E) \). The number of partial edge-saturation operations is at most two per vertex visited. For each minimal-potential vertex \( v \) we visit not with \( V \) other vertices, so we use at most \( V \) minimal-potential vertices altogether. So the partial edge saturation operations cost \( O(V) \) and the total edge saturation cost \( O(E) \). The operation of finding a vertex of minimum potential is `free`, in the following sense. Initially we compute and store the in- and out- potentials of every vertex. Thereafter, each time the flow in some edge is increased, the potential of this initial vertex and the potentials of its terminal vertices are reduced by the same amount. It follows that the cost of maintaining these arrays is linear in the number of vertices, \( V \). Hence it affects only the constants implied by the `big-O` symbols above, but not the orders of magnitude. The total cost is therefore \( O(V^2) \) for the complete MPM algorithm that finds a blocking flow in a layered network. Hence a maximum flow in a network can be found in \( O(V^3) \) time, since at most \( V \) layered networks need to be looked at in order to find a maximum flow in the original network. In contrast to the hasty example network of section 3.5, with its traditional edge capacities, that made the Ford-Fulkerson algorithm into an infinite process that converged to the wrong answer, the time bound \( O(V^3) \) that we have just proved for the layered-network MPM algorithm is totally independent of the capacities. ## 3.8 Applications of network flow We conclude this chapter by mentioning some applications of the network flow problem and algorithm. Certainly, among these, one most often mentions first the problem of maximum matching in a bipartite graph. Consider a set \( P \) of \( p \) people and a set \( J \) of \( j \) jobs, such that not all of the people are capable of doing all of the jobs. We construct a graph \( G = P \cup J \) to represent this situation, as follows. Take \( P \) vertices to represent the people, \( J \) vertices to represent the jobs, and connect vertex \( p \) to vertex \( j \) by an undirected edge if person \( p \) can do job \( j \). A graph is called bipartite. In general, a graph \( G \) is bipartite if its vertices can be partitioned into two classes in such a way that no edge runs between two vertices of the same class (see section 1.6). In Fig. 3.8.1 below we show a graph that might result from a certain group of people and jobs. The maximum matching problem is just this: assuming that each person can handle at most one job, and that each job needs only one person, assign people to the jobs in such a way that the largest possible number of people are employed. In terms of the bipartite graph \( G \), we want to find a maximum number of edges, no two incident with the same vertex. To solve this problem by the method of network flows we construct a network \( Y \). First we adjoin two new vertices \( s \) to the bipartite graph \( G \). If we let \( P \) denote the vertices of vertices in the graph \( G \), then we draw an edge from \( s \) to each \( p \in P \) and an edge from each \( j \in J \) to \( t \). Each edge in the network is #################### File: Algorithms%20and%20Complexity%20-%20Herbert%20S.%20Wilf%20%28PDF%29.pdf Page: 82 Context: # Chapter 3: The Network Flow Problem ![Matching people to jobs](path_to_image_1.png) **Fig. 3.8.1:** Matching people to jobs ![The network for the matching problem](path_to_image_2.png) **Fig. 3.8.2:** The network for the matching problem Given capacity 1. The result for the graph of Fig. 3.8.1 is shown in Fig. 3.8.2. Consider a maximum integer-valued flow in this network, of value \( Q \). Since each edge has capacity 1, \( Q \) edges of the type \( (p, q) \) can contain a unit of flow. Out of each vertex \( p \) that receives some of this flow, there will come one unit of flow (since inflow equals outflow at such vertices), which will then cross to a vertex \( j \) of \( J \). No such \( j \) will receive more than one unit because at most one unit can leave it for the sink \( t \). Hence the flow defines a matching of \( Q \) edges of the graph \( G \). Conversely, any matching in \( G \) defines a flow, hence a maximum flow corresponds to a maximum matching. In Fig. 3.8.3 we show a maximum flow in the network of Fig. 3.8.2 and therefore a maximum matching in the graph of Fig. 3.8.1. ![A maximum flow](path_to_image_3.png) **Fig. 3.8.3:** A maximum flow Image Analysis: ### Localization and Attribution: #### Image 1: - **Position:** Top of the page. - **Label:** Fig. 3.8.1: Matching people to jobs. #### Image 2: - **Position:** Middle of the page. - **Label:** Fig. 3.8.2: The network for the matching problem. #### Image 3: - **Position:** Bottom of the page. - **Label:** Fig. 3.8.3: A maximum flow. ### Object Detection and Classification: #### Image 1 (Fig. 3.8.1): - **Objects:** Nodes and directed edges forming a bipartite graph. - **Key Features:** - Two disjoint sets of nodes. - Edges connecting nodes from one set to nodes in the other set. #### Image 2 (Fig. 3.8.2): - **Objects:** Nodes, directed edges, and an additional network structure. - **Key Features:** - Similar to Image 1 but with an added network component including source and sink nodes. #### Image 3 (Fig. 3.8.3): - **Objects:** Nodes, directed edges, and a flow network. - **Key Features:** - More densely connected network. - Shows capacity and flow through edges. ### Scene and Activity Analysis: #### Image 1 (Fig. 3.8.1): - **Scene:** Bipartite graph representing the matching of individuals to jobs. - **Activities:** - Nodes represent people and jobs. - Edges represent potential matchings. #### Image 2 (Fig. 3.8.2): - **Scene:** Network flow diagram for the matching problem. - **Activities:** - Nodes represent individuals, jobs, and intermediary components. - Edges indicate flow paths. #### Image 3 (Fig. 3.8.3): - **Scene:** Network flow diagram showing a maximum flow scenario. - **Activities:** - Each edge shows the flow of units from one node to another. - Network demonstrates maximum possible flow from source to sink. ### Text Analysis: - **Text Detected:** - Chapter and section details at the top. - Descriptions below each figure (e.g., "Matching people to jobs"). - Paragraph text explains the theoretical basis and results observed in the figures, discussing capacity and maximum flow in network graphs. - **Significance:** - The text provides context and theoretical explanation of the concepts illustrated by the graphs, which include matching problems and network flows. ### Diagram and Chart Analysis: #### Image 1 (Fig. 3.8.1): - **Diagrams and Data:** Bipartite matching graph. - **Axes, Scales and Legends:** None. - **Key Insights:** Illustrates the concept of matching entities from two distinct sets. #### Image 2 (Fig. 3.8.2): - **Diagrams and Data:** Network structure for matching problem. - **Axes, Scales and Legends:** None. - **Key Insights:** Provides a more complex view incorporating network flow for the matching problem. #### Image 3 (Fig. 3.8.3): - **Diagrams and Data:** Maximum flow network diagram. - **Axes, Scales and Legends:** None. - **Key Insights:** Demonstrates the computation of maximum flow within a network graph. ### Color Analysis: - **Color Composition for all Images:** - Predominantly black and white, typical for schematic and instructional diagrams in technical documents. ### Perspective and Composition: #### Basic Features Shared by All Images: - **Perspective:** Straightforward 2D view with nodes and edges distinctly visible. - **Composition:** Symmetrically arranged diagrams focusing on clarity of nodes and edges to elucidate matching and flow concepts. ### Contextual Significance: - **Context within Document:** - Each figure exemplifies concepts crucial to understanding network flow problems and matching theory in a chapter dedicated to such topics. - Enhances comprehension by visually depicting theoretical explanations. ### Anomaly Detection: - **Possible Anomalies:** - No visible anomalies or unusual elements; all diagrams seem standard for educational purposes. ### Typen Bezeichnung (Type Designations): - **Image Designations:** - Bipartite Graph (Fig. 3.8.1) - Network for Matching Problem (Fig. 3.8.2) - Maximum Flow Network (Fig. 3.8.3) ### Trend and Interpretation: - **Matching and Flow Trends:** - Progressive complexity from a simple bipartite graph to a network flow system depicting maximum flow. ### ProencryptedContent .de: größeriges Chancen: less Beschreibtion Format .encryption: Completed . #################### File: Algorithms%20and%20Complexity%20-%20Herbert%20S.%20Wilf%20%28PDF%29.pdf Page: 84 Context: # Chapter 3: The Network Flow Problem ## Exercises for section 3.8 1. Apply the max-flow min-cut theorem to the network that is constructed in order to solve the bipartite matching problem. Precisely what does a cut correspond to in this network? What does the theorem tell you about the matching problem? 2. Same as question 1 above, but applied to the question of discovering whether or not there is a 0-1 matrix with a certain given set of row and column sums. ## Bibliography The standard reference for the network flow problem and its variants is: - L. R. Ford and D. R. Fulkerson, *Flows in Networks*, Princeton University Press, Princeton, NJ, 1974. The algorithm, the example of irrational capacities and lack of convergence to maximum flow, and many applications are discussed there. The chronology of accelerated algorithms is based on the following papers: - J. Edmonds and R. M. Karp, Theoretical improvements in algorithmic efficiency for network flow problems, *ACM 19*, 2 (1972), 248-264. - E. A. Dinic, Algorithm for solution of a problem of maximal flow in a network with power estimation, Soviet Math. Dokl. 11 (1970), 1277-1280. The paper of Dinic, above, also originated the idea of a layered network. Further accelerations of the network flow algorithms are found in the following: - A. V. Karzanov, Determining the maximal flow in a network by the method of preflows, Soviet Math. Dokl. 15 (1974), 434-437. - B. V. Cherkassky, Algorithm of construction of maximal flow in networks with complexity of \(O(V^2E)\) operations, Akad. Nauk. USSR, Mathematical methods for the solution of economical problems 7 (1977), 117-126. The MPM algorithm, discussed in the text, is due to: - V. M. Malhotra, M. Pramod-Kumar and S. N. Maheshwari, An \(O(V^3)\) algorithm for finding maximum flows in networks, *Information Processing Letters* 7, (1978), 277-278. Later algorithms depend on refined data structures that save fragments of partially constructed augmenting paths. These developments were initiated in: - Z. Gall, A new algorithm for the maximal flow problem, Proc. 19th IEEE Symposium on the Foundations of Computer Science, Ann Arbor, October 1978, 231-245. - Andrew V. Goldberg and Robert E. Tarjan, A new approach to the maximum flow problem, 1985. A number of examples that show that the theoretical complexity estimates for the various algorithms cannot be improved are contained in: - Z. Gall, On the theoretical efficiency of various network flow algorithms, IBM report RC73029, September 1978. The proof given in the text, of theorem 3.6.1, leans heavily on the one in: - Simon Even, Graph Algorithms, Computer Science Press, Potomac, MD, 1979. If edge capacities are all 0's and 1's, as in matching problems, then still faster algorithms can be given, as in: - S. Even and R. E. Tarjan, Network flow and testing graph connectivity, SIAM J. Computing 4, (1975), 507-518. - R. E. Gomory and T. C. Hu, Multiterminal network flows, *SIAM Journal* 9, (1961), 551-570. Handling in general graphs is much harder than in bipartite graphs. The pioneering work is due to: - J. Edmonds, Path, trees, and flowers, *Canadian J. Math.* 17 (1965), 449-467. #################### File: Algorithms%20and%20Complexity%20-%20Herbert%20S.%20Wilf%20%28PDF%29.pdf Page: 85 Context: # Chapter 4: Algorithms in the Theory of Numbers Number theory is the study of the properties of the positive integers. It is one of the oldest branches of mathematics and, one of the purest, so to speak. It has immense vitality, however, and we will see in this chapter and the next that parts of number theory are extremely relevant to current research in algorithms. Part of the reason for this is that number theory enters into the analysis of algorithms, but that isn't the whole story. Part of the reason is that many famous problems of number theory, when viewed from an algorithmic viewpoint (like, how do you decide whether or not a positive integer is prime?) present extremely deep and attractive unsolved algorithmic problems. At least, they are unsolved if we regard the question as not just how to solve these problems computationally, but how to do them as rapidly as possible. But that’s not the whole story either. There are close connections between algorithmic problems in the theory of numbers, and problems in other fields, seemingly far removed from number theory. There is a unity between these seemingly diverse problems that enhances the already considerable beauty of any one of them. At least some of these connections will be apparent by the end of study of Chapter 5. ## 4.1 Preliminaries We collect in this section a number of facts about the theory of numbers, for later reference. If \( n \) and \( m \) are positive integers then to divide \( n \) by \( m \) is to find an integer \( q \geq 0 \) (the quotient) and an integer \( r \) (the remainder) such that \( 0 \leq r < m \) and \( n = qm + r \). If \( r = 0 \), we say that \( m \) divides \( n \), or \( m \) is a divisor of \( n \), and we write \( m \mid n \). In any case the remainder \( r \) is also called \( n \) modulo \( m \), and we write \( r = n \mod m \). Thus \( 5 \mid 10 \) and \( 7 \) is not prime, else it is composite. Every positive integer \( n \) can be factored into primes, uniquely apart from the order of the factors. Thus \( 120 = 2^3 \cdot 3 \cdot 5 \); in general we will write \[ n = p_1^{e_1} p_2^{e_2} \cdots p_k^{e_k} \tag{4.1} \] We will refer to (4.1.1) as the canonical factorization of \( n \). Many interesting and important properties of an integer \( n \) can be calculated from its canonical factorization. For instance, let \( d(n) \) be the number of divisors of the integer \( n \). The divisors of \( 6 \) are \( 1, 2, 3, 6 \), so \( d(6) = 4 \). Can we find a formula for \( d(n) \)? A small example may help to clarify the method. Since \( 120 = 2^3 \cdot 3^1 \cdot 5^1 \), a divisor of \( 120 \) must be of the form \( 2^a3^b5^c \), in which \( a \) can have the values \( 0, 1, 2, 3 \), \( b \) can be \( 0 \) or \( 1 \), and \( c \) can be \( 0 \) or \( 1 \). Thus there are \( 4 \) choices for \( a \), \( 2 \) for \( b \), and \( 2 \) for \( c \), so there are \( 16 \) divisors of \( 120 \). In general, the integer in (4.1) has exactly \[ d(n) = (1 + e_1)(1 + e_2) \cdots (1 + e_k) \tag{4.2} \] divisors. If \( m \) and \( n \) are nonnegative integers then their greatest common divisor, written \( \gcd(m, n) \), is the integer \( g \) such that - (a) \( g \) divides both \( m \) and \( n \) - (b) \( g \) is divisible by every other common divisor of \( m \) and \( n \). Thus \( \gcd(12, 8) = 4 \), \( \gcd(32, 36) = 4 \), etc. If \( \gcd(m, n) = 1 \) then we say that \( m \) and \( n \) are relatively prime. Thus \( 27 \) and \( 125 \) are relatively prime (even though neither of them is prime). If \( n > 0 \) is given, then \( \varphi(n) \) will denote the number of positive integers \( k \) such that \( 1 \leq k \leq n \) and \( \gcd(k, n) = 1 \). Thus \( \varphi(6) = 2 \), because there are only positive integers \( \leq 6 \) that are relatively prime to \( 6 \) (namely \( 1 \) and \( 5 \)). \( \varphi(n) \) is called the Euler φ-function, or the Euler totient function. Let’s find a formula that expresses \( \varphi(n) \) in terms of the canonical factorization (4.1) of \( n \). #################### File: Algorithms%20and%20Complexity%20-%20Herbert%20S.%20Wilf%20%28PDF%29.pdf Page: 90 Context: # Chapter 4: Algorithms in the Theory of Numbers We can now formulate recursively the extended Euclidean algorithm. ```plaintext procedure gcdext(m, n, g, t, u); { computes g.c.d. of m and n, and finds integers g, t that satisfy (4.3.1) } if m = 0 then g := n; t := 1; u := 0 else gcdext(m mod n, g, t, u); s := u; u := t - [n/m] * u; t := s; end; end gcdext; ``` It is quite easy to use the algorithm above to make a proof of the main mathematical result of this section (see exercise 1), which is: ## Theorem 4.3.1. Let \( m \) and \( n \) be given integers, and let \( g \) be their greatest common divisor. Then there exist integers \( u \) such that \( g = m \cdot u + n \cdot v \). An immediate consequence of the algorithm and the theorem is the fact that finding inverses modulo a given integer is an easy computational problem. We will need to refer to that fact in the sequel, so we state it as: ## Corollary 4.3.1. Let \( m \) and \( n \) be given positive integers, and let \( g \) be their g.c.d. Then there is a multiplicative inverse modulo \( n \) if and only if \( g = 1 \). In that case, the inverse can be computed in polynomial time. ### Proof: By the extended Euclidean algorithm we can find, in linear time, integers \( u \) and \( v \) such that \( g = m + n \). But this last equation says that \( g \equiv 0 \, (\text{mod } n) \). If \( g = 1 \) then it is obvious that it is the inverse modulo of \( m \). If \( g > 1 \) then there exists \( u \) such that \( m \equiv 1 \, (\text{mod } n) \) since \( m = 1 + n \) implies that the g.c.d. of \( m \) and \( n \) is \( 1 \). We will now trace the execution of `gcdext` if it is called with \( (m, n) = (14, 11) \). The routine first replaces \( (14, 11) \) and calls itself successively with \( (3, 2) \), \( (2, 1) \), and \( (1, 0) \). When it executes with \( (m, n) = (1, 0) \) it encounters the 'if \( m = 0 \)' statement, so it sets \( g := 1; t := 1; u := 0 \). Now it can complete the execution of the call with \( (m, n) = (2, 1) \), which has so far been pending. To do this it sets: - \( u := t - [n/m] \cdot u = 1 \) - \( t := s \) The call with \( (n, m) = (2, 1) \) is now complete. The call to the routine with \( (m, n) = (3, 2) \) has been in limbo until just this moment. Now that the \( (2, 1) \) call is finished, the \( (3, 2) \) call executes and finds: - \( u := -[3/2] = 1 \) - \( t := 1 \) The call to the routine with \( (m, n) = (11, 3) \) has so far been languishing, but its turn has come. It computes: - \( u := -1 - [11/3] \cdot (-1) = -4 \) - \( t := -1 \) Finally, the original call to `gcdext` from the user, with \( (m, n) = (14, 11) \), can be processed. We find: - \( u := (-1) - [14/11] = -5 \) - \( t := -4 \) Image Analysis: ### Comprehensive Examination #### Image 1 1. **Localization and Attribution:** - **Image Position:** The image occupies the whole page and is likely a single image document from a book or lecture notes. 2. **Text Analysis:** - **Detected Text:** - The text appears to be an excerpt from an academic section, likely from a textbook or paper, discussing algorithms in the theory of numbers. - **Chapter 4: Algorithms in the Theory of Numbers** - **Algorithm and Theorem Description:** It describes the extended Euclidean algorithm used to compute the greatest common divisor (gcd) and also details corollaries, proofs, and examples related to the algorithm. - **Code Snippet:** There is a pseudo-code implementation of the `gcd` function. - **Mathematical Theorems and Proofs:** - Theorem 4.3.1: Describes the relationship between integers n and m related to their gcd. - Corollary 4.3.1: Discusses the inverses modulo n and their properties. - Detailed Proof: Provides a step-by-step proof with example computation sequences. - **Mathematical Expressions:** The document contains several mathematical expressions and operations such as modulo, integer division, and linear combinations. 3. **Scene and Activity Analysis:** - **Scene Description:** The image is a page from an academic textbook focused on number theory, specifically on the extended Euclidean algorithm and its applications. - **Activities:** The activities are primarily educational and academic, involving the explanation, proof, and illustration of mathematical algorithms. 4. **Diagram and Chart Analysis:** - **Flow of Explanation:** - **Procedure Explanation:** The text explains procedures in a structured manner followed by practical examples illustrating the implementation and result. - **Example Execution:** Step-by-step tracing and verification of the algorithm execution. 5. **Perspective and Composition:** - **Perspective:** The image is captured in a straightforward, readable format, intended for clear and effective communication of information. - **Composition:** It is structured as follows: - **Introduction:** Brief introductory statement about the algorithm. - **Algorithm Pseudo-code:** Procedural description of the extended Euclidean algorithm. - **Theorems and Corollaries:** Formal statements of mathematical properties and results. - **Proof and Example:** Detailed breakdown and execution of the algorithm with an example. 6. **Contextual Significance:** - **Contribution to Overall Document:** This page is likely part of a larger academic or educational document focused on teaching advanced mathematical concepts. It contributes an in-depth explanation of a fundamental algorithm in number theory, along with supporting proofs and practical application, reinforcing the theoretical foundations laid in previous or subsequent sections. In summary, this image is an academic page detailing the extended Euclidean algorithm, its implications in number theory, and its practical applications through proofs and specific examples. #################### File: Algorithms%20and%20Complexity%20-%20Herbert%20S.%20Wilf%20%28PDF%29.pdf Page: 93 Context: # 4.5 Interlude: the ring of integers modulo n Isn't it amazing that in this technologically enlightened age we still don't know how to find a divisor of a whole number quickly? ## 4.5 Interlude: the ring of integers modulo n In this section we will look at the arithmetic structure of the integers modulo some fixed integer \( n \). These results will be needed in the sequel, but they are also of interest in themselves and have numerous applications. Consider the ring whose elements are \( 0, 1, 2, \ldots, n-1 \) and in which we do addition, subtraction, and multiplication modulo \( n \). This ring is called \( \mathbb{Z}_n \). For example, in Table 4.5.1 we show the addition and multiplication tables of \( \mathbb{Z}_6 \). ### Table 4.5.1: Arithmetic in the ring \( \mathbb{Z}_6 \) | + | 0 | 1 | 2 | 3 | 4 | 5 | |----|---|---|---|---|---|---| | 0 | 0 | 1 | 2 | 3 | 4 | 5 | | 1 | 1 | 2 | 3 | 4 | 5 | 0 | | 2 | 2 | 3 | 4 | 5 | 0 | 1 | | 3 | 3 | 4 | 5 | 0 | 1 | 2 | | 4 | 4 | 5 | 0 | 1 | 2 | 3 | | 5 | 5 | 0 | 1 | 2 | 3 | 4 | | * | 0 | 1 | 2 | 3 | 4 | 5 | |----|---|---|---|---|---|---| | 0 | 0 | 0 | 0 | 0 | 0 | 0 | | 1 | 0 | 1 | 2 | 3 | 4 | 5 | | 2 | 0 | 2 | 4 | 0 | 2 | 4 | | 3 | 0 | 3 | 0 | 3 | 0 | 3 | | 4 | 0 | 4 | 2 | 0 | 4 | 2 | | 5 | 0 | 5 | 4 | 3 | 2 | 1 | Notice that while \( \mathbb{Z}_n \) is a ring, it certainly need not be a field, because there will usually be some noninvertible elements. Reference to Table 4.5.1 shows that \( 2, 3, 4 \) have no multiplicative inverses in \( \mathbb{Z}_6 \), while \( 1, 5 \) do have such inverses. The difference, of course, stems from the fact that \( 1 \) and \( 5 \) are relatively prime to the modulus \( 6 \) while \( 2, 3, 4 \) are not. We learned, in Corollary 4.3.1, that an element of \( \mathbb{Z}_n \) is invertible if and only if \( m \) and \( n \) are relatively prime. The invertible elements of \( \mathbb{Z}_n \), form a multiplicative group. We will call that group the group of units of \( \mathbb{Z}_n \), and will denote it by \( U_n \). It has exactly \( \varphi(n) \) elements, by lemma 4.5.1, where \( \varphi \) is the Euler function of (4.1.5). The multiplication table of the group \( U_{18} \) is shown in Table 4.5.2. ### Table 4.5.2: Multiplication modulo 18 | * | 1 | 5 | 7 | 11 | 13 | 17 | |----|---|---|---|----|----|----| | 1 | 1 | 5 | 7 | 11 | 13 | 17 | | 5 | 5 | 7 | 11 | 13 | 17 | 1 | | 7 | 7 | 11 | 5 | 1 | 13 | 17 | | 11 | 11| 13 | 1 | 5 | 7 | 17 | | 13 | 13| 17 | 11 | 7 | 1 | 5 | | 17 | 17| 1 | 13 | 5 | 7 | 11 | Notice that \( U_{18} \) contains \( \varphi(18) = 6 \) elements, that each row (column) of the multiplication table contains a permutation of all the group elements. Let's look at the table a little more closely, with a view to finding out if the group \( U_{18} \) is cyclic. In a cyclic group there is an element \( a \) whose powers \( 1, a, a^2, \ldots \) run through all of the elements of the group. If we refer to the table again, we see that in \( U_{18} \) the powers of \( 5 \) are \( 1, 5, 7, 11, 13, 17 \). Thus the order of the group element \( 5 \) is equal to the order of the group, and \( 5 \) is a generator of \( U_{18} \). The group \( U_{18} \) is indeed cyclic, and \( 5 \) is a generator of \( U_{18} \). #################### File: Algorithms%20and%20Complexity%20-%20Herbert%20S.%20Wilf%20%28PDF%29.pdf Page: 95 Context: Theorem 4.5.4. Let \( \pi = p_1^{n_1} p_2^{n_2} \cdots p_r^{n_r} \). The mapping which associates with each \( z \in \mathbb{Z} \), the r-tuple \((z_1, z_2, \ldots, z_r)\), where \( z_i \equiv z \mod p_i^{n_i} \) (for \( i = 1, \ldots, r \)), in which - (a) \( z_i \in \mathbb{Z}_{p_i^{n_i}} \) (for \( i = 1 \)) - (b) \((z_1, \ldots, z_r) = (z_1 + y_1, \ldots, z_r + y_r)\) and - (c) \((x_1, \ldots, x_r) \cdot (y_1, \ldots, y_r) = (x_1 y_1, \ldots, x_r y_r)\) - (d) In (b), the \( i \)-th \( + \) sign on the right side is the addition operation of \( \mathbb{Z}_{p_i^{n_i}} \) and in (c) the \( i \)-th \( \cdot \) sign is the multiplication operation of \( \mathbb{Z}_{p_i^{n_i}} \), for each \( i = 1, \ldots, r \). The proof of theorem 4.5.4 follows at once from the following: Theorem 4.5.5 (‘The Chinese Remainder Theorem’). Let \( m_i \) (for \( i = 1, r \)) be pairwise relatively prime positive integers, and let \[ M = m_1 m_2 \cdots m_r. \] Then the mapping that associates with each integer \( x \) (for \( 0 \leq s < M - 1 \)) the r-tuple \( (b_1, b_2, \ldots, b_r) \), where \( b_i \equiv x \mod m_i \) (for \( i = 1, \ldots, r \)), is a bijection between \( \mathbb{Z}/M\mathbb{Z} \) and \( \mathbb{Z}/m_1\mathbb{Z} \times \cdots \times \mathbb{Z}/m_r\mathbb{Z} \). A good theorem deserves a good proof. An outstanding theorem deserves two proofs, at least, one existential, and one constructive. So here are one of each for the Chinese Remainder Theorem. **Proof 1:** We must show that each r-tuple \((b_1, \ldots, b_r)\), such that \( 0 \leq k < m_i \) (for \( i = 1, \ldots, r \)) occurs exactly once. There are obviously \( M \) such vectors, and so it will be sufficient to show that each of them occurs at most once as the image of some \( x \). In the contrary case we would have \( x \) and \( x' \) both corresponding to \((b_1, b_2, \ldots, b_r)\), say. But then \( x - x' \equiv 0 \mod m_i \) for all the \( m_i \). Hence \( x - x' \equiv 0 \) must be \( < |M| \), hence \( x = x' \). **Proof 2:** Here’s how to compute a number \( x \) that satisfies the simultaneous congruences \( x \equiv b_i \mod m_i \) (for \( i = 1, \ldots, r \)). First, by the extended Euclidean algorithm we can quickly find \( u_1, u_2, \ldots, u_r \), such that \( m_i y_i + m_j u_j = 1 \) for \( j = 1, \ldots, r \). Then we claim that the number \[ x = \sum_{j=1}^{r} b_j \frac{M}{m_j} \] satisfies all the given congruences. Indeed, for each \( i = 1, \ldots, r \), we have \[ x \equiv \sum_{j=1}^{r} b_j \frac{M}{m_j} \equiv b_i \left(\frac{M}{m_i} \mod m_i\right) \equiv b_i \mod m_i, \] where the first congruence holds because \( M/m_j \) is divisible by \( m_j \), and the second congruence follows since \( t_k(M/m_i) = 1 - u_i m_i \equiv 1 \mod m_i \), completing the second proof of the Chinese Remainder Theorem. Now the proof of theorem 4.5.4 follows easily, and is left as an exercise for the reader. The factorization that is described in detail in theorem 4.5.4 will be written symbolically as \[ \mathbb{Z}_n \cong \bigoplus_{i=1}^{r} \mathbb{Z}_{p_i^{n_i}} \tag{4.5.2} \] The factorization (4.5.2) of the ring \( \mathbb{Z} \), induces a factorization \[ U_r \cong \bigoplus_{i=1}^{r} U_{p_i^{n_i}} \tag{4.5.3} \] Image Analysis: ### Analysis of the Attached Visual Content: #### **1. Localization and Attribution:** - The image analyzed is a single page from a document. - The entire content is treated as **Image 1**. #### **2. Object Detection and Classification:** - **Objects Identified:** - Text blocks - Mathematical notation - Equations #### **3. Scene and Activity Analysis:** - **Scene Description:** - The entire scene is a mathematical text page likely from a textbook or academic paper. The primary activity is the presentation and proof of mathematical theorems, such as the discussion around modular arithmetic and number theory. #### **4. Text Analysis:** - **Text Detected and Extracted:** - Theorems, equations, proofs, and mathematical explanations are present throughout the page. Key sections include: - Theorem 4.5.4 and Theorem 4.5.5 - Definitions and proofs related to The Chinese Remainder Theorem - Factorization formulas - **Content Analysis:** - **Theorem 4.5.4** outlines a mapping related to integers and rings of tuples. - **Theorem 4.5.5**, a.k.a. **The Chinese Remainder Theorem**, describes a bijective mapping for a specific set of positive integers. - The page includes proofs for the theorems mentioned along with explanations and extended algorithms for computations. #### **5. Diagram and Chart Analysis:** - No diagrams or charts are present on this page. #### **7. Anomaly Detection:** - No anomalies or unusual elements are detected in the content of the image. #### **8. Color Analysis:** - The image appears in grayscale (black and white) which is typical for academic or textbook pages intended for printing. #### **9. Perspective and Composition:** - **Perspective:** - The image is taken at a straight-on angle, typical for scanned or digitally captured documents. - **Composition:** - The text is arranged in a traditional column format, with sections neatly organized and formulas centered for visibility. #### **10. Contextual Significance:** - The content appears to be an excerpt from an academic text or reference book on number theory, specifically dealing with modular arithmetic and decomposition of rings. ### Overall Message: - The page is intended to educate or inform the reader about the principles of number theory, specifically modular arithmetic and the Chinese Remainder Theorem. It provides detailed mathematical proofs and is structured to facilitate understanding of the complex mathematical concepts. ### **Additional Notes:** - The document is likely mathematical in nature, based on the presence of theorems and proofs. - This content is most useful to an academic or educational audience, particularly students or professionals in mathematics or related fields. #################### File: Algorithms%20and%20Complexity%20-%20Herbert%20S.%20Wilf%20%28PDF%29.pdf Page: 96 Context: # Chapter 4: Algorithms in the Theory of Numbers of the group of units. Since \( U_n \) is a group, (4.5.3) is an isomorphism of the multiplicative structure only. In \( \mathbb{Z}_{27} \), for example, we find \[ U_{12} \cong U_4 \times U_3 \] where \( U_4 = \{ 1, 3 \} \), \( U_3 = \{ 1, 2 \} \). So \( U_{12} \) can be thought of as the set \( \{ (1, 1), (1, 2), (3, 1), (3, 2) \} \), together with the componentwise multiplication operation described above. ## Exercises for section 4.5 1. Give a complete proof of theorem 4.5.4. 2. Find all primitive roots modulo 18. 3. Find all primitive roots modulo 27. 4. Write out the multiplication table of the group \( U_{27} \). 5. Which elements of \( Z_{11} \) are squares? 6. Which elements of \( Z_{19} \) are squares? 7. Find all \( x \in U_{27} \) such that \( x^2 \equiv 1 \). 8. Prove that if there is a primitive root modulo \( n \) then the equation \( x^2 \equiv 1 \) in the group \( U_n \) has only the solutions \( x \equiv \pm 1 \). 9. Find a number \( a \) that is congruent to 1, 7, and 11 to the respective modulo 5, 11, and 17. Use the method in the second proof of the remainder theorem 4.5.5. 10. Write out the complete proof of the ‘immediate’ corollary 4.5.3. ### 4.6 Pseudoprimality tests In this section, we will discuss various tests that might be used for testing the compositeness of integers probabilistically. By a **pseudoprimality test** we mean a test that is applied to a pair \( (n, b) \) of integers, and that has the following characteristics: - **(a)** The possible outcomes of the test are ‘\( n \) is composite’ or ‘inconclusive.’ - **(b)** If the test reports ‘\( n \) is composite’ then \( n \) is composite. - **(c)** The test runs in a time that is polynomial in \( \log n \). If the test result is ‘inconclusive’ then we say that \( n \) is pseudoprime to the base \( b \) (which means that \( b \) is far acting like a prime number, as far as we can tell). The outcome of the test of the primality of \( n \) depends on the base \( b \) that is chosen. In a good pseudoprimality test there will be many bases \( b \) that will give the correct answer. More precisely, a good pseudoprimality test will, with high probability (i.e., for a large number of choices of the base \( b \)) declare that a composite \( n \) is composite. In more detail, we will say that a pseudoprimality test is ‘good’ if there is a fixed positive number \( t \) such that every composite integer \( n \) is declared to be composite for at least \( t \) choices of the base \( b \) in the interval \( [1, S] \). Of course, given an integer \( n \), it is silly to say that ‘there is a high probability that \( n \) is prime’ or it isn’t, and we should not blame our ignorance on its itself. Nonetheless, the abuse of language is sufficiently appealing that we will define the problem away: we will say that a given integer \( n \) is very probably prime if we have subjected it to a good pseudoprimality test, with a large number of different bases \( b \), and have found that it is pseudoprime to all of those bases. Here are four examples of pseudoprimality tests, only one of which is ‘good.’ #### Test 1 Given \( n \), Output \( n \) is composite if \( b \) divides \( n \), else ‘inconclusive.’ This isn’t the good one. If \( n \) is composite, the probability that it will be so declared is the probability that we happen to have found a \( b \) that divides \( n \), where \( b \) is not \( 1 \) or \( n \). The probability of this event, if \( b \) is chosen uniformly at random from \( [1, n] \) is \[ p_1 = \frac{d(n) - 2}{n} \] where \( d(n) \) is the number of divisors of \( n \). Certainly \( p_1 \) is not bounded from below by a positive constant \( t \) if \( n \) is composite. #################### File: Algorithms%20and%20Complexity%20-%20Herbert%20S.%20Wilf%20%28PDF%29.pdf Page: 97 Context: Test 4 (the strong pseudoprimality test): Given (b, n). Let n =1 - 2^q, where m is an old integer. If either (a) b^m ≠ 1 (modn) or (b) there is an integer i in [0, q- 1] such that b^mi ≠ -1 (modn) then return ‘inconclusive’ else return ‘n is composite.’ First we validate the test by proving the Proposition. If the test returns the message ‘n is composite,’ then n is composite. Proof: Suppose not. Then n is an odd prime. We claim that b^m ≡ 1 (modn) for all i = q, q — 1,..,, 0. If so then the case i = 0 will contradict the outcome of the test, and thereby complete the proof. To establish the claim, it is clearly true when i = q by Fermat’s theorem. If true for I, then it is true for i – 1 also, because (bm+1)2 == bm+2≡ 1 (mod n) implies that the quantity being squared is +1 or -1. Since n is an odd prime, by corollary 4.5.3 Un is cyclic, and so the equation z^2 = 1 in Un has only the solutions z = ±1. But -1 is ruled out by the outcome of the test, and the proof of the claim is complete. (q.e.d.) What is the computational complexity of the test? Consider first the computational problem of raising a number to a power. We can calculate, for example, bn mod n with O(log n) integer multiplications, by successive squaring. More precisely, we compute b, b^2, b^4, b^8,… by squaring, and reducing modulo n immediately after each squaring operation, rather than waiting until the final exponent is reached. Then we use the binary expansion of the exponent to tell us which of these powers of b we should multiply together in order to compute bp. For instance, b337 = b256 . b64 . b16 . b. 93 ``` - Significance: The extracted text details four pseudoprimality tests, explaining their effectiveness, limitations, examples, and mathematical proofs. This is essential for understanding advancements in determining the primality of numbers, a fundamental topic in number theory and cryptographic applications. ### Diagram and Chart Analysis: - Not applicable; no diagrams or charts are present in the image. ### Product Analysis: - Not applicable; no products are depicted in the image. ### Anomaly Detection: - No anomalies detected in the image. Everything appears coherent and well-structured. ### Color Analysis: - **Image 1**: - Dominant Colors: Black and white text on a white background. - Impact: The high contrast between the black text and the white background ensures readability. ### Perspective and Composition: - **Image 1**: - Perspective: Front-facing, as typical for a page of text in a book or article. - Composition: The text is structured in a standard, double-column format common in academic publications. ### Contextual Significance: - The image, being a page from a mathematical text, contributes to the overall theme of pseudoprimality tests within the broader document. The detailed explanations and proofs underscore the scientific rigor and depth of the subject matter. ### Metadata Analysis: - Not applicable; no metadata information is available. ### Graph and Trend Analysis: - Not applicable; no graphs are included in the image. ### Graph Numbers: - Not applicable; no graphs are present in the image. ### Ablaufprozesse (Process Flows): - Not explicitly depicted; the text describes step-by-step tests in a linear, explanatory format. ### Prozessbeschreibungen (Process Descriptions): - Details descriptions of four different pseudoprimality tests, explaining procedural steps and mathematical justifications. ### Typen Bezeichnung (Type Designations): - Identifies tests by labels (Test 2, Test 3, Test 4). ### Trend and Interpretation: - Identifies a progression in the effectiveness and reliability of pseudoprimality tests, indicating a trend towards more robust and comprehensive methods. ### Tables: - Not applicable; no tables are included in the image. The detailed extraction and analysis provide a comprehensive understanding of the pseudoprimality tests and their significance within the mathematical context. #################### File: Algorithms%20and%20Complexity%20-%20Herbert%20S.%20Wilf%20%28PDF%29.pdf Page: 97 Context: # 4.6 Pseudorandomity tests ## Test 2 Given \( n \). Output \( n \) is composite if \( \gcd(b, n) \neq 1 \), else output ‘inconclusive.’ This one is a little better, but not yet good. If it is composite, the number of bases \( b \leq k \) for which Test 2 will produce the result ‘composite’ is \( n - \phi(n) \), where \(\phi\) is the Euler totient function, of (4.1.5). This number of useful bases will be large if \( n \) has some small prime factors, but in that case it’s easy to find out that \( n \) is composite by other methods. If \( n \) has only a few large prime factors, say if \( n = p^k \), then the proportion of useful bases is very small, and we have the same kind of inefficiency as in Test 1 above. Now we can state the third pseudorandomity test. ## Test 3 Given \( n \). (If \( b \) and \( n \) are not relatively prime or) if \( n \equiv 1 \,(\text{mod}\, n) \) then output \( n \) is composite; else output ‘inconclusive.’ Regrettably, the test is still not ‘good,’ but it’s a lot better than its predecessors. To cite an extreme case of its un-goodness, there exist composite numbers \( n \), called Carmichael numbers, with the property that the pair \( (b, n) \) produces the output ‘inconclusive’ for every integer \( b \) that is relatively prime to \( n \). An example of such a number is \( n = 1729 \), which is composite (\( 1729 = 17 \cdot 101 \)), but for which Test 3 gives the result ‘inconclusive’ on every integer \( b < 1729 \) that is relatively prime to \( 1729 \) (i.e., that is not divisible by \( 7 \) or \( 13 \) or \( 19 \)). Despite such misbehavior, the test usually seems to perform quite well. When \( n = 169 \) (a difficult integer for Tests 1 and 2) it turns out that there are \( 158 \) different \( b \in [1, 168] \) that produce the ‘composite’ outcome from Test 3, namely every such \( b \) except for \( 19, 22, 23, 70, 80, 89, 96, 147, 150, 168 \). Finally, we will describe a good pseudorandomity test. The familial resemblance to Test 3 will be apparent. ## Test 4 (the strong pseudorandomity test) Given \( (n, k) \). Let \( n = 1 \cdot 2^m \), where \( m \) is an odd integer. If either - (a) \( b^m \equiv 1 \,(\text{mod}\, n) \) or - (b) there is an integer \( i \in [0, q - 1] \) such that \( b^{n^2} \equiv -1 \,(\text{mod}\, n) \) then return ‘inconclusive’; else return ‘is composite.’ First we validate the test by proving the Proposition. ### Proposition If the test returns the message \( n \) is composite, then \( n \) is composite. **Proof:** Suppose not. Then \( n \) is an odd prime. We claim that \[ b^{m^2} \equiv 1 \,(\text{mod}\, n) \] for all \( i = q, q - 1, \ldots, 0 \). If so then the case \( i = 0 \) will contradict the outcome of the test, and thereby complete the proof. To establish the claim, it is clearly true when \( i = q \) by Fermat’s theorem. If true for \( i \), then it is true for \( i - 1 \), because \[ (b^{m^{i-1}})^2 \equiv b^{m^2} \equiv 1 \,(\text{mod}\, n) \] implies that the quantity being squared is \( +1 \) or \( -1 \). Since \( n \) is an odd prime, by corollary 4.5.3 \( U_n \) is cyclic, and so the equation \( x^2 \equiv 1 \,(\text{mod}\, n) \) has only the solutions \( x \equiv \pm 1 \). But \( -1 \) is ruled out by the outcome of the test, and the proof of the claim is complete. What is the computational complexity of the test? Consider first the computational problem of raising a number to a power. We can calculate, for example, \( b^2, b^4, b^8, \ldots \), by squaring, and reducing modulus immediately after each squaring operation, rather than waiting until the final exponent is reached. Then we use the binary expansion of the exponent to tell us which of these powers of \( b \) we should multiply together in order to compute \( b^n \). For instance, \[ b^{37} = b^{32} \cdot b^{4} \cdot b^{1}. \] Image Analysis: ## Image Analysis ### Image Localization and Attribution: - **Image 1**: The only image present on the page. ### Object Detection and Classification: - **Image 1**: - Objects Detected: - Multiple pieces of text. - Mathematical formulas and expressions. ### Scene and Activity Analysis: - **Image 1**: - Scene: Academic or scientific publication page, specifically focusing on pseudoprimality tests in number theory. - Activities: Detailed explanation of various pseudoprimality tests, including complete descriptions and examples. ### Text Analysis: - **Image 1**: - Text Extracted: ``` 4.6 Pseudoprimality tests Test 2. Given b, n. Output ‘n is composite’ if gcd(b, n) ≠ 1, else output ‘inconclusive.’ This one is a little better, but not yet good. If n is composite, the number of bases b ≤ n for which Test 2 will produce the result ‘composite’ is tn - 6(n)), where t() is the Euler totient function, of (4.1.5). This number of useful bases will be large if n has some small prime factors, but in that case it’s easy to find out that n is composite by other methods. if n has only a few large prime factors, say if n=ps, then the proportion of useful bases is very small, and we have the same kind of inefficiency as in Test 1 above. Now we can state the third pseudoprimality test. Test 3. Given b, n. (If b and n are not relatively prime or if bn - 7 ≠ 1 (mod n)) then output 'n is composite’; else output 'inconclusive.’ Regrettably, the test is still not ‘good,’ but it’s a lot better than its predecessors. To cite an extreme case of its un-goodness, there exist composite numbers n, called Carmichael numbers, with the property that the pair (b, n) produces the output ‘inconclusive’ for every integer b in [1, n - 1] that is relatively prime to n. An example of such a number is n = 1729, which is composite (1729 = 7 · 13 · 19), but for which Test 3 gives the result ‘inconclusive’ on every integer b € 1729 that is relatively prime to 1729 (i.e., that is not divisible by 7 or 13 or 19). Despite such misbehavior, the test usually seems to perform quite well. When n=169 (a difficult integer for Tests 1 and 2) it turns out that there are 158 different b’s in [1, 168] that produce the ‘composite’ outcome from Test 3, namely every such b except for 19, 22, 23, 70, 80, 89, 99, 146, 147, 150, 168. Finally, we will describe a good pseudoprimality test. The familial resemblance to Test 3 will be apparent. #################### File: Algorithms%20and%20Complexity%20-%20Herbert%20S.%20Wilf%20%28PDF%29.pdf Page: 99 Context: # 4.7 Goodness of pseudoprimality test ## Lemma 4.7.1 The order of each element of \( U_n \) is a divisor of \( e' = \text{lcm}(\varphi_i)_{i=1}^{s} \). **Proof:** From the product representation (4.5.3) of \( U_n \), we find that an element of \( U_n \) can be regarded as an \( s \)-tuple of elements from the cyclic groups \( U_{d_i} \) \( (i = 1, \ldots, s) \). The order of \( x \) is equal to the lcm of the orders of the elements of the \( s \)-tuple. For each \( i = 1, \ldots, s \), the order of the \( i \)-th of those elements is a divisor of \( \varphi_i \), and therefore the order of \( x \) divides the item shown above. ## Lemma 4.7.2 Let \( n > 1 \) be odd. For each element \( x \in U_n \) (where \( U(n) = \{1, u_1, \ldots, u_{s-1}\} \)), denote the cyclic group that it generates. Let \( B \) be the set of all elements of \( U_n \) for which \( C(u) \) either contains \(-1\) or odd order (i.e., \( \text{ord}(x) \) odd). If \( B \) generates the full group \( U_n \), then \( n \) is prime power. **Proof:** Let \( e^* = 2^m \), where \( m \) is odd and \( e^* \) as shown in lemma 4.7.1. Then there is a \( j \) such that \( \varphi(n) \) is divisible by \( 2^j \). Now if \( n \) is a prime power, we are finished. So we can suppose that \( r \) is divisible by more than one prime number. Since \( \varphi(n) \) is an even number for all \( r > 2 \) (proof?), the number \( e \) is even. Hence \( t > 0 \) and we can define a mapping \( \psi \) of the group \( U_r \) to itself by \[ \psi(x) = x^{2^m} \quad (x \in U_n) \] (note that \( \psi(x) \) is its own inverse). This is in fact a group homomorphism. For all \( y \in U_n \): \( \psi(y) = \psi(x)\psi(y). Let \( B \) be as in the statement of lemma 4.7.2. For each \( x \in B \), \( \psi(x) \) is in \( B \) and \[ \psi^2(x) = \psi(x). \] Since \( \psi(y) \) is an element of \( C(x) \) whose square is \( 1 \), \( \psi(y) \) has order 1 or 2. Hence if \( \psi(e) \neq 1 \), it is of order 2. If the cyclic group \( C(y) \) is of odd order and contains \(-1\), then it can contain no other element of order 2, so \( \psi(e) = -1 \) in this case. Hence for every \( x \in B \), \( \psi(x) = 1 \). Suppose \( B \) generates the full group \( U_n \). Then not only for every \( x \in B \) but for every \( z \in U_n \) it must be that \( \psi(z) = 1 \). Suppose \( n \) is not a prime power. Then \( s > 1 \) in the factorization (4.5.2) of \( U_n \). Consider the element \( v \) in \( U_n \), which, when written out as an \( s \)-tuple according to that factorization, is of the form \[ v = (1, 1, \ldots, 1, y, 1, \ldots, 1) \] where the \( y \) is in the \( j \)-th component, \( y \in U_n \) (recall that \( s \) is described above, in the second sentence of this proof). We can suppose \( y \) to be an element of order exactly \( 2 \) in \( U_n \), since \( U_n \) is cyclic. Consider \( \psi(y) \). Clearly \( \psi(y) \) is not \( 1 \) or otherwise the order of \( y \), namely \( 2 \), would divide \( 2^{m-1} \), which is impossible because \( m \) is odd. Also, \( \psi(y) \) is not \(-1\), because the element \(-1\) of \( U_n \) is represented uniquely by the \( s \)-tuple all of whose entries are \( -1 \). Thus \( y \) is neither \( 1 \) nor \(-1\), which contradicts the italicized assertion above. Hence \( s = 1 \) and \( n \) is a prime power, completing the proof. We can now prove the main result of Solomon, Strassen and Rabin, which asserts that Test 4 is good. ## Theorem 4.7.1 Let \( B' \) be the set of integers \( m \) such that \( \gcd(m, n) \) returns 'inconclusive' in Test 4. (a) If \( B' \) generates \( U_n \), then \( n \) is prime. (b) If \( B' \) consists of at most half of the integers in \( [1, n-1] \). **Proof:** Suppose \( B' \) and let \( m \) be the odd part of \( n - 1 \). Then either \( m \equiv 1 \mod 2 \) or \( m \equiv -1 \mod 2 \) for some \( i \in [1, n-1] \). In the former case the cyclic subgroup \( C(y) \) has odd order, since \( m \) is odd, and in the latter case \( C(y) \) contains \(-1\). Image Analysis: ### Image Analysis #### 1. **Localization and Attribution:** - **Image Number:** 1 #### 4. **Text Analysis:** - **Detected Text:** ``` 4.7 Goodness of pseudoprimality test Lemma 4.7.1. The order of each element of Unis a divisor of e' = lem{φ(si)}, i = 1, s}. Proof: From the product representation (4.5.3) of Un we find that an element x of Un can be regarded as an s-tuple of elements from the cyclic groups Ui (i= 1, s). The order of x is equal to the lemt of the orders of the elements of the s-tuple. But for each i= 1,. Let be the order of the ith of those elements is a divisor of φ(si)}, and therefore the order of x divides the lem shown above. Lemma 4.7.2. Let n > 1 ed odd. For each element U,, let C(Un)= {1, w, wa2, ...,ws-1) denote the cyclic group that it generates. Let B be the set of all elements x of Un for which C(Un) either contains –1 or has odd order (ie odd). If B generates the full group Un then n is a prime power. Proof: Let e' = 2l'm, where m is odd and e is as shown in lemma 4.7.1. Then there is a j such that φ(n1) is divisible by2l'. Now if n is a prime power, we are finished. So we can suppose that x is divisible by more than one prime number. Since φ(n1) is an even number for all n > 2 (proof?), the number e' is even. Hence t > 0 and we can define a mapping φ½ of the group Un to itself by φ(z) = zxl'÷m. (note that φ(z) is its own inverse). This is in fact a group homomorphism’ Vzr3. y, E Un: r oly EUn:: φ(zx) = φ(z)φ(y). Let B be as in the statement of lemma 4.7.2 For each x € B, y(z) is in C(Un) alm φ(x)2 = φ(z)2=1. #################### File: Algorithms%20and%20Complexity%20-%20Herbert%20S.%20Wilf%20%28PDF%29.pdf Page: 99 Context: φ(x)2 = φ(z)2=1. Since (the square is 1,φ(z) has order 1 or 2. Hence ifψ(z)^ 1 it is of order 2. If the cyclic group CU) is of odd order, then it contains no element of even order. Hence Cu) is of even order and contains -1. Then it can contain no other element of order 2, so φ(z)*1 in this case. Hence for every x£ B,y(z)=±1.Die Suppose B generates the full group Un. Then not only for every x€ B but for every x E Un is true that φ(x)* Suppose n is not a prime power. Then s > 1 in the factorization (4.5.2) of Un. Consider the element y of Un, which, when written out as an s-tuple according to that factorization, is of the form v =(1,1,1,...1,w,w2, 1,...,1.....yw.) where the ‘v is in the ith component, y E Un, (recall that j as described above, in the second sentence of this proof). We can suppose yiy to be an element of order exactly 2' in Un since Un is cycic Consider y(z)=1. Clearly ψ(z) is not 1, for otherwise the order y'.%a would divide 2l'-lm, his impossible because m iso. Also,φ(z) is not 41 because the element -1 of Un is represented uniquely by the s-tuple all of whose entries are –1. Thus φ(s”) is neither 1 nor–1 in Un, which contradicts the italicized assertion above. Hence s= 1 nd n is a prime power, completing the proof. Now we can prove the main result of Solovay, Strassen and Rabin, which asserts that Test 4 is good. Theorem 4.7.1. LetIFn the set of integers to m3a such that In, (n)y returns ‘ inconclusive’ in Test 4. (a) If B generates Un, thenn is prime. (b) Ifnis composite then B' consists of at most half of the integers in In 1|| :| Proof: Suppose 6 €B and let m be the odd part of n - 1. Then either3m^1 1 or y=1 forsome s€ {0,4 - 1). In the former case the cyclic subgroup (C)b) has odd order, since m is odd, and in the latter case (Ch contains -1. ``` - **Analysis:** - This page contains advanced mathematical content typical of academic literature, specifically focusing on pseudoprimality tests. - **Lemma 4.7.1** and **Lemma 4.7.2** state mathematical properties related to the order of elements in certain cyclic groups. - **Theorem 4.7.1** establishes a criterion for determining the primality of an integer based on generating sets, related to Solovay, Strassen, and Rabin's work on primality tests. #### 8. **Color Analysis:** - **Dominant Colors:** - The image predominantly features black text on a white background. #### 9. **Perspective and Composition:** - **Perspective:** - The perspective is that of a flat, face-on view, typical of a page of text. - **Composition:** - The page consists of structured text with headings, sub-headings, numbered lemmas, and their proofs. The text is aligned evenly with consistent spacing, which is typical for mathematical or academic documents. #### 10. **Contextual Significance:** - **Overall Context:** - The image is part of an academic document or textbook on pseudoprimality tests in number theory or a related field. - The text on the page contributes significantly to the understanding and application of pseudoprimality tests, a crucial concept in computational number theory and cryptography. ### Summary: The analyzed image is a page from a mathematical text dealing with pseudoprimality tests. It includes detailed lemmas and a theorem related to the order of elements in cyclic groups and their application in pseudoprimality testing, with proofs providing rigorous validation of these lemmas and theorem. The page is composed primarily of structured text, black on white, and is geared towards readers with an advanced understanding of mathematics, specifically in number theory. #################### File: Algorithms%20and%20Complexity%20-%20Herbert%20S.%20Wilf%20%28PDF%29.pdf Page: 101 Context: # 4.8 Factoring and cryptography A computationally intractable problem can be used to create secure codes for the transmission of information over public channels of communication. The idea is that those who send the messages to each other will have extra pieces of information that will allow them to solve the intractable problem rapidly, whereas an aspiring eavesdropper would be faced with an exponential amount of computation. Even if we don’t have a provably computationally intractable problem, we can still take a chance that those who might intercept our messages won’t know polynomial-time algorithms if we don’t know any. Since there are precious few provably hard problems, and hordes of apparently hard problems, it is scarcely surprising that a number of sophisticated coding senders rely on the latter rather than the former. One should remember, though, that an adversary might discover fast algorithms for doing these problems and keep that fact secret while deepening all of our messages. A remarkable feature of a family of recently developed coding schemes, called ‘Public Key Encryption Systems’, is that the ‘key’ to the code lies in the public domain, so it can be easily available to sender and receiver (and eavesdropper), and can be readily changed if need be. On the negative side, the most widely used Public Key Systems lean on computational problems that are only presumed to be intractable, like factoring large integers, rather than having been proved so. We are going to discuss a Public Key System called the RSA scheme, after its inventors: Rivest, Shamir, and Adelman. This particular method depends for its success on the seeming intractability of the problem of finding the factors of large integers. If that problem could be done in polynomial time, then the RSA system could be ‘cracked.’ In this system, there are three centers of information: the sender of the message, the receiver of the message, and the Public Domain (for instance, the ‘Personals’ ads of the New York Times). Here is how the system works. ## (A) Who knows what and when Here are the items of information that are involved, and who knows each item: - **p, q**: two large prime numbers, chosen by the receiver, and told to nobody else (not even to the sender!). - **n**: the product pq, and this is placed in the Public Domain. - **E**: a random integer, placed in the Public Domain by the receiver, who has first made sure that \(E\) is relatively prime to \((p-1)(q-1)\) by computing the g.c.d. and choosing a new \(E\) at random until the g.c.d. is 1. This is easy for the receiver to do because \(p\) and \(q\) are known to him, and the g.c.d. calculation is fast. - **P**: a message that the sender would like to send, thought of as a string of bits whose value, when regarded as a binary number, lies in the range \([0, n-1]\). In addition to the above, one more item of information is computed by the receiver, and that is the integer **D** that is the multiplicative inverse mod \((p-1)(q-1)\) of \(E\), i.e., \[ DE \equiv 1 \, (\text{mod} \, (p-1)(q-1)). \] Again, since \(p\) and \(q\) are known, this is a fast calculation for the receiver, as we shall see. To summarize: - The receiver knows \(p\), \(q\), \(D\). - The sender knows \(P\). - Everybody knows \(n\) and \(E\). In Fig. 4.8.1, we show the interiors of the heads of the sender and receiver, as well as the contents of the Public Domain. #################### File: Algorithms%20and%20Complexity%20-%20Herbert%20S.%20Wilf%20%28PDF%29.pdf Page: 102 Context: # Chapter 4: Algorithms in the Theory of Numbers Fig. 4.8.1: Who knows what ## (B) How to send a message The sender takes the message \( P \), looks at the public keys \( E \) and \( n \), computes \( C = P^E \mod n \), and transmits \( C \) over the public airwaves. Note that the sender has no private codebook or anything secret other than the message itself. ## (C) How to decode a message The receiver receives \( C \) and computes \( C^D \mod n \). Observe, however, that \( (p-1)(q-1) \) is \( \phi(n) \), and so we have: \[ C^D \equiv P^{DE} \equiv P^{(1+k\phi(n))} \quad (t \text{ is some integer}) \] \[ \equiv P \quad (\text{mod } n) \] where the last equality is by Fermat’s theorem (4.5.1). The receiver has now recovered the original message \( P \). If the receiver suspects that the code has been broken, i.e., that the adversaries have discovered the primes \( p \) and \( q \), then the sender can change them without having to send any secret messages to anyone else. Only the public numbers \( n \) and \( E \) would change. The sender would not need to be informed of any other changes. Before proceeding, the reader is urged to construct a little scenario. Make up a short (very short!) message. Choose values for the other parameters that are needed to complete the picture. Send the message as the sender would, and decode it as the receiver would. Then try to intercept the message, as an eavesdropper would, and see what the difficulties are. ## (D) How to intercept the message An eavesdropper who receives the message \( C \) would be unable to decode it without (inventing some entirely new decoding scheme or) knowing the inverse \( D \) of \( E \) (mod \( (p-1)(q-1) \)). The eavesdropper, however, does not even know the modulus \( n = (p-1)(q-1) \) because \( p \) and \( q \) are unknown (only the receiver knows them), and knowing the product \( p \times q = n \) alone is insufficient. The eavesdropper is thereby compelled to derive a polynomial-time factoring algorithm for large integers. May success attend those efforts! The reader might well remind her that the receiver has a substantial computational problem in creating two large primes \( p \) and \( q \). To a certain extent this is so, but two factors make the task a good deal easier. First, \( p \) and \( q \) will need to have only half as many bits as \( n \) has, so the job is of smaller size. Second, there Image Analysis: ### Comprehensive Image Analysis #### 1. **Localization and Attribution:** - **Image 1:** - **Location:** Upper-middle section of the page. - **Content:** Diagram illustrating "Who knows what" in a cryptographic context. - **Number:** Image 1 #### 2. **Object Detection and Classification:** - **Image 1:** - **Objects Detected:** - Two cartoon heads labeled "Sender" and "Receiver." - Text bubbles indicating what each person knows ("n E" for Sender and "p, q, d, E⁻¹" for Receiver). - **Classification:** - Heads: Representations of human characters. - Text bubbles: Cryptographic keys and information. #### 3. **Scene and Activity Analysis:** - **Image 1:** - **Scene Description:** - A cartoon of two individuals, one labeled "Sender" and the other "Receiver," highlighting what cryptographic information each person holds. - Indicates the public and private keys held by the sender and receiver. - **Activities:** - The image is a visual aid to explain cryptographic key distribution in a communication system. #### 4. **Text Analysis:** - **Text in Image 1:** - **Extracted Text:** - "n E" (Public keys known to the sender) - "p, q, d, E⁻¹" (Keys known to the receiver including the private key components) - **Significance:** - Illustrates the concept of public-key cryptography, showing the distribution of public and private keys between the sender and receiver. - **Extracted Text from Surrounding Text:** - **How to send a message:** - Details the process of using public keys to encrypt a message without a private codebook. - **How to decode a message:** - Explains the decoding process using the receiver's private key. - **How to interpret the message:** - Discusses the computational complexity for eavesdroppers to decrypt the message without private keys. - **How to intercept the message:** - Highlights the challenges for eavesdroppers in breaking the encryption code. #### 9. **Perspective and Composition:** - **Image 1:** - **Perspective:** - Straight-on, illustrative perspective meant to clearly show concepts. - **Composition:** - Symmetrical arrangement with two characters side by side, each annotated with the keys they know. #### 11. **Metadata Analysis:** - **Metadata:** - Not available in the analyzed context; no additional stylistic or technical metadata provided. #### 13. **Graph Numbers:** - **Textual Context Analysis:** - Specific numeric data is not presented as a graph but rather through textual mathematical expressions relevant to public-key cryptography. - Example: \( C ≡ P^E \ (\text{mod} \ n) \) #### **Additional Aspects:** - **Prozessbeschreibungen (Process Descriptions):** - **How to send a message:** Encrypting a message using the receiver's public key. - **How to decode a message:** Decrypting a message using the receiver's private key. - **How to interpret the message:** Understanding the computational challenges for eavesdroppers. - **How to intercept the message:** Discussing the limitations for an eavesdropper trying to break the encryption. - **Typen Bezeichnung (Type Designations):** - Descriptions of cryptographic roles (Sender and Receiver) and key types (Public, Private, and their components). ### Summary: The document page helps convey complex cryptographic concepts through a combination of textual descriptions and informative diagrams. It explains the roles of public and private keys, the process of sending and decrypting messages, and the challenges faced by eavesdroppers. The visual elements support the textual content, ensuring a clearer understanding of cryptographic principles. #################### File: Algorithms%20and%20Complexity%20-%20Herbert%20S.%20Wilf%20%28PDF%29.pdf Page: 103 Context: # 4.9 Factoring large integers There are methods that will produce large prime numbers very rapidly as long as one is not particular about which primes they are, as long as they are large enough. We will not discuss those methods here. The elegance of the RSA cryptosystem prompts a few more remarks that are intended to reinforce the distinction between exponential- and polynomial-time complexities. How hard is it to factor a large integer? At this writing, integers of up to perhaps a couple of hundred digits can be approached with some confidence that factorization will be accomplished within a few hours of the computing time of a very fast machine. If we think in terms of a message that is about the length of one typewritten page, then that message would contain about 800 digits, equivalent to about 2400 decimal digits. This is in contrast to the largest feasible length that can be handled by contemporary factoring algorithms of about 200 decimal digits. A one-page message is therefore well into the zone of computational intractability. How hard is it to find the multiplicative inverse, mod \( p - 1 \) and \( q - 1 \)? If \( p \) and \( q \) are known then it's easy to find the inverse, as we saw in corollary 4.3.1. Finding an inverse mod \( n \) is no harder than carrying out the extended Euclidean algorithm, i.e., it’s a linear time job. ## 4.9 Factoring large integers The problem of finding divisors of large integers is in a much more primitive condition than is primality testing. For example, we don't even know a probabilistic algorithm that will return a factor of a large composite integer, with probability > 1/2, in polynomial time. In this section, we will discuss a probabilistic factoring algorithm that finds factors in an average time that is only moderately exponential, and that’s about the state of the art at present. Let \( n \) be an integer whose factorization is desired. **Definition.** By a factor base \( B \) we will mean a set of distinct nonzero integers \( \{ b_1, b_2, \ldots, b_h \} \). **Definition.** Let \( B \) be a factor base. An integer \( c \) will be called a \( B \)-number if the integer \( c \) is defined by the conditions 1. \( (a) \quad c \equiv b^2 \ (mod \ n) \) 2. \( (b) \quad -\sqrt{2} < \zeta < \sqrt{2} \) can be written as a product of factors from the factor base \( B \). If we let \( e(a_i) \) denote the exponent of \( b_i \) in that product, then we have \[ \alpha^2 \equiv \prod_{i=0}^{h} b_i^{e(a_i)} \ (mod \ n). \] Hence, for each \( B \)-number we get an \( (h + 1) \)-vector of exponents \( e(a) \). Suppose we can find enough \( B \)-numbers so that the resulting collection of exponent vectors is a linearly dependent set, mod 2. For instance, a set of \( h + 2 \) \( B \)-numbers would certainly have that property. Then we could nontrivially represent the zero vector as a sum of a certain set \( A \) of exponent vectors, say \[ \sum_{c \in A} e(a) \equiv (0, 0, \ldots, 0) \ (mod \ 2). \] Now define the integers \[ r_i = (1/2) \sum_{c \in A} e(a_i) \quad (i = 0, 1, \ldots, h) \] \[ u = \prod_{A} b_i \ (mod \ n) \] \[ v = \prod_{A} b_i^{r_i}. \] It then would follow, after an easy calculation, that \( u^2 \equiv v^2 \ (mod \ n) \). Hence either \( v - u \) or \( v + u \) has a factor in common with \( n \). It may be, of course, that \( u \equiv v \ (mod \ n) \), in which case we would have. #################### File: Algorithms%20and%20Complexity%20-%20Herbert%20S.%20Wilf%20%28PDF%29.pdf Page: 105 Context: # 4.10 Proving primality Now comes the hard part. How might we convince an audience that a certain integer \( n \) is a prime number? The rules are that we are allowed to do any immense amount of calculation beforehand, and the results of that calculation can be written on a certificate \( C(n) \) that accompanies the integer \( n \). The audience, however, will need to see only a polynomial amount of further computation in order to convince themselves that \( n \) is prime. We will describe a primality-checking algorithm \( A \) with the following properties: 1. If \( n \) is the integer and \( A \) a certain certificate \( C(n) \). 2. If \( n \) is prime then the action of \( A \) on the inputs \( (n, C(n)) \) results in the output `it is prime`. 3. If \( n \) is not prime then for every possible certificate \( C(n) \) the action of \( A \) on the inputs \( (n, C(n)) \) results in the output `primality of \( n \) is not verified`. 4. Algorithm \( A \) runs in polynomial time. Now the question is, does such a procedure exist for primality verification? The answer is affirmative, and we will now describe one. The fact that primality can be quickly verified, if not quickly discovered, is of great importance for the developments of Chapter 5. In the language of section 5.1, what we are about to do is show that the problem “Is \( n \) prime?” belongs to the class NP. The next lemma is a kind of converse to Fermat’s little theorem (theorem 4.5.2). ## Lemma 4.10.1 Let \( p \) be a positive integer. Suppose there is an integer \( x \) such that \( x^{p-1} \equiv 1 \,(\text{mod } p) \) and such that for all divisors of \( p-1 \), \( d < p-1 \), we have \( x^{d} \not\equiv 1 \,(\text{mod } p) \). Then \( p \) is prime. **Proof:** First we claim that \( \gcd(d, x) = 1 \), for \( d = \text{gcd}(p, x) \). Then \( x = g^{r} \) and \( p = g^{s} \). Since \( x^{p-1} \equiv 1 \), it follows that \( x^{p-1} = 1 + t + x^{p-1} - t = (gs)^{p-1} - 1 \). The left side is a multiple of \( g \). The right side is not, unless \( g = 1 \). It follows that \( x \in U_{p} \), the group of units \( Z_{p} \). Thus \( x \) is an element of order \( p - 1 \) in a group of order \( \varphi(p) \). Hence \( \varphi(p) \leq p - 1 \). Hence \( \varphi(p) = p - 1 \) and \( p \) is prime. Lemma 4.10.1 is the basis for V. Pratt’s method of constructing certificates of primality. The construction of the certificate is actually recursive since step 3b allows for certificates of smaller primes. We suppose that the certificate of the prime \( 2 \) is the trivial case, and that it can be verified at no cost. Here is a complete list of the information that is on the certificate \( C(p) \) that accompanies an integer \( p \) whose primality is to be attested to: 1. \( P \): a list of the primes \( p_i \) and the exponents \( a_i \) for the canonical factorization \( p - 1 = \prod_{i=1}^{k} p_i^{a_i} \). 2. \( C_{p} \): the certificates \( C_{p_i} \) of each of the primes \( p_1, \ldots, p_k \). 3. \( x \): a positive integer \( x \). To verify that \( p \) is prime we could execute the following algorithm \( B \): **(B1)** Check that \( p - 1 = \prod_{i=1}^{k} p_i^{a_i} \). **(B2)** Check that each \( p_i \) is prime, using the certificates \( C_{p_i} \) \( (i = 1, r) \). **(B3)** For each divisor \( d \) of \( p - 1 \), \( d < p - 1 \), check that \( x^{d} \not\equiv 1 \,(\text{mod } p) \). **(B4)** Check that \( x^{p-1} \equiv 1 \,(\text{mod } p) \). This algorithm \( B \) is correct, but it might not operate in polynomial time. In step \( B3 \) we are looking at every divisor of \( p - 1 \) and there may be a lot of them. Fortunately, it isn’t necessary to check every divisor of \( p-1 \). The reader will have no trouble proving that there is a divisor of \( p - 1 \) (or \( < d \) such that \( x^{d} \equiv 1 \,(\text{mod } p) \) and only if there is such a divisor that has the special form \( d = (p - 1)/t \). The primality checking algorithm \( A \) now reads as follows: **(A1)** Check that \( p - 1 = \prod_{i=1}^{k} p_i^{a_i} \). **(A2)** Check that each \( p_i \) is prime, using the certificates \( C_{p_i} \) \( (i = 1, r) \). **(A3)** For each \( i = 1 \) to \( k \), check that \( x^{(p-1)/p_i} \not\equiv 1 \,(\text{mod } p) \). Image Analysis: ### Image Analysis #### 1. **Localization and Attribution** - **Image Number**: 1 - **Location on the Page**: Entire page has a single image consisting of text. #### 4. **Text Analysis** - **Detected Text and Content**: This image consists entirely of text discussing a mathematical proof related to prime number verification. The image includes definitions, lemmas, proofs, and algorithms related to the topic. - **Analyzed Content and Significance**: - **Header**: "4.10 Proving primality" indicates the section discussing methods to prove whether a number is prime. - **Main Text**: - **Algorithm Description**: Describes a polynomial-time algorithm \( A \) to verify the primality of an integer \( n \). - **Verification Conditions**: Includes conditions (1) through (4) that algorithm \( A \) must satisfy to verify primality. - **Significant Definitions and Lemmas**: - **Lemma 4.10.1**: States a lemma crucial for understanding the proof method. - **Proof Section**: Detailed proof of Lemma 4.10.1, with algebraic and number-theoretic reasoning. - **Process Description**: Outlines the process and steps to verify primality using the proposed algorithm, referred to as Algorithm \( B \) and modifications for Algorithm \( A \). - **Steps for Primality Checking**: Detailed step-by-step methodology for verifying prime numbers, including checks on divisors and certificates of primality. #### 6. **Product Analysis** - **Textual Product**: The page is composed solely of text discussing a mathematical proof; there are no physical products depicted. #### 10. **Contextual Significance** - **Document Context**: The document is evidently a part of a detailed mathematical text or textbook on number theory or algorithms. - **Contribution to Overall Theme**: The image contributes to the academic and educational theme by outlining theoretical and practical aspects of primality proving, key for students or enthusiasts in mathematics or computer science. #### 12. **Graph and Trend Analysis** - **Logical Flow**: Demonstrates the logical progression of mathematical theorem proving, starting from definitions to stepwise verification algorithms. #### 13. **Graph Numbers** - **No Graphs**: The page does not contain any graphical elements or numerical data points. #### Prozessbeschreibungen (Process Descriptions) - **Process Flow for Verifying Primality**: - **Steps**: - Check specific properties of \( p-1 \) - Verify primality of the prime divisors of \( p-1 \) - Use certificates to confirm divisors and primality - Ensure the calculation follows polynomial time to ensure efficiency ### Summary This page from a mathematical textbook outlines a comprehensive method for verifying the primality of numbers using an algorithmic approach. It includes detailed theoretical explanations, step-by-step proofs, and algorithmic descriptions necessary for academic understanding and practical application in mathematical computations or related fields. #################### File: Algorithms%20and%20Complexity%20-%20Herbert%20S.%20Wilf%20%28PDF%29.pdf Page: 107 Context: # 4.10 Proving primality ## Bibliography The material in this chapter has made extensive use of the excellent review article: - John D. Dixon, *Factorization and primality tests*, The American Mathematical Monthly, **91** (1984), 333-352. A basic reference for number theory, Fermat's theorem, etc. is: - G. H. Hardy and E. M. Wright, *An Introduction to the Theory of Numbers*, Oxford University Press, Oxford, 1954. Another is: - W. J. LeVeque, *Fundamentals of Number Theory*, Addison-Wesley, Reading, MA, 1977. The probabilistic algorithm for compositeness testing was found by: - M. O. Rabin, *Probabilistic algorithms*, in *Algorithms and Complexity, New Directions and Recent Results*, J. Traub ed., Academic Press, New York, 1976 and about the same time by: - R. Solovay and V. Strassen, *A fast Monte Carlo test for primality*, SIAM Journal of Computing, **6** (1977), pp. 84-85; erratum ibid., **7** (1978), 118. Some empirical properties of that algorithm are in: - C. Pomerance, J. L. Selfridge and S. Wagstaff Jr., *The pseudoprimes to 25·10⁹*, Mathematics of Computation, **35** (1980), 1003-1026. The fastest nonprobabilistic primality test appeared first in: - L. M. Adleman, *On distinguishing prime numbers from composite numbers*, IEEE Abstracts, May 1980, 387-406. A more complete account, together with the complexity analysis, is in: - L. M. Adleman, C. Pomerance and R. S. Rumely, *On distinguishing prime numbers from composite numbers*, Annals of Mathematics **117** (1983), 173-206. A streamlined version of the above algorithm was given by: - H. Cohen and H. W. Lenstra Jr., *Primality testing and Jacobi sums*, Report 82-18, Math. Inst. U. of Amsterdam, Amsterdam, 1982. The ideas of public key data encryption are due to: - W. Diffie and M. E. Hellman, *New directions in cryptography*, IEEE Transactions on Information Theory, IT-22, 6 (1976), 644-654. An account of the subject is contained in: - M. E. Hellman, *The mathematics of public key cryptography*, Scientific American, **241**, 2 (August 1979), 146-157. The use of factoring as the key to the code is due to: - R. L. Rivest, A. Shamir and L. M. Adleman, *A method for obtaining digital signatures and public key cryptosystems*, Communications of the ACM, **21**, 2 (February 1978), 120-126. The probabilistic factoring algorithm in the text is that of: - John D. Dixon, *Asymptotically fast factorization of integers*, Mathematics of Computation, **36** (1981), 255-260. 103 #################### File: Algorithms%20and%20Complexity%20-%20Herbert%20S.%20Wilf%20%28PDF%29.pdf Page: 108 Context: # Chapter 5: NP-completeness ## 5.1 Introduction In the previous chapter we met two computational problems for which fast algorithms have never been found, but neither have such algorithms been proved to be unmanageable. Those were the primality-testing problem, for which the best-known algorithm is delicately poised on the brink of polynomial time, and the integer-factoring problem, for which the known algorithms are in a more primitive condition. In this chapter we will meet a large family of such problems (hundreds of them now!). This family is not just a list of seemingly difficult computational problems. It is in fact bound together by strong ties. The collection of problems, called the NP-complete problems, includes many well-known and important questions in discrete mathematics, such as the following: - **The travelling salesman problem (TSP)**: Given n points in the plane (‘cities’), and a distance D, is there a tour that visits all of the cities, returns to its starting point, and has total length ≤ D? - **Graph coloring**: Given a graph G and an integer K. Can the vertices of G be properly colored in K or fewer colors? - **Independent set**: Given a graph G and an integer K. Does V(G) contain an independent set of K vertices? - **Bin packing**: Given a finite set S of positive integers and an integer N (the number of bins). Does there exist a partition of S into N or fewer subsets such that the sum of the integers in each subset is ≤ K? In other words, can we ‘pack’ the integers of S into at most N ‘bins’, where the ‘capacity’ of each bin is K? These are very difficult computational problems. Take the graph coloring problem, for instance. We could try every possible way of coloring the vertices of G in K colors to see if any of them work. There are \(K^n\) such possibilities, if G has n vertices. Hence if G has 50 vertices and we have 20 colors at our disposal, the problem would lie far beyond the capabilities of the fastest computers that are now available. Hard problems can have easy instances. If the graph G happens to have no edges at all, or very few of them, then it will be very easy to find out if a coloring is possible, or if an independent set of K vertices is present. The real question is this (let's use ‘Independent Set’ as an illustration). Is it possible to design an algorithm that will come packaged with a performance guarantee of the following kind: > **The seller warrants that if a graph G, of n vertices, and a positive integer K are input to this program, then it will correctly determine if there is an independent set of K or more vertices in V(G), and it will do so in an amount of time that is at most 1000n^k.** Hence there is no contradiction between the facts that the problem is hard and that there are easy cases. The hardness of the problem stems from the seeming impossibility of producing such an algorithm accompanied by such a manufacturer’s warranty card. Of course the “1000” didn’t have to be exactly that. But some quite specific polynomial in the length of the input bit string must appear in the performance guarantee. Hence “357n” might have appeared in the guarantee, and so might “23n”, but \(n^k\) would not have allowed. Let’s look carefully at why \(n^k\) would not be an acceptable worst-case polynomial time performance bound. In the ‘Independent Set’ problem the input must describe the graph G and the integer K. How many bits are needed to do that? The graph can be specified, for example, by its vertex adjacency matrix A. This is an \(n \times n\) matrix in which the entry in row i and column j is 1 if \((i,j) \in E(G)\) and 0 else. Evidently \(n^2\) bits of input will describe the matrix A. The integers K and n can be entered with just \(O(\log n)\) bits, so the entire input bit string for the ‘Independent Set’ problem is at most \(n^2\) bits long, but the number of bits in the input string. Suppose that on the warranty card the program was guaranteed to run in a time that is \(O(n^k)\). Is this a guarantee of polynomial time performance? That question takes us to the next question: Is there a polynomial P such that for every instance of ‘Independent Set’ the running time T will be at most P(|B|)? Well, is it bounded? Image Analysis: ### Comprehensive Image Analysis #### Localization and Attribution - **Image Position:** Single image/page. - **Image Identifier:** This image has been labeled for reference as Image 1. #### Text Analysis - **Detected Text:** - Chapter Information: "Chapter 5: NP-completeness" - Section Title: "5.1 Introduction" - Mathematical and problem descriptions: - *Travelling salesman problem (TSP)*: Given 'n' points and a distance D, determining a tour that visits all points and returns with a total length ≤ D. - *Graph coloring*: Coloring vertices of a graph G with K colors. - *Independent set*: Identifying an independent set of K vertices in graph G. - *Bin packing*: Partitioning a set S into N sets within a capacity K, ensuring optimal packing. - Example of a computational guarantee: - "The seller warrants that if a graph G, r vertices, and a positive integer K are input to this program, then it will correctly determine if there is an independent set of K or more vertices in V(G), and it will do so in an amount of time that is at most 1000n^k milliseconds." - Additional explanations and technical details relevant to the difficulty of these computational problems and the warranties provided. - **Content Significance:** - This text outlines different NP-complete problems, particularly those challenging due to their computational complexity. - Highlights crucial problems in discrete mathematics, emphasizing the significance of understanding NP-completeness. - Discusses practical implications and theoretical underpinnings of computational guarantees and problem-solving capabilities. #### Object Detection and Classification - **Category:** Document text analysis. - **Key Features:** The document features mathematical problems, definitions, and explanations pertaining to NP-completeness. - **Main Actors:** Textual descriptions, graphs, equations, and warranties regarding algorithms. #### Scene and Activity Analysis - **Scene Description:** - The single scene is an academic or technical document page focused on introducing NP-completeness. - The activity is mainly a textual explanation of theoretical problems in computer science. #### Perspective and Composition - **Perspective:** - The image is a direct scan or screenshot of a document page taken from a flat, front-on perspective typical of document presentations. - **Composition:** - Text densely arranged in paragraphs, - Section headers and subsections properly marked and highlighted for emphasis. #### Contextual Significance - **Overall Document/Website Contextualization:** - The page is part of a larger document or textbook discussing computational theory, specifically addressing NP-completeness in computational problems. - Contributes significantly to the foundational understanding for students or readers studying computational complexity, illustrating both theoretical and practical considerations. ### Metadata and Additional Analysis - **Metadata:** - None available. #### Conclusion - **Significance:** - The document serves as an introductory section to NP-completeness, fundamental for students or professionals in computer science and related fields. - The text sets the stage for further discussions on computational problems, emphasizing both the complexities and potential capabilities of various algorithms in managing these issues. Note: There were no diagrams, charts, or tables within the provided image context, so these aspects were not relevant to this analysis. #################### File: Algorithms%20and%20Complexity%20-%20Herbert%20S.%20Wilf%20%28PDF%29.pdf Page: 112 Context: # Chapter 5: NP-completeness The implications of NP-completeness are numerous. Suppose we could prove that a certain decision problem \( Q \) is NP-complete. Then we could concentrate our efforts to find polynomial-time algorithms on just that one problem \( Q \). Indeed if we were to succeed in finding a polynomial-time algorithm to the instances of \( Q \), we would automatically have found a fast algorithm for doing every problem in NP. How does that work? Take an instance \( I' \) of some problem \( Q' \) in NP. Since \( Q' \) is quickly reducible to \( Q \), we could transform the instance \( I' \) into an instance \( I \) of \( Q \). Then use the super algorithm that we found for problems in \( Q \) to decide \( I \). Altogether only polynomial amount of time will have been used from start to finish. Let’s be more specific. Suppose that tomorrow morning we prove that the graph coloring problem is NP-complete, and that on the next morning you find a fast algorithm for solving it. Then consider some instance of the bin packing problem. Since graph coloring is NP-complete, the instance of bin packing can be quickly converted into an instance of graph coloring for which the ‘Yes/No’ answer is the same. Now use the fast graph coloring algorithm that you found (congratulations, by the way!) on the converted problem. The answer you get is the correct answer for the original bin packing problem. So, a fast algorithm for some NP-complete problem implies a fast algorithm for every problem in NP. Conversely, suppose we can prove that it is impossible to find a fast algorithm for some particular problem \( Q \) in NP. Then we can’t find a fast algorithm for any NP-complete problem \( Q' \) either. For if we could then we would be able to solve instances of \( Q \) quickly by reducing them to instances of \( Q' \) and solving them. If we could prove that there is no fast way to test the primality of a given integer then we would have proved that it is fast too to decide if graphs are k-colorable, because, as we will see, the primality testing problem is NP-complete and primality testing is in NP. Think about it for a few moments, and the extraordinary beauty and structural unity of these computational problems will begin to reveal itself. To summarize: quick fixes for NP-complete problems imply quick fixes for all of NP; provably slow for one problem in NP implies provably slow for all NP-complete problems. There’s just one small detail to add here. We’ve been discussing the economic advantages of keeping flocks of unicorns instead of sheep. If there aren’t any unicorns then the discussion is a little silly. NP-complete problems have all sorts of marvelous properties. It’s lovely that every problem in NP can be quickly reduced to just one NP-complete problem. But are there any NP-complete problems? After all, shouldn’t there be a single computational problem with the property that every one of the diverse creatures that inhabit NP should be quickly reducible to it? Well, there are NP-complete problems, hordes of them, and proving that will occupy our attention for the next two sections. Here’s the plan. In section 5.2 we are going to talk about a simple computer, called a Turing machine. It is an idealized computer, and its purpose is to standardize ideas of compatibility and time of computation by referring all problems to the one standard machine. A Turing machine is an extremely simple finite-state computer, and when it performs a computation, a unit of computational labor will be very clearly and unambiguously describable. It turns out that the important aspects of polynomial time computability do not depend on the particular counter that is chosen as the model. The beauty of the Turing machine is that it is one as a strong enough concept that it can in principle perform any calculation that any other finite state machine can do, while at the same time it is logically completely amenable to being used for proving theorems about complexity. The microcomputer on your desktop might have been chosen as the standard against which polynomial time compatibility is measured. If that had been done then the class of \( P \) quickly solvable problems would scarcely have changed at all (the polynomial would be different but there would still be polynomials), but the proofs that we humans would have to give in order to establish the relevant theorems would have gotten much more complicated because of the variety of different kinds of states modern computers have. Next, in section 5.3 we will prove that there is an NP-complete problem: it is called the satisfiability problem. Its status as an NP-complete problem was established by S. Cook in 1971, and from that work all later progress in the field has flowed. The proof uses the theory of Turing machines. The first NP-complete problem was the hardest one to find. We will find, in section 5.4, a few more NP-complete problems, so the reader will get some idea of the methods that are used in identifying them. Since nobody knows a fast way to solve these problems, various methods have been developed that give approximate solutions quickly, or that give exact solutions in fast average time, and so forth. The beautiful #################### File: Algorithms%20and%20Complexity%20-%20Herbert%20S.%20Wilf%20%28PDF%29.pdf Page: 113 Context: # 5.2 Turing Machines ## Exercises for section 5.1 1. Prove that the following decision problem belongs to P: Given integers \( K \) and \( a_1, \ldots, a_n \). Is the median of the \( a_i \) smaller than \( K \)? 2. Prove that the following decision problem is in NP: given an \( n \times n \) matrix \( A \) of integer entries. Is \( \det A = 0 \)? 3. For which of the following problems can you prove membership in P? (a) Given a graph \( G \). Does \( G \) contain a circuit of length 4? (b) Given a graph \( G \). Is \( G \) bipartite? (c) Given integers. Is there a subset of them whose sum is an even number? (d) Given \( n \) integers. Is there a subset of them whose sum is divisible by 3? (e) Given a graph \( G \). Does \( G \) contain an Euler circuit? 4. For which of the following problems can you prove membership in NP? (a) Given a set of integers and another integer \( K \). Is there a subset of the given integers whose sum is \( K \)? (b) Given a graph \( G \) and an integer \( K \). Does \( G \) contain a path of length \( 2K \)? (c) Given a set of \( K \) integers. Is it true that not all of them are prime? (d) Given a set of \( K \) integers. Is it true that all of them are prime? ## 5.2 Turing Machines A Turing machine consists of: (a) A doubly infinite tape, that is marked off into squares that are numbered as shown in Fig. 5.2.1 below. Each square can contain a single character from the character set that the machine recognizes. For simplicity, we can assume that the character set consists of just three symbols: '0', '1', and ' ' (blank). (b) A tape head that is capable of either reading a single character from a square on the tape or writing a single character on a square, or moving its position relative to the tape by an increment of one square in either direction. (c) A finite list of states such that at every instant the machine is exactly one of those states. The possible states of the machine are, first of all, the regular states \( q_1, \ldots, q_n \), and second, three special states: - \( q_0 \): the initial state - \( q_y \): the final state in a problem to which the answer is 'Yes' - \( q_n \): the final state in a problem to which the answer is 'No' (d) A program (or program module, if we think of it as a pluggable component) that directs the machine through the steps of a particular task. ``` ... ... ... ... ... ``` ``` ... --3 --2 --> 0 1 2 3 ... ... -- . . . -- . -- . . . -- ``` Image Analysis: ## Analysis of Attached Visual Content ### 1. Localization and Attribution - **Image on the Page**: The visual content consists of a single image located midway through the text on the page. - **Image Number**: Image 1. ### 2. Object Detection and Classification - **Image 1**: - **Objects Detected**: - Text blocks. - Diagram of a Turing Machine tape. - **Categories**: - Written text (instructions and exercises related to computational theory). - Diagram (schematic representation of a Turing Machine tape). ### 3. Scene and Activity Analysis - **Image 1**: - **Scene Description**: The scene is an excerpt from an academic textbook focusing on computational theory, specifically on topics related to NP-completeness and Turing Machines. - **Activities**: - The text describes various decision problems and properties, exercises for solving these problems, and a detailed explanation of Turing Machines. ### 4. Text Analysis - **Image 1**: - **Text Detected**: - Main Heading: "5.2 Turing Machines" - Sub-Headings: "Exercises for section 5.1", "5.2.1 A Turing machine tape" - Exercises and Theoretical Explanations about decision problems and Turing Machine properties. - **Content Analysis**: - The text explains key concepts in computational theory, providing exercises to test understanding and elaborations on the workings of a Turing Machine and its tape configuration. - **Exercises for section 5.1**: 1. Problems related to decision problem membership in P and NP. 2. Questions regarding graph properties and integer subsets in relation to computational complexity. - **5.2 Turing Machines**: - Detailed explanation of what a Turing Machine is, including its components like the infinite tape, states, and program modules. - **5.2.1 A Turing Machine tape**: - Diagram illustrating how the tape operates and moves, including states and symbols. ### 6. Product Analysis - **Image 1**: - **Products Depicted**: - Diagram of a Turing Machine tape. - **Features**: - The tape shows squares numbered in sequence, demonstrating how a Turing machine processes input and moves between states. - Squares contain possible tape symbols: '0', '1', and ' ' (blank). - Arrows indicate possible movements of the tape head. ### 7. Anomaly Detection - **Image 1**: - **Anomalies**: No significant anomalies detected. The content appears typical for an educational text on computational theory. ### 8. Color Analysis - **Image 1**: - **Color Composition**: - Dominantly black text on a white background. - The diagram uses simple black outlines and symbols without any colors, maintaining consistency with typical textbook illustrations and not distracting from the informational content. ### 9. Perspective and Composition - **Image 1**: - **Perspective**: Top-down view, typical for a scanned or photocopied page from a textbook. - **Composition**: - The page is divided into sections with headings, explanations, and numbered exercises. - The diagram is centrally placed and clearly labeled, giving a clear visual complement to the adjacent text. ### 10. Contextual Significance - **Image 1**: - **Context**: This page is part of a textbook on computational theory, contributing to the reader's understanding of NP-completeness and Turing Machines. - **Contribution**: - Provides foundational exercises and theoretical explanations critical for mastering concepts in computer science and computational complexity. ### 13. Table Analysis - **Image 1**: - **No tables detected**: This image does not contain tabular data. ### Additional Aspects #### Ablaufprozesse (Process Flows) - **Image 1**: - **Process Flow Description**: The operations of a Turing Machine, including how the machine reads the tape, decides its next state, writes on the tape, and moves the tape head. #### Prozessbeschreibungen (Process Descriptions) - **Image 1**: - **Process Description**: - A detailed description of the Turing Machine’s functioning, defining initial and final states, regular states, and the program module’s role in guiding the machine through task-specific steps. #### Typen Bezeichnung (Type Designations) - **Image 1**: - **Type Designations**: Turing Machine components such as infinite tape, tape head, states (qi), and character set (symbols: '0', '1', blank). #### Trend and Interpretation - **Image 1**: - **No trends**: The content is theoretical, focusing on explaining core concepts rather than presenting data trends. Overall, the visual content provides insightful information on computational theory, effectively using text and diagrams to enhance understanding of complex topics like NP-completeness and Turing Machine operations. #################### File: Algorithms%20and%20Complexity%20-%20Herbert%20S.%20Wilf%20%28PDF%29.pdf Page: 114 Context: # Chapter 5: NP-completeness One step of the program, therefore, goes from ``` (state, symbol) to (newstate, newsymbol, increment). (5.21) ``` If and when the state reaches q₀ or q₁, the computation is over and the machine halts. The machine should be thought of as part hardware and part software. The programmer's job is, as usual, to write the software. To write a program for a Turing machine, what we have to do is to tell it how to make each and every one of the transitions (5.21). A Turing machine program looks like a table in which, for every possible pair (state, symbol) that the machine might find itself in, the programmer has specified what the newstate, the newsymbol and the increment shall be. To begin a computation with a Turing machine, we take the input string α of length B, say, that describes the problem that we want to solve, and we write it on squares 1, 2, …, B of the tape. The tape head is then positioned over square 1, the machine is put into state q₀, the program module that the programmer prepared is plugged into its slot, and the computation begins. The machine reads the symbol in square 1. It now is in state q₀ and has read symbol s, so it consults the program module to find out what to do. The program instructs it to write at square 1 a newsymbol, to move the head either to square 0 or to square 2, and to enter a certain newstate, say q₁. The whole process is then repeated, possibly forever, but hopefully after finitely many steps the machine will enter the state q₀ or state q₁, at which moment the computation will halt with the decision having been made. If we want to watch a Turing machine in operation, we don't have to build it. We can simulate one. Here is a pseudo-Pascal simulation of a Turing machine that can easily be turned into a functioning program. It is in two principal parts. The procedure `turnback` has for input a string x of length B, and for output it sets the Boolean variable accept to True or False, depending on whether the outcome of the computation is that the machine halted in state q₀ or q₁, respectively. This procedure is the "hardware" part of the Turing machine. It doesn't vary from one job to the next. ```pascal Procedure turnback is the program module of the machine, and it will be different for each task. Its inputs are the present state of the machine and the symbol that was just read from the tape. Its outputs are the newstate into which the machine goes next, the newsymbol that the tape head now writes on the current square, and the increment (±1) by which the tape head will now move. procedure turnback(B: integer; x: array[1..B]: accept: Boolean); {simulates Turing machine action on input string x of length B} {write input string on tape in first B squares} for square := 1 to B do tape[square] := x[square]; {record boundaries of written-on part of tape} leftmost := 1; rightmost := B; {initialize tape head and state} state := 0; square := 1; while state ≠ 'Y' and state ≠ 'N' do read symbol at current tape square; if square leftmost or square rightmost then symbol := ' ' else symbol := tape[square]; {ask program module for state transition} gometto(state, symbol, newstate, newsymbol, increment); state := newstate; {update boundaries and write new symbol}; if square = rightmost then leftmost := square; tape[square] := newsymbol; {move tape head} square := square + increment; end; while accept := (state = 'Y'); end. (turnback) ``` #################### File: Algorithms%20and%20Complexity%20-%20Herbert%20S.%20Wilf%20%28PDF%29.pdf Page: 115 Context: Now let's try to write a particular program module **gonzetto**. Consider the following problem: given an input string \( x \), consisting of 0's and 1's, of length \( B \). Find out if it is true that the string contains an odd number of 1's. We will write a program that will scan the input string from left to right, and at each moment the machine will be in state 0 if it has so far scanned an even number of 1's, in state 1 otherwise. In Fig. 5.2.2 we show a program that will get the job done. | state | symbol | newstate | newsymbol | increment | |-------|--------|----------|-----------|-----------| | 0 | 0 | 0 | 0 | +1 | | 0 | 1 | 1 | 1 | +1 | | 0 | blank | \( q_v \) | blank | -1 | | 1 | 0 | 1 | 0 | +1 | | 1 | 1 | 0 | 1 | +1 | | 1 | blank | \( q_v \) | blank | -1 | **Fig. 5.2.2**: A Turing machine program for bit parity **Exercise**: Program the above as procedure **gonzetto**, run it for some input string, and print out the state of the machine, the contents of the tape, and the position of the tape head after each step of the computation. In the next section we are going to use the Turing machine concept to prove Cook's theorem, which is the assertion that a certain problem is NP-complete. Right now let's review some of the ideas that have already been introduced from the point of view of Turing machines. We might immediately notice that some terms were just a little bit fuzzy before are now much more sharply in focus. Take the notion of polynomial time, for example. To make that idea precise one needs a careful definition of what 'the length of the input bit string' means, and what one means by the number of 'steps' in a computation. But on a Turing machine both of these ideas come through with crystal clarity. The input bit string \( x \) is what we write on the tape to get things started, and its length is the number of tape squares it occupies. A 'step' in a Turing machine calculation is obviously a single call to the program module. A Turing machine calculation was done in time \( P(B) \) if the input string occupied \( B \) tape squares and the calculation took \( P(B) \) steps. Another word that we have been using without even precisely defining is 'algorithm.' We all understand informally what an algorithm is. But now we understand formally how. An algorithm for a problem is a program module for a Turing machine that will cause the machine to halt after finitely many steps in state 'Y' for every instance whose answer is 'Yes', and after finitely many steps in state 'N' for every instance whose answer is 'No.' Now let's see how the idea of a Turing machine can clarify the description of the class NP. This is the class of problems for which the decisions can be made quickly if the input strings are accompanied by suitable certificates. By a certificate we mean a finite string of Turing machine tape, consisting of 0 or more squares, each of which contains a symbol from the character set of the machine. A certificate can be loaded into a Turing machine as follows. If the certificate contains \( m > 0 \) tape squares, then replace the segment from square number \( -m \) to square number \( -1 \) of the tape. We then write a verifying program for the program module in which the program verifies that the string \( x \) is indeed a word in the language of the machine, and in the course of the verification the program is quite free to examine the certificate as well as the problem instance. A Turing machine that is being used as a verifying computer is called a **nondeterministic machine**. The hardware is the same, but the manner of input and the question that is being asked are different from the #################### File: Algorithms%20and%20Complexity%20-%20Herbert%20S.%20Wilf%20%28PDF%29.pdf Page: 116 Context: # Chapter 5: NP-completeness The class NP (Nondeterministic Polynomial) consists of those decision problems for which there exists a fast (polynomial time) algorithm that will verify, given a problem instance string \( s \) and a suitable certificate \( C \), that \( s \) belongs to the language recognized by the machine, and for which, if \( s \) does not belong to the language, no certificate would cause an accepting computation to ensue. ## 5.3 Cook's Theorem The NP-complete problems are the hardest problems in NP, in the sense that if \( Q' \) is any decision problem in NP and \( Q \) is NP-complete problem, then every instance of \( Q' \) is polynomially reducible to an instance of \( Q \). As we have already remarked, the surprising thing is that there is an NP-complete problem at all, since it is not immediately clear why any single problem should hold the key to the polynomial time solvability of every problem in the class NP. But there is one. As soon as we see why there is one, then we'll be able to see more easily why there are hundreds of them, including many computational questions about discrete structures such as graphs, networks and games and about optimization problems, about algebraic structures, formal logic, and so forth. ### Here is the satisfiability problem, the first problem that was proved to be NP-complete, by Stephen Cook in 1971. We begin with a list of (Boolean) variables \( x_1, \ldots, x_n \). A literal is either one of the variables \( x_i \) or the negation of one of the variables, as \( \neg x_i \). There are 2n possible literals. A clause is a set of literals. The rules of the game are these. We assign the value ‘True’ (T) or ‘False’ (F), to each one of the variables. Having done that, each one of the literals inherits a truth value; namely, a literal \( x_i \) has the same truth or falsity as the corresponding variable \( x_i \), and a literal \( \neg x_i \) has the opposite truth value from that of the variable \( x_i \). Finally each of the clauses also inherits a truth value from this process, and it is determined as follows. A clause has the value ‘True’ if and only if at least one of the literals in that clause has the value ‘T’; and otherwise it has the value ‘F’. Hence starting with an assignment of truth values to the variables, some true and some false, we end up with a determination of the truth values of each of the clauses, some true and some false. #### Definition. A set of clauses is satisfiable if there exists an assignment of truth values to the variables that makes all the clauses true. Think of the word ‘or’ as being between each of the literals in a clause, and the word ‘and’ as being between the clauses. ### The satisfiability problem (SAT). Given a set of clauses. Does there exist a set of truth values (T or F), one for each variable, such that every clause contains at least one literal whose value is T (i.e., such that every clause is satisfied)? #### Example: Consider the set \( x_1, x_2, x_3 \) of variables. From these we might manufacture the following list of four clauses: - \( \{x_1, x_2\} \) - \( \{x_1, \neg x_3\} \) - \( \{\neg x_2, x_3\} \) - \( \{x_1, x_3\} \) If we choose the truth values (T, T, F) for the variables, respectively, then the four clauses would achieve the truth values (T, T, F), and so this would not be a satisfying truth assignment for the set of clauses. There are only eight possible ways to assign truth values to three variables, and after a little more experimentation we might find out that these clauses would in fact be satisfied if we were to make the assignments (T, T, T) (how can we recognize a set of clauses that is satisfied by assigning to every variable the value ‘T’?). The example already leaves one with the feeling that SAT might be a tough computational problem, because there are \( 2^n \) possible sets of truth values that we might have to explore if we were to do an exhaustive search. It is quite clear, however, that this problem belongs to NP. Indeed, it is a decision problem. Furthermore we can easily assign a certificate to every set of clauses for which the answer to SAT is ‘Yes, the clauses’. Image Analysis: ### 1. **Localization and Attribution:** - **Image 1**: There is only one page with text, appearing as a single image. ### 4. **Text Analysis:** - **Detected Text**: The page contains a discussion on NP-completeness and Cook’s Theorem. - **Chapter Title**: "Chapter 5: NP-completeness." - **Section Title**: "5.3 Cook’s Theorem." - **Main Body**: The text elaborates on the concept of NP-complete problems, Cook's Theorem, and the satisfiability problem (SAT). - It starts by defining NP-completeness and the importance of NP and Q problems. - It then describes Cook’s Theorem and introduces the satisfiability problem (SAT), explaining the rules and providing an example. - **Significance**: - **Context of NP-Completeness**: The text provides critical insight into one of the most fundamental topics in computational theory, highlighting the difficulty of solving NP-complete problems. - **Cook’s Theorem**: Establishes the significance of Cook's Theorem as the first problem proven to be NP-complete. - **Satisfiability Problem**: It introduces SAT, a central problem in computer science, outlining its computational complexity and implications for other problems in NP. ### 9. **Perspective and Composition:** - **Perspective**: The image is taken directly above the document, showing the page in a portrait orientation. The perspective is flat and head-on. - **Composition**: The text is arranged in a single column typical of a textbook. The chapter heading and section subheading are prominently displayed, with main content organized in paragraphs and lists. ### 12. **Graph and Trend Analysis:** - **Analysis**: There are no graphs in the image provided. ### 13. **Graph Numbers:** - **Data Points**: No graphs or numerical data points are present. ### Additional Aspects (specific to the content analyzed): - **Prozessbeschreibungen (Process Descriptions)**: - **SAT Problem Process**: The text describes the process of determining the satisfiability of a set of logical clauses. Each clause must be analyzed to check if an assignment of truth values makes all the clauses true. - **Typen Bezeichnung (Type Designations)**: - **Types of Variables**: In the context of SAT, variables and their assignments (True/False) are referenced. - **Types of Clauses**: Descriptions include clauses containing literals that must evaluate to true as per the rules defined. - **Tables**: No tables are included. ### Conclusion: The examined visual content is an excerpt from a textbook discussing NP-completeness, specifically focusing on Cook's Theorem and the satisfiability problem. The text provides foundational insights into why NP-complete problems are significant in computational theory and offers an introductory explanation of the SAT problem. The document is well-structured with clear headings and a logical flow of information. #################### File: Algorithms%20and%20Complexity%20-%20Herbert%20S.%20Wilf%20%28PDF%29.pdf Page: 118 Context: # Chapter 5: NP-completeness ## Proof of Cook's theorem We want to prove that SAT is NP-complete, i.e., that every problem in NP is polynomially reducible to an instance of SAT. Hence let \( Q \) be some problem in NP and let \( I \) be an instance of problem \( Q \). Since \( Q \) is in NP there exists a Turing machine that recognizes encoded instances of problem \( Q \) accompanied by a suitable certificate, in polynomial time. Let \( TMQ \) be such a Turing machine, and let \( P(n) \) be a polynomial in its argument with the property that \( TMQ \) recognizes every pair \( (x, C(y)) \), where \( x \) is a word in the language \( Q \) and \( C(y) \) is its certificate, in time \( S(P(n)) \), where \( n \) is the length of \( x \). We intend to construct, corresponding to each word \( i \) in the language \( Q \), an instance \( f(i) \) of SAT for which the answer is "Yes, the clauses are all simultaneously satisfiable." Conversely, if the word \( i \) is not in the language \( Q \), the clauses will not be satisfiable. The idea can be summarized like this: the instance of SAT that will be constructed will be a collection of clauses that together express the fact that there exists a certificate that causes Turing machine \( TMQ \) to an accepting calculation. Therefore, in order to test whether or not the word \( i \) belongs to the language, it suffices to check that the collection of clauses is satisfiable. To construct an instance of SAT means that we are going to define a number of variables, of literals, and of clauses, in such a way that the clauses are satisfiable if and only if \( i \) is in the language \( Q \), i.e., the machine \( TMQ \) accepts \( x \) and its certificate. What we must do, then, is to express the accepting computation of the Turing machine as the simultaneous satisfaction of a number of logical propositions. It is precisely here that the relative simplicity of a Turing machine allows us to enumerate all of the possible paths to an accepting computation in a way that would be quite unthinkable with a 'real' computer. Now we will describe the Boolean variables that will be used in the clauses under construction. - Variable \( Q_i \): is true if step \( i \) (after step \( i \), symbol \( a \) is in tape square \( j \)). - Variable \( T_{j,k} \): (after step \( i \), the tape head is positioned over square \( j \)). Let’s count the variables that we’ve just introduced. Since the Turing machine \( TMQ \) does its calculation in time \( P(n) \), it follows that the tape head will never venture more than \( 2 + P(n) \) squares away from its starting position. Therefore the subscript \( j \), which runs through the tape squares that are scanned during the computation, can assume only \( O(P(n)) \) different values. Index \( k \) runs over the letters in the alphabet that the machine can read, so it takes at most \( O(P(n)) \) values. Finally, \( i \) indexes the states of the Turing machine, and there is only some fixed finite number, \( K \), say, of states that \( TMQ \) might be in. Hence there are altogether \( O(P(n)^2) \) variables, a polynomial number of variables. Is it true that every random assignment of true or false values to each of these variables corresponds to an accepting computation on \( (x, C(y)) \)? Certainly not. For example, if we weren’t careful we might assign true values to \( T_{j,4} \) and \( T_{j,3} \), thereby giving the wrong bearings on the tape transport mechanism! (Why?) Our variables taken, then, will be to describe precisely the conditions under which a set of clauses assigned to the variables listed above actually defines a possible accepting calculation for \( (x, C(y)) \). Then we will be sure that whatever set of satisfying values of the variables might be found by solving the SAT problem, they will determine a real accepting calculation of the machine \( TMQ \). This will be done by requiring that a number of clauses be all true (“satisfied”) at once, where each clause will express one necessary condition. In the following, the bold face type will describe, in words, the condition that we want to express, and it will be followed by the formal set of clauses that actually expresses the condition on input to SAT. At each step, the machine is in at least one state. Here at least one of the \( K \) available state variables must be true. This leads to the first set of clauses: #################### File: Algorithms%20and%20Complexity%20-%20Herbert%20S.%20Wilf%20%28PDF%29.pdf Page: 119 Context: # At step P(n) the machine is in state q_y. one for each step i of the computation: ``` {Q_{1}, Q_{2}, \ldots, Q_{k}} ``` Since I assume \( O(P(n)) \) values, these are \( O(P(n)) \) clauses. ## At each step, the machine is not in more than one state Therefore, for each step \( i \) and each pair \( j, j' \) of distinct states, the clause ``` {Q_{i}, \neg Q_{j}} ``` must be true. These are \( O(P(n)) \) additional clauses to add to the list, but still more are needed. ## At each step, each tape square contains exactly one symbol from the alphabet of the machine. This leads to two lists of clauses which require, first, that there is at least one symbol in each square at each step, and second, that there are not two symbols in each square at each step. The clauses that do this are ``` \{S_{1}, S_{2}, \ldots, S_{A}\} ``` where \( A \) is the number of letters in the machine's alphabet, and ``` \{S_{j}, S_{j'}\} ``` for each step \( i \), square \( j \), and pair \( k', k' \) of distinct symbols in the alphabet of the machine. The reader will by now have gotten the idea of how to construct the clauses, so for the next three categories we will simply list the functions that must be performed by the corresponding lists of clauses, and leave the construction of the clauses as an exercise. ## At each step, the tape head is positioned over a single square. Initially the machine is in state 0, the head is over square 1, the input string \( z \) is in squares 1 to \( n \), and \( C(z) \) (the input certificate of \( z \)) is in squares 0, -1, \ldots, -P(n). ## At step P(n) the machine is in state q_y. The last set of restrictions is a little trickier: ## At each step the machine moves to its next configuration (state, symbol, head position) in accordance with the application of its program module to its previous (state, symbol). To find the clauses that will do this job, consider first the following condition: the symbol in square \( j \) of the tape cannot change during step \( i \) of the computation if the tape head isn't positioned there at that moment. This translates into the collection ``` \{T_{j}, S_{j}, S_{i,j,k}\} ``` of clauses, one for each triple \( (i, j, k) = (state, square, symbol) \). These clauses express the condition in the following way: either (at time \( t \)) the tape head is positioned over square \( j \) (i.e., true) or else the head is not positioned there, in which case either symbol \( k \) is not in the \( j \) square before the step or symbol \( k \) is (still) in the \( j \) square after the step is executed. It remains to express the fact that the transitions from one configuration of the machine to the next are the direct results of the operation of the program module. The three sets of clauses that do this are ``` \{F_{i}, Q_{i}, S_{j}, S_{i,j,t+1}\} ``` ``` \{T_{j}, Q_{j}, S_{i,j}, Q_{i+1}\} ``` ``` \{T_{j}, Q_{i}, S_{i,j}, S_{j,i+1}\} ``` #################### File: Algorithms%20and%20Complexity%20-%20Herbert%20S.%20Wilf%20%28PDF%29.pdf Page: 122 Context: # Chapter 5: NP-completeness In Fig. 5.4.1, we show the graph \( G \) of 11 vertices that corresponds to the following instance of 3SAT: - \( C_1 = \{ x_1, \neg x_1 \} \) - \( C_2 = \{ x_2, \neg x_2, \neg x_3 \} \) ## Fig. 5.4.1: The graph for a 3SAT problem Now we claim that this graph is \( n + 1 \) colorable if and only if the clauses are satisfiable. Clearly, \( G \) cannot be colored in fewer than \( n \) colors, because the \( n \) vertices \( x_1, \ldots, x_n \) are all connected to each other and therefore they alone already require different colors for a proper colocation. Suppose that \( x_i \) is assigned color \( i \) for \( i = 1, \ldots, n \). Do we need new colors in order to color the \( x_j \) vertices? Since vertex \( x_j \) is connected to every vertex and every \( y \) vertex except \( x_i \), if color \( i \) is going to be used on the \( x_j \)'s, it will have to be assigned to one of \( x_j \) or \( \neg x_j \), but not both, since they are connected to each other. Hence a new color, color \( n + 1 \), will have to be introduced in order to color the \( x_j \)'s and \( \neg x_j \). Further, if we are going to color the vertices of \( G \) in only \( n + 1 \) colors, the only way to do it will be to assign color \( n + 1 \) to exactly one member of each pair \( (x_i, \neg x_i) \), and color it to the other one, for each \( i = 1, \ldots, n \). That will be called the False vertex; the other one is the True vertex of the pair \( (x_i, \neg x_i) \) for each \( i = 1, \ldots, n \). It remains to color the vertices \( C_1, C_2, \ldots, C_k \). The graph will be \( n + 1 \) colorable if and only if we can do this without using any new colors. Since each clause contains at most three literals, and \( n > 4 \), every variable \( C_j \) must be adjacent to both \( x_j \) and \( x_j \) for at least one value of \( j \). Therefore, \( C_j \) cannot be colored in the color \( n + 1 \) in a proper coloring of \( G \), and therefore every \( C_j \) must be colored in one of the colors \( 1, \ldots, n \). Since \( C_1 \) is connected by an edge to every vertex \( x_i \) or \( \neg x_i \), it follows that \( C_j \) cannot be colored in the same color as any \( x_i \) or \( \neg x_i \) that is not in the clause \( C_j \). Hence the color that we assign to \( C_j \) must be the same as the color of some True vertex \( x_j \) that corresponds to a literal that is in clause \( C_j \). Therefore the graph is \( n + 1 \) colorable if and only if there is a True vertex for each \( C_j \) and this means exactly that the clauses are satisfiable. By means of many, often quite ingenious, transformations of the kind that we have just seen, the list of NP-complete problems has grown rapidly since the first example, and the 21 additional problems found by R. Karp. Hundreds of such problems are now known. Here are a few of the more important ones. Image Analysis: 1. **Localization and Attribution:** - The page contains one image located centrally. - Image number assignment: Image 1 (as there is only one image on the page). 2. **Object Detection and Classification:** - **Image 1:** - Objects: Nodes and edges in a graph. - Key Features: - Nodes are labeled (x1, x2, ..., x7, y1, y2, ..., y4). - Nodes appear as dots. - Edges are drawn as lines connecting pairs of nodes. 3. **Scene and Activity Analysis:** - **Image 1:** - Scene: The image illustrates a graph related to a 3SAT problem. - Activities: Depiction of a mathematical graph with labeled nodes and edges that indicate the relationships between variables in the 3SAT problem. 4. **Text Analysis:** - Text on Image: Symbols and variables labeling nodes. - Example: "x1, x2, z1, z2, C1, C2" - Analysis Significance: - The text relates to the 3SAT problem, indicating the variables and clauses. - Provides a tangible visualization for theoretical concepts in problem-solving within NP-completeness theory. 5. **Diagram and Chart Analysis:** - **Image 1:** - The graph visualizes an instance of a 3SAT problem. - Axes, scales, and legends: - No explicit axes or scales; the focus is on the connectivity of nodes. - Key insights: - The graph involves variables and clauses interconnected, each node representing either a variable or a clause. - Essential for understanding the coloring and connectivity that relate to solving the 3SAT problem through graph theory. 8. **Color Analysis:** - **Image 1:** - The image is primarily black and white, with no additional colors. - Impact: The monochromatic scheme emphasizes the structure and relationships between nodes without distracting elements. 9. **Perspective and Composition:** - **Image 1:** - Perspective: The graph is presented in a two-dimensional, planar perspective. - Composition: Nodes and edges are symmetrically arranged to show clear relationships. Nodes are distributed evenly with edges indicating direct connections between them. 10. **Contextual Significance:** - Image 1 contributes to the overall understanding of solving NP-complete problems by providing a graphical representation of the 3SAT problem. It aids in comprehending the theoretical discussion elucidated in the accompanying text. 13. **Graph Numbers:** - The image does not contain explicit numerical data points that can be listed. **Ablaufprozesse (Process Flows):** - The image indirectly shows the process flow of assigning colors (coloring vertices) to meet the conditions of the problem. **Prozessbeschreibungen (Process Descriptions):** - The text describes the process of proving that the graph is n+1 colorable by assigning colors to vertices in such a way that reflects the satisfiability of clauses in the 3SAT problem. **Typen Bezeichnung (Type Designations):** - The types are specified as literals (variables x1, x2, etc.) and clauses (C1, C2). **Trend and Interpretation:** - The image is indicative of general methods to solve NP-completeness problems, showing how graph theory can simplify such complex problems into verifiable conditions. **Tables:** - No tables are included in this page. In summary, the image is a graph that visualizes an instance of a 3SAT problem to assist in understanding its coloring and variable relationships as discussed in NP-completeness. The diagram emphasizes structural relationships with symmetrical composition and textual identifiers representing mathematical principles. #################### File: Algorithms%20and%20Complexity%20-%20Herbert%20S.%20Wilf%20%28PDF%29.pdf Page: 125 Context: # 5.5 Half a loaf ... enhanced chances of ultimate completion. ![Fig. 5.5.1: The short circuit](path/to/image) Here is a formal statement of the algorithm of Angluin and Valiant for finding a Hamilton path or circuit in an undirected graph \( G \): ```plaintext procedure uh(G: graph; s: vertex); { finds a Hamilton path (if \( s \neq t \)) or a Hamilton circuit (if \( s = t \)) in an undirected graph \( G \) and returns `success`, or fails, and returns `failure` } G' := G; ndp := s; P := empty path; repeat if ndp is an isolated point of \( G' \) then return `failure` else choose uniformly at random an edge (ndp, v) from among the edges of \( G' \) that are incident with ndp and delete that edge from \( G' \); if \( v \neq t \) and \( v \in P \) then adjoint the edge (ndp, v) to \( P \); ndp := v else if \( v \neq t \) and \( v \in P \) then { This is the short-circuit of Fig. 5.5.1 } u := neighbor of \( t \) in \( P \) that is closer to ndp; delete edge (u, v) from \( P \); adjoint edge (ndp, u) to \( P \); ndp := u end; { then } end; else until \( P \) contains every vertex of \( G \) (except \( T \), if \( s \neq t \) and edge (ndp, t) is in \( G \) but not in \( G' \); adjoint edge (ndp, t) to \( P \) and return `success` end; { uh } ``` As stated above, the algorithm makes only a very modest claim: either it succeeds or it fails! Of course, what makes it valuable is the accompanying theorem, which asserts that in fact the procedure almost always succeeds, provided the graph \( G \) has a good chance of having a Hamilton path or circuit. Image Analysis: ### Analysis of the Attached Visual Content #### 1. **Localization and Attribution:** - **Image 1:** Positioned at the top of the page. - **Image 2:** Positioned below Image 1. #### 2. **Object Detection and Classification:** - **Image 1:** - Objects: Graph showing a path labeled "Path P (before)". - Key Features: The path includes points connected by edges and a specific point labeled "ndp". - **Image 2:** - Objects: Graph showing a path labeled "Path P (after)". - Key Features: This path also includes points connected by edges and a specific point labeled "ndp", but the layout of the path differs from the first graph. #### 3. **Scene and Activity Analysis:** - **Image 1:** Depicts the initial state of a path (Path P) in an undirected graph with a marked point "ndp". This suggests steps are to be taken to transform this path. - **Image 2:** Shows the final state of a path (Path P) after a transformation involving the point "ndp". This indicates a change or development towards achieving a goal, likely related to finding a Hamilton path or circuit. #### 4. **Text Analysis:** - **Extracted Text:** - Title: "Fig. 5.5.1: The short circuit" - Descriptive Text: "Here is a formal statement of the algorithm of Angluin and Valiant for finding a Hamilton path or circuit in an undirected graph G:" - Procedure (Algorithm Description): ``` procedure uhc(G: graph, s, t: vertex); {finds a Hamilton path (if s ≠ t) or a Hamilton circuit (if s = t) P in an undirected graph G and returns `success`, or fails, and returns `failure`} G' := G; ndp := s; P := empty path; repeat if ndp is an isolated point of G' then return `failure` else choose uniformly at random an edge (ndp, v) from among the edges of G' that are incident with ndp and delete that edge from G'; if v ≠ t and v ∉ P then adjoin the edge (ndp, v) to P; ndp := v else if v ≠ t and v ∈ P then {This is the short-circuit of Fig. 5.5.1} u := neighbor of v in P that is closer to ndp; delete edge (u, v) from P; adjoin edge (ndp, v) to P; ndp := u end; {then} end; {else} until P contains every vertex of G (except T, if s ≠ t) and edge (ndp, t) is in G but not in G'; adjoin edge (ndp, t) to P and return `success` end; {uhc} ``` - Context: The text provides a detailed algorithm for finding a Hamilton path or circuit, explaining logical steps and conditions. This algorithm is crucial for understanding the transformation depicted in the graphs (Images 1 and 2). #### 5. **Diagram and Chart Analysis:** - **Image 1:** Represents the initial layout of a graph (Path P before transformation) with specific vertices and an isolated point "ndp". - **Image 2:** Shows the same graph after a transformation process described in the algorithm, depicting how to potentially find a Hamilton path or circuit. - **Axes and Legends:** Not applicable to these visual representations, as they are pure network diagrams. #### 6. **Product Analysis:** Not applicable. #### 7. **Anomaly Detection:** No anomalies detected; all elements appear to be consistent with the algorithm's steps described in the text. #### 8. **Color Analysis:** - **Image 1 and Image 2:** Both diagrams are in black and white, focusing on lines and points. The lack of colors emphasizes the structure and connectivity of the graphs. #### 9. **Perspective and Composition:** - **Perspective:** Direct 2D view from above, presenting a clear view of each point and edge in the graphs. - **Composition:** Simple and functional, with points and edges arranged to clearly depict the connections and transformations of the paths. #### 10. **Contextual Significance:** - These images and the accompanying text form part of a section in a document or a book discussing graph algorithms, specifically the Hamilton path and circuit problem. The diagrams illustrate the intermediate and final stages of the algorithm applied to a graph. ### Summary: - This page illustrates and explains an algorithm (by Angluin and Valiant) for finding a Hamilton path or circuit in an undirected graph. - Two diagrams show the state of the path before and after the application of the algorithm. - The text provides a formal algorithmic statement, describing each step and the conditions involved in transforming the path. - The significance lies in the visual and textual explanation of a complex algorithm, aiding in understanding its practical application. #################### File: Algorithms%20and%20Complexity%20-%20Herbert%20S.%20Wilf%20%28PDF%29.pdf Page: 126 Context: # Chapter 5: NP-completeness What kind of graph has such a ‘good chance’? A great deal of research has gone into the study of how many edges a graph has to have before one can assure it must contain certain given structures. For instance, how many edges must a graph of \( n \) vertices have before we can be almost certain that it will contain a complete graph of \( n \) vertices? To say that graphs have a property ‘almost certainly’ is to say that the ratio of the number of graphs on \( n \) vertices that have the property to the number of graphs on \( n \) vertices approaches 1 as \( n \) grows without bound. For the Hamilton path problem, an important dividing line, or threshold, turns out to be at the level of \( \log n \) edges. That is to say, a graph of \( n \) vertices that has \( o(\log n) \) edges has relatively little chance of being even connected, whereas a graph with \( \geq \log n \) edges is almost certainly connected, and almost certainly has a Hamilton path. We now state the theorem of Angluin and Valiant, which asserts that the algorithm above will almost surely succeed if the graph \( G \) has enough edges. ## Theorem 5.5.1 Fix a positive real number \( \epsilon \). There exist numbers \( M \) and \( c \) such that if we choose a graph \( G \) at random from among those of \( n \) vertices and at least \( cn \) edges, and we choose arbitrary vertices \( s, t \) in \( G \), then the probability that algorithm UHC returns 'success' before making a total of \( M \log n \) attempts to extend partly constructed paths is \( 1 - O(n^{-\epsilon}) \). ## 5.6 Backtracking (I): independent sets In this section, we are going to describe an algorithm that is capable of solving some NP-complete problems fast, on the average, while at the same time guaranteeing that a solution will always be found, be it quickly or slowly. The method is called backtracking, and it has long been a standard method in computer search problems when all else fails. It has been common to think of backtracking as a very long process, and indeed can be. But recently it has been shown that the method can be very fast on average, and that in the graph coloring problem, for instance, it functions in an average of constant time, i.e., the time is independent of the number of vertices, although to be sure, the worst-case behavior is very exponential. We first illustrate the backtrack method in the context of a search for the largest independent set of vertices (a set of vertices too two of which are joined by an edge) in a given graph \( G \), an NP-complete problem. In this case the average time behavior of the method is not constant, or even polynomial, but is subexponential. The method is also easy to analyze and describe in this case. Hence consider a graph \( G \) of \( n \) vertices, in which the vertices have been numbered \( 1, 2, \ldots, n \). We want to find, in \( G \), the size of the largest independent set of vertices. In Fig. 5.6.1 below, the graph \( G \) has 6 vertices. ![Fig. 5.6.1: Find the largest independent set](#) Begin by searching for an independent set \( S \) that contains vertex 1, so let \( S = \{ 1 \} \). Now attempt to enlarge \( S \). We cannot enlarge \( S \) by adjoining vertex 2 to it, but we can add vertex 3. Our set \( S \) is now \( \{ 1, 3 \} \). Now we cannot add vertex 4 (joined to 1) or vertex 5 (joined to 3) or vertex 6 (joined to 3), so we backtrack. Therefore we backtrack, by replacing the most recently added member of \( S \) by the next choice that we might have made for it. In this case, we delete vertex 3 from \( S \), and the next choice would be vertex 6. The set \( S \) is \( \{ 1, 6 \} \). Again we have a dead end. If we backtrack again, there are no further choices with which to replace vertex 6, so we backtrack even further, and not only delete 6 from \( S \) but also replace vertex 1 by the next possible choice for it, namely vertex 2. 122 Image Analysis: ### Analysis of Attached Visual Content #### 1. Localization and Attribution - **Number of Images:** - There is a single image embedded in the text, which will be referred to as Image 1. - **Position:** - Image 1 is located centrally on the page at the bottom part. #### 2. Object Detection and Classification - **Image 1:** - **Objects Detected:** - A labeled graph with vertices. - Text annotations and numerical notations. - Arrows indicating directions and connections. - **Classification:** - The object is a graph typically used in mathematical and computational contexts to illustrate the concept of independent sets. #### 3. Scene and Activity Analysis - **Image 1:** - **Scene Description:** - The image depicts a graphical representation of a graph, where nodes (vertices) connected by edges (lines) are showcased. The vertices are numbered, and connections between them indicate edges. - **Activities Taking Place:** - The activity involves finding the largest independent set, which is a set of vertices in a graph, none of which are adjacent to each other. #### 4. Text Analysis - **Text in Image 1:** - Text below the image: "Fig. 5.6.1: Find the largest independent set" - Intended to describe the process depicted in the illustration above it. - The numerical notations and annotations on the graph: - Vertices numbered 1 to 6. - An arrowed sequence illustrating connections and potential selections for the independent set. - **Content Significance:** - The text and numerical annotations are crucial for understanding the step-by-step process of identifying an independent set in graph theory. #### 5. Diagram and Chart Analysis - **Image 1:** - **Data and Trends Presented:** - The diagram represents a graph used for backtracking to find the largest independent set of vertices. - Shows a step-by-step process highlighting the vertices chosen and discarded. - **Axes, Scales, and Legends:** - Vertices are marked by numbers (1 to 6). - Lines (edges) connecting these vertices indicate relationships. - **Key Insights:** - Shows how backtracking can help identify an independent set in the graph. - Demonstrates the complexity and decision points in the algorithm. #### 7. Anomaly Detection - **No noticeable anomalies** in the context of the image and supporting text. #### 8. Color Analysis - **Predominant Colors:** - Black and white. - Impact: The monochromatic scheme is typical for scientific and mathematical diagrams, focusing attention on the structure and details without color distraction. #### 9. Perspective and Composition - **Image 1:** - **Perspective:** - The image is presented from a front view, ensuring clarity of all the nodes and connections. - **Composition:** - Balanced layout, central focus on the graph. - Clear and labeled vertices with connecting edges, illustrating the step-by-step process of finding the independent set. #### 10. Contextual Significance - **Image 1:** - **Context in the Document:** - The image supports the text explaining backtracking and its application in finding the largest independent set in NP-complete problems. - **Contribution to the Overall Message:** - Helps in visualizing and understanding the theoretical explanations provided in the text. #### 11. Metadata Analysis - **No metadata available** directly from the image. #### 12. Graph and Trend Analysis - **Image 1:** - **Trend Identification:** - Steps in selecting vertices aiming to maximize the independent set while avoiding adjacency. - **Data Interpretation:** - The graph and steps illustrate trials and errors in the selection process, indicating potential complexities and requiring backtracking. ### Conclusion: The attached content includes a detailed analysis of a single image illustrating the backtracking process to find an independent set in graph theory. The analysis comprehensively covers the visual elements, context, and significance of the image within the document. This aids in understanding the theoretical underpinnings of the text and provides clarity on the subject matter discussed. #################### File: Algorithms%20and%20Complexity%20-%20Herbert%20S.%20Wilf%20%28PDF%29.pdf Page: 129 Context: # 5.7 Backtracking (II): Graph Coloring ## Lemma 5.7.1 Let \( s_1, \ldots, s_K \) be nonnegative numbers whose sum is \( L \). Then the sum of their squares is at least \( \frac{L^2}{K} \). **Proof:** We have \[ 0 \leq \sum_{i=1}^K s_i^2 = \sum_{i=1}^K \left( s_i - \frac{L}{K} \right)^2 + \frac{L^2}{K} \] \[ = \sum_{i=1}^K s_i^2 - \frac{L^2}{K^2} + \frac{L^2}{K} \] \[ = \sum_{i=1}^K s_i^2 - \frac{L^2}{K^2} + \frac{L^2}{K} \] \[ \Rightarrow \sum_{i=1}^K s_i^2 \geq \frac{L^2}{K}. \] The next lemma deals with a kind of inside-out chromatic polynomial question. Instead of asking “How many proper colorings can a given graph have?”, we ask “How many graphs can have a given proper coloring?” ## Lemma 5.7.2 Let \( C \) be one of the \( K^L \) possible ways to color in \( K \) colors a set of \( L \) abstract vertices \( 1, 2, \ldots, L \). Then the number of graphs \( G \) whose vertex set is that set of \( L \) colored vertices and for which \( C \) is a proper coloring of \( G \) is at most \( 2^{L(L - 1)/2} \). **Proof:** In the coloring \( C \), suppose \( s_1 \) vertices get color 1, \( \ldots, s_K \) get color \( K \), where, of course, \( s_1 + \ldots + s_K = L \). If a graph \( G \) is to admit \( C \) as a proper vertex coloring then its edges can be drawn only between vertices of different colors. The number of edges that \( G \) might have is therefore \[ s_1 s_2 + s_1 s_3 + \ldots + s_K s_{K-1} + \ldots + s_{K-1} s_K \] for which we have the following estimate: \[ \sum_{1 \leq j < k \leq K} s_j s_k \leq \frac{1}{2} \sum_{j=1}^K s_j^2 \] \[ = \frac{1}{2} \left( \sum_{j=1}^K s_j^2 - \sum_{j=1}^K s_j^2 \right) = \frac{1}{2} \sum_{j=1}^K s_j^2 \] \[ \Rightarrow \sum_{1 \leq j < k \leq K} s_j s_k \leq \frac{L^2}{2} - \frac{1}{2} \sum_{j=1}^K s_j^2 \quad \text{(by lemma 5.7.1)} \] The number of possible graphs \( G \) is therefore at most \( 2^{(L(L - 1)/2)} \). ## Lemma 5.7.3 The total number of proper colorings in \( K \) colors of all graphs of \( L \) vertices is at most \[ K \cdot L^{2^{(L-1)/K}}. \] **Proof:** We are counting the pairs \( (G, C) \), where the graph \( G \) has \( L \) vertices and \( C \) is a proper coloring of \( G \). If we keep \( C \) fixed and sum on \( G \), then by lemma 5.7.2 the sum is at most \( 2^{(L-1)/K} \). Since there are \( K \) such \( C \), the proof is finished. Now let's think about a backtrack search for a \( K \)-coloring of a graph. Begin by using color 1 on vertex 1. Then use color 2 on vertex 2 unless \( (1, 2) \) is an edge, in which case use color 2. As the coloring progresses through vertices \( 1, 2, \ldots, L \), we color each new vertex with the lowest available color number that does not cause a conflict with some vertex that has previously been colored. Image Analysis: ### Comprehensive Analysis of the Attached Visual Content #### 1. **Localization and Attribution** - The visual content consists of one page from a document. - The page includes multiple mathematical expressions, proofs, and text explanations. - There is no numbering of images as there is a single continuous page of text and equations. #### 2. **Object Detection and Classification** - **Text and equations**: The page is composed mainly of paragraphs containing text and mathematical expressions. - **Mathematical Symbols**: Various symbols including summation (∑), inequality signs (≤), and fractions are present. - **Rectangles with numbers**: There are black rectangles with white text inside, representing the end of lemmas and proofs. #### 3. **Scene and Activity Analysis** - The scene is academic and mathematical, with the content focused on graph coloring and related lemmas and proofs. - The activities involve the presentation and proof of lemmas relating to the sum of squares and proper graph coloring. #### 4. **Text Analysis** - **Lemma 5.7.1**: Discusses nonnegative numbers and the sum of their squares. - **Significance**: The lemma concludes that the sum of the squares of nonnegative numbers under certain conditions is at least \(L^2 / K\). - **Lemma 5.7.2**: Explores a coloring problem in graph theory, providing a bound on the number of possible graphs for a given proper coloring. - **Significance**: This is crucial for understanding the complexity and constraints in graph coloring. - **Lemma 5.7.3**: Calculates the total number of proper colorings in \(K\) colors of all graphs with \(L\) vertices. - **Significance**: Provides a formula (\( K^L \cdot 2^{(L^2 - L) \cdot (1 - 1/K) / 2} \)) for quantifying the proper colorings, advancing theoretical knowledge in graph theory. - **Proofs**: Detailed mathematical proofs are provided for each lemma, following a typical structure of definitions, logical deductions, and conclusions. #### 7. **Anomaly Detection** - There are no apparent anomalies or unusual elements in the visual content. All elements align with standard mathematical documentation practices. #### 8. **Color Analysis** - **Dominant Colors**: The document uses a standard black-and-white color scheme typical for academic papers. - **Black**: Used for all text and mathematical symbols, enhancing readability. - **White**: Background color, ensuring contrast and clarity. #### 9. **Perspective and Composition** - **Perspective**: The perspective is direct, as expected from a scanned or digitally created academic document. - **Composition**: The page is well-structured with clear sections for lemmas and proofs. Equations are centered and inline with text, following standard mathematical document formatting. #### 13. **Graph Numbers** - **Lemma 5.7.1**: - The sum of squares formula is \[ \sum_{i=1}^K s_i^2 = \frac{L^2}{K} \] - **Lemma 5.7.2**: - The number of graphs \(G\) possible is \[ 2^{(L^2 - L) \cdot (1 - 1/K) / 2} \] - **Lemma 5.7.3**: - The total number of proper colorings is \[ K^L \cdot 2^{(L^2 - L) \cdot (1 - 1/K) / 2} \] #### **Contextual Significance** - The page appears to be from a chapter on "Backtracking (II): Graph Coloring" in a mathematical or computer science text. - **Contribution**: This section contributes to the overall understanding of graph coloring by providing theoretical bounds and proofs that facilitate further study and algorithms development. Overall, the page is a detailed exploration of specific aspects of graph theory, primarily focused on proper coloring and combinatorial bounds, aimed at readers with a strong background in mathematics or computer science. #################### File: Algorithms%20and%20Complexity%20-%20Herbert%20S.%20Wilf%20%28PDF%29.pdf Page: 130 Context: # Chapter 5: NP-completeness At some stage, we may reach a dead end: out of colors, but not out of vertices to color. In the graph of Fig. 5.7.1, if we try to 2-color the vertices we can color vertex 1 in color 1, vertex 2 in color 2, vertex 3 in color 1, and then we'd be stuck because neither color would work on vertex 4. ![Fig. 5.7.1: Color this graph](path_to_image) When a dead end is reached, back up to the most recently colored vertex for which other color choices are available, replace its color with the next available choice, and try again to push forward to the next vertex. The (futile) attempt to color the graph in Fig. 5.7.1 with 2 colors by the backtrack method can be portrayed by the **backtrack search** tree in Fig. 5.7.2. The search is thought of as beginning at ‘Root’. The label at each node of the tree describes the colors of the vertices that have so far been colored. Thus ‘212’ means that vertices 1, 2, and 3 have been colored, respectively, in colors 2, 1, and 2. ![Fig. 5.7.2: A frustrated search tree](path_to_image) ![Fig. 5.7.3: A happy search tree](path_to_image) Image Analysis: ### Comprehensive Analysis of the Attached Visual Content #### 1. Localization and Attribution - **Image 1:** - Positioned at the top of the page. - Caption: Fig. 5.7.1: Color this graph - **Image 2:** - Positioned in the middle of the page. - Caption: Fig. 5.7.2: A frustrated search tree - **Image 3:** - Positioned at the bottom of the page. - Caption: Fig. 5.7.3: A happy search tree #### 2. Object Detection and Classification - **Image 1 (Fig. 5.7.1):** - Objects: Vertices and edges forming a graph. - Key Features: The graph consists of four vertices connected by edges, forming a shape visible as a triangle with an extended line. - **Image 2 (Fig. 5.7.2):** - Objects: Nodes and connecting lines forming a search tree. - Key Features: The nodes are labeled with numerical values indicating the coloring state of vertices. - **Image 3 (Fig. 5.7.3):** - Objects: Nodes and connecting lines forming another search tree. - Key Features: This tree is more extensive with detailed numerals representing vertex colorings. #### 3. Scene and Activity Analysis - **Image 1 (Fig. 5.7.1):** - Scene: A simple graph illustration. - Activity: An attempt to color the vertices of the graph. - **Image 2 (Fig. 5.7.2):** - Scene: A binary search tree. - Activity: Illustrates a search process that ends in frustration due to being unable to find a successful coloring of the graph. - **Image 3 (Fig. 5.7.3):** - Scene: Another binary search tree. - Activity: Shows a successful search process, resulting in heuristics that lead to a correctly colored graph. #### 4. Text Analysis - **Text Content:** - At some stage we may reach a dead end: out of colors, but not out of vertices to color... - When a dead end is reached, back up to the most recently colored vertex... - The (futile) attempt to color the graph in Fig. 5.7.1 with 2 colors by the backtrack method... - **Significance:** - The text explains the process of graph coloring and the backtracking algorithm, highlighting frustration when a dead end is reached, and satisfaction when a proper path is found. #### 7. Anomaly Detection - **Image 1:** - No unusual elements detected. - **Image 2:** - No noticeable anomalies; tree represents unsuccessful search attempts. - **Image 3:** - The volume of nodes suggests a more complex and refined search, but no anomalies. #### 8. Color Analysis - **Overall Color Composition:** - The images are in black and white, typical for textbook illustrations focusing on structure and logic rather than color impact. #### 9. Perspective and Composition - **Image 1:** - Perspective: Planar view of a graph. - Composition: Balanced with four vertices connected cleanly with edges. - **Image 2 & 3:** - Perspective: Hierarchical tree structures viewed from the root (top) downwards. - Composition: Nodes are symmetrical, illustrating the progression of search algorithms. #### 10. Contextual Significance - **Overall Contribution:** - The images visually support an explanation in a chapter about NP-completeness, emphasizing the difficulties in solving certain computational problems (e.g., graph coloring) and demonstrating both unsuccessful and successful search strategies. #### 13. Graph Numbers - **Image 2 (Fig. 5.7.2):** - Data Points: Root (1, 2), Level 1 (12, 21), Level 2 (121, 212) - **Image 3 (Fig. 5.7.3):** - Data Points: Root (1, 2), Level 1 (12, 13, 21, 23, 31, 32), Level 2 and beyond include more extensive numbering indicating paths and successful searches. #### Ablaufsprozesse (Process Flows) - **Images 2 and 3:** - These illustrate decision-making processes in search trees. #### Prozessbeschreibungen (Process Descriptions) - **Images 2 and 3:** - They depict the backtracking process in the search for valid graph colorings. #### Typen Bezeichnung (Type Designations) - **Images 2 and 3:** - Types are designated by numerical labels indicating vertex colorings at different nodes in the search process. ### Summary The content comprehensively demonstrates the concept of graph coloring in the context of NP-completeness through visual aids, including graphs and search trees, which effectively illustrate the problem-solving process via backtracking. #################### File: Algorithms%20and%20Complexity%20-%20Herbert%20S.%20Wilf%20%28PDF%29.pdf Page: 131 Context: 1. **Localization and Attribution:** - **Image Number:** 1 2. **Text Analysis:** - **Detected Text:** ``` 5.7 Backtracking (II): graph coloring If instead we use 3 colors on the graph of Fig. 5.7.1 then we get a successful coloring; in fact we get 12 of them, as is shown in Fig. 5.7.3. Let's concentrate on a particular level of the search tree. Level 2, for instance, consists of the nodes of the search tree that are at a distance 2 from `Root.' In Fig. 5.7.3, level 2 contains 6 nodes, corresponding to the partial colorings 12, 13, 21, 23, 31, 32 of the graph. When the coloring reaches vertex 2 it has seen only the portion of the graph G that is induced by vertices 1 and 2. Generally, a node at level L of the backtrack search tree corresponds to a proper coloring in K colors of the subgraph of G that is induced by vertices 1,2,..., L. Let H_l(G) denote that subgraph. Then we see the truth of Lemma 5.7.4. The number of nodes at level L of the backtrack search tree for coloring a graph G in K colors is equal to the number of proper colorings of H_l(G) in K colors, i.e., to P(K, H_l(G)), where P is the chromatic polynomial. We are now ready for the main question of this section: what is the average number of nodes in a backtrack search tree for K-coloring graphs of n vertices? This is A(n, K) = 1/number of graphs G_n Σ_(graphs G_n) no. of nodes in tree for G = 2^(-3) Σ_(graphs G_i) (Σ L>=0 Σ_(nodes at level L)){no. of nodes at level L}} = 2^(-3) Σ_(graphs G_i) Σ L>=0 P(K, H_l(G)) (by lemma 5.7.4) = 2^(-3) Σ_(graphs G_i) Σ L>=0 (Σ_(Hl) P(K, H_l(G))... Fix some value of L and consider the inner sum. As G runs over all graphs of N vertices, H_l(G) selects the subgraph of G that is induced by vertices 1, 2,..., L. Now lots of graphs G of n vertices have the same H_l(G) (G) selecting at vertices 1, 2,... L. In fact exactly (n choose L)*(n-L choose i-L) different graphs G of n vertices all have the same graph H of L vertices in residence at vertices 1, 2,..., L (see exercise 15 of section 1.6). Hence (5.7.2) gives A(n, K) = 2^(-3) Σ L>=0 (choose i-L)(2^-L)(Σ_(H_h^l) P(K, H)) = Σ L>=0 2^(-l)(choose i-L) (Σ_(H_h^(_l)) P(K, H)). The inner sum is exactly the number that is counted by lemma 5.7.3, and so A(n, K) = Σ L>=0 2^(-L)(choose i-L)K^L{2^(-1-(L)(i/2}} <= Σ L>=0 K^L2^(-L/2-(L^2)/2/K. The infinite series actually converges! Hence, A(n, K) is bounded, for all n. This proves Theorem 5.7.1. Let A(n, K) denote the average number of nodes in the backtrack search trees for K-coloring the vertices of all graphs of n vertices. Then there is a constant h = h(K), that depends on the number of colors, K, but not on n, such that A(n, K) ≤ h(K) for all n. ``` - **Content Significance:** - This text discusses backtracking in the context of graph coloring. - It explains how nodes at different levels of a backtrack search tree correspond to colorings of subgraphs. - Lemma 5.7.4 is introduced, focusing on the number of nodes at a given level correlating to the number of proper colorings. - The text derives a formula for the average number of nodes in the backtrack search tree for K-coloring graphs with n vertices (A(n, K)). - Theorem 5.7.1 is stated, which provides bounds on A(n, K), showing that it is finite and does not grow indefinitely with n. 11. **Graph and Trend Analysis:** - While there is no visual graph included, a mathematical trend is described. - The average number of nodes in a tree for K-coloring graphs with n vertices is bounded. - This information is essential for understanding the efficiency of backtracking algorithms in graph coloring problems. #################### File: Algorithms%20and%20Complexity%20-%20Herbert%20S.%20Wilf%20%28PDF%29.pdf Page: 132 Context: # Chapter 5: NP-completeness ## 5.8 Approximate algorithms for hard problems Finally, we come to Type III of the three kinds of ‘half-a-loaf-is-better-than-none’ algorithms that were described in section 5.5. In these algorithms we don’t find the exact solution of the problem, only an approximate one. As consolation we have an algorithm that runs in polynomial time as well as a performance guarantee to the effect that while the answer is approximate, it can certainly deviate by no more than such-and-such from the exact answer. An elegant example of such a situation is the Travelling Salesman Problem, which we will now express as an optimization problem rather than as a decision problem. We are given \( n \) points (cities) in the plane, as well as the distances between every pair of them, and we are asked to find a round-trip tour of all of these cities that has minimum length. We will assume throughout the following discussion that the distances satisfy the triangle inequality. This restriction of the TSP is often called the *Euclidean* Travelling Salesman Problem. The algorithm that we will discuss for this problem has the properties 1. It runs in polynomial time and 2. The round-trip tour that it finds will never be more than twice as long as the shortest possible tour. The first step in carrying out the algorithm is to find a minimum spanning tree (MST) for the \( n \) given cities. A MST is a tree whose nodes are the cities in question, and which, among all possible trees on the vertex set, has minimum possible length. It may seem that finding a MST is just as hard as solving the TSP, but NIN (No, It’s Not!). The MST problem is one of those all-too-rare computational situations in which it pays to be greedy. Generally speaking, in a greedy algorithm, 1. We are trying to construct some optimal structure by adding one piece at a time, and 2. At each step we make the decision about which piece will be added next by choosing, among all available pieces, the single one that will carry us as far as possible in the desirable direction (be greedy!). The reason that greedy algorithms are not usually the best possible ones is that it may be better not to take the single best piece at each step, but to take some other piece, in the hope that at a later step we will be able to improve things even more. In other words, the global problem of finding the best structure might not be solvable by the local procedure of being as greedy as possible at each step. In the MST problem, though, the greedy strategy works, as we see in the following algorithm. ```plaintext procedure mst(x: array of n points in the plane); /* constructs a spanning tree of minimum length on the */ /* vertices {x1, x2, ..., xn} in the plane */ let T consist of a single vertex x1; while T has fewer than n vertices do for each vertex x that is not yet in T, find the distance d(x) from \( x \) to the nearest vertex of T; let \( v \) be a vertex of smallest d(x); add \( v \) to the vertex set of T; add to T the edge from \( v \) to the nearest vertex \( x \) of T; end(mst) ``` ### Proof of correctness of mst: Let \( T \) be the tree that is produced by running mst, and let \( e_1, e_2, \ldots, e_{n-1} \) be its edges, listed in the same order in which the algorithm produced them. Let \( T' \) be a minimum spanning tree for \( x \). Let \( e \) be the first edge of \( T' \) that does not appear in \( T \). In the minimum tree \( T' \), edges \( e_1, \ldots, e_{i-1} \) all appear, and we let \( S \) be the union of their vertex sets. In \( T' \), \( f \) be the edge that joins the subtree on \( S \) to the subtree on the remaining vertices of \( x \). Suppose \( f \) is shorter than \( e \). Then \( f \) was one of the edges that was available to the algorithm and at the instant that it chose \( e \), and since \( e \) was the shortest edge available at that moment, we have a contradiction. #################### File: Algorithms%20and%20Complexity%20-%20Herbert%20S.%20Wilf%20%28PDF%29.pdf Page: 133 Context: ``` # 5.7 Backtracking (II): Graph Coloring Suppose \( T \) is longer than \( \epsilon \). Then \( T' \) would not be minimal because the tree that we would obtain by exchanging \( f_1 \) for \( e \) in \( T' \) (why is it still a tree if we do that exchange?) would be shorter, contradicting the minimality of \( T' \). Hence \( f_1 \) and \( e \) have the same length. In \( T' \) exchange \( f_1 \) for \( e \). Then \( T' \) is still a tree, and is still a minimum spanning tree. The index of the first edge of \( T \) that does not appear in \( T' \) is now at least \( r + 1 \), one unit larger than before. The process of replacing edges of \( T \) that do not appear in \( T' \) without affecting the minimality of \( T \) can be repeated until every edge of \( T \) appears in \( T' \), i.e., until \( T = T' \). Hence \( T \) was a minimum spanning tree. That finishes one step of the process that leads to a polynomial time travelling salesman algorithm that finds a tour of at most twice the minimum length. The next step involves finding an Euler circuit. Way back in theorem 1.6.1 we learned that a connected graph has an Euler circuit if and only if every vertex has even degree. Recall that the proof was recursive in nature, and immediately implies a linear time algorithm for finding Euler circuits recursively. We also noted that the proof remains valid even if we are dealing with a multigraph, that is, with a graph in which several edges are permitted between single pairs of vertices. We will in fact need that extra flexibility for the purpose at hand. ## Theorem 5.8.1 There is an algorithm that operates in polynomial time and which will return a travelling salesman tour whose length is at most twice the length of a minimum tour. Here is the algorithm. Given the \( n \) cities in the plane: 1. Find a minimum spanning tree \( T \) for the cities. 2. Double each edge of the tree, thereby obtaining a ‘multitree’ \( T' \) in which each pair of vertices there are 0 or 2 edges. 3. Since every vertex of the doubled tree has even degree, there is an Eulerian tour \( W \) of the edges of \( T' \); find one, as in the proof of theorem 1.6.1. 4. Now we construct the output tour of the cities. Begin at some city and follow the walk \( W \). However, instead of starting at some vertex \( v \), go from \( v \) directly (via a straight line) to the next vertex of the walk \( W \) that you haven't visited yet. This means that you will often short-circuit portions of the walk \( W \) by going directly from some vertex to another via a several edges ‘down the road.’ The tour \( Z' \) that results from (4) above is indeed a tour of all the cities in which each city is visited once and only once. We claim that this tour is at most twice optimal. Let \( Z \) be an optimum tour, and let \( e \) be some edge of \( Z \). Then \( Z - e \) is a path that visits all of the cities. Since a path is a tree, \( Z - e \) is a spanning tree of the cities, hence \( Z - e \) is at least as long as \( T \), and so \( Z \) is surely at least as long as \( T \). Next consider the length of the tour \( Z' \). A step of \( Z' \) that walks along an edge of the walk \( W \) has length equal to the length of that edge of \( W \). A step of \( Z' \) that short circuits several edges of \( W \) has length at most equal to the sum of the lengths of the edges of \( W \) that were short-circuited. If we sum these inequalities over all steps of \( Z' \) we find that the length of \( Z' \) is at most equal to the length of \( W \), which is in turn twice the length of the tree \( T \). If we put all of this together we find that: \[ \text{length}(Z') \leq \text{length}(Z - e) \leq \text{length}(T) = \frac{1}{2} \text{length}(W) \leq \frac{1}{2} \text{length}(Z') \] as claimed. More recently it has been proved (Christodes, 1976) that in polynomial time we can find a TSP tour whose total length is at most \( \frac{3}{2} \) as long as \( G \) is a complete tour. The algorithm makes use of Edmonds’s algorithm for maximum matching in a general graph (see the reference at the end of Chapter 3). It will be interesting to see if the factor \( \frac{3}{2} \) can be further refined. Polynomial time algorithms are known for other NP-complete problems that guarantee that the answers obtained will not exceed, by more than a constant factor, the optimum answer. In some cases this guarantees apply to the difference between the answer that the algorithm gives and the best one. See the references below for more information. ``` Image Analysis: ### Analysis of Attached Visual Content: #### **Localization and Attribution:** - The attached visual content is a single image of a page from a document or book. There are no multiple images to number. #### **Text Analysis:** - **Extracted Text:** ``` 5.7 Backtracking (II): graph coloring Suppose f is longer than e_r. Then T' would not be minimal because the tree that we would obtain by exchanging f for e_r in T' (why is it still a tree if we do that exchange?) would be shorter, contradicting the minimality of T'. Hence f and e_r have the same length. In T' exchange f for e_r. Then T' is still a tree, and is still a minimum spanning tree. The index of the first edge of T' that does not appear in T' is now at least r + 1, one unit larger than before. The process of replacing edges of T that do not appear in T' without affecting... ``` - **Content Analysis:** - The text primarily discusses graph theory, minimal spanning trees, and the traveling salesman problem. - Backtracking and polynomial time algorithms are mentioned, including references to Euler circuits, multitrees, and optimization of tours. #### **Contextual Significance:** - The content appears to be from a mathematical or computer science textbook focusing on algorithmic theory. - It contributes to the overall understanding of backtracking, graph coloring, and efficient algorithms for graph-related problems, specifically the traveling salesman problem. #### **Perspective and Composition:** - **Perspective:** - The image is a direct, front-facing view of a page in a book or document. - **Composition:** - The text is organized into paragraphs with mathematical equations interspersed. #### **Color Analysis:** - **Color Composition:** - The image primarily consists of black text on a white background, standard for academic or printed materials. - Dominant colors: Black and white. #### **Typen Bezeichnung (Type Designations):** - This image includes types or categories like "backtracking," "Euler circuit," "multitree," "traveling salesman tour," etc. #### **Prozessbeschreibungen (Process Descriptions):** - The page describes iterative processes and step-by-step algorithms for finding Euler circuits, constructing a traveling salesman tour, and optimizing the length of separate tours. #### **Trend and Interpretation:** - Trends indicate a focus on algorithmic efficiency, step reductions, and polynomial time solutions in graph theory and optimization problems. ### **Additional Observations:** - This examination shows the meticulous nature of algorithmic problem-solving methods and theoretical proofs in graph theory. By focusing on dense mathematical and algorithmic content, the image provides educational material for students or professionals in the field of computer science or applied mathematics. #################### File: Algorithms%20and%20Complexity%20-%20Herbert%20S.%20Wilf%20%28PDF%29.pdf Page: 134 Context: # Chapter 5: NP-completeness ## Exercises for section 5.8 1. Consider the following algorithm: ``` procedure mst2(x: array of n points in the plane); { allegedly finds a tree of minimum total length that visits every one of the given points } if n = 1 then T := {x₁} else T := mst2(n - 1, x − xₙ); let u be the vertex of T that is nearest to xₙ; mst2 := T plus vertex xₙ plus edge (xₙ, u) end. ``` Is this algorithm a correct recursive formulation of the minimum spanning tree greedy algorithm? If so then prove it, and if not then give an example of a set of points where mst2 gets the wrong answer. ## Bibliography Before we list some books and journal articles, it should be mentioned that research in the area of NP-completeness is moving rapidly, and the state of the art is changing all the time. Readers who would like updates on the subject are referred to a series of articles that have appeared in issues of the Journal of Algorithms in recent years. These are called "NP-completeness: An ongoing guide." They are written by David S. Johnson, and each of them is a thorough survey of recent progress in one particular area of NP-completeness research. They are written as updates of the first reference below. Journals that contain a good deal of research on the areas of this chapter include the Journal of Algorithms, the Journal of the Association for Computing Machinery, the SIAM Journal of Computing, Information Processing Letters, and SIAM Journal of Discrete Mathematics. The most complete reference on NP-completeness is - M. Garey and D. S. Johnson, *Computers and Intractability: A guide to the theory of NP-completeness*, W. H. Freeman and Co., San Francisco, 1979. The above is highly recommended. It is readable, careful, and complete. The earliest ideas on the computational intractability of certain problems go back to - Alan Turing, "On computable numbers, with an application to the Entscheidungsproblem," Proc. London Math. Soc., Ser. 2, 42 (1936), 230-265. Cook's theorem, which originated the subject of NP-completeness, is in - S. A. Cook, "The complexity of theorem proving procedures," Proc., Third Annual ACM Symposium on the Theory of Computing, ACM, New York, 1971, 151-158. After Cook's work was done, a large number of NP-complete problems were found by - Richard M. Karp, "Reducibility among combinatorial problems," in R. E. Miller and J. W. Thatcher, eds., *Complexity of Computer Combinations*, Plenum, New York, 1972, 85-103. The above paper is recommended both for its content and its clarity of presentation. The approximate algorithm for the traveling salesman problem is in - D. J. Rothlauf, R. E. Stearns and P. M. Lewis, "An analysis of several heuristics for the travelling salesman problem," SIAM J. Comp. 6 (1977), 563-581. Another approximate algorithm for the Euclidean TSP which guarantees that the solution found is no more than 3/2 as long as the optimum tour, was found by - N. Christofides, "Worst case analysis of a new heuristic for the travelling salesman problem," Technical Report, Graduate School of Industrial Administration, Carnegie-Mellon University, Pittsburgh, 1976. The minimum spanning tree algorithm is due to - R. C. Prim, "Shortest connection networks and some generalizations," Bell System Tech. J. 36 (1957), 1389-1401. The probabilistic algorithm for the Hamilton path problem can be found in --- 130 #################### File: Algorithms%20and%20Complexity%20-%20Herbert%20S.%20Wilf%20%28PDF%29.pdf Page: 135 Context: # 5.7 Backtracking (II): Graph Coloring D. Angluin and L. G. Valiant, *Fast probabilistic algorithms for Hamilton circuits and matchings*, Proc. Ninth Annual ACM Symposium on the Theory of Computing, ACM, New York, 1977. The result that the graph coloring problem can be done in constant average time is due to H. W. Wilf, *Backtrack: An O(1) average time algorithm for the graph coloring problem*, Information Processing Letters, 18 (1994), 119-122. Further refinements of the above result can be found in E. Bender and H. S. Wilf, *A theoretical analysis of backtracking in the graph coloring problem*, Journal of Algorithms, 6 (1985), 275-282. If you enjoyed the average numbers of independent sets and average complexity of backtrack, you might enjoy the subject of random graphs. An excellent introduction to the subject is Edgar M. Palmer, *Graphical Evolution: An introduction to the theory of random graphs*, Wiley-Interscience, New York, 1985. #################### File: Algorithms%20and%20Complexity%20-%20Herbert%20S.%20Wilf%20%28PDF%29.pdf Page: 136 Context: # Index - adjacent 40 - Adleman, L. 149, 164, 165, 176 - Alo, A. V. 103 - Anguita, D. 209-211, 227 - Appel, K. 69 - average complexity 57, 211f. - backtracking 211f. - Bender, E. 227 - Bentley, J. L. 54 - Berger, R. 3 - big O 9 - binary system 19 - bin-packing 178 - binomial theorem 37 - bipartite graph 44, 182 - binomial coefficients 35 - growth of 33 - blocking flow 124 - Burnside's lemma 46 - cardinality 35 - canonical factorization 138 - capacity of a cut 115 - Carmichael numbers 155 - certificate 171, 182, 193 - Chenskasy, B. V. 135 - Chinese remainder theorem 154 - chromatic number 44 - chromatic polynomial 73 - Cohen, H. 176 - coloring graphs 43 - complement of a graph 44 - complexity 1 - worst-case 4 - connected 41 - Cook, S. 187, 194-201, 226 - Cook's theorem 195f. - Cooley, J. W. 103 - Coppersmith, D. 99 - cryptography 165 - Cristofides, N. 224, 227 - cut in a network 115 - capacity of 115 - cycle 61 - cyclic group 152 - decimal system 19 - decision problem 181 - degree of a vertex 40 - deterministic 193 - Diffie, W. 176 - digitalis 105 - Divine, D. 103, 134 - divide 137 - Dixon, J. D. 170, 175, 177 - domino problem 3 - ‘easy’ computation 1 - edge coloring 206 - edge connectivity 132 #################### File: Algorithms%20and%20Complexity%20-%20Herbert%20S.%20Wilf%20%28PDF%29.pdf Page: 138 Context: ```markdown # Index - **k-subset** 35 - **language** 132 - **Lawler, E.** 99 - **layered network** 120f - **Lenstra, H. W., Jr.** 176 - **Levyque, W. J.** 175 - **Lewis, P. A. W.** 103 - **Lewis, P. M.** 227 - **L'Hôpital's rule** 12 - **Little, O.** 54 ## Network - **network** 105 - **flow** 105f - **dense** 107 - **layered** 108, 120f - **height** 125 - **Nijenhuis, A.** 60 - **nondeterministic** 193 - **NP** 182 - **NP-complete** 61, 180 - **NP-completeness** 178f - **octal system** 21 - **optimization problem** 181 - **orders of magnitude** 6f ## P - **P** 12 - **Palmer, E. M.** 228 - **Pav, V.** 103 - **Pascal’s triangle** 36 - **path** 41 - **predicate function** 87 - **polynomial time** 2, 179, 185 - **polynomials, multiplication of** 96 - **Ponomarev, C.** 143, 164, 176 - **positional number systems** 19f - **Pramodh-Kumar, M.** 108f, 135 - **Pratt, V.** 171, 172 - **Prim, R. C.** 227 - **primality testing** 148f, 186 - **routing** 179 - **prime number** 2 - **primitive root** 152 - **pseudorandomity test** 149, 156ff - **strong** 158 - **public key encryption** 150, 165 - **Quicksort** 50f - **Rabin, M. O.** 149, 162, 175 - **Ralston, A.** 103 ``` #################### File: Algorithms%20and%20Complexity%20-%20Herbert%20S.%20Wilf%20%28PDF%29.pdf Page: 139 Context: ``` # Index - **recurrence relations** 26/f - **recurrent inequality** 31 - **recursive algorithms** 48/f - **reducibility** 135 - **relatively prime** 138 - **ring** 21, 151 - **Rivet, R.** 165, 176 - **roots of unity** 86 - **Rosenkrantz, D.** 227 - **RSA system** 165, 168 - **Rumely, R.** 149, 164, 176 - **Runge, C.** 103 ## SAT - **satisfiability** 187, 195 - **second vertex** 111 - **Schöning, A.** 103 - **Selinger, J.** 176 - **Shamir, A.** 165, 176 - **slowart** 50 - **Solow, R.** 149, 162, 176 - **splitter** 52 - **Stearns, R. E.** 227 - **Stirling's formula** 16, 216 - **Strassen, V.** 73, 103, 149, 162, 176 - **synthetic division** 86 ## 3SAT - **target sum** 206 - **Tajima, R. E.** 66, 70, 103, 135 - **Θ (Theta of)** 10 - **tiling** 2 - **tractable** 5 - **travelling salesman problem** 178, 184, 221 - **tree** 45 - **Tropowski, A.** 66, 103 - **TSP** 178, 201 - **Tukey, J. W.** 103 - **Turing, A.** 226 - **Turing machine** 187/f - **Ullman, J. D.** 103 - **usable edge** 111 - **Valiant, L.** 208-11, 227 - **vertices** 40 - **Wizig, V.** 206 - **Wagstaff, S.** 176 - **Welch, P. D.** 103 - **Wills, H. G.** 103, 227, 228 - **Winograd, S.** 99 - **worst-case** 4, 180 - **Wright, E. M.** 175 ``` #################### File: Algebraic%20Topology%20AT-toc.pdf Page: 1 Context: # Algebraic Topology ## Allen Hatcher Copyright © 2001 by Allen Hatcher Paper or electronic copies for noncommercial use may be made freely without explicit permission from the author. All other rights reserved. Image Analysis: ### Analysis of Visual Content #### 1. Localization and Attribution - **Image 1**: - Position: This is the only image on the page, located centrally. #### 4. Text Analysis - **Image 1**: - **Detected Text**: - Title: "Algebraic Topology". - Author: "Allen Hatcher". - Copyright Notice: - "Copyright © 2001 by Allen Hatcher". - "Paper or electronic copies for noncommercial use may be made freely without explicit permission from the author. All other rights reserved." - **Content Significance**: - The title indicates that the document focuses on "Algebraic Topology," a branch of mathematics. - The author’s name, "Allen Hatcher," identifies the individual responsible for the work. - The copyright notice provides information regarding the legal use of the material, specifying that copying for noncommercial purposes is permitted. #### 6. Product Analysis - **Image 1**: - **Main Features**: - **Illustration**: A central geometric design likely indicates a topological or mathematical concept, typical in academic and educational publications. - **Materials and Colors**: The illustration uses intersecting loops in blue and red hues, creating an appealing pattern. - **Comparison**: There is only one design element, so internal comparison isn’t applicable here. #### 8. Color Analysis - **Image 1**: - **Color Composition**: - Dominant Colors: Blue and red, used in the central geometric pattern. - Impact: The use of blue and red draws attention to the geometric design, which is intricate and visually stimulating. #### 9. Perspective and Composition - **Image 1**: - **Perspective**: The image is presented from a front-on, flat perspective, typical for book covers. - **Composition**: - The geometric design is central and symmetrical. - The title and author's name are positioned above the design, with the copyright information below. - The design and text are framed by a blue border, providing structure and focus. #### 10. Contextual Significance - **Image 1**: - **Overall Contribution**: - The image serves as the cover of a textbook on "Algebraic Topology." - The geometric design visually represents mathematical complexity, aligning with the book’s subject. - The clean, structured layout and professional design establish the document as an academic publication. #### 13. Process Flows - Not Applicable: There are no process flows depicted in the image. #### 14. Process Descriptions - Not Applicable: There are no process descriptions in the image. ### Conclusion This image serves as an academic book cover for "Algebraic Topology" by Allen Hatcher. The design elements, color composition, and structured layout emphasize its educational purpose, visually reflecting the abstract and complex nature of the subject matter. #################### File: Algebraic%20Topology%20AT-toc.pdf Page: 2 Context: I'm unable to view images. Please provide the text that you would like to be formatted in Markdown, and I'll be happy to help! Image Analysis: Based on the aspects provided, here is a comprehensive examination of the attached visual content: **1. Localization and Attribution:** - The image occupies the entirety of the provided space. It can be numbered as Image 1. **2. Object Detection and Classification:** - **Image 1:** - **Objects Detected:** - A person. - A large screen/projector behind the person. - A clock on the wall. - Three smaller screens or panels below the large screen. - A speaker or microphone setup on the podium. - A laptop on the podium. - **Classification by Category:** - Person: Human. - Screen/Projector: Electronic device. - Clock: Timekeeping device. - Screens/Panels: Electronic display devices. - Speaker/Microphone: Audio equipment. - Laptop: Computing device. **3. Scene and Activity Analysis:** - **Image 1:** - **Scene Description:** - The scene takes place in what appears to be a conference room or lecture hall. - The person is standing at a podium, presumably giving a presentation. - **Activities Taking Place:** - The main actor, a person, is engaged in speaking or presenting information to an audience. - The person appears to be using a laptop, possibly to control a presentation on the large screen behind them. **4. Text Analysis:** - **Image 1:** - There is no visible text in the image based on the provided resolution and image quality. **8. Color Analysis:** - **Image 1:** - **Dominant Colors:** - Predominantly neutral colors like white and gray for the walls and background. - The podium and the person's attire include darker shades like black and gray. - The large screen in the background is turned off, showing a dark color. - **Impact on Perception:** - The use of neutral and dark colors keeps the focus on the person presenting. **9. Perspective and Composition:** - **Image 1:** - **Perspective:** - The image is taken from a viewpoint that is at the audience level, facing toward the presenter. - This perspective gives the sense of being part of the audience. - **Composition:** - The composition places the presenter at the center. - The large screen behind the presenter acts as the background, with additional visual elements like a clock and smaller screens filling the side spaces. **14. Ablaufprozesse (Process Flows):** - **Image 1:** - No specific process flows are depicted directly in the image. **15. Prozessbeschreibungen (Process Descriptions):** - **Image 1:** - The main process described here involves a presentation setup, with the presenter utilizing electronic equipment to communicate information. **16. Typen Bezeichnung (Type Designations):** - **Image 1:** - The types of equipment include Audio-Visual equipment (screen, laptop, microphones) and timekeeping devices (clock). **17. Trend and Interpretation:** - **Image 1:** - The trend seems to indicate a professional or educational setting where technology is integrated to facilitate presentations and lectures. **19. Tables:** - **Image 1:** - There are no tables in the image to analyze. The image provides a focused look at a presentation scene in a formal setting. The arrangement of elements and the color palette underscore the importance of the presenter and the information being shared. #################### File: Algebraic%20Topology%20AT-toc.pdf Page: 4 Context: # Chapter 2. Homology . . . . . . . . . . . . . . . . . . . . 97 ## 2.1. Simplicial and Singular Homology . . . . . . . . . 102 - Δ-Complexes 102 - Simplicial Homology 104 - Singular Homology 108 - Homotopy Invariance 110 - Exact Sequences and Excision 113 - The Equivalence of Simplicial and Singular Homology 128 ## 2.2. Computations and Applications . . . . . . . . . . 134 - Degree 134 - Cellular Homology 137 - Mayer-Vietoris Sequences 149 - Homology with Coefficients 153 ## 2.3. The Formal Viewpoint . . . . . . . . . . . . . . . 160 - Axioms for Homology 160 - Categories and Functors 162 ### Additional Topics - **2.A**. Homology and Fundamental Group 166 - **2.B**. Classical Applications 169 - **2.C**. Simplicial Approximation 177 # Chapter 3. Cohomology . . . . . . . . . . . . . . . . . . 185 ## 3.1. Cohomology Groups . . . . . . . . . . . . . . . . 190 - The Universal Coefficient Theorem 190 - Cohomology of Spaces 197 ## 3.2. Cup Product . . . . . . . . . . . . . . . . . . . 206 - The Cohomology Ring 212 - A Künneth Formula 214 - Spaces with Polynomial Cohomology 220 ## 3.3. Poincaré Duality . . . . . . . . . . . . . . . . 230 - Orientations and Homology 233 - The Duality Theorem 239 - Connection with Cup Product 249 - Other Forms of Duality 252 ### Additional Topics - **3.A**. Coefficients for Homology 261 - **3.B**. The General Künneth Formula 268 - **3.C**. H-Spaces and Hopf Algebras 281 - **3.D**. The Cohomology of \( S^0(n) \) 292 - **3.E**. Bockstein Homomorphisms 321 - **3.F**. Limits and Ext 311 - **3.G**. Local Coefficients 327 #################### File: Algebraic%20Topology%20AT-toc.pdf Page: 6 Context: # Preface This book was written to be a readable introduction to algebraic topology with rather broad coverage of the subject. The viewpoint is quite classical in spirit, and stays well within the confines of pure algebraic topology. In a sense, the book could have been written thirty or forty years ago since virtually everything in it is at least that old. However, the passage of the intervening years has helped clarify what are the most important results and techniques. For example, CW complexes have proved over time to be the most natural class of spaces for algebraic topology, so they are emphasized here much more than in the books of an earlier generation. This emphasis also illustrates the book's general slant towards geometric, rather than algebraic, aspects of the subject. The geometry of algebraic topology is so pretty, it would seem a pity to slight it and to miss all the intuition it provides. At the elementary level, algebraic topology separates naturally into the two broad channels of homology and homotopy. This material is here divided into four chapters, roughly according to increasing sophistication, with homotopy split between Chapters 1 and 4, and homology and its mirror variant cohomology in Chapters 2 and 3. These four chapters do not have to be read in this order, however. One could begin with homology and perhaps continue with cohomology before turning to homotopy. In the other direction, one could postpone homology and cohomology until after parts of Chapter 4. If this latter strategy is pushed to its natural limit, homology and cohomology can be developed just as branches of homotopy theory. Appealing as this approach is from a strictly logical point of view, it places more demands on the reader, and since readability is one of the first priorities of the book, this homotopic interpretation of homology and cohomology is described only after the latter theories have been developed independently of homotopy theory. Preceding the four main chapters there is a preliminary Chapter 0 introducing some of the basic geometric concepts and constructions that play a central role in both the homological and homotopical sides of the subject. This can either be read before the other chapters or skipped and referred back to later for specific topics as they become needed in the subsequent chapters. Each of the four main chapters concludes with a selection of additional topics that the reader can sample at will, independent of the basic core of the book contained in the earlier parts of the chapters. Many of these extra topics are in fact rather important in the overall scheme of algebraic topology, though they might not fit into the time #################### File: Algebraic%20Topology%20AT-toc.pdf Page: 8 Context: # Preface Eilenberg and Zilber in 1950 under the name of semisimilpicial complexes. Soon after this, additional structure in the form of certain 'degeneracy maps' was introduced, leading to a very useful class of objects that came to be called semisimplical sets. The semisimplical complexes of Eilenberg and Zilber then became 'semisimplical sets', but in this book, we have chosen to use the shorter term 'd-complex'. This book will remain available online in electronic form after it has been printed in the traditional fashion. The web address is [http://www.math.cornell.edu/~hatcher](http://www.math.cornell.edu/~hatcher) One can also find here the parts of the other two books in the sequence that are currently available. Although the present book has gone through countless revisions, including the correction of many small errors both typographical and mathematical found by careful readers of earlier versions, it is inevitable that some errors remain, so the web page includes a list of corrections to the printed version. With the electronic version of the book, it will be possible not only to incorporate corrections but also to make more substantial revisions and additions. Readers are encouraged to send comments and suggestions as well as corrections to the email address posted on the web page. ## Note on the 2015 reprinting A large number of corrections are included in this reprinting. In addition, there are two places in the book where the material was rearranged to an extent requiring renumbering of theorems, etc. In §3.2 starting on page 210, the renumbering is the following: | old | 3.11 | 3.12 | 3.13 | 3.14 | 3.15 | 3.16 | 3.17 | 3.18 | 3.19 | 3.20 | 3.21 | |-----|------|------|------|------|------|------|------|------|------|------|------| | new | 3.16 | 3.19 | 3.14 | 3.11 | 3.13 | 3.15 | 3.20 | 3.16 | 3.17 | 3.21 | 3.18 | In §4.1 the following renumbering occurs in pages 352-355: | old | 4.13 | 4.14 | 4.15 | 4.16 | 4.17 | |-----|------|------|------|------|------| | new | 4.17 | 4.13 | 4.14 | 4.15 | 4.16 | #################### File: Algebraic%20Topology%20AT-toc.pdf Page: 9 Context: # Standard Notations **Z, Q, R, C, H, O** : the integers, rationals, reals, complexes, quaternions, and octonions. - **Zn** : the integers mod n. - **Rn** : n-dimensional Euclidean space. - **Cn** : complex n-space. In particular, **R^0 = {0} = C^0**, zero-dimensional vector spaces. - **I = [0, 1]** : the unit interval. - **Sn** : the unit sphere in **R^(n+1)**, all points of distance 1 from the origin. - **Dn** : the unit disk or ball in **R^n**, all points of distance ≤ 1 from the origin. - **∂Dn = Sn-1** : the boundary of the n-disk. - **en** : an n-cell, homeomorphic to the open n-disk **Dn - ∂Dn**. In particular, **D^0** and **e^0** consist of a single point since **R^0 = {0}**. But **S^0** consists of two points since it is **∂D^1**. - **1** : the identity function from a set to itself. - **|S|** : disjoint union of sets or spaces. - **×, ∏** : product of sets, groups, or spaces. - **≅** : isomorphism. - **A ⊂ B** or **B ⊃ A** : set-theoretic containment, not necessarily proper. - **A ↪ B** : the inclusion map **A → B** when **A ⊂ B**. - **A - B** : set-theoretic difference, all points in **A** that are not in **B**. - **iff** : if and only if. There are also a few notations used in this book that are not completely standard. The union of a set **X** with a family of sets **Yi**, with **i** ranging over some index set, is usually written simply as **X ∪ Yi** rather than something more elaborate such as **X ∪ (∪i Yi)**. Intersections and other similar operations are treated in the same way. Definitions of mathematical terms are given within paragraphs of text, rather than displayed separately like theorems. These definitions are indicated by the use of **boldface** type for the more important terms, with italics being used for less important or simpler definitions as well as simple emphasis as in standard written prose. Terms defined using boldface appear in the Index, with the page number where the definition occurs listed first. #################### File: An%20Introduction%20to%20the%20Theory%20of%20Numbers%20-%20Leo%20Moser%20%28PDF%29.pdf Page: 1 Context: # The Trillia Lectures on Mathematics ## An Introduction to the Theory of Numbers 978-1-937-75001-1 #################### File: An%20Introduction%20to%20the%20Theory%20of%20Numbers%20-%20Leo%20Moser%20%28PDF%29.pdf Page: 3 Context: # Copyright Notice An Introduction to the Theory of Numbers © 1967 Leo MosER Distributed under a Creative Commons Attribution 4.0 International (CC BY 4.0) license. Informally, this license allows you to: - Share: copy and redistribute the material in any medium or format - Adapt: remix, transform, and build upon the material for any purpose, even commercially, under the following conditions: - **Attribution**: You must give appropriate credit, provide a link to the license, and indicate if changes were made. You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use. - **No additional restrictions**: You may not apply legal terms or technological measures that legally restrict others from doing anything the license permits. Full license terms at: [http://creativecommons.org/licenses/by/4.0/legalcode](http://creativecommons.org/licenses/by/4.0/legalcode) Published by The Trilla Group, West Lafayette, Indiana, USA ISBN 1-58901-114-1 First published: March 1, 2001. This version revised: July 31, 2011. The publisher "The Trilla Group" and The Trilla Group logo are trademarks of The Trilla Group. This book was prepared by William MosER from a typescript by Leo MosER. We thank Siwan Gunturo, Joseph Lipman, and Mark Hudson for proofreading parts of the manuscript. We intend to correct and update the work as needed. If you notice any mistakes in this work, please send email to Bradley Lucier (lucier@math.purdue.edu) and they will be corrected in a later version. --- # Contents - Preface .............................................................................. v - Chapter 1. Compositions and Partitions ............................... 1 - Chapter 2. Arithmetic Functions ......................................... 7 - Chapter 3. Distribution of Primes ...................................... 17 - Chapter 4. Irrational Numbers ............................................ 37 - Chapter 5. Congruences ..................................................... 43 - Chapter 6. Diophantine Equations ...................................... 53 - Chapter 7. Combinatorial Number Theory ........................... 59 - Chapter 8. Geometry of Numbers ....................................... 69 - Classical Unsolved Problems ............................................. 73 - Miscellaneous Problems .................................................... 75 - Unsolved Problems and Conjectures .................................... 83 #################### File: An%20Introduction%20to%20the%20Theory%20of%20Numbers%20-%20Leo%20Moser%20%28PDF%29.pdf Page: 4 Context: # Preface These lectures are intended as an introduction to the elementary theory of numbers. I use the word “elementary” both in the technical sense—complex variable theory is to be avoided—and in the usual sense—that of being easy to understand, I hope. I shall not concern myself with questions of foundations and shall presuppose familiarity only with the most elementary concepts of arithmetic, i.e., elementary divisibility properties, e.g., (greatest common divisor), l.c.m. (least common multiple), essentially unique factorization into primes and the fundamental theorem of arithmetic: if \( p \mid ab \) then \( p \mid a \) or \( p \mid b \). I shall consider a number of rather distinct topics each of which could easily be the subject of 15 lectures. Hence, I shall not be able to penetrate deeply in any direction. On the other hand, it is well known that in number theory, more than in any other branch of mathematics, it is easy to reach the frontiers of knowledge. It is easy to propound problems in number theory that are unsolved. I shall mention many of these problems; but the trouble with the natural problems of number theory is that they are either too easy or much too difficult. I shall therefore try to expose some problems that are of interest and unsolved but for which there is at least a reasonable hope for a solution by you or me. The topics I hope to touch on are outlined in the Table of Contents, as are some of the main reference books. Most of the material I want to cover will consist of old theorems proved in old ways, but I also hope to produce some old theorems proved in new ways and some new theorems proved in old ways. Unfortunately I cannot produce many new theorems proved in really new ways. #################### File: An%20Introduction%20to%20the%20Theory%20of%20Numbers%20-%20Leo%20Moser%20%28PDF%29.pdf Page: 5 Context: # Chapter 1 ## Compositions and Partitions We consider problems concerning the number of ways in which a number can be written as a sum. If the order of the terms in the sum is taken into account, the sum is called a **composition** and the number of compositions of \( n \) is denoted by \( c(n) \). If the order is not taken into account, the sum is a **partition** and the number of partitions of \( n \) is denoted by \( p(n) \). Thus, the compositions of \( 3 \) are: - \( 3 \) - \( 3 = 1 + 2 \) - \( 3 = 2 + 1 \) - \( 3 = 1 + 1 + 1 \) so that \( c(3) = 4 \). The partitions of \( 3 \) are: - \( 3 \) - \( 3 = 2 + 1 \) - \( 3 = 1 + 1 + 1 \) so \( p(3) = 3 \). There are essentially three methods of obtaining results on compositions and partitions: first by purely combinatorial arguments, second by algebraic arguments with generating series, and finally by analytic operations on the generating series. We shall discuss only the first two of these methods. We consider first compositions, these being easier to handle than partitions. The function \( c(n) \) is easily determined as follows. Consider \( n \) written as a sum of \( 1 \)'s. We have \( n - 1 \) spaces between them and in each of the spaces we can insert a slash, yielding \( 2^{n-1} \) possibilities corresponding to the \( (n-1)^{\text{th}} \) composition of \( n \). For example: \[ c(3) = 3 = 1 + 1 + 1, \quad 3 = 1 + 2, \quad 3 = 2 + 1 \] Just to illustrate the algebraic method in this rather trivial case we consider: \[ \sum_{n=1}^{\infty} c(n)x^n \] It is easily verified that: \[ \sum_{n=1}^{\infty} c(n)x^n = \frac{1}{(1 - x)^2} = \sum_{m=0}^{\infty} (m + 1)x^m \] #################### File: An%20Introduction%20to%20the%20Theory%20of%20Numbers%20-%20Leo%20Moser%20%28PDF%29.pdf Page: 10 Context: 10 # Chapter 2: Arithmetic Functions ## Chapter 2: Arithmetic Functions We can be used as alternative definitions. We prove the most important of these, namely $$ \sum_{d|n} \mu(d) = \begin{cases} 1 & \text{if } n = 1 \\ 0 & \text{if } n \neq 1 \end{cases} $$ Since \( \mu(n) = 0 \) if \( n \) contains a squared factor, it suffices to suppose that \( n \) has no such factor, i.e., \( n = p_1^{a_1} p_2^{a_2} \cdots \). For such an \( n > 1 \), $$ \sum_{d|n} \mu(d) = \left( -1 \right)^{k} + \binom{k}{1} (-1)^{k-1} + \cdots + (-1)^{1} = 0. $$ By definition \( \mu(1) = 1 \) so the theorem is proved. If we sum this result over \( n = 1, 2, \ldots, x \), we obtain $$ \sum_{n \leq x} \mu(d) = 1, $$ which is another defining relation. Another very interesting defining property, the proof of which I shall leave as an exercise, is that if $$ M(z) = \sum_{n \geq 1} \mu(d) $$ then $$ \sum_{d|n} \frac{1}{d} = 1. $$ This is perhaps the most elegant definition of \( \mu \). Still another very important property is that $$ \left( \sum_{n = 1}^{\infty} \frac{1}{n} \right) \left( \sum_{n \geq 1} \frac{\mu(n)}{n^s} \right) = 1. $$ We now turn our attention to Dirichlet multiplication and series. Consider the set of arithmetic functions. These can be combined in various ways to give new functions. For example, we could define \( f + g \) by $$ (f + g)(n) = f(n) + g(n) $$ and $$ (f \cdot g)(n) = f(n) \cdot g(n). $$ A less obvious mode of combination is given by \( f \times g \), defined by $$ (f \times g)(n) = \sum_{d|n} f\left(\frac{n}{d}\right) g(d). $$ This may be called the Dirichlet product or Dirichlet convolution. The motivation for this definition is as follows. If $$ F(s) = \sum_{n=1}^{\infty} f(n)n^{-s}, \quad G(s) = \sum_{n=1}^{\infty} g(n)n^{-s}, \quad \text{and} \quad F(s) \cdot G(s) = \sum_{n=1}^{\infty} (f \times g)(n) n^{-s}, $$ then it is readily checked that \( F = G \). Thus Dirichlet multiplication of arithmetic functions corresponds to the ordinary multiplication of the corresponding Dirichlet series: $$ f \times g = g \times f, \quad (f \times g)(x) = f(x) \cdot g(x), $$ i.e., our multiplication is commutative and associative. A purely arithmetic proof of these results is easy to supply. Let us now define the function $$ \ell(s) = (n)^{1.0,0,\ldots}. $$ It is seen that \( f \times \ell = f \). Thus the function \( \ell \) is the unity of our multiplication. It can be proved without difficulty that if \( f(1) \neq 0 \), then \( f \) has an inverse with respect to \( \cdot \). Such functions are called regular. Thus the regular functions form a group with respect to the operation \( \times \). Another theorem, whose proof we shall omit, is that the Dirichlet product of multiplicative functions is again multiplicative. We now introduce the functions $$ \ell^1, \ell^2, \ell^3, \ldots $$ It is interesting that, starting only with the functions \( f \) and \( \ell \), we can build up many of the arithmetic functions and their important properties. To begin with we define \( \rho(n) \) by \( \rho(1) = 1 \). This means, of course, that $$ \mu \times \ell(d) = \rho(n), $$ and we have already seen that this is a defining property of the \( \mu \) function. We can define \( \sigma_k \) by $$ \sigma_k(n) = \sum_{d|n} d^{k-1}. $$ This means that $$ \sigma_k(n) = \sum_{d|n} (d \cdot 1), $$ which corresponds to our earlier definition. Special cases are $$ \tau = \ell_0 \times \ell_1 \quad \text{and} \quad \sigma_0 = \ell \times \ell_1. $$ #################### File: An%20Introduction%20to%20the%20Theory%20of%20Numbers%20-%20Leo%20Moser%20%28PDF%29.pdf Page: 14 Context: # Chapter 3: Distribution of Primes ## Lemma If \( R(x) \) exists then \[ \lim_{x \to \infty} \frac{R(x)}{x} = 0. \] ### Proof. \[ R(x) = 1(R(1) - R(0)) + 2(R(2) - R(1)) + \cdots + x(R(x) - R(x-1)), \] or \[ \frac{R(x)}{x} = R(1) - R(0) + R(1) + \cdots + R(x - 1). \] Since \( R(x) \) approaches a limit, the expression within the square brackets approaches this limit and the lemma is proved. In what follows we assume that the \( p \)'s are the primes. To prove that \( \sum_{p} \frac{1}{p} \) diverges, we will assume the opposite, i.e., \( \sum_{p} \frac{1}{p} \) converges (and hence also that \( \frac{1}{p} \to 0 \)). By our assumption there exists an \( n \) such that \[ \sum_{p \leq n} \frac{1}{p} < \frac{1}{2} \tag{1} \] But now this is fixed so there will also be an \( m \) such that \[ \frac{R(m)}{m} < \frac{1}{2m} \tag{2} \] With such an \( m \) and we form the numbers \( T_n = n! - 1, T_{n} = 2n! - 1, \ldots, T_m = mn! - 1 \). Note that none of the \( T_n \)'s have prime factors \( p \) such that \( p \mid T_j \) and \( p \mid T_i \) for \( i \neq j \). In other words, the multiples of \( p \) are apart in our set of numbers. Hence note that \( \frac{n}{p} + 1 \geq 2m \) or \[ \sum_{p \leq n} \frac{n}{p} \geq 1. \] But now by (1) and (2) we find that \( m \) should be \( < 1 \) and we have a contradiction, which proves our theorem. Euler's proof, which is more significant, depends on his very important identity \[ \zeta(s) = \sum_{n=1}^{\infty} \frac{1}{n} \prod_{p} \frac{1}{1 - p^{-s}}. \] This identity is essentially an analytic statement of the unique factorization theorem. Formally, its validity can easily be seen. We have \[ \prod_{p} \frac{1}{1 - p^{-s}} = \prod_{p} \left( 1 + \frac{1}{p} + \frac{1}{p^2} + \cdots \right) = \left( 1 + \frac{1}{2} + \cdots \right) \left( 1 + \frac{1}{3} + \cdots \right) \left( 1 + \frac{1}{5} + \cdots \right) \cdots \] which converges to \[ \frac{1}{1 - \frac{1}{2}} + \frac{1}{2} + \frac{1}{3} + \cdots. \] Euler now argued that for \( s \geq 1 \), \[ \sum_{n=1}^{\infty} \frac{1}{n} = \infty \] so that \[ \prod_{p} \frac{1}{1 - \frac{1}{p}} \] must be infinite, which in turn implies that \( \sum_{p} \frac{1}{p} \) must be infinite. This argument, although not quite valid, can certainly be made valid. In fact, it can be shown without much difficulty that \[ \sum_{n \leq x} \frac{1}{n} \prod_{p} \left( (1 - \frac{1}{p})^{-1} \right) \] is bounded. Since \( \sum_{n \leq x} \frac{1}{n} \) is bounded, we can, on taking logs, obtain \[ \log \log x - \log \left( 1 - \frac{1}{p} \right) + O(1). \] We shall use this result later. #################### File: An%20Introduction%20to%20the%20Theory%20of%20Numbers%20-%20Leo%20Moser%20%28PDF%29.pdf Page: 17 Context: Thus, for even \( m \): \[ \pi(m) + 1 = \frac{m}{\log 2} \] and the result follows. We next obtain an estimate for \( S(x) = \sum_{p \leq x} \log p \). Taking the logarithm of \( n! = \prod_{p \leq n} p^{e_p} \), we find that \[ \log n > \sum_{p \leq n} e_p \log p > \sum_{p \leq n} \log p. \] The reader may justify that the error introduced in replacing \( e_p(n) \) by \( e_p \) (of course \( e_p(n) = \sum_{p \leq n} e_p \) is small enough that \[ \sum_{p \leq n} \log p = n \log n + O(n) \] or \[ \sum_{p \leq n} \frac{\log p}{p} = \log n + O(1). \] We can now prove: ### Theorem 4. \[ R(x) = \sum_{p \leq x} S(n) - S(n - 1) = \sum_{p \leq x} S(n) \frac{1}{\log n} + O(1) \] In fact, \[ R(x) = \sum_{p \leq x} S(n) - S(n - 1) = \sum_{p \leq x} S(n) \left( \frac{1}{\log n} - \frac{1}{\log(n + 1)} \right) + O(1) = \sum_{n=2}^{x} \frac{\log(n + 1)}{(\log n)(\log(n + 1))} + O(1) = \log log n + O(1). \] Thus, \( R(x) = \log x + O(1) \). We now outline the proof of Chebyshev's theorem. ### Theorem 5. If \( R(x) \sim \frac{\alpha}{\log x} \text{ then } c = 1 \). Since \[ R(x) = \sum_{n = 1}^{x} \frac{\pi(n)}{n} \] but we already know that \( \pi(n) \sim \frac{n}{\log n} \) as follows that \( c = 1 \). We next give a proof of Bertrand's Postulate developed about ten years ago (L. Moser). To make the proof go more smoothly we only prove the somewhat weaker: ### Theorem 6. For every integer \( r \) there exists a prime \( p \) with \[ 3 \cdot 2^{r - 1} < p < 3 \cdot 2^r. \] We restate several of our lemmas in the form in which they will be used. 1. If \( n < p < 2n \) then \( p \) occurs exactly once in \( \binom{n}{2} \). 2. If \( 2^r < p < 3 \cdot 2^{r - 1} \) then \( p \) does not occur in \( \frac{3 \cdot 2^r}{(3 \cdot 2^{r - 1})} \). 3. If \( p > 2^{r + 1} \) then \( p \) occurs at most once in \( \frac{3 \cdot 2^r}{(3 \cdot 2^{r - 1})} \). 4. No prime occurs more than \( 2r + 1 \) times in \( \frac{3 \cdot r}{(3 \cdot 2^{r - 1})} \). We now compare \[ \frac{3 \cdot 2^{2r - 1}}{(2^{r - 1})(3 \cdot 2^{r - 1})}. \] Assume that there is no prime in the range \( 3 \cdot 2^{r - 1} < p < 3 \cdot 2^r \). Then, for every prime that occurs in the first expression also occurs in the second with at least as high a multiplicity; that is, the second expression is not smaller than the first. On the other hand, observing that for \( r \geq 6 \): \[ 3 \cdot 2^{r} > 2^{r} + 2^{r - 1} + \ldots + 2^{r + 1} + 2 r(2^{r + 1} + 2^{r - 1} + \ldots + 2), \] #################### File: An%20Introduction%20to%20the%20Theory%20of%20Numbers%20-%20Leo%20Moser%20%28PDF%29.pdf Page: 18 Context: ``` # Chapter 3: Distribution of Primes 1. \( r \) and interpreting \( \binom{2n}{n} \) as the number of ways of choosing \( r \) objects from \( 2n \), we conclude that the second expression is indeed smaller than the first. This contradiction proves the theorem when \( r > 5 \). The results 7, 29, 97, 389, and 1543 show that the theorem is also true for \( r \leq 5 \). The proof of Bertrand's Postulate by this method is left as an exercise. Bertrand's Postulate may be used to prove the following results. 1. \(\frac{1}{n} \sum_{p \leq n} \frac{1}{p} \text{ is never an integer.}\) 2. Every integer \( > 6 \) can be written as the sum of distinct primes. 3. Every prime \( p_n \) can be expressed in the form \[ p_n = 2 + 3 + 5 + \cdots + p_{n-1} \] with an error of most 1 (Sierk). 4. The equation \( \pi(n) = \psi(n) \) has exactly 8 solutions. About 1949 a sensation was created by the discovery by Erdős and Selberg of an elementary proof of the Prime Number Theorem. The main new result was the following estimate, proved in an elementary manner: \[ \sum_{p \leq x} \log p \sim 2x \log x + O(x). \] Although Selberg's inequality is still far from the Prime Number Theorem, the latter can be deduced from it in various ways without recourse to any further number theoretical results. Several proofs of this lemma have been given, perhaps the simplest being due to Tzwarzow and Szelk. Selberg's original proof depends on consideration of the functions \[ \lambda_n = \mu_n = \sum_{d \mid d} \mu(d) \frac{1}{d^2} \] and \[ T(r) = \sum_{n=1}^{r} \lambda^2. \] Some five years ago J. Landeck and L. Moser showed that one could prove Selberg's lemma in a completely elementary way, i.e., using properties of integers only. One of the main tools for doing this is the following rational analogue of the logarithmic function. Let \[ h(r) = \frac{1}{1 + \frac{1}{2} + \frac{1}{3} + \cdots + \frac{1}{r}}. \] We prove in an quite elementary way that \[ |h(e) - h(c)| < \frac{1}{k}. \] The results we have established are useful in the investigation of the magnitudes of the arithmetic functions \( \sigma(n) \), \( \phi(n) \) and \( g(n) \). Since these depend not only on the magnitude of \( n \) but also strongly on the arithmetic structure of \( n \), we cannot expect to approximate them by the elementary functions of analysis. Nevertheless, we shall will see that “on average” these functions have a rather simple behavior. Let \( f \) and \( g \) be functions for which \[ f(1) + f(2) + \cdots + f(n) + g(1) + g(2) + \cdots + g(n), \] we say that \( f \) and \( g \) have the same average order. We will see, for example, that the average order of \( \sigma(n) \) is long, that of \( \phi(n) \) is \(\frac{n}{\log n}\). Let us consider first a purely heuristic argument for obtaining the average value of \( a(n) \). The probability that \( r \mid n \) and \( r \leq 1 \) contributes \( \left( \frac{1}{k} \right)^r \) to \( a(n) \). Thus the expected value of \( a(n) \) is \[ \frac{1}{T(r)} \left( \sum_{k=1}^{1} \frac{1}{k} + 1 + \frac{1}{k} \right). \] For \( k = 0 \) this will be about \( \log n \). For \( n \geq 1 \) it will be about \( n^{k}(k + 1) \), e.g., for \( n = 1 \) it will be about \( n(k^2) = n^2 + \frac{1}{k^2} \). Before proceeding to the proof and refinement of some of these results we consider some applications of the inversion of order of summation in certain double sums. Let \( f \) be an arithmetic function and associate with it the function \[ F(n) = \sum_{d \mid n} f(d) \] and \( g(n) = \sum_{d \mid n} f(d). \] We will obtain two expressions for \[ F(n) = \sum_{n=1}^{r} f(d). \] ``` #################### File: An%20Introduction%20to%20the%20Theory%20of%20Numbers%20-%20Leo%20Moser%20%28PDF%29.pdf Page: 20 Context: ``` # Chapter 3: Distribution of Primes We consider the lattice point \((x, y)\), \(x > 0\), \(y > 0\), which lies on some hyperbola \(r = r\), \(s < n\). Hence, \[ \sum_{r=1}^{n} r(r) \] is the number of lattice points in the region \(y \leq n\), \(x > 0\), \(y > 0\). If we sum along vertical lines \(x = 1, 2, \ldots\), we obtain again \[ \tau(1) + \tau(2) + \ldots + \tau(n) = \left\lfloor \frac{n}{2} \right\rfloor + \left\{ \frac{n}{2} \right\} + \ldots + \left\lfloor \frac{n}{n} \right\rfloor. \] In this approach, the symmetry of \(y = n\) about \(x = y\) suggests how to improve this estimate and obtain a smaller error term. ### Figure 1 \[ \begin{array}{c} y = \sqrt{n} \\ y = 1 \\ x = 1 \\ x = \sqrt{n} \end{array} \] Using the symmetry of the above figure, we have, with \(h(n) = 1 + \frac{1}{2} + \ldots + \frac{1}{n}\), \[ \sum_{r=1}^{n} r(r) = 2 \left( \left( \frac{1}{1} + \frac{1}{2} + \ldots + \frac{1}{n} \right) \right) - u^2. \] Calculating, \[ \sum_{r = 1}^{n} r(r) = 2h(n) - n + O(\sqrt{n}), \] we find \[ \alpha(1) + \alpha(2) + \ldots + \alpha(n) = 1 + \frac{1}{2} + \ldots + \frac{1}{n}. \] Thus, we have immediately \[ \alpha(1) + \alpha(2) + \ldots + \alpha(c) = \frac{1}{2} \sum_{j=1}^{c} \left[ \left\lfloor \frac{n}{j} \right\rfloor + |j| \right]. \] To obtain similar estimates for \(\psi(r)\), we note that \(\psi(r)\) is the number of lattice points that can be seen from the line segment \(x = 0\), \(y < r\), and can be seen from the origin. (A point \((x,y)\) can be seen if \((y - 1) \in \mathbb{Z}\)). Thus, \(\psi(r)\) is the number of visible lattice points in the region with \(x > y > 0\). Let us consider a much more general problem, namely to estimate the number of visible lattice points in a large class of regions. Heuristically, we may argue as follows. A point \((x,y)\) is invisible by virtue of the prime \(p\) if \(p | j\). The probability that this occurs is \(\frac{1}{2}\). Hence the probability that the point is invisible is \[ \prod_{p} \left( 1 - \frac{1}{p} \right) \prod_{p} \left( 1 + \frac{1}{p} + \ldots \right) - 1 \approx \frac{6}{\pi^2}. \] Thus, the number of visible lattice points should be \(4\) times the area of the region. In particular, the average order of \(\phi(r)\) should be about \(\frac{1}{\phi(n)}\). Now we notice a point of the fact that it can estimate the fraction of visible lattice points contained in the region is approximately \(\frac{1}{4}\). Let \(R\) be a region in the plane having finite Jordan measure and finite perimeter. Let \(M(r)\) be the area of \(R\), \(L(R)\) the number of lattice points in \(R\), and \(V(r)\) the number of visible lattice points in \(R\). Applying the inversion formula to \[ L(R) = M(R) + O(e) \quad \text{and} \quad M(r) = 2M(R). \] Thus, we get \[ L(r) = M(R) + V(R) + \left( \frac{1}{2} + \frac{1}{\sqrt{n}} \right). \] ``` #################### File: An%20Introduction%20to%20the%20Theory%20of%20Numbers%20-%20Leo%20Moser%20%28PDF%29.pdf Page: 23 Context: # Chapter 4 ## Irrational Numbers The best known of all irrational numbers is \(\sqrt{2}\). We establish \(\sqrt{2} \neq \frac{a}{b}\) with a novel proof which does not make use of divisibility arguments. Suppose \(\sqrt{2} = \frac{a}{b}\) (where \(a, b\) are integers), with \(b\) as small as possible. Then \(0 < a < 2b\) so that \[ 2ab = a^2 \Rightarrow 2b^2 = a^2 \Rightarrow 2 = \frac{a^2}{b^2} \] Thus, \[ \sqrt{2} = \frac{2b^2}{b^2 - a} \] But \(a < 2b\) and \(b < k\), hence we have a rational representation of \(\sqrt{2}\) with a denominator smaller than the smallest possible! To convince students of the existence of irrationals, one might begin with a proof of the irrationality of \(\log_2 2\). If \(\log_2 2 = \frac{e^{10}}{2 }\) or \(2 = 10^{k}\) for some integer \(k\), the left-hand side is divisible by \(5\) while the right-hand side is not. Also not as familiar as it should be is the fact that \(\cos(1°)\) is irrational. From \[ \cos 45° + i \sin 45° = \left(\cos 1° + i \sin 1°\right)^{45} \] we deduce that \(\cos(45°)\) can be expressed as a polynomial in integer coefficients in \(\cos(1°)\). Hence if \(\cos(1°)\) were rational, so would be \(\cos(45°)\). The fact that \[ c = 1 - \frac{1}{2} + \frac{1}{3} - \frac{1}{4} + \cdots \] is irrational can be proved in the same way as the irrationality of \(c\). In the latter case, assuming \(c\) rational, \[ c = e = 1 + \frac{1}{1!} + \frac{1}{2!} + \frac{1}{3!} + \cdots \] which, after multiplication by \(e\), would imply that \(e = c + \lfloor e \rfloor + \cdots\) is a positive integer less than \(1\). A slightly more complicated argument can be used to show that \(c\) is not of quadratic irrationality, i.e., that \(e\) and \(c\) are integers and \(c \neq 0\). However, a proof of the transcendentality of \(e\) is still not easy. The earlier method establishes that \(e\) is not constructible. #################### File: An%20Introduction%20to%20the%20Theory%20of%20Numbers%20-%20Leo%20Moser%20%28PDF%29.pdf Page: 26 Context: # Chapter 5 ## Congruences In this section we shall develop some aspects of the theory of divisibility and congruences. If $$ a = \prod p_i^{\alpha_i} \quad \text{and} \quad b = \prod p_i^{\beta_i} $$ then it is easily seen that $$(a, b) = \prod p_i^{min(\alpha_i, \beta_i)} \quad \text{while} \quad [a, b] = \prod p_i^{max(\alpha_i, \beta_i)}.$$ From these it follows easily that $(a, b) | a, b$. We leave it as an exercise to show that $$ (a, b) = \frac{1}{n} \sum_{d | n} 2^{k_d} \sigma(d). $$ The notation \( a \equiv b \mod m \) for \( (a, b) \) is due to Gauss. Rather obvious properties of this congruence are: if \( a \equiv b \), then \( a \) and \( b \) and \( b \equiv c \implies a \equiv c \) is an equivalence relation. It is also easily proved that \( a \equiv b \) and \( c \) together imply \( a \equiv b \) in particular if \( c \equiv a \equiv b \). However the converse is not true in general. Thus \( 2 \equiv 3 \equiv 4 \equiv 0 \) does not imply \( 2 \equiv 4 \) (mod 6). However, if \( (k, m) = 1 \) then \( k \equiv l \) does imply \( a \equiv b \). Another important result is the following. ### Theorem If \( a_1, a_2, \ldots, a_n \) form a complete residue system mod \( m \) then so does \( a_1, a_2, \ldots, a_n \) provided \( (a, m) = 1 \). **Proof.** We have \( m \) residues. If two of them are congruent \( a_i \equiv a_j \) then \( a_i \equiv 0 \). But \( (a, n) = 1 \) so that \( a \equiv a_j \). An application of these ideas is to the important Euler's theorem. ### Theorem If \( (m, n) = 1 \) then \( a^{\varphi(n)} \equiv 1 \, (\text{mod} \, m) \). **Proof.** Since \( a_1, a_2, \ldots, a_n \) are congruent to \( a_1, a_2, \ldots, a_n \) in some order, their products are congruent. Hence $$ a^{\varphi(n)} \equiv a^{\varphi(m+n)} \equiv a^{\varphi(n)}. $$ #################### File: An%20Introduction%20to%20the%20Theory%20of%20Numbers%20-%20Leo%20Moser%20%28PDF%29.pdf Page: 28 Context: ``` 6, 8, 9, 10. We shall prove that \( \varphi(n) < 1 \) for every composite \( n \neq 4 \). We can also prove that the average value of \( \varphi(n) \) is zero, i.e., \[ \lim_{N \to \infty} \frac{1}{N} \left( \varphi(1) + \varphi(2) + \cdots + \varphi(N) \right) = 0. \] Since \( \varphi(n) = 1 \) for \( n = 1 \) and \( n = p \) we consider only the case where \( n \) is composite. Suppose then that the unique prime factorization of \( n \) is given by \[ n = p_1^{k_1} p_2^{k_2} \cdots \] Consider separately the cases: 1. \( n \) has more than one prime divisor, and 2. \( n = p^k, \; k > 1 \). In case (1) we can write \[ n = a \cdot b, \; (a, b) = 1, \; a > b > 1. \] We now show that if \( f(a) = f(b) = 0 \) then \( f(0) = 0 \). **Proof.** Let \( f(a) = c_0 + c_1 a + c_2 a^2 + \cdots \). Then \[ 0 = f(a) \equiv 0 \; \text{mod} \; n \] and \[ 0 = f(b) \equiv 0 \; \text{mod} \; n. \] Now since \( (a, b) = 1 \) there exist \( x, y \) such that \( ax + by = 0 \) and \( c_0 = 0 \). In case (2) we can write \[ n = p^k \cdot l_p. \] We show that \( f(p^{-1}) = 0 \) and \( f(0) = 0 \) if \( f(p^{-1}) = 0, \; k = 2, 3, \ldots \). **Proof.** Since \( f(0) = 0 \), we have \[ f(x) = c_0 + c_1 x + c_2 x^2 + \ldots + c_k x^k, \] and \[ f(p^{-1}) \equiv c_0 + c_1 p^{-1} + c_2 p^{-2} \equiv 0 \; \text{(mod} \; p^k\text{)}, \] so that \( c_0 = 0 \; \text{mod} \; p \). But now \( f(p^{-1}) = 0 \) as required. --- ## On Relatively Prime Sequences Formed by Iterating Polynomials (Lambek and Moser) Bellman has recently posed the following problem. If \( p(x) \) is an irreducible polynomial with integer coefficients and \( p(x) = z \) for \( x > z \), prove that \( p^{(k)}(c) \) cannot be prime for all large \( n \). We do not propose to solve this problem but wish to make some remarks. If \( p(x) \) is a polynomial with integer coefficients, then so is the \( k \)-th iterate defined recursively by \( p^{(k)}(z) = p(p^{(k-1)}(z)) \). If \( a \) and \( b \) are integers then \[ p^{(k)}(a) \equiv p^{(k)}(b) \; \text{(mod} \; (a-b)\text{)}. \] In particular for a \( c^{(k)} \) and \( m \) we have \( p^{(k)}(c) \equiv p(0) \; \text{(mod} \; p(c)\text{)}. Hence, \[ p^{(k+1)}(c) \cdot p(c) \equiv p^{(k)}(p(c)). \] Hence, \[ (p^{(k+n)}(c), p^{(n)}(c)) = (p^{(0)}(p(n), p(c))). \] (2) We shall call a sequence \( \{a_n\} \; n \geq 0 \), relatively prime if \( (a_n, a_m) = 1 \) for all values of \( m, n \) with \( m \neq n \). From (2) we obtain **Theorem 1.** \( \{p^{(k)}(n), n \geq 0\} \) is relatively prime if and only if \( p^{(k)}(p(c)) = 1 \; \text{for all} \; k \geq 2, n \geq 0 \). From this follows immediately a result of Bellman: If \( p^{(k)}(0) \neq 1 \) for \( k \geq 2 \) and \( p(0) = 1 \) implies \( p(0) = 1 \) then \( p^{(k)}(a) \; n \geq 2 \) is relatively prime whenever \( c(p(c)) = 0 \). We shall now construct all polynomials \( p(x) \) for which \( p^{(k)}(n), n \geq 0 \) is relatively prime for all \( k \geq 2, l \). It is as easily seen that \( k = 1 \) and \( c = 0 \). But then \( \{p\} \) must be one of the following six sequences: 1. \( 1, 1, \ldots \) 2. \( 1, -1, \ldots \) 3. \( -1, 1, \ldots \) 4. \( -1, -1, \ldots \) 5. \( -1, 1, -1, \ldots \) 6. \( -1, -1, 1, \ldots \) It is easily seen that the general solution of \( p(x) \) (with integer coefficients) of rational functions \[ p(x) = a_k x^k + a_{k-1} x^{k-1} + \ldots + a_0, \] is obtained from a particular solution \( p(z) \) as follows: \[ p(x) = p(z) + (x - a) \cdot (x - a_1) \cdots (x - a_k) \cdot Q(x), \] where \( Q(x) \) is any polynomial with integer coefficients. ``` #################### File: An%20Introduction%20to%20the%20Theory%20of%20Numbers%20-%20Leo%20Moser%20%28PDF%29.pdf Page: 30 Context: # Chapter 5. Congruences Roughly speaking, shows that the residues and non-residues are characterized by this property: Jacobi's law also obtained partial results for the cases of 3 consecutive residues and non-residues. Let \( R_k \) and \( N_k \) be the number of residues and non-residues, respectively. One might conjecture that \( R_k, N_k \to \infty \) among those who contributed to this question are Vandiver, Brauer, Dodge, Haywood, Davenport, and A. B. K. The most interesting result is that of A. Brauer. He showed that for \( p > p_0 \), \( R_k \) and \( N_k > 0 \). We shall shortly state this result. It depends on a very interesting result of Van der Waerden (1927). Given \( k \), there exists an integer \( N = N_k \) such that if one separates the integers \( 1, 2, \ldots, N \) into \( k \) classes in any manner whatsoever, at least one of the classes will contain an arithmetic progression of length \( k \). There are a number of unanswered questions about this theorem which we shall return to in a later section. Returning to Brauer's work, we shall show how the powers that all large primes have, say, \( r \) consecutive residues. One separates the numbers \( 1, 2, \ldots, r \) into 2 classes, residues and non-residues. If \( p \) is large enough one of these classes will contain, by Van der Waerden's theorem, \( 49 \) terms in arithmetic progression, say \[ a, a + t, a + 2t, \ldots, a + 48t. \] Now if \( t = c \) then we have \( 49 \) consecutive numbers of the same quadratic character, namely \[ c, c + 1, c + 2, \ldots, c + 48. \] If these are residues we are done. If non-residues then suppose \( p \) is the smallest nonresidue of \( d \leq 7 \) we have finished for the \( 1, 2, \ldots, r \) are consecutive nonresidues. If \( 4 \leq d \leq 7 \) for the \( 7 \) nonresidues \( c, c + 2t, c + 4t, \ldots \), we now divide these by the nonresidue of which \( r \) resides: \[ \frac{c}{d} = c + 1, \quad \frac{c}{d} = c + 6 \] and the result is complete. The proof of the existence of nonresidues is considerably more complicated. Furthermore, it is interesting to note that the existence of blocks of size \( r \) is not covered by these methods. We now return to the question raised by Gauss. What can be said about the least nonresidue \( r \) of a "prime"? Since \( 1 \) is a residue, the corresponding question about residues is what is the smallest prime residue; this question was attacked in the 1920s by a number of mathematicians, including Nagel, Schinzel, Polya, Landau, Vandiver, Brauer, and Vanguarda. Nagel, for example, proved that for \( r \geq 23, \, r \sqrt{p} \) and Schur proved that \[ \sum_{j=0}^{r-1} \left( \frac{p}{j} \right) < \sqrt{r p} < p. \] Small primes (under \( 10,000 \)) were considered by Bernet, Chatalan, Brauer, Moeser, and others. Quite recently, the unproven extended Riemann hypothesis has been applied to these problems by Linnik, Chudnovsky, Erdős, and Ankeny. Thus, for example, Ankeny used the extended Riemann hypothesis to prove that \( p_r \sim O(\log p) \). In the opposite direction, Pillai (1945) proved that \( p_r \sim \log p \). Using this, Riemann's projections, and later some deep results of Linnik on primes in arithmetic progression, Friedlander and Chorom applied this to \( n \) to \( \pi(x) \). Quite recently there have been a number of results in a fashion different from previously. Benner, Nagel, Selkorn, Reidel, and Reidel's method is fundamentally interesting. He uses a finite projective geometrical analogue of the fundamental theorem of Minkowski on convex bodies to prove that for \( p = 1 \) and \( a_t \), at least \( t \) of the integers up to \( p \) are residues and at least \( \frac{1}{2} \) are nonresidues. Our own recent contribution is to improve along these lines. We shall outline some of this work. We consider the lattice of points in a square of side one. We seek an estimate for \( V(n) \), the number of visible lattice points in the square. As one paper shows: \[ [n^2] = V(n) + \left( \frac{7}{6} \right). \] #################### File: An%20Introduction%20to%20the%20Theory%20of%20Numbers%20-%20Leo%20Moser%20%28PDF%29.pdf Page: 32 Context: # Chapter 6: Diophantine Equations We now go on to quite a different problem. Has the equation \[ 1^n + 2^n + \ldots + (m - 1)^n = m^n \] any solutions in integers other than \( n = 2 \)? Here are some near solutions: \[ 1^3 + 2^3 = 3^3 \] \[ 3^4 + 4^4 + 5^4 + 6^4 + 7^4 + 8^4 + 9^4 + 10^4 = 212^4 \] \[ 1^6 + 2^6 + 3^6 + 4^6 + 5^6 + 6^6 + 7^6 + 12^6 + 13^6 + 15^6 + 16^6 + 18^6 + 20^6 + 22^6 + 23^6 + 25^6 = 256^6 \] We now outline a proof that other solutions exist for \( n > 1000 \). The rest of this section appeared originally as the paper "On the Diophantine Equation \( 1^n + 2^n + \ldots + (m - 1)^n = m^n \)", *Rendiconti del Circolo Matematico di Palermo*, 19 (1953), pp. 84-85. A number of isolated equations expressing the sum of the \( n \)th powers of integers as an \( n \)th power of an integer have long been known. Some examples are: \[ 3^4 + 4^3 = 6^3 \] \[ \sum_{k=1}^{4} (-1)^k \cdot 2^k - 3^k - 10^k - 14^k - 72^k = 212^4 \] \[ 1^6 + 2^6 + 4^6 + 5^6 + 6^6 + 7^6 + 12^6 + 13^6 + 15^6 + 16^6 + 18^6 + 20^6 + 22^6 + 23^6 + 25^6 = 256^6 \] Further examples and references to such results are given in (1, 2). On the other hand, the only known solution in integers for the equation in the title is the trivial one \( 1 + 2 = 3 \). In a letter to the author, P. Erdos conjectured that this is the only solution. The object of this note is to show that if the equation has a solution with \( n \), then \( n > 1000 \). Let \( S_n(m) \) denote \[ S_n(m) = \sum_{j=1}^{m} j^n, \quad n > 1. \] It is possible to examine (1) with various modular and thereby obtain restrictions on \( m \) and \( n \). This is essentially our method, but the modulo are so chosen that we are able to combine the resulting congruences so as to obtain extremely large bounds for \( m \) without laborious computation. We use the following lemma. ## Lemma 1 If \( p \) is a prime and \( c(p) \) is defined by \( c(p) = \pm 1 \) when \( n \equiv 0 \mod p \) (1) does not divide \( n \) then \[ S_n(p - 1) \equiv 0 \mod p. \] A simple proof of (2) is given in [2, p. 90]. Now suppose \( p \equiv 1 \mod n \), then \[ S_n(m) \equiv \sum_{j=1}^{m} j^n \equiv \frac{m^n - 1}{p - 1} - c(p) \quad ( \text{mod } p). \] On the other hand, let \( m = 1 \quad ( \text{mod } p) \) so that by (1) \[ \frac{m - 1}{p} \equiv 1 \quad ( \text{mod } p). \] Hence \( c(p) \neq 0 \quad ( \text{mod } p) \) so that from the definition of \( c(p) \) it follows that \( c(p) = -1 \) and \[ p \equiv 1 \quad ( \text{mod } n). \] Thus (3) can be put in the form \[ \frac{m - 1}{p - 1} + 1 \equiv 0 \quad ( \text{mod } p) \] or \[ m - 1 \equiv 0 \quad ( \text{mod } p^2). \] From (6) it follows that \( m - 1 \) is squarefree. Further, since it is easily checked that \( m - 1 \) if \( 2 \) it follows that \( m - 1 \) must have at least one prime divisor, so by (4) \( n \) is even. We now multiply together all congruences of the type (5), that is one for each prime dividing \( m - 1 \). Since \( m - 1 \) is squarefree, the resulting modulus is \[ m - 1. \quad \text{Furthermore, products containing two or more distinct factors of the form (1 - j) will be divisible by \( m - 1 \). Thus we obtain} \] \[ (m - 1) \cdot \sum_{k=1}^{p} \frac{1}{k - 1} + 1 \equiv 0 \quad ( \text{mod } 1). \] The only roots of \( m < 1000 \) which satisfy (8) are \( 3, 7, 43 \). We proceeded to develop three more congruences, similar to (8), which when combined with (6) led us to the main result. Equation (12) can be written in the form \[ S_n(m + 2) = 2^{m + 1}. \] Suppose that \( p \equiv 1 \). Using (2) and the fact that \( n \) is even, we obtain \[ | p | (1 + 1) \implies \quad 0 \quad ( \text{mod } p). \] #################### File: An%20Introduction%20to%20the%20Theory%20of%20Numbers%20-%20Leo%20Moser%20%28PDF%29.pdf Page: 34 Context: # Chapter T ## Combinatorial Number Theory There are many interesting questions that lie between number theory and combinatorial analysis. We consider first one that goes back to Schur (1917) and is related in a surprising way to Fermat’s Last Theorem. Roughly speaking, the theorem of Schur states that if \( n \) is fixed and sufficiently many consecutive integers \( 1, 2, \ldots, n \) are separated into \( c \) classes, then at least one class will contain elements \( a, b, c \) with \( a + b = c \). Consider the fact that if we separate the positive integers less than \( 2^n \) into \( n \) classes by putting \( 1 \) in class \( 1 \), the next \( 2 \) in class \( 2 \), the next \( 4 \) in class \( 3 \), etc., then no class contains more than two of its elements. Alternatively, we could view every integer in the form \( 2^k \) where \( k \) is odd, and place it in the \( k \)th class. Again the numbers less than \( 2^n \) will be in classes and if \( m = 2^{k} \) and \( m' = 2^{k} + 2^j \) then \( m + m' = 2^{k + 1} \) lies in a higher numbered class. The more complicated manner of distributing integers outlined below enables us to distribute \( 1, 2, \ldots, \frac{2^{n}}{n} \) into classes in such a way that no class has a solution to \( a + b = c \): \[ \begin{array}{cccc} 1 & 2 & 3 & 4 \\ 5 & 6 & 7 & 8 \\ 9 & 10 & 11 & 12 \\ 13 & 14 & 15 & 16 \\ \vdots & \vdots & \vdots & \vdots \\ \end{array} \] On the other hand, the theorem of Schur states that if one separates the numbers \( 1, 2, \ldots, n \) into \( c \) classes then there will be at least one class that will contain a solution to \( a + b = c \). The gap between the last two statements reveals some interesting unsolved problem; namely, can we find the \( n \) that is \( [1, 2, \ldots, n] \) is clearly solved? We now give a definition and make several remarks to facilitate the proof of Schur’s theorem. Let \( T_n = T_{n-1} + \left( 1 + \frac{1}{2} + \frac{1}{3} + \ldots + \frac{1}{n} \right) \). ### References 1. L. E. Dickson, *History of the Theory of Numbers*, vol. 2 2. G. H. Hardy and E. M. Wright, *An Introduction to the Theory of Numbers*. 3. B. H. Lehmer, “List of Prime Numbers from 1 to 10,006,721.” 4. B. Rosser, "Explicit Bounds for Some Functions of Prime Numbers," *Amer. J. of Math.*, 63 (1941), 211–232. From Lehmer's table [3] and explicit estimates for \( \pi(x) \) due to Rosser [4], it can easily be checked that for \( 10^6 < x < 10^7 \) \[ \pi(x) \sim \frac{x}{\log x} \] Now in [2, p. 339] it is shown that \[ \sum_{p \leq x} \frac{1}{p} \sim \log x + \frac{1}{2} \log \log x. \] Combining (21), (22) and (23) gives the required result. In [4] it is proved that \[ \sum_{p \leq x} \log p \sim P \left( 1 - \frac{1}{\log^2 x} \right) x, \quad x < 10^6. \] Hence \[ \log M > \log P \implies P = \sum_{p \leq x} \log p \sim \left( 1 - \frac{1}{7 \log 10} \right) x > (231) 10^7. \] Now let \( m < 4 \) so that \[ \log m > \left( \log M - \log 2 \right) > (231) 10^7 \] and \( m > (231) 10^{10}. \) Returning to the case \( n = 1 \) odd, we note that in this case we cannot use (13). Letting \( N = (n - 1)/(2m - 1) \) we get from (8), (16), and (18) \[ \sum_{p \leq m} \frac{1}{p} + 1 \sim \frac{1}{m - 1} + \frac{2}{2m - 1} + \frac{4}{2m + 1} - 3. \] However, since the prime \( 2 \) does not appear on the left side (25) is actually a stronger condition on \( m \) than (19) so that in any case \( m > 10^{10}. \) #################### File: An%20Introduction%20to%20the%20Theory%20of%20Numbers%20-%20Leo%20Moser%20%28PDF%29.pdf Page: 36 Context: ``` # Chapter 2: Combinatorial Number Theory Let $$ b = \frac{(100)(2)(6)(10)(0)}{(100)(150)(60)}, $$ $$ c = \frac{(1008)(600)(290)(50)(0)}{(1008)(600)(290)(50)(0)}. $$ respectively. Now suppose the $\text{n}$ bracket in $\text{R}$ contains nonzero digits, but all further brackets to the left are 0. Call the number represented by the digits in the $\text{n}$ bracket, $x_r$, for $r = 1, 2, \ldots, r - 2$. Further, denote by $y$ the number represented by the digit in the last two brackets taken together, but excluding the last digit. For $x_r$ to belong to $\text{R}$ we require 1. The last digit of $x_r$ must be 1. 2. $x_r$ must begin with 0 for $r = 1, 2, \ldots, r - 2$. 3. $x_1 + x_2 + \ldots + x_r = z$. In particular, note that 2 satisfies (2) but violates (1) and (3) so that $x$ is not in $\text{R}$, but $x$ cannot satisfy all three conditions and are in $\text{R}$. To check (3) we note that $b^6 + 1^6 = 2600$. We next prove that no three integers in $\text{R}$ are in an arithmetic progression. First note that if two elements of $\text{R}$ have a different number of nonempty brackets their average cannot satisfy (1). Thus we need only consider averages of elements of $\text{R}$ having the same number of nonempty brackets. From (1) and (3) it follows that the two elements of $\text{R}$ can be averaged by bracket for the first $r - 2$ brackets and also for the last two brackets taken together. Thus, in our example, $$ \frac{(60 + 50)}{5} = \frac{1}{2}(150 + 290) = 220, $$ $$ \frac{1}{2}(10020060 + 100856600) = 100635300, $$ $$ \frac{1}{2}(h + c) = \frac{(10065)(230)(5)(0)}. $$ This violates (3) and so is not in $\text{R}$. In general we will prove that if $x$ and $y$ are in $\text{R}$ then $x = \frac{1}{2}(x + y)$ and $x$ is not in $\text{R}$. Since $x$ and $y$ are in $\text{R}$. On the other hand, if $z \in \text{R}$ implies $$ z = \sum_{i=1}^{r} x_i^2 + \frac{y^2}{2} - \sum_{i=1}^{r} (x_i + y_i)^2, $$ thus $$ \left( \sum_{i=1}^{r} (x_i + y_i)^2 \right) = 0, $$ which implies $x_r = y_r$ for $r = 1, 2, \ldots, r - 2$. This together with (1) and (2) implies that $x$ and $y$ are not distinct. Seeker's sequence starts with 100000, 1001000, 1002000, ... Nevertheless, the terms of this sequence are eventually much smaller than the corresponding terms of Seeker's sequence. We now estimate how many integers in $\text{R}$ contain exactly $r$ brackets. Given $r$ brackets we can make the first digit in each of the $r - 2$ brackets 0. We can fill up the first $r - 2$ brackets in as arbitrary manner. This can be done in $$ 10^{(r+2)-(\text{len}(r)-2)} = 10^{r-2} $$ ways. The last two brackets can be filled in such a way as to satisfy (1) and (3). To see this we need only check that the last two brackets will not be overfilled, and that the last digit, which we shall set equal to 1, will not be interfered with. This follows from the inequality $$ (10)^r + (10)^{r-2} + \ldots + (10)^{r-2} < 10^{r-n}. $$ For a given $r$ let $b$ be the integer determined by $$ 10^{\text{len}(r)-2} < k < 10^{\text{len}(r)+2}. \quad (4) $$ Since all integers with at most $r$ brackets will not exceed $n$, and since $r$ brackets can be filled to specification in $10^{(r - 2)(r-2)}$ ways, we have $$ R(n) \ge 10^{(r-2)-2}. \quad (5) $$ From the right hand side of (4) we have $$ r + z \approx 2 \sqrt{\log n} $$ that implies that $$ R(n) \ge (r)(r - 2) - 3 \log_{10}(r - \sqrt{n}), $$ where all logs are to base 10. ``` #################### File: An%20Introduction%20to%20the%20Theory%20of%20Numbers%20-%20Leo%20Moser%20%28PDF%29.pdf Page: 39 Context: # Chapter 8 ## Geometry of Numbers We have already seen that geometrical concepts are sometimes useful in illuminating number theoretic considerations. With the introduction by Minkowski of geometry of numbers a real widening of important parts of number theory and geometry was achieved. This branch of mathematics has been in considerable vogue in the last 20 years, particularly in England where it was and is being developed vigorously by Mordell, Davenport, Mahler and their students. We shall consider a very brief introduction to this subject. First, we shall examine a proof of the fundamental theorem of Minkowski due to Hajos (1934). Finally, we shall investigate some new results and conjectures that are closely related. In its simplest form the fundamental theorem of Minkowski is the following: Let \( B \) be a region in the \( x \)-plane of area \( A > 4 \), symmetric about the origin and convex. Then it contains a lattice point other than the origin. First, some preliminary remarks. In the condition \( A > 4 \), the 4 cannot be replaced by any smaller number. This may be seen by considering the square of side \( 2 - \varepsilon \), centered at the origin. Indeed this example might suggest that the theorem is quite intuitive, as it might seem that suggesting this region in any direction and keeping its area fixed would necessarily force the region to cover some lattice point. However the matter is not quite so simple, as other examples reveal that neither central symmetry nor convexity are indispensable. As far as convexity is concerned what is really needed is that the vectors \( \overset{\rightarrow}{V_1} \) and \( \overset{\rightarrow}{V_2} \) correspond such that with \( \overset{\rightarrow}{V_1} \) the vector \( -\overset{\rightarrow}{V_2} \) should also be in \( B \). Thus the symmetry and connectivity together imply that \( \overset{\rightarrow}{V_1} \) and \( \overset{\rightarrow}{V_2} \) satisfy \[ \text{it is inspired by symmetry and connectivity but does not imply either of these conditions.} \] Another example that perhaps illuminates the significance of Minkowski's theorem is the following. Consider a line through \( O \) making an angle \( \theta \); see Figure 4. This line passes through the lattice point other than the origin. If we take a long segment of this line, extending length \( h \) on the side of \( O \), then there will be a lattice point closest to \( O \), and a distance from \( O \). #################### File: An%20Introduction%20to%20the%20Theory%20of%20Numbers%20-%20Leo%20Moser%20%28PDF%29.pdf Page: 41 Context: # Chapter 8. Geometry of Numbers Consider the inequalities \[ |a_{11}x_1 + a_{12}x_2 + \ldots + a_{1n}x_n| \leq \lambda_1, \] \[ |a_{21}x_1 + a_{22}x_2 + \ldots + a_{2n}x_n| \leq \lambda_2, \] \[ \vdots \] \[ |a_{m1}x_1 + a_{m2}x_2 + \ldots + a_{mn}x_n| \leq \lambda_m, \] where the \(a_{ij}\) are real numbers and the \(\lambda_1, \ldots, \lambda_m\) are positive numbers. The problem is to find sufficient conditions for the existence of integers \(z_1,\ldots,z_n\) not all satisfying the system. The fundamental theorem of Minkowski can be used to prove that a solution will exist provided the determinant \(\det(a_{ij})\) of the coefficients is, in absolute value, less than the product \(\lambda_1 \ldots \lambda_m\). This comes about in the following way. Geometrically, the inequalities determine an \(n\)-dimensional parallelepiped whose volume (or content) is \[ \frac{1}{\det(a)} \cdot 2^n \cdot \lambda_1 \cdots \lambda_m. \] If \(\lambda_1, \ldots, \lambda_m > 0\) and \(\det(a) \neq 0\), then the content exceeds \(2^n\) and so contains a lattice point different from \(0\). A very recent analogue of the fundamental theorem of Minkowski is the following. Let \(R\) be a convex region, not necessarily symmetric about \(0\), but having its centroid at \(0\). If it can exceed \(2^n\), then it contains a lattice point not \(0\). The constant \(\frac{1}{2^n}\) is again best possible, but an-individual analogue of this result is unknown. The following is a conjectured generalization of the fundamental theorem of Minkowski, which we have unfortunately been unable to prove. Perhaps you will be able to prove or disprove it. Let \(R\) be a convex region containing the origin and defined by \(f(x) \leq 0\) for \(x \in R\). \[ \int_{R} f(x) \, dx > 4 \] Then \(R\) contains a nontrivial lattice point. For symmetrical regions \(f(x) = f(-x)\), and the conjecture reduces to the fundamental theorem of Minkowski. Here is a somewhat related and only partially solved problem. If \(M(n)\) be defined as the smallest number such that any convex region around \(0\) can be placed as to cover \(n\) lattice points. Clearly \(M(1) = 0\). It is difficult to show that \(M(2) = 2\), i.e., in any convex region whose area exceeds that of a circle of diameter \(d\) can be used to cover \(2\) lattice points. To determine \(M(3)\) already seems difficult. What one can easily prove is that \(M(3) = 1\\) and we conjecture the existence of a positive constant \(c\) such that \(M(n) \in c \sqrt{n}\). ## Classical Unsolved Problems 1. Is every even number \(> 2\) the sum of two primes? (Goldbach) 2. Is every number of the form \(4n + 2 (n \geq 1)\) the sum of two primes of the form \(4n + 1\)? (Euler) 3. Obtain an asymptotic formula for the number of representations of \(2n\) as the sum of two primes. 4. Can every even number be expressed as the difference of two primes? 5. Can every even number be expressed as the difference of two primes in infinitely many ways? 6. In particular, are there infinitely many prime pairs? 7. Find an asymptotic formula for the number of prime pairs \(\leq z\). 8. Do there exist infinitely many primes of the form \(x^2 + 1\)? 9. Does any polynomial of degree \(> 1\) represent infinitely many primes? 10. Are there infinitely many Fermat primes? 11. Are there infinitely many Mersenne primes (primes of the form \(2^n - 1\))? 12. Are there infinitely many primes of the form \(2p + 1\) where \(p\) is a prime? 13. Is there at least one prime between every pair of consecutive squares? 14. Are there odd perfect numbers? 15. Are there infinitely many pairs of amicable numbers? 16. Let \(\{f(n)\} = f(0) - n\). Does the sequence \(f(n) = f(n-1) + f(n-2)\) for \(n = 1,2,3,\ldots\) remain bounded for every \(n\)? (Pound) 17. Are there infinitely many primes \(p\) for which \(p - 1\) is divisible by \(p^2\)? 1. *Publisher's Note:* Since the time that these were first written in 1897, it is likely that several of the "unsolved" problems listed here have found solutions. We welcome any information about such developments. #################### File: An%20Introduction%20to%20the%20Theory%20of%20Numbers%20-%20Leo%20Moser%20%28PDF%29.pdf Page: 44 Context: ``` 78 Miscellaneous Problems 52. Prove that every positive integer is either of the form n + φ(n) or of the form n + P_n, but not both. 53. Show that \( (3 + 2 \sqrt{2})^{n} + (3 - 2 \sqrt{2})^{n} - 2 \) is a square for every \( n \geq 1 \). 54. Prove that for every real \( x > 2 \) there exists a real \( r \) such that the fractional part of \( r \) is greater than \( 1 - \frac{1}{x} \) for every integer \( x \). 55. Show that if \( p \) and \( q \) are integers such that \( p \) then it is possible to arrange \( n \) or fewer unit resistances to give a combined resistance of \( \phi \). 56. Show that \( (a_n)_{n \geq 1} \) and \( x = a - 12 \sum_{k=1}^{n} \left\lfloor \frac{km}{n} \right\rfloor \) imply \( x \equiv 1 \, (\text{mod} \, n) \). 57. If \( (a, b) = 1 \) prove that \( \sum_{k=1}^{\infty} \frac{(-1)^{k}}{k^a} \) diverges. 58. Show that the sum of reciprocals of integers representable as sums of two squares is divergent. 59. Show that the sum of reciprocals of integers whose digital representation does not include 100 consecutive 7's is convergent. 60. Prove that every \( n > 1 \) can be expressed as the sum of two deficient numbers. 61. Prove that every \( n > 10^6 \) can be expressed as the sum of two abundant numbers. 62. Prove that every sufficiently large \( n \) can be expressed as the sum of \( k \)-abundant numbers. 63. Prove that the \( n \)th non-square is \( n + \sqrt{n} \) (where \( \{x\} \) denotes the integer closest to \( x \)). 64. Prove that the \( n \)th nonquasimir is \( n + \sqrt{2n} \). 65. Prove that the \( n \)th non-\( k \)-power is \[ n + \sqrt{n + 1} \] 66. Show that the binary operation \( \circ \) defined on nonnegative integers by \[ m \circ n = m + n + \sqrt{mn} \] is associative. 67. Prove the same for the operation \( m \times n = m + n + 2\sqrt{mn} \). 68. Show that for \( p > 5 \), \( (p - 1)! \) contains a prime factor \( p \). 69. Show that the only solutions of \( x + y = z - 1 \) are \( (n, k) = (2, 1), (3, 1), \) and \( (5, 2) \). 79 Miscellaneous Problems 70. Show that \( x^2 \equiv 2^{n} \, (\text{mod} \, p) \) has a solution for every prime \( p \geq 3 \). 71. Show that if \( f(x) \) is a polynomial with integer coefficients and \( f(a) \) is a square for each \( a \), then \( f(x) = g(x)f(y) \), where \( g(y) \) is a polynomial with integer coefficients. 72. Given integers \( a_1 < a_2 < ... < a_k < n \) with \( a_j \leq \frac{n}{j} \), prove that for some \( i < j \leq k, a_i \). 73. Show that two of the \( a_i's \) of Problem 72 are relatively prime. 74. With the \( c \)'s of Problem 72, show that \( a_j + c_j \) is solvable. 75. Show that the number of solutions of \( x + 2y + 3z = n \) in non-negative integers is \[ \frac{(n + 3 - 1)(n + 3 - 2)}{2} \] 76. Show that the number of solutions of \( x + 2y + 4z = n \) in non-negative integers is \[ \left\{ \begin{array}{ll} \frac{(1 + 2n + 5)(-1)^{n}}{16}, & \text{if } n \equiv 1 \, (\text{mod} \, 16) \\ 0, & \text{otherwise} \end{array} \right. \] 77. Show that \( n \) and \( n + 2 \) are simultaneously prime if and only if \[ \sum_{k=1}^{n} \left[ \frac{n + 2}{k} + \frac{-1}{-1 - n} \right] = 4. \] 78. Show that if \( m \) and \( n \) are simultaneously prime if and only if \[ 4(n - 1) + 1 = 0 \, (\text{mod} \, n + 2), \, (n > 1). \] 79. Show that for every \( n \), \( 6, 10^2, \) and \( 125 \cdot 10^{t} + 1 \) are Pythagorean triples. 80. Show that the number of ordered pairs of integers whose 1.c.m. is \( n \) is \( \sigma(n) \). 81. Show that \[ \frac{1}{2} + \frac{1}{3} + \cdots + \sqrt[n]{n} \] is never an integer. 82. Show that \( x^2 + 2x + y^2 \) is a square if and only if \( x = y \). 83. Show that \[ \sum_{k=1}^{n} \phi(k)x^{n + k} = x(1 + x)^{n - g(n - 1)} \] 84. Show that the number of regular \( p \)-gons with \( p \) edges is \( 2d \). 85. Prove that the \( n \)th order determinant with \( a_{ij} \) has the value \( \prod_{j=1}^{n} \phi(j) \). ``` #################### File: An%20Introduction%20to%20the%20Theory%20of%20Numbers%20-%20Leo%20Moser%20%28PDF%29.pdf Page: 46 Context: # Unsolved Problems and Conjectures 1. Does \( y(n) = y(n + 1) \) have infinitely many solutions? 2. Does \( \sigma(n) = \sigma(n + 1) \) have infinitely many solutions? 3. Does \( y(n) = y(n + 1) = \ldots = y(n+k) \) have solutions for every \( k \)? (Erdős) 4. **Conjecture:** There is no \( n \) for which \( y(n) = n \) has a unique solution. (Carmichael) 5. **Conjecture:** For every positive integer \( k > 1 \) there exist infinitely many \( n \) for which \( y(n) = n \) has exactly \( k \) solutions. 6. Do there exist solutions of \( \sigma(n) = 2n + 1 \)? 7. Is \( y(x) = \sigma(y) \) solvable for every \( n \)? (Moore) 8. Are there infinitely many solutions of \( \sigma(n) = n + 1 \)? 9. Are there infinitely many numbers not of the form \( \sigma(n) + n \)? (Erdős) 10. Are there infinitely many numbers not of the form \( \sigma(n) \)? (Erdős) 11. Do there exist solutions of \( \sigma(n) = m \) for every integer \( m \)? (Sierpiński) 12. Are 1, 2, 4, and 12 the only powers of 2, all whose digits are powers of 2? (Stark) 13. Does there exist for every \( n \) distinct integers \( a_i \) whose sums in pairs are squares? (This is true for \( n \leq 5 \).) 14. Does there exist a sequence of \( \{ a_k \} \) such that \( \sum_{k=1}^n a_k \) is bounded for every \( k \)? (Erdős) 15. If \( f(n) \) is an arithmetic function of period \( k \) and not identically zero, is it true that \( \sum_{n} f(n) \neq 0 \)? (Erdős) 16. **Conjecture:** For sufficiently large \( n \), \( n \) can be partitioned as \( n = a + b + c + d + e + f \) with \( abc = def \). (Moktan) 17. Is \( \sum_{k=1}^{n} \frac{\sigma(k)}{k} \) irrational for every \( n \)? (Erdős and Kac) 18. Is \( \frac{1}{u} + \frac{1}{v} = d \) solvable for every \( n \)? (Erdős) 19. Has \( n^1 + 1 = r \) any solutions with \( n > r \)? (Brouwer) ########## """QUERY: Please summarize the whole context. It is important that you include a summary for each file. All files should be included, so please make sure to go through the entire context""" Consider the chat history for relevant information. Use all information included. If query is already asked in the history double check the correctness of your answer and maybe correct your previous mistake. Use as much tokens as needed but at the same time be as efficient as possible. If you find information separated by a | in the context, it is a table formatted in Markdown - the whole context is formatted as md structure. Final Files Sources: Algorithms%20and%20Complexity%20-%20Herbert%20S.%20Wilf%20%28PDF%29.pdf - Page 1, Algorithms%20and%20Complexity%20-%20Herbert%20S.%20Wilf%20%28PDF%29.pdf - Page 2, Algorithms%20and%20Complexity%20-%20Herbert%20S.%20Wilf%20%28PDF%29.pdf - Page 3, Algorithms%20and%20Complexity%20-%20Herbert%20S.%20Wilf%20%28PDF%29.pdf - Page 5, Algorithms%20and%20Complexity%20-%20Herbert%20S.%20Wilf%20%28PDF%29.pdf - Page 6, Algorithms%20and%20Complexity%20-%20Herbert%20S.%20Wilf%20%28PDF%29.pdf - Page 7, Algorithms%20and%20Complexity%20-%20Herbert%20S.%20Wilf%20%28PDF%29.pdf - Page 8, Algorithms%20and%20Complexity%20-%20Herbert%20S.%20Wilf%20%28PDF%29.pdf - Page 10, Algorithms%20and%20Complexity%20-%20Herbert%20S.%20Wilf%20%28PDF%29.pdf - Page 11, Algorithms%20and%20Complexity%20-%20Herbert%20S.%20Wilf%20%28PDF%29.pdf - Page 12, Algorithms%20and%20Complexity%20-%20Herbert%20S.%20Wilf%20%28PDF%29.pdf - Page 13, Algorithms%20and%20Complexity%20-%20Herbert%20S.%20Wilf%20%28PDF%29.pdf - Page 15, Algorithms%20and%20Complexity%20-%20Herbert%20S.%20Wilf%20%28PDF%29.pdf - Page 16, Algorithms%20and%20Complexity%20-%20Herbert%20S.%20Wilf%20%28PDF%29.pdf - Page 17, Algorithms%20and%20Complexity%20-%20Herbert%20S.%20Wilf%20%28PDF%29.pdf - Page 18, Algorithms%20and%20Complexity%20-%20Herbert%20S.%20Wilf%20%28PDF%29.pdf - Page 19, Algorithms%20and%20Complexity%20-%20Herbert%20S.%20Wilf%20%28PDF%29.pdf - Page 20, Algorithms%20and%20Complexity%20-%20Herbert%20S.%20Wilf%20%28PDF%29.pdf - Page 21, Algorithms%20and%20Complexity%20-%20Herbert%20S.%20Wilf%20%28PDF%29.pdf - Page 22, Algorithms%20and%20Complexity%20-%20Herbert%20S.%20Wilf%20%28PDF%29.pdf - Page 23, Algorithms%20and%20Complexity%20-%20Herbert%20S.%20Wilf%20%28PDF%29.pdf - Page 24, Algorithms%20and%20Complexity%20-%20Herbert%20S.%20Wilf%20%28PDF%29.pdf - Page 25, Algorithms%20and%20Complexity%20-%20Herbert%20S.%20Wilf%20%28PDF%29.pdf - Page 26, Algorithms%20and%20Complexity%20-%20Herbert%20S.%20Wilf%20%28PDF%29.pdf - Page 29, Algorithms%20and%20Complexity%20-%20Herbert%20S.%20Wilf%20%28PDF%29.pdf - Page 31, Algorithms%20and%20Complexity%20-%20Herbert%20S.%20Wilf%20%28PDF%29.pdf - Page 33, Algorithms%20and%20Complexity%20-%20Herbert%20S.%20Wilf%20%28PDF%29.pdf - Page 34, Algorithms%20and%20Complexity%20-%20Herbert%20S.%20Wilf%20%28PDF%29.pdf - Page 35, Algorithms%20and%20Complexity%20-%20Herbert%20S.%20Wilf%20%28PDF%29.pdf - Page 36, Algorithms%20and%20Complexity%20-%20Herbert%20S.%20Wilf%20%28PDF%29.pdf - Page 38, Algorithms%20and%20Complexity%20-%20Herbert%20S.%20Wilf%20%28PDF%29.pdf - Page 40, Algorithms%20and%20Complexity%20-%20Herbert%20S.%20Wilf%20%28PDF%29.pdf - Page 44, Algorithms%20and%20Complexity%20-%20Herbert%20S.%20Wilf%20%28PDF%29.pdf - Page 45, Algorithms%20and%20Complexity%20-%20Herbert%20S.%20Wilf%20%28PDF%29.pdf - Page 47, Algorithms%20and%20Complexity%20-%20Herbert%20S.%20Wilf%20%28PDF%29.pdf - Page 48, Algorithms%20and%20Complexity%20-%20Herbert%20S.%20Wilf%20%28PDF%29.pdf - Page 49, Algorithms%20and%20Complexity%20-%20Herbert%20S.%20Wilf%20%28PDF%29.pdf - Page 51, Algorithms%20and%20Complexity%20-%20Herbert%20S.%20Wilf%20%28PDF%29.pdf - Page 53, Algorithms%20and%20Complexity%20-%20Herbert%20S.%20Wilf%20%28PDF%29.pdf - Page 55, Algorithms%20and%20Complexity%20-%20Herbert%20S.%20Wilf%20%28PDF%29.pdf - Page 60, Algorithms%20and%20Complexity%20-%20Herbert%20S.%20Wilf%20%28PDF%29.pdf - Page 62, Algorithms%20and%20Complexity%20-%20Herbert%20S.%20Wilf%20%28PDF%29.pdf - Page 63, Algorithms%20and%20Complexity%20-%20Herbert%20S.%20Wilf%20%28PDF%29.pdf - Page 64, Algorithms%20and%20Complexity%20-%20Herbert%20S.%20Wilf%20%28PDF%29.pdf - Page 65, Algorithms%20and%20Complexity%20-%20Herbert%20S.%20Wilf%20%28PDF%29.pdf - Page 66, Algorithms%20and%20Complexity%20-%20Herbert%20S.%20Wilf%20%28PDF%29.pdf - Page 70, Algorithms%20and%20Complexity%20-%20Herbert%20S.%20Wilf%20%28PDF%29.pdf - Page 71, Algorithms%20and%20Complexity%20-%20Herbert%20S.%20Wilf%20%28PDF%29.pdf - Page 73, Algorithms%20and%20Complexity%20-%20Herbert%20S.%20Wilf%20%28PDF%29.pdf - Page 74, Algorithms%20and%20Complexity%20-%20Herbert%20S.%20Wilf%20%28PDF%29.pdf - Page 77, Algorithms%20and%20Complexity%20-%20Herbert%20S.%20Wilf%20%28PDF%29.pdf - Page 79, Algorithms%20and%20Complexity%20-%20Herbert%20S.%20Wilf%20%28PDF%29.pdf - Page 81, Algorithms%20and%20Complexity%20-%20Herbert%20S.%20Wilf%20%28PDF%29.pdf - Page 82, Algorithms%20and%20Complexity%20-%20Herbert%20S.%20Wilf%20%28PDF%29.pdf - Page 84, Algorithms%20and%20Complexity%20-%20Herbert%20S.%20Wilf%20%28PDF%29.pdf - Page 85, Algorithms%20and%20Complexity%20-%20Herbert%20S.%20Wilf%20%28PDF%29.pdf - Page 90, Algorithms%20and%20Complexity%20-%20Herbert%20S.%20Wilf%20%28PDF%29.pdf - Page 93, Algorithms%20and%20Complexity%20-%20Herbert%20S.%20Wilf%20%28PDF%29.pdf - Page 95, Algorithms%20and%20Complexity%20-%20Herbert%20S.%20Wilf%20%28PDF%29.pdf - Page 96, Algorithms%20and%20Complexity%20-%20Herbert%20S.%20Wilf%20%28PDF%29.pdf - Page 97, Algorithms%20and%20Complexity%20-%20Herbert%20S.%20Wilf%20%28PDF%29.pdf - Page 99, Algorithms%20and%20Complexity%20-%20Herbert%20S.%20Wilf%20%28PDF%29.pdf - Page 101, Algorithms%20and%20Complexity%20-%20Herbert%20S.%20Wilf%20%28PDF%29.pdf - Page 102, Algorithms%20and%20Complexity%20-%20Herbert%20S.%20Wilf%20%28PDF%29.pdf - Page 103, Algorithms%20and%20Complexity%20-%20Herbert%20S.%20Wilf%20%28PDF%29.pdf - Page 105, Algorithms%20and%20Complexity%20-%20Herbert%20S.%20Wilf%20%28PDF%29.pdf - Page 107, Algorithms%20and%20Complexity%20-%20Herbert%20S.%20Wilf%20%28PDF%29.pdf - Page 108, Algorithms%20and%20Complexity%20-%20Herbert%20S.%20Wilf%20%28PDF%29.pdf - Page 112, Algorithms%20and%20Complexity%20-%20Herbert%20S.%20Wilf%20%28PDF%29.pdf - Page 113, Algorithms%20and%20Complexity%20-%20Herbert%20S.%20Wilf%20%28PDF%29.pdf - Page 114, Algorithms%20and%20Complexity%20-%20Herbert%20S.%20Wilf%20%28PDF%29.pdf - Page 115, Algorithms%20and%20Complexity%20-%20Herbert%20S.%20Wilf%20%28PDF%29.pdf - Page 116, Algorithms%20and%20Complexity%20-%20Herbert%20S.%20Wilf%20%28PDF%29.pdf - Page 118, Algorithms%20and%20Complexity%20-%20Herbert%20S.%20Wilf%20%28PDF%29.pdf - Page 119, Algorithms%20and%20Complexity%20-%20Herbert%20S.%20Wilf%20%28PDF%29.pdf - Page 122, Algorithms%20and%20Complexity%20-%20Herbert%20S.%20Wilf%20%28PDF%29.pdf - Page 125, Algorithms%20and%20Complexity%20-%20Herbert%20S.%20Wilf%20%28PDF%29.pdf - Page 126, Algorithms%20and%20Complexity%20-%20Herbert%20S.%20Wilf%20%28PDF%29.pdf - Page 129, Algorithms%20and%20Complexity%20-%20Herbert%20S.%20Wilf%20%28PDF%29.pdf - Page 130, Algorithms%20and%20Complexity%20-%20Herbert%20S.%20Wilf%20%28PDF%29.pdf - Page 131, Algorithms%20and%20Complexity%20-%20Herbert%20S.%20Wilf%20%28PDF%29.pdf - Page 132, Algorithms%20and%20Complexity%20-%20Herbert%20S.%20Wilf%20%28PDF%29.pdf - Page 133, Algorithms%20and%20Complexity%20-%20Herbert%20S.%20Wilf%20%28PDF%29.pdf - Page 134, Algorithms%20and%20Complexity%20-%20Herbert%20S.%20Wilf%20%28PDF%29.pdf - Page 135, Algorithms%20and%20Complexity%20-%20Herbert%20S.%20Wilf%20%28PDF%29.pdf - Page 136, Algorithms%20and%20Complexity%20-%20Herbert%20S.%20Wilf%20%28PDF%29.pdf - Page 138, Algorithms%20and%20Complexity%20-%20Herbert%20S.%20Wilf%20%28PDF%29.pdf - Page 139, Algebraic%20Topology%20AT-toc.pdf - Page 1, Algebraic%20Topology%20AT-toc.pdf - Page 2, Algebraic%20Topology%20AT-toc.pdf - Page 4, Algebraic%20Topology%20AT-toc.pdf - Page 6, Algebraic%20Topology%20AT-toc.pdf - Page 8, Algebraic%20Topology%20AT-toc.pdf - Page 9, An%20Introduction%20to%20the%20Theory%20of%20Numbers%20-%20Leo%20Moser%20%28PDF%29.pdf - Page 1, An%20Introduction%20to%20the%20Theory%20of%20Numbers%20-%20Leo%20Moser%20%28PDF%29.pdf - Page 3, An%20Introduction%20to%20the%20Theory%20of%20Numbers%20-%20Leo%20Moser%20%28PDF%29.pdf - Page 4, An%20Introduction%20to%20the%20Theory%20of%20Numbers%20-%20Leo%20Moser%20%28PDF%29.pdf - Page 5, An%20Introduction%20to%20the%20Theory%20of%20Numbers%20-%20Leo%20Moser%20%28PDF%29.pdf - Page 10, An%20Introduction%20to%20the%20Theory%20of%20Numbers%20-%20Leo%20Moser%20%28PDF%29.pdf - Page 14, An%20Introduction%20to%20the%20Theory%20of%20Numbers%20-%20Leo%20Moser%20%28PDF%29.pdf - Page 17, An%20Introduction%20to%20the%20Theory%20of%20Numbers%20-%20Leo%20Moser%20%28PDF%29.pdf - Page 18, An%20Introduction%20to%20the%20Theory%20of%20Numbers%20-%20Leo%20Moser%20%28PDF%29.pdf - Page 20, An%20Introduction%20to%20the%20Theory%20of%20Numbers%20-%20Leo%20Moser%20%28PDF%29.pdf - Page 23, An%20Introduction%20to%20the%20Theory%20of%20Numbers%20-%20Leo%20Moser%20%28PDF%29.pdf - Page 26, An%20Introduction%20to%20the%20Theory%20of%20Numbers%20-%20Leo%20Moser%20%28PDF%29.pdf - Page 28, An%20Introduction%20to%20the%20Theory%20of%20Numbers%20-%20Leo%20Moser%20%28PDF%29.pdf - Page 30, An%20Introduction%20to%20the%20Theory%20of%20Numbers%20-%20Leo%20Moser%20%28PDF%29.pdf - Page 32, An%20Introduction%20to%20the%20Theory%20of%20Numbers%20-%20Leo%20Moser%20%28PDF%29.pdf - Page 34, An%20Introduction%20to%20the%20Theory%20of%20Numbers%20-%20Leo%20Moser%20%28PDF%29.pdf - Page 36, An%20Introduction%20to%20the%20Theory%20of%20Numbers%20-%20Leo%20Moser%20%28PDF%29.pdf - Page 39, An%20Introduction%20to%20the%20Theory%20of%20Numbers%20-%20Leo%20Moser%20%28PDF%29.pdf - Page 41, An%20Introduction%20to%20the%20Theory%20of%20Numbers%20-%20Leo%20Moser%20%28PDF%29.pdf - Page 44, An%20Introduction%20to%20the%20Theory%20of%20Numbers%20-%20Leo%20Moser%20%28PDF%29.pdf - Page 46 ================================================== **Elapsed Time: 10.55 seconds** ================================================== FINAL ANSWER Answer: ================================================== **Elapsed Time: 0.00 seconds** ==================================================