Stable Homotopy Theory of Dendroidal Sets

Total Page:16

File Type:pdf, Size:1020Kb

Stable Homotopy Theory of Dendroidal Sets Stable homotopy theory of dendroidal sets Proefschrift ter verkrijging van de graad van doctor aan de Radboud Universiteit Nijmegen op gezag van de rector magnificus prof. dr. Th. L. M. Engelen, volgens besluit van het college van decanen in het openbaar te verdedigen op donderdag 23 april 2015 om 12.30 uur precies door Matija Baˇsi´c geboren op 21 augustus 1985 te Zagreb, Kroati¨e Promotor: prof. dr. I. Moerdijk Manuscriptcommissie: prof. dr. N.P. Landsman (vz) dr. C. Berger (Universit´ede Nice-Sophia Antipolis, Frankrijk) dr. J.J. Guti´errezMarin prof. dr. K. Hess (Ecole´ Polytechnique F´ed´eralede Lausanne, Zwitserland) dr. U. Schreiber (Eduard Cechˇ Institute, Tsjechische Republiek) ISBN { 978-94-6259-634-4 Gedrukt door: Ipskamp Drukkers, Enschede Contents Contents i 1 Introduction 1 1.1 Algebraic structures in topology . .1 1.1.1 Homotopy invariants . .1 1.1.2 Homotopy invariant algebraic structures . .2 1.1.3 Loop spaces and infinite loop spaces . .3 1.1.4 Operads . .5 1.2 Homotopy theory . .8 1.2.1 Homotopy theory in various categories . .8 1.2.2 Axiomatic homotopy theory . 10 1.2.3 A categorical definition of simplicial sets . 11 1.2.4 Homotopy theory of simplicial sets . 12 1.2.5 Higher categorical point of view . 14 1.2.6 Simplicially enriched categories . 15 1.3 Dendroidal sets . 17 1.3.1 The category Ω of trees . 17 1.3.2 Dendroidal sets and operads . 19 1.3.3 The operadic model structure . 20 1.3.4 Homotopy theory of homotopy coherent algebras . 21 1.4 Main results and the organization of the thesis . 23 1.4.1 The dendroidal group{like completion . 23 1.4.2 An elementary construction of the stable model structure . 25 1.4.3 Homology of dendroidal sets . 26 1.4.4 Overview of the chapters . 28 2 Background on axiomatic homotopy theory 29 2.1 Categorical preliminaries and the definition of a model category . 29 2.1.1 Conventions about sets and categories . 29 2.1.2 Localization of categories . 32 2.1.3 Factorization and lifting properties . 33 i 2.1.4 Quillen model structures . 34 2.2 Examples of homotopy theories . 36 2.2.1 Small categories . 36 2.2.2 Chain complexes . 36 2.2.3 Topological spaces . 37 2.2.4 Simplicial sets . 38 2.2.5 Operads . 41 2.3 Further properties of model categories . 46 2.3.1 Left and right homotopy . 46 2.3.2 The construction of the homotopy category . 47 2.3.3 Detecting weak equivalences . 49 2.3.4 Cofibrantly generated model categories . 52 2.3.5 Quillen functors . 53 2.3.6 Model structures on categories of diagrams . 55 2.3.7 Simplicial model categories and function complexes . 57 2.3.8 Left Bousfield localization . 61 3 Dendroidal sets 63 3.1 The formalism of trees . 63 3.1.1 Definition of a tree . 63 3.1.2 Operads associated with trees and the category Ω . 64 3.1.3 Elementary face and degeneracy maps . 66 3.2 Dendroidal sets . 68 3.2.1 Relating dendroidal sets to simplicial sets and operads . 68 3.2.2 A tensor product of dendroidal sets . 69 3.2.3 Normal monomorphisms and normalizations . 74 3.2.4 Dendroidal Kan fibrations . 76 3.2.5 Homotopy theories of dendroidal sets . 79 4 Combinatorics of dendroidal anodyne extensions 81 4.1 Elementary face maps . 82 4.1.1 Planar structures and a total order of face maps . 82 4.1.2 Combinatorial aspects of elementary face maps . 83 4.2 The method of canonical extensions . 85 4.3 The pushout-product property . 90 5 Construction of the stable model structure 101 5.1 Homotopy of dendroidal sets . 101 5.2 Stable weak equivalences . 103 5.3 Stable trivial cofibrations . 105 5.4 The stable model structure . 110 ii 5.5 Quillen functors from the stable model structure . 114 6 Dendroidal sets as models for connective spectra 117 6.1 Fully Kan dendroidal sets and Picard groupoids . 118 6.2 The stable model structure . 121 6.3 Equivalence to connective spectra . 123 6.4 Proof of Theorem 6.2.3, part I . 129 6.5 Proof of Theorem 6.2.3, part II . 136 6.6 Proof of Theorem 6.2.3, part III . 138 7 Homology of dendroidal sets 145 7.1 The sign conventions . 145 7.2 The unnormalized chain complex . 148 7.3 The normalized chain complex . 151 7.4 The equivalence of the unnormalized and the normalized chain complex . 152 7.5 The associated spectrum and its homology . 154 7.6 The homology of A1 .............................. 156 7.7 Acyclicity argument . 157 Bibliography 159 Summary 163 Samenvatting 165 Curriculum vitae 167 Acknowledgments 169 iii Chapter 1 Introduction The focus of this thesis is on dendroidal sets and their stable homotopy theory. In this introductory chapter we would like to motivate the reader for this topic and present our main results. We will first give a short overview of the basic principles of algebraic topology and, in particular, explain what is understood under the term homotopy theory. Next, we wish to present the theory of dendroidal sets as a generalization of the theory of simplicial sets. Therefore, we will shortly review certain aspects of simplicial sets (that are probably familiar to the reader) with an aim of making the passage from simplicial sets to dendroidal sets natural. We will review the main results from the theory of dendroidal sets that have been known before writing this thesis and on which our work is based. In the final part of this chapter we will present our new results and explain how the rest of the thesis is organized. 1.1 Algebraic structures in topology 1.1.1 Homotopy invariants The subject of this thesis falls under the area of mathematics called algebraic topology. One of the main objectives of topology is to classify all topological spaces up to various equivalence relations. Two spaces are homeomorphic (or topologically equivalent) if there is a continuous bijection between them such that the inverse is also a continuous map. Although classifying spaces up to a homeomorphism is the most important question, we often consider coarser equivalence relations. For two continuous maps f; g : X ! Y we say that f is homotopic to g if there exists a continuous map H : X × [0; 1] ! Y such that H(x; 0) = f(x) and H(x; 1) = g(x) for all x 2 X. A map f : X ! Y is called a homotopy equivalence if there is a map g : Y ! X such that fg is homotopic to the identity 1Y and gf is homotopic to the identity 1X . In such cases, we say that g is a homotopy inverse of f and that the spaces X and Y are homotopy equivalent (or of the same homotopy type). With this definition at hand we 1 2 Chapter 1. Introduction may consider classification of all topological spaces up to homotopy equivalence. Obviously, every homeomorphism is a homotopy equivalence, but not vice versa. To show that two spaces are not of the same type we consider invariants shared by all spaces of the same type. An invariant might be a certain property of a space (e.g. compactness or connectedness) or a mathematical object assigned to it (e.g. the number of connected components, the Euler characteristic, the Betti numbers, the cohomology ring, the homotopy groups etc.). Typically, to each topological space we assign an object with a certain algebraic structure and to each continuous map we assign a morphism respecting that algebraic structure. For example, to a topological space X we might assign a group π(X) and to a continuous map f : X ! Y a group homomorphism π(f): π(X) ! π(Y ). The most important invariants in algebraic topology are functorial. This means that they are respecting the composition of maps, i.e. π(fg) = π(f)π(g). We say that π : Top ! Grp is a functor from the category Top of topological spaces and continuous maps to the category Grp of groups and group homomorphisms. If π : Top !C is a functor that sends homotopic maps to the same morphism in a category C, then π sends homotopy equivalences to isomorphisms. We say that π is a homotopy invariant. Now, consider the homotopy category Ho(Top). The objects of Ho(Top) are topological spaces and morphisms are homotopy equivalence classes of continuous maps. There is a functor γ : Top ! Ho(Top) sending each continuous map to its equivalence class. The pair (Ho(Top); γ) has the following universal property. Every homotopy invariant π : Top !C induces a functor π : Ho(Top) !C such that π = γπ. This illustrates that by studying homotopy invariants we study the homotopy category and functors defined on it. Category theory provides an efficient way to compare various invariants and to study various properties as we are passing from a topological to an algebraic context. The language of categories will be used throughout this thesis in an essential way. 1.1.2 Homotopy invariant algebraic structures Algebraic topology also studies topological spaces with an additional algebraic structure and the way the algebraic and the topological structures interact. Here is a basic example. Let X be a topological monoid and Y a space that is homotopy equivalent to X. One can transfer the multiplicative structure from X to Y via the homotopy equivalence. The transferred structure will not satisfy the strictly associative law (y1y2)y3 = y1(y2y3) for all y1; y2; y3 2 Y , but the maps F0;F1 : Y × Y × Y ! Y given by F0(y1; y2; y3) = (y1y2)y3 and F1(y1; y2; y3) = y1(y2y3) will be homotopic.
Recommended publications
  • While Statement in C
    While Statement In C EnricoIs Reg alwaysdisheartening deplete or his novel aspects when chagrined luminesced disputatiously, some crayfishes he orbits clump so temporizingly? grindingly. Solid Ring-necked and comose Bennet Brendan tarnishes never tensehalf-and-half his Stuttgart! while Thank you use a counter is a while loop obscures the condition which is evaluated to embed videos in while c program C while loops statement allows to repeatedly run at same recipient of code until a wrap is met while loop is empty most basic loop in C programming while loop. We then hand this variable c in the statement block and represent your value for each. While adultery in C Set of instructions given coil the compiler to night set of statements until condition becomes false is called loops. If it is negative number added to the condition in c language including but in looping structures, but is executed infinite loop! While Loop Definition Example & Results Video & Lesson. While talking in C Know Program. What is the while eternal in C? A while loop around loop continuously and infinitely until the policy inside the parenthesis becomes false money must guard the. C while and dowhile Loop Programiz. Programming While Loop. The widow while redeem in the C language is basically a post tested loop upon the execution of several parts of the statements can be repeated by reckless use children do-while. 43 Loops Applications in C for Engineering Technology. Do it Loop in C Programming with Examples Phptpoint. Statements and display control C Tutorials Cpluspluscom. Do while just in c example program.
    [Show full text]
  • Detecting and Escaping Infinite Loops Using Bolt
    Detecting and Escaping Infinite Loops Using Bolt by Michael Kling Submitted to the Department of Electrical Engineering and Computer Science in partial fulfillment of the requirements for the degree of Masters of Engineering in Electical Engineering and Computer Science at the MASSACHUSETTS INSTITUTE OF TECHNOLOGY February 2012 c Massachusetts Institute of Technology 2012. All rights reserved. Author.............................................................. Department of Electrical Engineering and Computer Science February 1, 2012 Certified by. Martin Rinard Professor Thesis Supervisor Accepted by . Prof. Dennis M. Freeman Chairman, Masters of Engineering Thesis Committee 2 Detecting and Escaping Infinite Loops Using Bolt by Michael Kling Submitted to the Department of Electrical Engineering and Computer Science on February 1, 2012, in partial fulfillment of the requirements for the degree of Masters of Engineering in Electical Engineering and Computer Science Abstract In this thesis we present Bolt, a novel system for escaping infinite loops. If a user suspects that an executing program is stuck in an infinite loop, the user can use the Bolt user interface, which attaches to the running process and determines if the program is executing in an infinite loop. If that is the case, the user can direct the interface to automatically explore multiple strategies to escape the infinite loop, restore the responsiveness of the program, and recover useful output. Bolt operates on stripped x86 and x64 binaries, analyzes both single-thread and multi-threaded programs, dynamically attaches to the program as-needed, dynami- cally detects the loops in a program and creates program state checkpoints to enable exploration of different escape strategies. This makes it possible for Bolt to detect and escape infinite loops in off-the-shelf software, without available source code, or overhead in standard production use.
    [Show full text]
  • CS 161, Lecture 8: Error Handling and Functions – 29 January 2018 Revisit Error Handling
    CS 161, Lecture 8: Error Handling and Functions – 29 January 2018 Revisit Error Handling • Prevent our program from crashing • Reasons programs will crash or have issues: • Syntax Error – prevents compilation, the programmer caused this by mistyping or breaking language rules • Logic Errors – the code does not perform as expected because the underlying logic is incorrect such as off by one, iterating in the wrong direction, having conditions which will never end or be met, etc. • Runtime Errors – program stops running due to segmentation fault or infinite loop potentially caused by trying to access memory that is not allocated, bad user input that was not handled, etc. check_length • The end of a string is determined by the invisible null character ‘\0’ • while the character in the string is not null, keep counting Assignment 3 Notes • Allowed functions: • From <string>: .length(), getline(), [], += • From <cmath>: pow() • Typecasting allowed only if the character being converted fits the stated criterion (i.e. character was confirmed as an int, letter, etc.) • ASCII Chart should be used heavily http://www.asciitable.com/ Debugging Side Bar • Read compiler messages when you have a syntax error • If you suspect a logic error -> print everything! • Allows you to track the values stored in your variables, especially in loops and changing scopes • Gives you a sense of what is executing when in your program Decomposition • Divide problem into subtasks • Procedural Decomposition: get ready in the morning, cooking, etc. • Incremental Programming:
    [Show full text]
  • Automatic Repair of Infinite Loops
    Automatic Repair of Infinite Loops Sebastian R. Lamelas Marcote Martin Monperrus University of Buenos Aires University of Lille & INRIA Argentina France Abstract Research on automatic software repair is concerned with the develop- ment of systems that automatically detect and repair bugs. One well-known class of bugs is the infinite loop. Every computer programmer or user has, at least once, experienced this type of bug. We state the problem of repairing infinite loops in the context of test-suite based software repair: given a test suite with at least one failing test, generate a patch that makes all test cases pass. Consequently, repairing infinites loop means having at least one test case that hangs by triggering the infinite loop. Our system to automatically repair infinite loops is called Infinitel. We develop a technique to manip- ulate loops so that one can dynamically analyze the number of iterations of loops; decide to interrupt the loop execution; and dynamically examine the state of the loop on a per-iteration basis. Then, in order to synthesize a new loop condition, we encode this set of program states as a code synthesis problem using a technique based on Satisfiability Modulo Theory (SMT). We evaluate our technique on seven seeded-bugs and on seven real-bugs. Infinitel is able to repair all of them, within seconds up to one hour on a standard laptop configuration. 1 Introduction Research on automatic software repair is concerned with the development of sys- tems that automatically detect and repair bugs. We consider as bug a behavior arXiv:1504.05078v1 [cs.SE] 20 Apr 2015 observed during program execution that does not correspond to the expected one.
    [Show full text]
  • Chapter 6 Flow of Control
    Chapter 6 Flow of Control 6.1 INTRODUCTION “Don't you hate code that's In Figure 6.1, we see a bus carrying the children to not properly indented? school. There is only one way to reach the school. The Making it [indenting] part of driver has no choice, but to follow the road one milestone the syntax guarantees that all after another to reach the school. We learnt in Chapter code is properly indented.” 5 that this is the concept of sequence, where Python executes one statement after another from beginning to – G. van Rossum the end of the program. These are the kind of programs we have been writing till now. In this chapter Figure 6.1: Bus carrying students to school » Introduction to Flow of Control Let us consider a program 6-1 that executes in » Selection sequence, that is, statements are executed in an order in which they are written. » Indentation The order of execution of the statements in a program » Repetition is known as flow of control. The flow of control can be » Break and Continue implemented using control structures. Python supports Statements two types of control structures—selection and repetition. » Nested Loops 2021-22 Ch 6.indd 121 08-Apr-19 12:37:51 PM 122 COMPUTER SCIENCE – CLASS XI Program 6-1 Program to print the difference of two numbers. #Program 6-1 #Program to print the difference of two input numbers num1 = int(input("Enter first number: ")) num2 = int(input("Enter second number: ")) diff = num1 - num2 print("The difference of",num1,"and",num2,"is",diff) Output: Enter first number 5 Enter second number 7 The difference of 5 and 7 is -2 6.2 SELECTION Now suppose we have `10 to buy a pen.
    [Show full text]
  • Infinite Loop Space Theory
    BULLETIN OF THE AMERICAN MATHEMATICAL SOCIETY Volume 83, Number 4, July 1977 INFINITE LOOP SPACE THEORY BY J. P. MAY1 Introduction. The notion of a generalized cohomology theory plays a central role in algebraic topology. Each such additive theory E* can be represented by a spectrum E. Here E consists of based spaces £, for / > 0 such that Ei is homeomorphic to the loop space tiEi+l of based maps l n S -» Ei+,, and representability means that E X = [X, En], the Abelian group of homotopy classes of based maps X -* En, for n > 0. The existence of the E{ for i > 0 implies the presence of considerable internal structure on E0, the least of which is a structure of homotopy commutative //-space. Infinite loop space theory is concerned with the study of such internal structure on spaces. This structure is of interest for several reasons. The homology of spaces so structured carries "homology operations" analogous to the Steenrod opera­ tions in the cohomology of general spaces. These operations are vital to the analysis of characteristic classes for spherical fibrations and for topological and PL bundles. More deeply, a space so structured determines a spectrum and thus a cohomology theory. In the applications, there is considerable interplay between descriptive analysis of the resulting new spectra and explicit calculations of homology groups. The discussion so far concerns spaces with one structure. In practice, many of the most interesting applications depend on analysis of the interrelation­ ship between two such structures on a space, one thought of as additive and the other as multiplicative.
    [Show full text]
  • Basically Speaking
    '' !{_ . - -,: s ' �"-� . ! ' , ) f MICRO VIDEQM P.O. (.t�Box 7357 204 E. Washington St. · Ann Arbor, MI 48107 BASICALLY SPEAKING A Guide to BASIC Progratntning for the INTERACT Cotnputer MICRO VIDEqM P.O. �Box � 7357 204 E. Washington St. Ann Arbor, Ml 48107 BASICALLY SPEAKING is a publication of Micro Video Corporation Copyright 1980 , Micro Video Corporation Copyright 1978 , Microsoft All Rights Reserved First Printing -- December 1980 Second Printing -- April 1981 (Revisions) \. BASICALLY SPEAKING A Guide to BASIC Programming for the Interact Computer Table of Contents Chapter 1 BASIC Basics......................................................... 1-1 The Three Interact BASIC Languages ................................ 1-11 BASIC Dialects .................................................... 1-12 Documentation Convent ions ......................................... 1-13 Chapter 2 HOW TO SPEAK BASIC................................................... 2-1 DIRECT MODE OPERATION. 2-2 Screen Control 2-4 .........................................•....... Screen Layout .................................................. 2-5 Graphics Commands . ............................................. 2-6 Sounds and Music............................................... 2-8 Funct ions ...................................................... 2-9 User-defined Functions ......................................... 2-12 INDIRECT MODE OPERATION . 2-13 Program Listings............................................... 2-14 Mu ltiple Statements on a Single Line ..........................
    [Show full text]
  • Control Flow Statements
    Control Flow Statements Christopher M. Harden Contents 1 Some more types 2 1.1 Undefined and null . .2 1.2 Booleans . .2 1.2.1 Creating boolean values . .3 1.2.2 Combining boolean values . .4 2 Conditional statements 5 2.1 if statement . .5 2.1.1 Using blocks . .5 2.2 else statement . .6 2.3 Tertiary operator . .7 2.4 switch statement . .8 3 Looping constructs 10 3.1 while loop . 10 3.2 do while loop . 11 3.3 for loop . 11 3.4 Further loop control . 12 4 Try it yourself 13 1 1 Some more types 1.1 Undefined and null The undefined type has only one value, undefined. Similarly, the null type has only one value, null. Since both types have only one value, there are no operators on these types. These types exist to represent the absence of data, and their difference is only in intent. • undefined represents data that is accidentally missing. • null represents data that is intentionally missing. In general, null is to be used over undefined in your scripts. undefined is given to you by the JavaScript interpreter in certain situations, and it is useful to be able to notice these situations when they appear. Listing 1 shows the difference between the two. Listing 1: Undefined and Null 1 var name; 2 // Will say"Hello undefined" 3 a l e r t( "Hello" + name); 4 5 name= prompt( "Do not answer this question" ); 6 // Will say"Hello null" 7 a l e r t( "Hello" + name); 1.2 Booleans The Boolean type has two values, true and false.
    [Show full text]
  • Loops Or Control Statement
    LOOPS OR CONTROL STATEMENT ITERATION CONTROL STATEMENT (LOOPING STATEMENT) • Program statement are executed sequentially one after another. In some situations, a block of code needs of times • These are repetitive program codes, the computers have to perform to complete tasks. • The following are the loop structures available in python • While statement • for ….loop statement • Nested loop statement while loop statement • A while loop statement in python programming language repeatedly executes a target statement as long as a given condition is true. • Syntax: • while expression: • statement(s) Examples of a while loop • Write a program to find the sum of number • n=int(input(“enter no”)) • s=0 OUTPUT • while(n>0): enter no 5 • s=s+n the sum is 15 • n=n-1 • print(“the sum is”,s) In while loop- Infinite loop Using else statement with while loops • Python supports have an else statement associated with a loop statement • If the else statement is used with a while loop, the else statement is executed when the condition false. Program to illustrate the else in while loop c=0 OUTPUT while c<3: print(“inside loop”) inside loop c=c+1 inside loop else: inside loop print(“outside loop”) outside loop for loop statement • The for loop is another repetitive control structure, and is used to execute a set of instructions repeatedly, until the condition becomes false. • The for loop in python is used to iterate over a sequence(list,tuple,string) or other iterable objects. Iterating over a sequence is called traversal. • Syntax: • for val in expression: • Body of the for loop String|Tuple| List| Dictionary collection range( ) range ([begin],end-1,[step_value]) • For VN in : for loop and for loop with else clause Difference between for and while loop Nested Loop Examples of Nested Loop.
    [Show full text]
  • GWBASIC User's Manual
    GWBASIC User's Manual User's Guide GW-BASIC User's Guide Chapters 1. Welcome Microsoft Corporation 2. Getting Started Information in this document is subject to change without 3. Reviewing and Practicing notice and does not represent a commitment on the part of 4. The Screen Editor Microsoft Corporation. The software described in this 5. Creating and Using Files document is furnished under a license agreement or 6. Constants, Variables, nondisclosure agreement. It is against the law to copy this Expressions and Operators software on magnetic tape, disk, or any other medium for any Appendicies purpose other than the purchaser's personal use. A. Error Codes and Messages © Copyright Microsoft Corporation, 1986, 1987. All rights B. Mathematical Functions reserved. C. ASCII Character Codes D. Assembly Language Portions copyright COMPAQ Computer Corporation, 1985 E. Converting Programs Simultaneously published in the United States and Canada. F. Communications G. Hexadecimal Equivalents Microsoft®, MS-DOS®, GW-BASIC® and the Microsoft logo H. Key Scan Codes are registered trademarks of Microsoft Corporation. I. Characters Recognized Compaq® is a registered trademark of COMPAQ Computer Glossary Corporation. DEC® is a registered trademark of Digital Equipment Corporation. User's Reference Document Number 410130001-330-R02-078 ABS Function ASC Function ATN Function GW-BASIC User's Reference AUTO Command Microsoft Corporation BEEP Statement BLOAD Command Information in this document is subject to change without BSAVE Command notice and does not represent a commitment on the part of Microsoft Corporation. The software described in this CALL Statement document is furnished under a license agreement or CDBL Function nondisclosure agreement.
    [Show full text]
  • C++ Infinite for Loop
    C++ Infinite For Loop C++ Infinite For Loop To make a C++ For Loop run indefinitely, the condition in for statement has to be true whenever it is evaluated. To make the condition always true, there are many ways. In this tutorial, we will learn some of the ways to create an infinite for loop in C++. We shall learn these methods with the help of example C++ programs. Flowchart – C++ Infinite For Loop Following is the flowchart of infinite for loop in C++. start initialization www.tutorialkart.com condition true Infinite update Loop statements As the condition is never going to be false, the control never comes out of the loop, and forms an Infinite Loop as shown in the above diagram, with blue paths representing flow of infinite for loop. Example – C++ Infinite For Loop with True for Condition For Loop condition is a boolean expression that evaluates to true or false. So, instead of providing an expression, we can provide the boolean value true , in place of condition, and the result is a infinite for loop. C++ Program #include <iostream> using namespace std; int main() { for (; true; ) { cout << "hello" << endl; } } Output hello hello hello hello Note: You will see the string hello print to the console infinitely, one line after another. If you are running from command prompt or terminal, to terminate the execution of the program, enter Ctrl+C from keyboard. If you are running the program from an IDE, click on stop button provided by the IDE. Example – C++ Infinite For Loop with Condition that is Always True Instead of giving true boolean value for the condition in for loop, you can also give a condition that always evaluates to true.
    [Show full text]
  • Lesson 9 Part 2: Loops a Loop Is a Control Structure That Causes A
    Lesson 9 Part 2: Loops A loop is a control structure that causes a statement or group of statements to repeat. We will discuss three (possibly four) looping control structures. They differ in how they control the repetition. The while Loop General Form: while (BooleanExpression) Statement or Block First, the BooleanExpression is tested If it is true, the Statement or Block is executed After the Statement or Block is done executing, the BooleanExpression is tested again If it is still true, the Statement or Block is executed again o This continues until the test of the BooleanExpression results in false. Note: the programming style rules that apply to decision statements also apply. while Loop Example public class WhileLoop { public static void main(String[] args) { int number = 1; //Must have a starting value for While Loop while (number <= 5) { System.out.println("Hello!"); number++; } } } Flowchart for the above loop Here, number is called a loop control variable. A loop control variable determines how many times a loop repeats. Each repetition of a loop is called an iteration. The while loop is known as a pretest loop, because it tests the boolean expression before it executes the statements in its body. Note: This implies that if the boolean expression is not initially true, the body is never executed. Infinite Loops In all but rare cases, loops must contain a way to terminate within themselves. In the previous example number was incremented so that eventually number <= 5 would be false. If a loop does not have a way of terminating it’s iteration, it is said to be an infinite loop, because it will iterate indefinitely.
    [Show full text]