text
stringlengths
16
172k
source
stringlengths
32
122
Type inference, sometimes calledtype reconstruction,[1]: 320refers to the automatic detection of thetypeof an expression in aformal language. These includeprogramming languagesand mathematicaltype systems, but alsonatural languagesin some branches ofcomputer scienceandlinguistics. In a typed language, a term's type determines the ways it can and cannot be used in that language. For example, consider the English language and terms that could fill in the blank in the phrase "sing _." The term "a song" is of singable type, so it could be placed in the blank to form a meaningful phrase: "sing a song." On the other hand, the term "a friend" does not have the singable type, so "sing a friend" is nonsense. At best it might be metaphor; bending type rules is a feature of poetic language. A term's type can also affect the interpretation of operations involving that term. For instance, "a song" is of composable type, so we interpret it as the thing created in the phrase "write a song". On the other hand, "a friend" is of recipient type, so we interpret it as the addressee in the phrase "write a friend". In normal language, we would be surprised if "write a song" meant addressing a letter to a song or "write a friend" meant drafting a friend on paper. Terms with different types can even refer to materially the same thing. For example, we would interpret "to hang up the clothes line" as putting it into use, but "to hang up the leash" as putting it away, even though, in context, both "clothes line" and "leash" might refer the same rope, just at different times. Typings are often used to prevent an object from being considered too generally. For instance, if the type system treats all numbers as the same, then a programmer who accidentally writes code where4is supposed to mean "4 seconds" but is interpreted as "4 meters" would have no warning of their mistake until it caused problems at runtime. By incorporatingunitsinto the type system, these mistakes can be detected much earlier. As another example,Russell's paradoxarises when anything can be a set element and any predicate can define a set, but more careful typing gives several ways to resolve the paradox. In fact, Russell's paradox sparked early versions of type theory. There are several ways that a term can get its type: Especially in programming languages, there may not be much shared background knowledge available to the computer. Inmanifestly typedlanguages, this means that most types have to be declared explicitly.Type inferenceaims to alleviate this burden, freeing the author from declaring types that the computer should be able to deduce from context. In a typing, an expression E is opposed to a type T, formally written as E : T. Usually a typing only makes sense within some context, which is omitted here. In this setting, the following questions are of particular interest: For thesimply typed lambda calculus, all three questions aredecidable. The situation is not as comfortable when moreexpressivetypes are allowed. Types are a feature present in somestronglystatically typedlanguages. It is often characteristic offunctional programming languagesin general. Some languages that include type inference includeC23,[2]C++11,[3]C#(starting with version 3.0),Chapel,Clean,Crystal,D,F#,[4]FreeBASIC,Go,Haskell,Java(starting with version 10),Julia,[5]Kotlin,[6]ML,Nim,OCaml,Opa, Q#,RPython,Rust,[7]Scala,[8]Swift,[9]TypeScript,[10]Vala,[11]Dart,[12]andVisual Basic[13](starting with version 9.0). The majority of them use a simple form of type inference; theHindley–Milner type systemcan provide more complete type inference. The ability to infer types automatically makes many programming tasks easier, leaving the programmer free to omittype annotationswhile still permitting type checking. In some programming languages, all values have adata typeexplicitly declared atcompile time, limiting the values a particular expression can take on atrun-time. Increasingly,just-in-time compilationblurs the distinction between run time and compile time. However, historically, if the type of a value is known only at run-time, these languages aredynamically typed. In other languages, the type of an expression is known only atcompile time; these languages arestatically typed. In most statically typed languages, the input and output types of functions andlocal variablesordinarily must be explicitly provided by type annotations. For example, inANSI C: Thesignatureof this function definition,int add_one(int x), declares thatadd_oneis a function that takes one argument, aninteger, and returns an integer.int result;declares that the local variableresultis an integer. In a hypothetical language supporting type inference, the code might be written like this instead: This is identical to how code is written in the languageDart, except that it is subject to some added constraints as described below. It would be possible toinferthe types of all the variables at compile time. In the example above, the compiler would infer thatresultandxhave type integer since the constant1is type integer, and hence thatadd_oneis a functionint -> int. The variableresult2isn't used in a legal manner, so it wouldn't have a type. In the imaginary language in which the last example is written, the compiler would assume that, in the absence of information to the contrary,+takes two integers and returns one integer. (This is how it works in, for example,OCaml.) From this, the type inferencer can infer that the type ofx + 1is an integer, which meansresultis an integer and thus the return value ofadd_oneis an integer. Similarly, since+requires both of its arguments be of the same type,xmust be an integer, and thus,add_oneaccepts one integer as an argument. However, in the subsequent line,result2is calculated by adding a decimal1.0withfloating-point arithmetic, causing a conflict in the use ofxfor both integer and floating-point expressions. The correct type-inference algorithm for such a situation has been knownsince 1958and has been known to be correct since 1982. It revisits the prior inferences and uses the most general type from the outset: in this case floating-point. This can however have detrimental implications, for instance using a floating-point from the outset can introduce precision issues that would have not been there with an integer type. Frequently, however, degenerate type-inference algorithms are used that cannot backtrack and instead generate an error message in such a situation. This behavior may be preferable as type inference may not always be neutral algorithmically, as illustrated by the prior floating-point precision issue. An algorithm of intermediate generality implicitly declaresresult2as a floating-point variable, and the addition implicitly convertsxto a floating point. This can be correct if the calling contexts never supply a floating point argument. Such a situation shows the difference betweentype inference, which does not involvetype conversion, andimplicit type conversion, which forces data to a different data type, often without restrictions. Finally, a significant downside of complex type-inference algorithm is that the resulting type inference resolution is not going to be obvious to humans (notably because of the backtracking), which can be detrimental as code is primarily intended to be comprehensible to humans. The recent emergence ofjust-in-time compilationallows for hybrid approaches where the type of arguments supplied by the various calling context is known at compile time, and can generate a large number of compiled versions of the same function. Each compiled version can then be optimized for a different set of types. For instance, JIT compilation allows there to be at least two compiled versions ofadd_one: Type inference is the ability to automatically deduce, either partially or fully, the type of an expression at compile time. The compiler is often able to infer the type of a variable or thetype signatureof a function, without explicit type annotations having been given. In many cases, it is possible to omit type annotations from a program completely if the type inference system is robust enough, or the program or language is simple enough. To obtain the information required to infer the type of an expression, the compiler either gathers this information as an aggregate and subsequent reduction of the type annotations given for its subexpressions, or through an implicit understanding of the type of various atomic values (e.g. true : Bool; 42 : Integer; 3.14159 : Real; etc.). It is through recognition of the eventual reduction of expressions to implicitly typed atomic values that the compiler for a type inferring language is able to compile a program completely without type annotations. In complex forms ofhigher-order programmingandpolymorphism, it is not always possible for the compiler to infer as much, and type annotations are occasionally necessary for disambiguation. For instance, type inference withpolymorphic recursionis known to be undecidable. Furthermore, explicit type annotations can be used to optimize code by forcing the compiler to use a more specific (faster/smaller) type than it had inferred.[14] Some methods for type inference are based onconstraint satisfaction[15]orsatisfiability modulo theories.[16] As an example, theHaskellfunctionmapapplies a function to each element of a list, and may be defined as: (Recall that:in Haskell denotescons, structuring a head element and a list tail into a bigger list or destructuring a nonempty list into its head element and its tail. It does not denote "of type" as in mathematics and elsewhere in this article; in Haskell that "of type" operator is written::instead.) Type inference on themapfunction proceeds as follows.mapis a function of two arguments, so its type is constrained to be of the forma->b->c. In Haskell, the patterns[]and(first:rest)always match lists, so the second argument must be a list type:b=[d]for some typed. Its first argumentfisappliedto the argumentfirst, which must have typed, corresponding with the type in the list argument, sof::d->e(::means "is of type") for some typee. The return value ofmapf, finally, is a list of whateverfproduces, so[e]. Putting the parts together leads tomap::(d->e)->[d]->[e]. Nothing is special about the type variables, so it can be relabeled as It turns out that this is also the most general type, since no further constraints apply. As the inferred type ofmapisparametrically polymorphic, the type of the arguments and results offare not inferred, but left as type variables, and somapcan be applied to functions and lists of various types, as long as the actual types match in each invocation. The algorithms used by programs like compilers are equivalent to the informally structured reasoning above, but a bit more verbose and methodical. The exact details depend on the inference algorithm chosen (see the following section for the best-known algorithm), but the example below gives the general idea. We again begin with the definition ofmap: (Again, remember that the:here is the Haskell list constructor, not the "of type" operator, which Haskell instead spells::.) First, we make fresh type variables for each individual term: Then we make fresh type variables for subexpressions built from these terms, constraining the type of the function being invoked accordingly: We also constrain the left and right sides of each equation to unify with each other:κ ~ [δ]andμ ~ ο. Altogether the system of unifications to solve is: Then we substitute until no further variables can be eliminated. The exact order is immaterial; if the code type-checks, any order will lead to the same final form. Let us begin by substitutingοforμand[δ]forκ: Substitutingζforη,[ζ]forθandλ,ιforν, and[ι]forξandο, all possible because a type constructor like·->·isinvertiblein its arguments: Substitutingζ -> ιforεandβ -> [γ] -> [δ]forα, keeping the second constraint around so that we can recoverαat the end: And, finally, substituting(ζ -> ι)forβas well asζforγandιforδbecause a type constructor like[·]isinvertibleeliminates all the variables specific to the second constraint: No more substitutions are possible, and relabeling gives usmap::(a->b)->[a]->[b], the same as we found without going into these details. The algorithm first used to perform type inference is now informally termed the Hindley–Milner algorithm, although the algorithm should properly be attributed to Damas and Milner.[17]It is also traditionally calledtype reconstruction.[1]: 320If a term is well-typed in accordance with Hindley–Milner typing rules, then the rules generate a principal typing for the term. The process of discovering this principal typing is the process of "reconstruction". The origin of this algorithm is the type inference algorithm for thesimply typed lambda calculusthat was devised byHaskell CurryandRobert Feysin 1958.[citation needed]In 1969J. Roger Hindleyextended this work and proved that their algorithm always inferred the most general type. In 1978Robin Milner,[18]independently of Hindley's work, provided an equivalent algorithm,Algorithm W. In 1982Luis Damas[17]finally proved that Milner's algorithm is complete and extended it to support systems with polymorphic references. By design, type inference will infer the most general type appropriate. However, many languages, especially older programming languages, have slightly unsound type systems, where using a more general types may not always be algorithmically neutral. Typical cases include: Type inference algorithms have been used to analyzenatural languagesas well as programming languages.[19][20][21]Type inference algorithms are also used in somegrammar induction[22][23]andconstraint-based grammarsystems for natural languages.[24]
https://en.wikipedia.org/wiki/Type_inference
Incomputing,type introspectionis the ability of a program toexaminethetypeor properties of anobjectatruntime. Someprogramming languagespossess this capability. Introspection should not be confused withreflection, which goes a step further and is the ability for a program tomanipulatethe metadata, properties, and functions of an object at runtime. Some programming languages also possess that capability (e.g.,Java,Python,Julia, andGo). InObjective-C, for example, both the generic Object and NSObject (inCocoa/OpenStep) provide themethodisMemberOfClass:which returns true if the argument to the method is an instance of the specified class. The methodisKindOfClass:analogously returns true if the argument inherits from the specified class. For example, say we have anAppleand anOrangeclass inheriting fromFruit. Now, in theeatmethod we can write Now, wheneatis called with a generic object (anid), the function will behave correctly depending on the type of the generic object. C++ supports type introspection via therun-time type information(RTTI)typeidanddynamic castkeywords. Thedynamic_castexpression can be used to determine whether a particular object is of a particular derived class. For instance: Thetypeidoperator retrieves astd::type_infoobject describing the most derived type of an object: Type introspection has been a part of Object Pascal since the original release of Delphi, which uses RTTI heavily for visual form design. In Object Pascal, all classes descend from the base TObject class, which implements basic RTTI functionality. Every class's name can be referenced in code for RTTI purposes; the class name identifier is implemented as a pointer to the class's metadata, which can be declared and used as a variable of type TClass. The language includes anisoperator, to determine if an object is or descends from a given class, anasoperator, providing a type-checked typecast, and several TObject methods. Deeper introspection (enumerating fields and methods) is traditionally only supported for objects declared in the $M+ (a pragma) state, typically TPersistent, and only for symbols defined in the published section. Delphi 2010 increased this to nearly all symbols. The simplest example of type introspection in Java is theinstanceof[1]operator. Theinstanceofoperator determines whether a particular object belongs to a particular class (or a subclass of that class, or a class that implements that interface). For instance: Thejava.lang.Class[2]class is the basis of more advanced introspection. For instance, if it is desirable to determine the actual class of an object (rather than whether it is a member of aparticularclass),Object.getClass()andClass.getName()can be used: InPHPintrospection can be done usinginstanceofoperator. For instance: Introspection can be achieved using therefandisafunctions inPerl. We can introspect the following classes and their corresponding instances: using: Much more powerful introspection in Perl can be achieved using theMooseobject system[3]and theClass::MOPmeta-objectprotocol;[4]for example, you can check if a given objectdoesaroleX: This is how you can list fully qualified names of all of the methods that can be invoked on the object, together with the classes in which they were defined: The most common method of introspection inPythonis using thedirfunction to detail the attributes of an object. For example: Also, the built-in functionstypeandisinstancecan be used to determine what an objectiswhilehasattrcan determine what an objectdoes. For example: Type introspection is a core feature ofRuby. In Ruby, the Object class (ancestor of every class) providesObject#instance_of?andObject#kind_of?methods for checking the instance's class. The latter returns true when the particular instance the message was sent to is an instance of a descendant of the class in question. For example, consider the following example code (you can immediately try this with theInteractive Ruby Shell): In the example above, theClassclass is used as any other class in Ruby. Two classes are created,AandB, the former is being a superclass of the latter, then one instance of each class is checked. The last expression gives true becauseAis a superclass of the class ofb. Further, you can directly ask for the class of any object, and "compare" them (code below assumes having executed the code above): InActionScript(as3), the functionflash.utils.getQualifiedClassNamecan be used to retrieve the class/type name of an arbitrary object. Alternatively, the operatoriscan be used to determine if an object is of a specific type: This second function can be used to testclass inheritanceparents as well: Like Perl, ActionScript can go further than getting the class name, but all the metadata, functions and other elements that make up an object using theflash.utils.describeTypefunction; this is used when implementingreflectionin ActionScript.
https://en.wikipedia.org/wiki/Type_introspection
typeof, alternately alsotypeOf, andTypeOf, is anoperatorprovided by severalprogramming languagesto determine thedata typeof avariable. This is useful when constructing programs that must accept multiple types of data without explicitly specifying the type. In languages that supportpolymorphismandtype casting, the typeof operator may have one of two distinct meanings when applied to anobject. In some languages, such asVisual Basic,[1]the typeof operator returns thedynamic typeof the object. That is, it returns the true, original type of the object, irrespective of any type casting. In these languages, the typeof operator is the method for obtainingrun-time type information. In other languages, such asC#[2]orD[3]and, to some degree, in C (as part of nonstandard extensions andproposed standard revisions),[4][5]the typeof operator returns thestatic typeof the operand. That is, it evaluates to the declared type at that instant in the program, irrespective of its original form. These languages usually have other constructs for obtaining run-time type information, such astypeid. InC#: As ofC23typeof is a part of the C standard. The operator typeof_unqual was also added which is the same as typeof, except it removes cvr-qualification and atomic qualification.[6][7] In a non-standard (GNU) extension of theC programming language, typeof may be used to define a general macro for determining the maximum value of two parameters: Java does not have a keyword equivalent to typeof. All objects can use Object's getClass() method to return their class, which is always an instance of the Class class. All types can be explicitly named by appending ".class", even if they are not considered classes, for example int.class and String[].class . There is also the instanceof operator fortype introspectionwhich takes an instance and a class name, and returns true for all subclasses of the given class. InJavaScript: InTypeScript:[8] InVB.NET, the C# variant of "typeof" should be translated into the VB.NET'sGetTypemethod. TheTypeOfkeyword in VB.NET is used to compare an object reference variable to a data type. The following example usesTypeOf...Isexpressions to test the type compatibility of two object reference variables with various data types.
https://en.wikipedia.org/wiki/Typeof
Incomputer science,reflective programmingorreflectionis the ability of aprocessto examine,introspect, and modify its own structure and behavior.[1] The earliest computers were programmed in their nativeassembly languages, which were inherently reflective, as these original architectures could be programmed by defining instructions as data and usingself-modifying code. As the bulk of programming moved to higher-levelcompiled languagessuch asALGOL,COBOL,Fortran,Pascal, andC, this reflective ability largely disappeared until new programming languages with reflection built into their type systems appeared.[citation needed] Brian Cantwell Smith's 1982 doctoral dissertation introduced the notion of computational reflection in proceduralprogramming languagesand the notion of themeta-circular interpreteras a component of3-Lisp.[2][3] Reflection helps programmers make generic software libraries to display data, process different formats of data, performserializationand deserialization of data for communication, or do bundling and unbundling of data for containers or bursts of communication. Effective use of reflection almost always requires a plan: A design framework, encoding description, object library, a map of a database or entity relations. Reflection makes a language more suited to network-oriented code. For example, it assists languages such asJavato operate well in networks by enabling libraries for serialization, bundling and varying data formats. Languages without reflection such asCare required to use auxiliary compilers for tasks likeAbstract Syntax Notationto produce code for serialization and bundling. Reflection can be used for observing and modifying program execution atruntime. A reflection-oriented program component can monitor the execution of an enclosure of code and can modify itself according to a desired goal of that enclosure. This is typically accomplished by dynamically assigning program code at runtime. Inobject-oriented programminglanguages such asJava, reflection allowsinspectionof classes, interfaces, fields and methods at runtime without knowing the names of the interfaces, fields, methods atcompile time. It also allowsinstantiationof new objects andinvocationof methods. Reflection is often used as part ofsoftware testing, such as for the runtime creation/instantiation ofmock objects. Reflection is also a key strategy formetaprogramming. In some object-oriented programming languages such asC#andJava, reflection can be used to bypassmember accessibilityrules. For C#-properties this can be achieved by writing directly onto the (usually invisible) backing field of a non-public property. It is also possible to find non-public methods of classes and types and manually invoke them. This works for project-internal files as well as external libraries such as.NET's assemblies and Java's archives. A language that supports reflection provides a number of features available at runtime that would otherwise be difficult to accomplish in a lower-level language. Some of these features are the abilities to: These features can be implemented in different ways. InMOO, reflection forms a natural part of everyday programming idiom. When verbs (methods) are called, various variables such asverb(the name of the verb being called) andthis(the object on which the verb is called) are populated to give the context of the call. Security is typically managed by accessing the caller stack programmatically: Sincecallers() is a list of the methods by which the current verb was eventually called, performing tests oncallers()[0] (the command invoked by the original user) allows the verb to protect itself against unauthorised use. Compiled languages rely on their runtime system to provide information about the source code. A compiledObjective-Cexecutable, for example, records the names of all methods in a block of the executable, providing a table to correspond these with the underlying methods (or selectors for these methods) compiled into the program. In a compiled language that supports runtime creation of functions, such asCommon Lisp, the runtime environment must include a compiler or an interpreter. Reflection can be implemented for languages without built-in reflection by using aprogram transformationsystem to define automated source-code changes. Reflection may allow a user to create unexpectedcontrol flowpaths through an application, potentially bypassing security measures. This may be exploited by attackers.[4]Historicalvulnerabilitiesin Java caused by unsafe reflection allowed code retrieved from potentially untrusted remote machines to break out of the Javasandboxsecurity mechanism. A large scale study of 120 Java vulnerabilities in 2013 concluded that unsafe reflection is the most common vulnerability in Java, though not the most exploited.[5] The following code snippets create aninstancefooofclassFooand invoke itsmethodPrintHello. For eachprogramming language, normal and reflection-based call sequences are shown. The following is an example inCommon Lispusing theCommon Lisp Object System: The following is an example inC#: ThisDelphiandObject Pascalexample assumes that aTFooclass has been declared in a unit calledUnit1: The following is an example in eC: The following is an example inGo: The following is an example inJava: The following is an example inJavaScript: The following is an example inJulia: The following is an example inObjective-C, implying either theOpenSteporFoundation Kitframework is used: The following is an example inPerl: The following is an example inPHP:[6] The following is an example inPython: The following is an example inR: The following is an example inRuby: The following is an example usingXojo:
https://en.wikipedia.org/wiki/Reflection_(computer_science)
Templatesare a feature of theC++programming language that allowsfunctionsandclassesto operate withgeneric types. This allows a function or classdeclarationto reference via a genericvariableanother different class (built-in or newly declareddata type) without creating full declaration for each of these different classes. In plain terms, a templated class or function would be the equivalent of (before "compiling") copying and pasting the templated block of code where it is used, and then replacing the template parameter with the actual one. For this reason, classes employing templated methods place the implementation in the headers (*.h files) as no symbol could be compiled without knowing the type beforehand. TheC++ Standard Libraryprovides many useful functions within a framework of connected templates. Major inspirations for C++ templates were the parameterized modules provided by the languageCLUand the generics provided byAda.[1] There are three kinds of templates:function templates,class templatesand, sinceC++14,variable templates. SinceC++11, templates may be eithervariadicor non-variadic; in earlier versions of C++ they are always non-variadic. C++ Templates areTuring complete.[2] Afunction templatebehaves like a function except that the template can have arguments of many different types (see example). In other words, a function template represents a family of functions. The format for declaring function templates with type parameters is: Both expressions have the same meaning and behave in exactly the same way. The latter form was introduced to avoid confusion,[3]since a type parameter need not be a class until C++20. (It can be a basic type such asintordouble.) For example, the C++ Standard Library contains the function templatemax(x, y)which returns the larger ofxandy. That function template could be defined like this: This single function definition works with many data types. Specifically, it works with all data types for which<(the less-than operator) is defined and returns a value with a type convertible tobool. The usage of a function template saves space in the source code file in addition to limiting changes to one function description and making the code easier to read. An instantiated function template usually produces the same object code, though, compared to writing separate functions for all the different data types used in a specific program. For example, if a program uses both anintand adoubleversion of themax()function template above, thecompilerwill create an object code version ofmax()that operates onintarguments and another object code version that operates ondoublearguments.[citation needed]The compiler output will be identical to what would have been produced if the source code had contained two separate non-templated versions ofmax(), one written to handleintand one written to handledouble. Here is how the function template could be used: In the first two cases, the template argumentTis automatically deduced by the compiler to beintanddouble, respectively. In the third case automatic deduction ofmax(3, 7.0)would fail because the type of the parameters must in general match the template arguments exactly. Therefore, we explicitly instantiate thedoubleversion withmax<double>(). This function template can be instantiated with anycopy-constructibletype for which the expressiony < xis valid. For user-defined types, this implies that the less-than operator (<) must beoverloadedin the type. SinceC++20, usingautoorConceptautoin any of the parameters of afunction declaration, that declaration becomes anabbreviated function templatedeclaration.[4]Such a declaration declares a function template and one invented template parameter for each placeholder is appended to the template parameter list: A class template provides a specification for generating classes based on parameters. Class templates are generally used to implementcontainers. A class template is instantiated by passing a given set of types to it as template arguments.[5]The C++ Standard Library contains many class templates, in particular the containers adapted from theStandard Template Library, such asvector. In C++14, templates can be also used for variables, as in the following example: Although templating on types, as in the examples above, is the most common form of templating in C++, it is also possible to template on values. Thus, for example, a class declared with can be instantiated with a specificint. As a real-world example, thestandard libraryfixed-sizearraytypestd::arrayis templated on both a type (representing the type of object that the array holds) and a number which is of typestd::size_t(representing the number of elements the array holds).std::arraycan be declared as follows: and an array of sixchars might be declared: When a function or class is instantiated from a template, aspecializationof that template is created by the compiler for the set of arguments used, and the specialization is referred to as being a generated specialization. Sometimes, the programmer may decide to implement a special version of a function (or class) for a given set of template type arguments which is called an explicit specialization. In this way certain template types can have a specialized implementation that is optimized for the type or a more meaningful implementation than the generic implementation. Explicit specialization is used when the behavior of a function or class for particular choices of the template parameters must deviate from the generic behavior: that is, from the code generated by the main template, or templates. For example, the template definition below defines a specific implementation ofmax()for arguments of typeconst char*: C++11 introducedvariadic templates, which can take a variable number of arguments in a manner somewhat similar tovariadic functionssuch asstd::printf. C++11 introduced template aliases, which act like parameterizedtypedefs. The following code shows the definition of a template aliasStrMap. This allows, for example,StrMap<int>to be used as shorthand forstd::unordered_map<int,std::string>. Initially, the concept of templates was not included in some languages, such asJavaandC#1.0.Java's adoption of genericsmimics the behavior of templates, but is technically different. C# added generics (parameterized types) in.NET2.0. The generics in Ada predate C++ templates. Although C++ templates, Java generics, and.NETgenerics are often considered similar, generics only mimic the basic behavior ofC++templates.[6]Some of the advanced template features utilized by libraries such asBoostandSTLSoft, and implementations of the STL, fortemplate metaprogramming(explicit or partial specialization, default template arguments, template non-type arguments, template template arguments, ...) are unavailable with generics. In C++ templates, compile-time cases were historically performed by pattern matching over the template arguments. For example, the template base class in the Factorial example below is implemented by matching 0 rather than with an inequality test, which was previously unavailable. However, the arrival in C++11 of standard library features such as std::conditional has provided another, more flexible way to handle conditional template instantiation. With these definitions, one can compute, say 6! at compile time using the expressionFactorial<6>::value. Alternatively,constexprin C++11 /if constexprin C++17 can be used to calculate such values directly using a function at compile-time: Because of this, template meta-programming is now mostly used to do operations on types.
https://en.wikipedia.org/wiki/Template_(C%2B%2B)
Insystems engineering,information systemsandsoftware engineering, thesystems development life cycle(SDLC), also referred to as theapplication development life cycle, is a process for planning, creating, testing, and deploying aninformation system.[1]The SDLC concept applies to a range of hardware and software configurations, as a system can be composed of hardware only, software only, or a combination of both.[2]There are usually six stages in this cycle: requirement analysis, design, development and testing, implementation, documentation, and evaluation. A systems development life cycle is composed of distinct work phases that are used by systems engineers and systems developers to deliverinformation systems. Like anything that is manufactured on an assembly line, an SDLC aims to produce high-quality systems that meet or exceed expectations, based on requirements, by delivering systems within scheduled time frames and cost estimates.[3]Computer systems are complex and often link components with varying origins. Various SDLC methodologies have been created, such aswaterfall,spiral,agile,rapid prototyping,incremental, and synchronize and stabilize.[4] SDLC methodologies fit within a flexibility spectrum ranging from agile to iterative to sequential. Agile methodologies, such asXPandScrum, focus on lightweight processes that allow for rapid changes.[5]Iterativemethodologies, such asRational Unified Processanddynamic systems development method, focus on stabilizing project scope and iteratively expanding or improving products. Sequential or big-design-up-front (BDUF) models, such as waterfall, focus on complete and correct planning to guide larger projects and limit risks to successful and predictable results.[6]Anamorphic developmentis guided by project scope and adaptive iterations. Inproject managementa project can include both aproject life cycle(PLC) and an SDLC, during which somewhat different activities occur. According to Taylor (2004), "the project life cycle encompasses all the activities of theproject, while the systems development life cycle focuses on realizing the productrequirements".[7] SDLC is not a methodology per se, but rather a description of the phases that a methodology should address. The list of phases is not definitive, but typically includes planning, analysis, design, build, test, implement, and maintenance/support. In the Scrum framework,[8]for example, one could say a single user story goes through all the phases of the SDLC within a two-week sprint. By contrast the waterfall methodology, where every business requirement[citation needed]is translated into feature/functional descriptions which are then all implemented typically over a period of months or longer.[citation needed] According to Elliott (2004), SDLC "originated in the 1960s, to develop large scale functionalbusiness systemsin an age of large scalebusiness conglomerates. Information systems activities revolved around heavydata processingandnumber crunchingroutines".[9] Thestructured systems analysis and design method(SSADM) was produced for the UK governmentOffice of Government Commercein the 1980s. Ever since, according to Elliott (2004), "the traditional life cycle approaches to systems development have been increasingly replaced with alternative approaches and frameworks, which attempted to overcome some of the inherent deficiencies of the traditional SDLC".[9] SDLC provides a set of phases/steps/activities for system designers and developers to follow. Each phase builds on the results of the previous one.[10][11][12][13]Not every project requires that the phases be sequential. For smaller, simpler projects, phases may be combined/overlap.[10] The oldest and best known is thewaterfall model, which uses a linear sequence of steps.[11]Waterfall has different varieties. One variety is as follows:[10][11][14][15] Conduct with a preliminary analysis, consider alternative solutions, estimate costs and benefits, and submit a preliminary plan with recommendations. Decompose project goals[clarification needed]into defined functions and operations. This involves gathering and interpreting facts, diagnosing problems, and recommending changes. Analyze end-user information needs and resolve inconsistencies and incompleteness:[16] At this step, desired features and operations are detailed, including screen layouts,business rules,process diagrams,pseudocode, and other deliverables. Write the code. Assemble the modules in a testing environment. Check for errors, bugs, and interoperability. Put the system into production. This may involve training users, deploying hardware, and loading information from the prior system. Monitor the system to assess its ongoing fitness. Make modest changes and fixes as needed. To maintain the quality of the system. Continual monitoring and updates ensure the system remains effective and high-quality.[17] The system and the process are reviewed. Relevant questions include whether the newly implemented system meets requirements and achieves project goals, whether the system is usable, reliable/available, properly scaled and fault-tolerant. Process checks include review of timelines and expenses, as well as user acceptance. At end of life, plans are developed for discontinuing the system and transitioning to its replacement. Related information and infrastructure must be repurposed, archived, discarded, or destroyed, while appropriately protecting security.[18] In the following diagram, these stages are divided into ten steps, from definition to creation and modification of IT work products: Systems analysis and design(SAD) can be considered a meta-development activity, which serves to set the stage and bound the problem. SAD can help balance competing high-level requirements. SAD interacts with distributed enterprise architecture, enterprise I.T. Architecture, and business architecture, and relies heavily on concepts such as partitioning, interfaces, personae and roles, and deployment/operational modeling to arrive at a high-level system description. This high-level description is then broken down into the components and modules which can be analyzed, designed, and constructed separately and integrated to accomplish the business goal. SDLC and SAD are cornerstones of full life cycle product and system planning. Object-oriented analysis and design(OOAD) is the process of analyzing a problem domain to develop a conceptualmodelthat can then be used to guide development. During the analysis phase, a programmer develops written requirements and a formal vision document via interviews with stakeholders. The conceptual model that results from OOAD typically consists ofuse cases, andclassandinteraction diagrams. It may also include auser interfacemock-up. An outputartifactdoes not need to be completely defined to serve as input of object-oriented design; analysis and design may occur in parallel. In practice the results of one activity can feed the other in an iterative process. Some typical input artifacts for OOAD: The system lifecycle is a view of a system or proposed system that addresses all phases of its existence to include system conception, design and development, production and/or construction, distribution, operation, maintenance and support, retirement, phase-out, and disposal.[19] Theconceptual designstage is the stage where an identified need is examined, requirements for potential solutions are defined, potential solutions are evaluated, and a system specification is developed. The system specification represents the technical requirements that will provide overall guidance for system design. Because this document determines all future development, the stage cannot be completed until a conceptualdesign reviewhas determined that the system specification properly addresses the motivating need. Key steps within the conceptual design stage include: During this stage of the system lifecycle, subsystems that perform the desired system functions are designed and specified in compliance with the system specification. Interfaces between subsystems are defined, as well as overall test and evaluation requirements.[20]At the completion of this stage, a development specification is produced that is sufficient to perform detailed design and development. Key steps within the preliminary design stage include: For example, as the system analyst of Viti Bank, you have been tasked to examine the current information system. Viti Bank is a fast-growing bank inFiji. Customers in remote rural areas are finding difficulty to access the bank services. It takes them days or even weeks to travel to a location to access the bank services. With the vision of meeting the customers' needs, the bank has requested your services to examine the current system and to come up with solutions or recommendations of how the current system can be provided to meet its needs. This stage includes the development of detailed designs that brings initial design work into a completed form of specifications. This work includes the specification of interfaces between the system and its intended environment, and a comprehensive evaluation of the systems logistical, maintenance and support requirements. The detail design and development is responsible for producing the product, process and material specifications and may result in substantial changes to the development specification. Key steps within the detail design and development stage include: During the production and/or construction stage the product is built or assembled in accordance with the requirements specified in the product, process and material specifications, and is deployed and tested within the operational target environment. System assessments are conducted in order to correct deficiencies and adapt the system for continued improvement. Key steps within the product construction stage include: Once fully deployed, the system is used for its intended operational role and maintained within its operational environment. Key steps within the utilization and support stage include: Effectiveness and efficiency of the system must be continuously evaluated to determine when the product has met its maximum effective lifecycle.[21]Considerations include: Continued existence of operational need, matching between operational requirements and system performance, feasibility of system phase-out versus maintenance, and availability of alternative systems. During this step, current priorities that would be affected and how they should be handled are considered. Afeasibility studydetermines whether creating a new or improved system is appropriate. This helps to estimate costs, benefits, resource requirements, and specific user needs. The feasibility study should addressoperational,financial,technical, human factors, andlegal/politicalconcerns. The goal ofanalysisis to determine where the problem is. This step involves decomposing the system into pieces, analyzing project goals, breaking down what needs to be created, and engaging users to define requirements. Insystems design, functions and operations are described in detail, including screen layouts, business rules, process diagrams, and other documentation. Modular design reduces complexity and allows the outputs to describe the system as a collection of subsystems. The design stage takes as its input the requirements already defined. For each requirement, a set of design elements is produced. Design documents typically include functional hierarchy diagrams, screen layouts, business rules, process diagrams, pseudo-code, and a completedata modelwith adata dictionary. These elements describe the system in sufficient detail that developers and engineers can develop and deliver the system with minimal additional input. The code is tested at various levels insoftware testing. Unit, system, and user acceptance tests are typically performed. Many approaches to testing have been adopted. The following types of testing may be relevant: Once a system has been stabilized through testing, SDLC ensures that proper training is prepared and performed before transitioning the system to support staff and end users. Training usually covers operational training for support staff as well as end-user training. After training, systems engineers and developers transition the system to its production environment. Maintenanceincludes changes, fixes, and enhancements. The final phase of the SDLC is to measure the effectiveness of the system and evaluate potential enhancements. SDLC phase objectives are described in this section with key deliverables, a description of recommended tasks, and a summary of related control objectives for effective management. It is critical for the project manager to establish and monitor control objectives while executing projects. Control objectives are clear statements of the desired result or purpose and should be defined and monitored throughout a project. Control objectives can be grouped into major categories (domains), and relate to the SDLC phases as shown in the figure.[22] To manage and control a substantial SDLC initiative, awork breakdown structure(WBS) captures and schedules the work. The WBS and all programmatic material should be kept in the "project description" section of the project notebook.[clarification needed]The project manager chooses a WBS format that best describes the project. The diagram shows that coverage spans numerous phases of the SDLC but the associated MCD (Management Control Domains) shows mappings to SDLC phases. For example, Analysis and Design is primarily performed as part of the Acquisition and Implementation Domain, and System Build and Prototype is primarily performed as part of delivery and support.[22] The upper section of the WBS provides an overview of the project scope and timeline. It should also summarize the major phases and milestones. The middle section is based on the SDLC phases. WBS elements consist of milestones and tasks to be completed rather than activities to be undertaken and have a deadline. Each task has a measurable output (e.g., analysis document). A WBS task may rely on one or more activities (e.g. coding). Parts of the project needing support from contractors should have astatement of work(SOW). The development of a SOW does not occur during a specific phase of SDLC but is developed to include the work from the SDLC process that may be conducted by contractors.[22] Baselines[clarification needed]are established after four of the five phases of the SDLC, and are critical to theiterativenature of the model.[23]Baselines become milestones. Alternativesoftware development methodsto systems development life cycle are: – Fundamentally, SDLC trades flexibility for control by imposing structure. It is more commonly used for large scale projects with many developers.
https://en.wikipedia.org/wiki/Systems_development_life_cycle
Computer-aided software engineering(CASE) is a domain of software tools used to design and implement applications. CASE tools are similar to and are partly inspired bycomputer-aided design(CAD) tools used for designing hardware products. CASE tools are intended to help develop high-quality, defect-free, and maintainable software.[1]CASE software was often associated with methods for the development ofinformation systemstogether with automated tools that could be used in thesoftware development process.[2] The Information System Design and Optimization System (ISDOS) project, started in 1968 at theUniversity of Michigan, initiated a great deal of interest in the whole concept of using computer systems to help analysts in the very difficult process of analysing requirements and developing systems. Several papers by Daniel Teichroew fired a whole generation of enthusiasts with the potential of automated systems development. His Problem Statement Language / Problem Statement Analyzer (PSL/PSA) tool was a CASE tool although it predated the term.[3] Another major thread emerged as a logical extension to thedata dictionaryof adatabase. By extending the range ofmetadataheld, the attributes of an application could be held within a dictionary and used at runtime. This "active dictionary" became the precursor to the more modernmodel-driven engineeringcapability. However, the active dictionary did not provide a graphical representation of any of the metadata. It was the linking of the concept of a dictionary holding analysts' metadata, as derived from the use of an integrated set of techniques, together with the graphical representation of such data that gave rise to the earlier versions of CASE.[4] The next entrant into the market was Excelerator from Index Technology in Cambridge, Mass. While DesignAid ran on Convergent Technologies and later Burroughs Ngen networked microcomputers, Index launched Excelerator on theIBM PC/ATplatform. While, at the time of launch, and for several years, the IBM platform did not support networking or a centralized database as did the Convergent Technologies or Burroughs machines, the allure of IBM was strong, and Excelerator came to prominence. Hot on the heels of Excelerator were a rash of offerings from companies such as Knowledgeware (James Martin,Fran Tarkentonand Don Addington), Texas Instrument'sCA GenandAndersen Consulting'sFOUNDATION toolset (DESIGN/1, INSTALL/1, FCP).[5] CASE tools were at their peak in the early 1990s.[6]According to thePC Magazineof January 1990, over 100 companies were offering nearly 200 different CASE tools.[5]At the timeIBMhad proposed AD/Cycle, which was an alliance of software vendors centered on IBM'sSoftware repositoryusingIBM DB2inmainframeandOS/2: With the decline of the mainframe, AD/Cycle and the Big CASE tools died off, opening the market for the mainstream CASE tools of today. Many of the leaders of the CASE market of the early 1990s ended up being purchased byComputer Associates, including IEW, IEF, ADW, Cayenne, and Learmonth & Burchett Management Systems (LBMS). The other trend that led to the evolution of CASE tools was the rise of object-oriented methods and tools. Most of the various tool vendors added some support for object-oriented methods and tools. In addition new products arose that were designed from the bottom up to support the object-oriented approach. Andersen developed its project Eagle as an alternative to Foundation. Several of the thought leaders in object-oriented development each developed their own methodology and CASE tool set: Jacobson, Rumbaugh,Booch, etc. Eventually, these diverse tool sets and methods were consolidated via standards led by theObject Management Group(OMG). The OMG'sUnified Modelling Language(UML) is currently widely accepted as the industry standard for object-oriented modeling.[citation needed] CASE tools support specific tasks in the software development life-cycle. They can be divided into the following categories: Another common way to distinguish CASE tools is the distinction between Upper CASE and Lower CASE. Upper CASE Tools support business and analysis modeling. They support traditional diagrammatic languages such asER diagrams,Data flow diagram,Structure charts,Decision Trees,Decision tables, etc. Lower CASE Tools support development activities, such as physical design, debugging, construction, testing, component integration, maintenance, and reverse engineering. All other activities span the entire life-cycle and apply equally to upper and lower CASE.[8] Workbenches integrate two or more CASE tools and support specific software-process activities. Hence they achieve: An example workbench is Microsoft'sVisual Basicprogramming environment. It incorporates several development tools: a GUI builder, a smart code editor, debugger, etc. Most commercial CASE products tended to be such workbenches that seamlessly integrated two or more tools. Workbenches also can be classified in the same manner as tools; as focusing on Analysis, Development, Verification, etc. as well as being focused on the upper case, lower case, or processes such as configuration management that span the complete life-cycle. An environment is a collection of CASE tools or workbenches that attempts to support the complete software process. This contrasts with tools that focus on one specific task or a specific part of the life-cycle. CASE environments are classified by Fuggetta as follows:[9] In practice, the distinction between workbenches and environments was flexible. Visual Basic for example was a programming workbench but was also considered a 4GL environment by many. The features that distinguished workbenches from environments were deep integration via a shared repository or common language and some kind of methodology (integrated and process-centered environments) or domain (4GL) specificity.[9] Some of the most significant risk factors for organizations adopting CASE technology include:
https://en.wikipedia.org/wiki/Computer-aided_software_engineering
This is a list of approaches, styles, methodologies, and philosophies in software development and engineering. It also containsprogramming paradigms,software development methodologies,software development processes, and single practices, principles, and laws. Some of the mentioned methods are more relevant to a specific field than another, such as automotive or aerospace.[1][2]The trend towards agile methods in software engineering is noticeable,[3]however the need for improved studies on the subject is also paramount.[4][5]Also note that some of the methods listed might be newerorolderorstill in useorout-dated, and the research on software design methods is not new and on-going.[6][7][8][9]
https://en.wikipedia.org/wiki/List_of_software_development_philosophies
The followingoutlineis provided as an overview of and topical guide to software engineering: Software engineering– application of a systematic, disciplined, quantifiable approach to the development, operation, and maintenance ofsoftware; that is the application ofengineeringtosoftware.[1] The ACM Computing Classification system is a poly-hierarchical ontology that organizes the topics of the field and can be used in semantic web applications and as a de facto standard classification system for the field. The major section "Software and its Engineering" provides an outline and ontology for software engineering. Softwareengineers buildsoftware(applications,operating systems,system software) that people use. Applications influence software engineering by pressuring developers to solve problems in new ways. For example, consumer software emphasizes low cost, medical software emphasizes high quality, and Internet commerce software emphasizes rapid development. A platform combines computer hardware and an operating system. As platforms grow more powerful and less costly, applications and tools grow more widely available. Skilled software engineers know a lot ofcomputer scienceincluding what is possible and impossible, and what is easy and hard for software. Discrete mathematicsis a key foundation ofsoftwareengineering. Other Deliverables must be developed for many SE projects. Software engineers rarely make all of these deliverables themselves. They usually cooperate with the writers, trainers, installers, marketers, technical support people, and others who make many of these deliverables. History of software engineering Many people made important contributions to SE technologies, practices, or applications. See also
https://en.wikipedia.org/wiki/Outline_of_software_engineering
Software project managementis the process of planning and leading software projects.[1]It is a sub-discipline ofproject managementin whichsoftwareprojects are planned, implemented, monitored and controlled. In the 1970s and 1980s,the software industrygrew very quickly, as computer companies quickly recognized the relatively low cost of software production compared to hardware production and circuitry. To manage new development efforts, companies applied the established project management methods, but projectschedulesslippedduring test runs, especially when confusion occurred in the gray zone between the user specifications and the delivered software. To be able to avoid these problems,softwareproject management methods focused on matching user requirements to delivered products, in a method known now as thewaterfall model. As the industry has matured, analysis of software project management failures has shown that the following are the most common causes:[2][3][4] The first five items in the list above show the difficulties articulating the needs of the client in such a way that proper resources can deliver the proper project goals. Specificsoftware project management toolsare useful and often necessary, but the true art in software project management is applying the correct method and then using tools to support the method. Without a method, tools are worthless. Since the 1960s, several proprietary software project management methods have been developed by software manufacturers for their own use, while computer consulting firms have also developed similar methods for their clients. Today software project management methods are still evolving, but the current trend leads away from the waterfall model to a more cyclic project delivery model that imitates a software development process. Asoftware development processis concerned primarily with the production aspect ofsoftware development, as opposed to the technical aspect, such assoftware tools. These processes exist primarily for supporting the management of software development, and are generally skewed toward addressing business concerns. Many software development processes can be run in a similar way to general project management processes. Examples are: The purpose ofproject planningis to identify the scope of the project,estimatethe work involved, and create aproject schedule. Project planning begins withrequirementsthat define the software to be developed. Theproject planis then developed to describe thetasksthat will lead to completion. Theproject executionis the process of completing the tasks defined in the project plan. The purpose of project monitoring and control is to keep the team and management up to date on the project's progress. If the project deviates from the plan, then the project manager can take action to correct the problem. Project monitoring and control involves status meetings to gather status from the team. When changes need to be made,change controlis used to keep the products up to date. In computing, the term "issue" is a unit of work to accomplish an improvement in a system.[6]An issue could be abug, a requestedfeature, task, missingdocumentation, and so forth. For example,OpenOffice.orgused to call their modified version ofBugzillaIssueZilla. As of September 2010[update], they call their system Issue Tracker.[needs update] Issues are often categorized in terms ofseverity levels. Different companies have different definitions of severities, but some of the most common ones are: In some implementations of software development processes, issues are investigated byquality assurance analystsa system is verified for correctness, and then assigned back to a member of the development team to resolve the identified issue. They can also be identified by system users during theUser Acceptance Testing (UAT)phase. Issues can be recorded and communicated usingIssue or Defect Tracking Systems. In the absence of a formal Issue or Defect Tracking system, it is commonplace to simply use any form of written communication such as emails or instant messages to communicate the existence of a found issue. As a subdiscipline of project management, some regard the management of software development akin to the management ofmanufacturing, which can be performed by someone with management skills, but no programming skills.John C. Reynoldsrebuts this view, and argues that software development is entirelydesignwork, and compares amanagerwho cannotprogramto themanaging editorof anewspaperwho cannotwrite.[7]
https://en.wikipedia.org/wiki/Software_project_management
Software developmentis the process ofdesigningandimplementingasoftwaresolution tosatisfyauser. The process is more encompassing thanprogramming, writingcode, in that it includes conceiving the goal, evaluating feasibility, analyzingrequirements,design,testingandrelease. The process is part ofsoftware engineeringwhich also includesorganizational management,project management,configuration managementand other aspects.[1] Software development involves many skills and job specializations includingprogramming,testing,documentation,graphic design,user support,marketing, andfundraising. Software development involves manytoolsincluding:compiler,integrated development environment(IDE),version control,computer-aided software engineering, andword processor. The details of the process used for a development effort varies. The process may be confined to a formal, documentedstandard, or it can be customized andemergentfor the development effort. The process may be sequential, in which each major phase (i.e. design, implement and test) is completed before the next begins, but an iterative approach – where small aspects are separately designed, implemented and tested – can reduce risk and cost and increase quality. Each of the available methodologies are best suited to specific kinds of projects, based on various technical, organizational, project, and team considerations.[3] Another focus in many programming methodologies is the idea of trying to catch issues such assecurity vulnerabilitiesandbugsas early as possible (shift-left testing) to reduce the cost of tracking and fixing them.[13] In 2009, it was estimated that 32 percent of software projects were delivered on time and budget, and with the full functionality. An additional 44 percent were delivered, but missing at least one of these features. The remaining 24 percent were cancelled prior to release.[14] Software development life cyclerefers to the systematic process of developingapplications.[15] The sources of ideas for software products are plentiful. These ideas can come frommarket researchincluding thedemographicsof potential new customers, existing customers, sales prospects who rejected the product, other internal software development staff, or a creative third party. Ideas for software products are usually first evaluated bymarketingpersonnel for economic feasibility, fit with existing channels of distribution, possible effects on existing product lines, requiredfeatures, and fit with the company's marketing objectives. In the marketing evaluation phase, the cost and time assumptions become evaluated.[16]The feasibility analysis estimates the project'sreturn on investment, its development cost and timeframe. Based on this analysis, the company can make a business decision to invest in further development.[17]After deciding to develop the software, the company is focused on delivering the product at or below the estimated cost and time, and with a high standard of quality (i.e., lack of bugs) and the desired functionality. Nevertheless, most software projects run late and sometimes compromises are made in features or quality to meet a deadline.[18] Software analysis begins with arequirements analysisto capture the business needs of the software.[19]Challenges for the identification of needs are that current or potential users may have different and incompatible needs, may not understand their own needs, and change their needs during the process of software development.[20]Ultimately, the result of analysis is a detailed specification for the product that developers can work from. Software analysts oftendecomposethe project into smaller objects, components that can be reused for increased cost-effectiveness, efficiency, and reliability.[19]Decomposing the project may enable amulti-threadedimplementation that runs significantly faster onmultiprocessorcomputers.[21] During the analysis and design phases of software development,structured analysisis often used to break down the customer's requirements into pieces that can be implemented by software programmers.[22]The underlying logic of the program may be represented indata-flow diagrams,data dictionaries,pseudocode,state transition diagrams, and/orentity relationship diagrams.[23]If the project incorporates a piece oflegacy softwarethat has not been modeled, this software may be modeled to help ensure it is correctly incorporated with the newer software.[24] Design involves choices about the implementation of the software, such as whichprogramming languagesand database software to use, or how the hardware and network communications will be organized. Design may be iterative with users consulted about their needs in a process oftrial and error. Design often involves people expert in aspect such asdatabase design, screen architecture, and the performance of servers and other hardware.[19]Designers often attempt to findpatternsin the software's functionality to spin off distinct modules that can be reused withobject-oriented programming. An example of this is themodel–view–controller, an interface between agraphical user interfaceand thebackend.[25] The central feature of software development is creating and understanding the software that implements the desired functionality.[26]There are various strategies for writing the code. Cohesive software has various components that are independent from each other.[19]Coupling is the interrelation of different software components, which is viewed as undesirable because it increases the difficulty ofmaintenance.[27]Often, software programmers do not follow industry best practices, resulting in code that is inefficient, difficult to understand, or lackingdocumentationon its functionality.[28]These standards are especially likely to break down in the presence of deadlines.[29]As a result, testing, debugging, and revising the code becomes much more difficult.Code refactoring, for example adding more comments to the code, is a solution to improve the understandability of code.[30] Testing is the process of ensuring that the code executes correctly and without errors.Debuggingis performed by each software developer on their own code to confirm that the code does what it is intended to. In particular, it is crucial that the software executes on all inputs, even if the result is incorrect.[31]Code reviewsby other developers are often used to scrutinize new code added to the project, and according to some estimates dramatically reduce the number of bugs persisting after testing is complete.[32]Once the code has been submitted,quality assurance—a separate department of non-programmers for most large companies—test the accuracy of the entire software product.Acceptance testsderived from the original software requirements are a popular tool for this.[31]Quality testing also often includes stress and load checking (whether the software is robust to heavy levels of input or usage),integration testing(to ensure that the software is adequately integrated with other software), andcompatibility testing(measuring the software's performance across different operating systems or browsers).[31]When tests are written before the code, this is calledtest-driven development.[33] Production is the phase in which software is deployed to the end user.[34]During production, the developer may create technical support resources for users[35][34]or a process for fixing bugs and errors that were not caught earlier. There might also be a return to earlier development phases if user needs changed or were misunderstood.[34] Software development is performed bysoftware developers, usually working on a team. Efficient communications between team members is essential to success. This is more easily achieved if the team is small, used to working together, and located near each other.[36]Communications also help identify problems at an earlier state of development and avoid duplicated effort. Many development projects avoid the risk of losing essential knowledge held by only one employee by ensuring that multiple workers are familiar with each component.[37]Software development involves professionals from various fields, not just softwareprogrammersbut also product managers who set the strategy and roadmap for the product,[38]individuals specialized in testing, documentation writing,graphic design, user support,marketing, and fundraising. Although workers for proprietary software are paid, most contributors toopen-source softwareare volunteers.[39]Alternately, they may be paid by companies whosebusiness modeldoes not involve selling the software, but something else—such as services and modifications to open source software.[40] Computer-aided software engineering(CASE) is tools for the partialautomationof software development.[41]CASE enables designers to sketch out the logic of a program, whether one to be written, or an already existing one to help integrate it with new code orreverse engineerit (for example, to change theprogramming language).[42] Documentation comes in two forms that are usually kept separate—that intended for software developers, and that made available to the end user to help them use the software.[43][44]Most developer documentation is in the form ofcode commentsfor each file,class, andmethodthat cover theapplication programming interface(API)—how the piece of software can be accessed by another—and often implementation details.[45]This documentation is helpful for new developers to understand the project when they begin working on it.[46]In agile development, the documentation is often written at the same time as the code.[47]User documentation is more frequently written bytechnical writers.[48] Accurate estimation is crucial at the feasibility stage and in delivering the product on time and within budget. The process of generating estimations is often delegated by theproject manager.[49]Because the effort estimation is directly related to the size of the complete application, it is strongly influenced by addition of features in the requirements—the more requirements, the higher the development cost. Aspects not related to functionality, such as the experience of the software developers and code reusability, are also essential to consider in estimation.[50]As of 2019[update], most of the tools for estimating the amount of time and resources for software development were designed for conventional applications and are not applicable toweb applicationsormobile applications.[51] Anintegrated development environment(IDE) supports software development with enhanced features compared to a simpletext editor.[52]IDEs often include automatedcompiling,syntax highlightingof errors,[53]debugging assistance,[54]integration withversion control, and semi-automation of tests.[52] Version control is a popular way of managing changes made to the software. Whenever a new version is checked in, the software saves abackupof all modified files. If multiple programmers are working on the software simultaneously, it manages the merging of their code changes. The software highlights cases where there is a conflict between two sets of changes and allows programmers to fix the conflict.[55] Aview modelis a framework that provides theviewpointson thesystemand itsenvironment, to be used in thesoftware development process. It is a graphical representation of the underlying semantics of a view. The purpose of viewpoints and views is to enable human engineers to comprehend verycomplex systemsand to organize the elements of the problem around domains ofexpertise. In theengineeringof physically intensive systems, viewpoints often correspond to capabilities and responsibilities within the engineering organization.[56] Fitness functionsare automated and objective tests to ensure that the new developments don't deviate from the established constraints, checks and compliance controls.[57] Intellectual propertycan be an issue when developers integrateopen-sourcecode or libraries into a proprietary product, because mostopen-source licensesused for software require that modifications be released under the same license. As an alternative, developers may choose a proprietary alternative or write their own software module.[58]
https://en.wikipedia.org/wiki/Software_development
Insoftware development,effort estimationis the process of predicting the most realistic amount of effort (expressed in terms of person-hours or money) required to develop or maintainsoftwarebased on incomplete, uncertain and noisy input. Effortestimatesmay be used as input to project plans, iteration plans, budgets, investment analyses, pricing processes and bidding rounds.[1][2] Published surveys on estimation practice suggest that expert estimation is the dominant strategy when estimating software development effort.[3] Typically, effort estimates are over-optimistic and there is a strong over-confidence in their accuracy. The mean effort overrun seems to be about 30% and not decreasing over time. For a review of effort estimation error surveys, see.[4]However, the measurement of estimation error is problematic, seeAssessing the accuracy of estimates. The strong overconfidence in the accuracy of the effort estimates is illustrated by the finding that, on average, if a software professional is 90% confident or "almost sure" to include the actual effort in a minimum-maximum interval, the observed frequency of including the actual effort is only 60-70%.[5] Currently the term "effort estimate" is used to denote as different concepts such as most likely use of effort (modal value), the effort that corresponds to a probability of 50% of not exceeding (median), the planned effort, the budgeted effort or the effort used to propose a bid or price to the client. This is believed to be unfortunate, because communication problems may occur and because the concepts serve different goals.[6][7] Software researchers and practitioners have been addressing the problems of effort estimation for software development projects since at least the 1960s; see, e.g., work by Farr[8][9]and Nelson.[10] Most of the research has focused on the construction of formal software effort estimation models. The early models were typically based onregression analysisor mathematically derived from theories from other domains. Since then a high number of model building approaches have been evaluated, such as approaches founded oncase-based reasoning, classification andregression trees,simulation,neural networks,Bayesian statistics,lexical analysisof requirement specifications,genetic programming,linear programming, economic production models,soft computing,fuzzy logicmodeling, statisticalbootstrapping, and combinations of two or more of these models. The perhaps most common estimation methods today are the parametric estimation modelsCOCOMO,SEER-SEMand SLIM. They have their basis in estimation research conducted in the 1970s and 1980s and are since then updated with new calibration data, with the last major release being COCOMO II in the year 2000. The estimation approaches based on functionality-based size measures, e.g.,function points, is also based on research conducted in the 1970s and 1980s, but are re-calibrated with modified size measures and different counting approaches, such as theuse case points[11]orobject pointsandCOSMIC Function Pointsin the 1990s. There are many ways of categorizing estimation approaches, see for example.[12][13]The top level categories are the following: Below are examples of estimation approaches within each category. The evidence on differences in estimation accuracy of different estimation approaches and models suggest that there is no "best approach" and that the relative accuracy of one approach or model in comparison to another depends strongly on the context .[18]This implies that different organizations benefit from different estimation approaches. Findings[19]that may support the selection of estimation approach based on the expected accuracy of an approach include: The most robust finding, in many forecasting domains, is that combination of estimates from independent sources, preferable applying different approaches, will on average improve the estimation accuracy.[19][20][21] It is important to be aware of the limitations of each traditional approach to measuring software development productivity.[22] In addition, other factors such as ease of understanding and communicating the results of an approach, ease of use of an approach, and cost of introduction of an approach should be considered in a selection process. The most common measure of the average estimation accuracy is the MMRE (Mean Magnitude of Relative Error), where the MRE of each estimate is defined as: This measure has been criticized[23][24][25]and there are several alternative measures, such as more symmetric measures,[26]Weighted Mean of Quartiles of relative errors (WMQ)[27]and Mean Variation from Estimate (MVFE).[28] MRE is not reliable if the individual items are skewed. PRED(25) is preferred as a measure of estimation accuracy. PRED(25) measures the percentage of predicted values that are within 25 percent of the actual value. A high estimation error cannot automatically be interpreted as an indicator of low estimation ability. Alternative, competing or complementing, reasons include low cost control of project, high complexity of development work, and more delivered functionality than originally estimated. A framework for improved use and interpretation of estimation error measurement is included in.[29] There are many psychological factors potentially explaining the strong tendency towards over-optimistic effort estimates. These factors are essential to consider even when using formal estimation models, because much of the input to these models is judgment-based. Factors that have been demonstrated to be important arewishful thinking,anchoring,planning fallacyandcognitive dissonance.[30] The chronic underestimation of development effort has led to the coinage and popularity of numerous humorous adages, such as ironically referring to a task as a "small matter of programming" (when much effort is likely required), and citing laws about underestimation: The first 90 percent of the code accounts for the first 90 percent of the development time. The remaining 10 percent of the code accounts for the other 90 percent of the development time.[31] Hofstadter's Law: It always takes longer than you expect, even when you take into account Hofstadter's Law. What one programmer can do in one month, two programmers can do in two months.
https://en.wikipedia.org/wiki/Software_development_effort_estimation
Software documentationis written text or illustration that accompanies computersoftwareor is embedded in the source code. The documentation either explains how the software operates or how to use it, and may mean different things to people in different roles. Documentationis an important part of software engineering. Types of documentation include: Requirementsdocumentation is the description of what a particular software does or should do. It is used throughoutdevelopmentto communicate how the software functions or how it is intended to operate. It is also used as an agreement or as the foundation for agreement on what the software will do. Requirements are produced and consumed by everyone involved in the production of software, including:end users,customers,project managers,sales,marketing,software architects,usability engineers,interaction designers,developers, andtesters. Requirements come in a variety of styles, notations and formality. Requirements can be goal-like (e.g.,distributed work environment), close to design (e.g.,builds can be started by right-clicking a configuration file and selecting the 'build' function), and anything in between. They can be specified as statements innatural language, as drawn figures, as detailedmathematical formulas, or as a combination of them all. The variation and complexity of requirement documentation make it a proven challenge. Requirements may be implicit and hard to uncover. It is difficult to know exactly how much and what kind of documentation is needed and how much can be left to the architecture and design documentation, and it is difficult to know how to document requirements considering the variety of people who shall read and use the documentation. Thus, requirements documentation is often incomplete (or non-existent). Without proper requirements documentation, software changes become more difficult — and therefore more error prone (decreasedsoftware quality) and time-consuming (expensive). The need for requirements documentation is typically related to the complexity of the product, the impact of the product, and thelife expectancyof the software. If the software is very complex or developed by many people (e.g., mobile phone software), requirements can help better communicate what to achieve. If the software is safety-critical and can have a negative impact on human life (e.g., nuclear power systems, medical equipment, mechanical equipment), more formal requirements documentation is often required. If the software is expected to live for only a month or two (e.g., very small mobile phone applications developed specifically for a certain campaign) very little requirements documentation may be needed. If the software is a first release that is later built upon, requirements documentation is very helpful when managing the change of the software and verifying that nothing has been broken in the software when it is modified. Traditionally, requirements are specified in requirements documents (e.g. using word processing applications and spreadsheet applications). To manage the increased complexity and changing nature of requirements documentation (and software documentation in general), database-centric systems and special-purposerequirements managementtools are advocated. In Agile software development, requirements are often expressed asuser storieswith accompanying acceptance criteria. User stories are typically part of a feature, or an epic, which is a broader functionality or set of related functionalities that deliver a specific value to the user based on the business requirements. Architecture documentation (also known assoftware architecture description) is a special type of design document. In a way, architecture documents are third derivative from the code (design documentbeing second derivative, and code documents being first). Very little in the architecture documents is specific to the code itself. These documents do not describe how to program a particular routine, or even why that particular routine exists in the form that it does, but instead merely lays out the general requirements that would motivate the existence of such a routine. A good architecture document is short on details but thick on explanation. It may suggest approaches for lower level design, but leave the actual exploration trade studies to other documents. Another type of design document is the comparison document, or trade study. This would often take the form of awhitepaper. It focuses on one specific aspect of the system and suggests alternate approaches. It could be at theuser interface, code, design, or even architectural level. It will outline what the situation is, describe one or more alternatives, and enumerate the pros and cons of each. A good trade study document is heavy on research, expresses its idea clearly (without relying heavily on obtusejargonto dazzle the reader), and most importantly is impartial. It should honestly and clearly explain the costs of whatever solution it offers as best. The objective of a trade study is to devise the best solution, rather than to push a particular point of view. It is perfectly acceptable to state no conclusion, or to conclude that none of the alternatives are sufficiently better than the baseline to warrant a change. It should be approached as a scientific endeavor, not as a marketing technique. A very important part of the design document in enterprise software development is the Database Design Document (DDD). It contains Conceptual, Logical, and Physical Design Elements. The DDD includes the formal information that the people who interact with the database need. The purpose of preparing it is to create a common source to be used by all players within the scene. The potential users are: When talking aboutRelational DatabaseSystems, the document should include following parts: It is very important to include all information that is to be used by all actors in the scene. It is also very important to update the documents as any change occurs in the database as well. It is important for the code documents associated with the source code (which may includeREADMEfiles andAPIdocumentation) to be thorough, but not so verbose that it becomes overly time-consuming or difficult to maintain them. Various how-to and overview documentation guides are commonly found specific to the software application or software product being documented byAPI writers. This documentation may be used by developers, testers, and also end-users. Today, a lot of high-end applications are seen in the fields of power, energy, transportation, networks, aerospace, safety, security, industry automation, and a variety of other domains. Technical documentation has become important within such organizations as the basic and advanced level of information may change over a period of time with architecture changes. There is evidence that the existence of good code documentation actually reduces maintenance costs for software.[1] Code documents are often organized into areference guidestyle, allowing a programmer to quickly look up an arbitrary function or class. Often,toolssuch asDoxygen,NDoc,Visual Expert,Javadoc,JSDoc,EiffelStudio,Sandcastle,ROBODoc,POD,TwinText, or Universal Report can be used to auto-generate the code documents—that is, they extract the comments andsoftware contracts, where available, from the source code and create reference manuals in such forms as text orHTMLfiles. The idea of auto-generating documentation is attractive to programmers for various reasons. For example, because it is extracted from the source code itself (for example, throughcomments), the programmer can write it while referring to the code, and use the same tools used to create the source code to make the documentation. This makes it much easier to keep the documentation up-to-date. A possible downside is that only programmers can edit this kind of documentation, and it depends on them to refresh the output (for example, by running acron jobto update the documents nightly). Some would characterize this as a pro rather than a con. Respected computer scientistDonald Knuthhas noted that documentation can be a very difficult afterthought process and has advocatedliterate programming, written at the same time and location as thesource codeand extracted by automatic means. The programming languagesHaskellandCoffeeScripthave built-in support for a simple form of literate programming, but this support is not widely used. Elucidative Programming is the result of practical applications of Literate Programming in real programming contexts. The Elucidative paradigm proposes that source code and documentation be stored separately. Often, software developers need to be able to create and access information that is not going to be part of the source file itself. Suchannotationsare usually part of several software development activities, such as code walks and porting, where third-party source code is analysed in a functional way. Annotations can therefore help the developer during any stage of software development where a formal documentation system would hinder progress. Unlike code documents, user documents simply describe how a program is used. In the case of asoftware library, the code documents and user documents could in some cases be effectively equivalent and worth conjoining, but for a general application this is not often true. Typically, the user documentation describes each feature of the program, and assists the user in realizing these features. It is very important for user documents to not be confusing, and for them to be up to date. User documents do not need to be organized in any particular way, but it is very important for them to have a thoroughindex. Consistency and simplicity are also very valuable. User documentation is considered to constitute a contract specifying what the software will do.API Writersare very well accomplished towards writing good user documents as they would be well aware of the software architecture and programming techniques used. See alsotechnical writing. User documentation can be produced in a variety of online and print formats.[2]However, there are three broad ways in which user documentation can be organized. A common complaint among users regarding software documentation is that only one of these three approaches was taken to the near-exclusion of the other two. It is common to limit provided software documentation forpersonal computerstoonline helpthat gives only reference information on commands or menu items. The job of tutoring new users or helping more experienced users get the most out of a program is left to private publishers, who are often given significant assistance by the software developer. Like other forms of technical documentation, good user documentation benefits from an organized process of development. In the case of user documentation, the process as it commonly occurs in industry consists of five steps:[5] For many applications it is necessary to have some promotional materials to encourage casual observers to spend more time learning about the product. This form of documentation has three purposes: "The resistance to documentation among developers is well known and needs no emphasis."[10]This situation is particularly prevalent inagile software developmentbecause these methodologies try to avoid any unnecessary activities that do not directly bring value. Specifically, theAgile Manifestoadvocates valuing "working software over comprehensive documentation", which could be interpreted cynically as "We want to spend all our time coding. Remember, real programmers don't write documentation."[11] A survey among software engineering experts revealed, however, that documentation is by no means considered unnecessary in agile development. Yet it is acknowledged that there are motivational problems in development, and that documentation methods tailored to agile development (e.g. throughReputation systemsandGamification) may be needed.[12][13] Docs as Codeis an approach to documentation that treats it with the same rigor and processes as software code. This includes:
https://en.wikipedia.org/wiki/Software_documentation
Bottom-upandtop-downare strategies of composition and decomposition in fields as diverse asinformation processingand ordering knowledge,software,humanisticandscientific theories(seesystemics), and management and organization. In practice they can be seen as a style of thinking, teaching, or leadership. Atop-downapproach (also known asstepwise designandstepwise refinementand in some cases used as a synonym ofdecomposition) is essentially the breaking down of a system to gain insight into its compositional subsystems in areverse engineeringfashion. In a top-down approach an overview of the system is formulated, specifying, but not detailing, any first-level subsystems. Each subsystem is then refined in yet greater detail, sometimes in many additional subsystem levels, until the entirespecificationis reduced to base elements. A top-down model is often specified with the assistance ofblack boxes, which makes it easier to manipulate. However, black boxes may fail to clarify elementary mechanisms or be detailed enough to realisticallyvalidatethe model. A top-down approach starts with the big picture, then breaks down into smaller segments.[1] Abottom-upapproach is the piecing together of systems to give rise to more complex systems, thus making the original systems subsystems of the emergent system. Bottom-up processing is a type ofinformation processingbased on incoming data from the environment to form aperception. From a cognitive psychology perspective, information enters the eyes in one direction (sensory input, or the "bottom"), and is then turned into an image by the brain that can be interpreted and recognized as a perception (output that is "built up" from processing to finalcognition). In a bottom-up approach the individual base elements of the system are first specified in great detail. These elements are then linked together to form larger subsystems, which then in turn are linked, sometimes in many levels, until a complete top-level system is formed. This strategy often resembles a "seed" model, by which the beginnings are small but eventually grow in complexity and completeness. But "organic strategies" may result in a tangle of elements and subsystems, developed in isolation and subject to local optimization as opposed to meeting a global purpose. In thesoftware development process, the top-down and bottom-up approaches play a key role. Top-down approaches emphasize planning and a complete understanding of the system. It is inherent that no coding can begin until a sufficient level of detail has been reached in the design of at least some part of the system. Top-down approaches are implemented by attaching the stubs in place of the module. But these delay testing of the ultimate functional units of a system until significant design is complete. Bottom-up emphasizes coding and early testing, which can begin as soon as the first module has been specified. But this approach runs the risk that modules may be coded without having a clear idea of how they link to other parts of the system, and that such linking may not be as easy as first thought.Re-usability of codeis one of the main benefits of a bottom-up approach.[2][failed verification] Top-down design was promoted in the 1970s byIBMresearchersHarlan MillsandNiklaus Wirth. Mills developedstructured programmingconcepts for practical use and tested them in a 1969 project to automate theNew York Timesmorgue index. The engineering and management success of this project led to the spread of the top-down approach through IBM and the rest of the computer industry. Among other achievements, Niklaus Wirth, the developer ofPascal programming language, wrote the influential paperProgram Development by Stepwise Refinement. Since Niklaus Wirth went on to develop languages such asModulaandOberon(where one could define a module before knowing about the entire program specification), one can infer that top-down programming was not strictly what he promoted. Top-down methods were favored insoftware engineeringuntil the late 1980s,[2][failed verification]andobject-oriented programmingassisted in demonstrating the idea that both aspects of top-down and bottom-up programming could be used. Modernsoftware designapproaches usually combine top-down and bottom-up approaches. Although an understanding of the complete system is usually considered necessary for good design—leading theoretically to a top-down approach—most software projects attempt to make use of existing code to some degree. Pre-existing modules give designs a bottom-up flavor. Top-down is a programming style, the mainstay of traditionalprocedural languages, in which design begins by specifying complex pieces and then dividing them into successively smaller pieces. The technique for writing a program using top-down methods is to write a main procedure that names all the major functions it will need. Later, the programming team looks at the requirements of each of those functions and the process is repeated. These compartmentalized subroutines eventually will perform actions so simple they can be easily and concisely coded. When all the various subroutines have been coded the program is ready for testing. By defining how the application comes together at a high level, lower-level work can be self-contained. In a bottom-up approach the individual base elements of the system are first specified in great detail. These elements are then linked together to form larger subsystems, which in turn are linked, sometimes at many levels, until a complete top-level system is formed. This strategy often resembles a "seed" model, by which the beginnings are small, but eventually grow in complexity and completeness. Object-oriented programming (OOP) is a paradigm that uses "objects" to design applications and computer programs. In mechanical engineering with software programs such as Pro/ENGINEER, Solidworks, and Autodesk Inventor users can design products as pieces not part of the whole and later add those pieces together to form assemblies like building withLego. Engineers call this "piece part design". Parsingis the process of analyzing an input sequence (such as that read from a file or a keyboard) in order to determine its grammatical structure. This method is used in the analysis of bothnatural languagesandcomputer languages, as in acompiler.Bottom-up parsingis parsing strategy that recognizes the text's lowest-level small details first, before its mid-level structures, and leaves the highest-level overall structure to last.[3]Intop-down parsing, on the other hand, one first looks at the highest level of theparse treeand works down the parse tree by using the rewriting rules of aformal grammar.[4] Top-down and bottom-up are two approaches for the manufacture of products. These terms were first applied to the field of nanotechnology by theForesight Institutein 1989 to distinguish between molecular manufacturing (to mass-produce large atomically precise objects) and conventional manufacturing (which can mass-produce large objects that are not atomically precise). Bottom-up approaches seek to have smaller (usuallymolecular) components built up into more complex assemblies, while top-down approaches seek to create nanoscale devices by using larger, externally controlled ones to direct their assembly. Certain valuable nanostructures, such asSilicon nanowires, can be fabricated using either approach, with processing methods selected on the basis of targeted applications. A top-down approach often uses the traditional workshop or microfabrication methods where externally controlled tools are used to cut, mill, and shape materials into the desired shape and order.Micropatterningtechniques, such asphotolithographyandinkjet printingbelong to this category. Vapor treatment can be regarded as a new top-down secondary approaches to engineer nanostructures.[5] Bottom-up approaches, in contrast, use the chemical properties of single molecules to cause single-molecule components to (a) self-organize or self-assemble into some useful conformation, or (b) rely on positional assembly. These approaches use the concepts ofmolecular self-assemblyand/ormolecular recognition. See alsoSupramolecular chemistry. Such bottom-up approaches should, broadly speaking, be able to produce devices in parallel and much cheaper than top-down methods but could potentially be overwhelmed as the size and complexity of the desired assembly increases. These terms are also employed incognitive sciencesincludingneuroscience,cognitive neuroscienceandcognitive psychologyto discuss the flow of information in processing.[6][page needed]Typically,sensoryinput is considered bottom-up, andhigher cognitive processes, which have more information from other sources, are considered top-down. A bottom-up process is characterized by an absence of higher-level direction in sensory processing, whereas a top-down process is characterized by a high level of direction of sensory processing by more cognition, such as goals or targets (Biederman, 19).[2][failed verification] According to college teaching notes written by Charles Ramskov,[who?]Irvin Rock, Neiser, and Richard Gregory claim that the top-down approach involves perception that is an active and constructive process.[7][better source needed]Additionally, it is an approach not directly given by stimulus input, but is the result of stimulus, internal hypotheses, and expectation interactions. According to theoretical synthesis, "when a stimulus is presented short and clarity is uncertain that gives a vague stimulus, perception becomes a top-down approach."[8] Conversely, psychology defines bottom-up processing as an approach in which there is a progression from the individual elements to the whole. According to Ramskov, one proponent of bottom-up approach, Gibson, claims that it is a process that includes visual perception that needs information available from proximal stimulus produced by the distal stimulus.[9][page needed][better source needed][10]Theoretical synthesis also claims that bottom-up processing occurs "when a stimulus is presented long and clearly enough."[8] Certain cognitive processes, such as fast reactions or quick visual identification, are considered bottom-up processes because they rely primarily on sensory information, whereas processes such asmotorcontrol anddirected attentionare considered top-down because they are goal directed. Neurologically speaking, some areas of the brain, such as areaV1mostly have bottom-up connections.[8]Other areas, such as thefusiform gyrushave inputs from higher brain areas and are considered to have top-down influence.[11][better source needed] The study ofvisual attentionis an example. If your attention is drawn to a flower in a field, it may be because the color or shape of the flower are visually salient. The information that caused you to attend to the flower came to you in a bottom-up fashion—your attention was not contingent on knowledge of the flower: the outside stimulus was sufficient on its own. Contrast this situation with one in which you are looking for a flower. You have a representation of what you are looking for. When you see the object, you are looking for, it is salient. This is an example of the use of top-down information. In cognition, two thinking approaches are distinguished. "Top-down" (or "big chunk") is stereotypically the visionary, or the person who sees the larger picture and overview. Such people focus on the big picture and from that derive the details to support it. "Bottom-up" (or "small chunk") cognition is akin to focusing on the detail primarily, rather than the landscape. The expression "seeing the wood for the trees" references the two styles of cognition.[12] Studies in task switching and response selection show that there are differences through the two types of processing. Top-down processing primarily focuses on the attention side, such as task repetition.[13][page needed]Bottom-up processing focuses on item-based learning, such as finding the same object over and over again.[13][page needed]Implications for understanding attentional control of response selection in conflict situationsare discussed.[incomprehensible][13][page needed] This also applies to how we[who?]structure these processing neurologically. With structuring information interfaces in our neurological processes for procedural learning. These processes were proven effective to work in our[who?]interface design. But although both top-down principles were effective in guiding interface design; they were not sufficient. They can be combined with iterative bottom-up methods to produce usable interfaces .[14][clarification needed] Undergraduate (or bachelor) students are taught the basis of top-down bottom-up processing around their third year in the program.[citation needed]Going through four main parts of the processing when viewing it from a learning perspective. The two main definitions are that bottom-up processing is determined directly by environmental stimuli rather than the individual's knowledge and expectations.[15] Both top-down and bottom-up approaches are used in public health. There are many examples of top-down programs, often run by governments or largeinter-governmental organizations; many of these are disease-or issue-specific, such asHIVcontrol orsmallpoxeradication. Examples of bottom-up programs include many small NGOs set up to improve local access to healthcare. But many programs seek to combine both approaches; for instance,guinea worm eradication, a single-disease international program currently run by theCarter Centerhas involved the training of many local volunteers, boosting bottom-up capacity, as have international programs for hygiene, sanitation, and access to primary healthcare. Inecologytop-down control refers to when a top predator controls the structure or population dynamics of theecosystem. The interactions between these top predators and their prey are what influences lowertrophic levels. Changes in the top level of trophic levels have an inverse effect on the lower trophic levels. Top-down control can have negative effects on the surrounding ecosystem if there is a drastic change in the number of predators. The classic example is ofkelp forestecosystems. In such ecosystems,sea ottersare akeystonepredator. They prey onurchins, which in turn eat kelp. When otters are removed, urchin populations grow and reduce the kelp forest creatingurchin barrens. This reduces the diversity of the ecosystem as a whole and can have detrimental effects on all of the other organisms. In other words, such ecosystems are not controlled by productivity of the kelp, but rather, a top predator. One can see the inverse effect that top-down control has in this example; when the population of otters decreased, the population of the urchins increased. Bottom-up control in ecosystems refers to ecosystems in which the nutrient supply, productivity, and type ofprimary producers(plants and phytoplankton) control the ecosystem structure. If there are not enough resources or producers in the ecosystem, there is not enough energy left for the rest of the animals in the food chain because ofbiomagnificationandecological efficiency. An example would be how plankton populations are controlled by the availability of nutrients. Plankton populations tend to be higher and more complex in areas whereupwellingbrings nutrients to the surface. There are many different examples of these concepts. It is common for populations to be influenced by both types of control, and there are still debates going on as to which type of control affects food webs in certain ecosystems. In the fields of management and organization, the terms "top-down" and "bottom-up" are used to describe how decisions are made and/or how change is implemented.[16] A "top-down" approach is where an executive decision maker or other top person makes the decisions of how something should be done. This approach is disseminated under their authority to lower levels in the hierarchy, who are, to a greater or lesser extent, bound by them. For example, when wanting to make an improvement in a hospital, a hospital administrator might decide that a major change (such as implementing a new program) is needed, and then use a planned approach to drive the changes down to the frontline staff.[16] A bottom-up approach to changes is one that works from thegrassroots, and originates in a flat structure with people working together, causing a decision to arise from their joint involvement. A decision by a number of activists, students, or victims of some incident to take action is a "bottom-up" decision. A bottom-up approach can be thought of as "an incremental change approach that represents an emergent process cultivated and upheld primarily by frontline workers".[16] Positive aspects of top-down approaches include their efficiency and superb overview of higher levels;[16]and external effects can be internalized. On the negative side, if reforms are perceived to be imposed "from above", it can be difficult for lower levels to accept them.[17]Evidence suggests this to be true regardless of the content of reforms.[18]A bottom-up approach allows for more experimentation and a better feeling for what is needed at the bottom. Other evidence suggests that there is a third combination approach to change.[16] Top-down and bottom-up planning are two fundamental approaches inenterprise performance management(EPM), each offering distinct advantages. Top-down planning begins with senior management setting overarching strategic goals, which are then disseminated throughout the organization. This approach ensures alignment with the company's vision and facilitates uniform implementation across departments.[19] Conversely, bottom-up planning starts at the departmental or team level, where specific goals and plans are developed based on detailed operational insights. These plans are then aggregated to form the organization's overall strategy, ensuring that ground-level insights inform higher-level decisions. Many organizations adopt a hybrid approach, known as the countercurrent orintegrated planningmethod, to leverage the strengths of both top-down and bottom-up planning. In this model, strategic objectives set by leadership are informed by operational data from various departments, creating a dynamic and iterative planning process. This integration enhancescollaboration, improves data accuracy, and ensures that strategies are both ambitious and grounded in operational realities. Financial planning & analysis(FP&A) teams play a crucial role in harmonizing these approaches, utilizing tools like driver-based planning and AI-assisted forecasting to create flexible, data-driven plans that adapt to changing business conditions. During the development of new products, designers and engineers rely on both bottom-up and top-down approaches. The bottom-up approach is being used when off-the-shelf or existing components are selected and integrated into the product. An example includes selecting a particular fastener, such as a bolt, and designing the receiving components such that the fastener will fit properly. In a top-down approach, a custom fastener would be designed such that it would fit properly in the receiving components. For perspective, for a product with more restrictive requirements (such as weight, geometry, safety, environment), such as a spacesuit, a more top-down approach is taken and almost everything is custom designed. Often theÉcole des Beaux-Artsschool of design is said to have primarily promoted top-down design because it taught that an architectural design should begin with aparti, a basic plan drawing of the overall project.[20] By contrast, theBauhausfocused on bottom-up design. This method manifested itself in the study of translating small-scale organizational systems to a larger, more architectural scale (as with the wood panel carving and furniture design). Top-down reasoning in ethics is when the reasoner starts from abstract universalizable principles and then reasons down them to particular situations. Bottom-up reasoning occurs when the reasoner starts from intuitive particular situational judgements and then reasons up to principles.[21][full citation needed]Reflective equilibriumoccurs when there is interaction between top-down and bottom-up reasoning until both are in harmony.[22][full citation needed]That is to say, when universalizable abstract principles are reflectively found to be in equilibrium with particular intuitive judgements. The process occurs whencognitive dissonanceoccurs when reasoners try to resolve top-down with bottom-up reasoning, and adjust one or the other, until they are satisfied, they have found the best combinations of principles and situational judgements.
https://en.wikipedia.org/wiki/Top-down_and_bottom-up_design#Computer_science
User Account Control(UAC) is amandatory access controlenforcement feature introduced withMicrosoft'sWindows Vista[1]andWindows Server 2008operating systems, with a more relaxed[2]version also present inWindows 7,Windows Server 2008 R2,Windows 8,Windows Server 2012,Windows 8.1,Windows Server 2012 R2,Windows 10, andWindows 11. It aims to improve the security ofMicrosoft Windowsby limitingapplication softwareto standarduser privilegesuntil anadministratorauthorises an increase or elevation. In this way, only applications trusted by the user may receive administrative privileges andmalwareare kept from compromising the operating system. In other words, a user account may have administrator privileges assigned to it, but applications that the user runs do not inherit those privileges unless they are approved beforehand or the user explicitly authorises it. UAC usesMandatory Integrity Controlto isolate running processes with different privileges. To reduce the possibility of lower-privilege applications communicating with higher-privilege ones, another new technology,User Interface Privilege Isolation, is used in conjunction with User Account Control to isolate these processes from each other.[3]One prominent use of this isInternet Explorer 7's "Protected Mode".[4] Operating systems on mainframes and on servers have differentiated betweensuperusersanduserlandfor decades. This had an obvious security component, but also an administrative component, in that it prevented users from accidentally changing system settings. Early Microsofthome operating-systems(such asMS-DOSandWindows 9x) did not have a concept of different user-accounts on the same machine. Subsequent versions of Windows and Microsoft applications encouraged the use of non-administrator user-logons, yet some applications continued to require administrator rights. Microsoft does not certify applications as Windows-compliant if they require administrator privileges; such applications may not use the Windows-compliant logo with their packaging. Tasks that require administrator privileges will trigger a UAC prompt (if UAC is enabled); they are typically marked by a security shield icon with the 4 colors of the Windows logo (in Vista and Windows Server 2008) or with two panels yellow and two blue (Windows 7, Windows Server 2008 R2 and later). In the case of executable files, the icon will have a security shield overlay. The following tasks require administrator privileges:[9][10] Common tasks, such as changing the time zone, do not require administrator privileges[11](although changing the system time itself does, since the system time is commonly used in security protocols such asKerberos). A number of tasks that required administrator privileges in earlier versions of Windows, such as installing critical Windows updates, no longer require administrator privileges in Vista.[12]Any program can be run as administrator by right-clicking its icon and clicking "Run as administrator", except MSI or MSU packages as, due to their nature, if administrator rights will be required a prompt will usually be shown. Should this fail, the only workaround is to run a Command Prompt as an administrator and launch the MSI or MSP package from there. User Account Control asks for credentials in aSecure Desktopmode, where the entire screen is temporarily dimmed,Windows Aerodisabled, and only the authorization window at full brightness, to present only the elevation user interface (UI). Normal applications cannot interact with the Secure Desktop. This helps prevent spoofing, such as overlaying different text or graphics on top of the elevation request, or tweaking the mouse pointer to click the confirmation button when that's not what the user intended.[13]If an administrative activity comes from a minimized application, the secure desktop request will also be minimized so as to prevent thefocusfrom being lost. It is possible to disableSecure Desktop, though this is inadvisable from a security perspective.[14] In earlier versions of Windows, Applications written with the assumption that the user will be running with administrator privileges experienced problems when run from limited user accounts, often because they attempted to write to machine-wide or system directories (such asProgram Files) or registry keys (notablyHKLM).[5]UAC attempts to alleviate this usingFile and Registry Virtualization, which redirects writes (and subsequent reads) to a per-user location within the user's profile. For example, if an application attempts to write to a directory such as "C:\Program Files\appname\settings.ini" to which the user does not have write permission, the write will be redirected to "C:\Users\username\AppData\Local\VirtualStore\Program Files\appname\settings.ini". The redirection feature is only provided for non-elevated 32-bit applications, and only if they do not include a manifest that requests specific privileges.[15] There are a number of configurable UAC settings. It is possible to:[16] Command Promptwindows that are running elevated will prefix the title of the window with the word "Administrator", so that a user can discern which instances are running with elevated privileges.[18] A distinction is made between elevation requests from a signed executable and an unsigned executable; and if the former, whether the publisher is 'Windows Vista'. The color, icon, and wording of the prompts are different in each case; for example, attempting to convey a greater sense of warning if the executable is unsigned than if not.[19] Internet Explorer 7's "Protected Mode" feature uses UAC to run with a 'low'integrity level(a Standard user token has an integrity level of 'medium'; an elevated (Administrator) token has an integrity level of 'high'). As such, it effectively runs in a sandbox, unable to write to most of the system (apart from the Temporary Internet Files folder) without elevating via UAC.[7][20]Since toolbars and ActiveX controls run within the Internet Explorer process, they will run with low privileges as well, and will be severely limited in what damage they can do to the system.[21] A program can request elevation in a number of different ways. One way for program developers is to add a requestedPrivileges section to an XML document, known as themanifest, that is then embedded into the application. A manifest can specify dependencies, visual styles, and now the appropriate security context: Setting the level attribute for requestedExecutionLevel to "asInvoker" will make the application run with the token that started it, "highestAvailable" will present a UAC prompt for administrators and run with the usual reduced privileges for standard users, and "requireAdministrator" will require elevation.[22]In both highestAvailable and requireAdministrator modes, failure to provide confirmation results in the program not being launched. An executable that is marked as "requireAdministrator" in its manifest cannot be started from a non-elevated process usingCreateProcess(). Instead,ERROR_ELEVATION_REQUIREDwill be returned.ShellExecute()orShellExecuteEx()must be used instead. If anHWNDis not supplied, then the dialog will show up as a blinking item in the taskbar. Inspecting an executable's manifest to determine if it requires elevation is not recommended, as elevation may be required for other reasons (setup executables, application compatibility). However, it is possible to programmatically detect if an executable will require elevation by usingCreateProcess()and setting thedwCreationFlagsparameter toCREATE_SUSPENDED. If elevation is required, thenERROR_ELEVATION_REQUIREDwill be returned.[23]If elevation is not required, a success return code will be returned at which point one can useTerminateProcess()on the newly created, suspended process. This will not allow one to detect that an executable requires elevation if one is already executing in an elevated process, however. A new process with elevated privileges can be spawned from within a .NET application using the "runas" verb. An example usingC#: In a nativeWin32application the same "runas" verb can be added to aShellExecute()orShellExecuteEx()call:[7] In the absence of a specific directive stating what privileges the application requests, UAC will applyheuristics, to determine whether or not the application needs administrator privileges. For example, if UAC detects that the application is a setup program, from clues such as the filename, versioning fields, or the presence of certain sequences of bytes within the executable, in the absence of a manifest it will assume that the application needs administrator privileges.[24] UAC is aconveniencefeature; it neither introduces a security boundary nor prevents execution ofmalware.[25][26][27][28] Leo Davidson discovered that Microsoft weakened UAC inWindows 7through exemption of about 70 Windows programs from displaying a UAC prompt and presented aproof of conceptfor aprivilege escalation.[29] Stefan Kanthak presented a proof of concept for a privilege escalation via UAC's installer detection andIExpressinstallers.[30] Stefan Kanthak presented another proof of concept forarbitrary code executionas well as privilege escalation via UAC's auto-elevation and binary planting.[31] There have been complaints that UAC notifications slow down various tasks on the computer such as the initial installation of software ontoWindows Vista.[32]It is possible to turn off UAC while installing software, and re-enable it at a later time.[33]However, this is not recommended since, asFile & Registry Virtualizationis only active when UAC is turned on, user settings and configuration files may be installed to a different place (a system directory rather than a user-specific directory) if UAC is switched off than they would be otherwise.[14]AlsoInternet Explorer 7's "Protected Mode", whereby the browser runs in a sandbox with lower privileges than the standard user, relies on UAC; and will not function if UAC is disabled.[20] Yankee Groupanalyst Andrew Jaquith said, six months before Vista was released, that "while the new security system shows promise, it is far too chatty and annoying."[34]By the time Windows Vista was released in November 2006,Microsofthad drastically reduced the number ofoperating systemtasks that triggered UAC prompts, and added file and registry virtualization to reduce the number oflegacyapplications that triggered UAC prompts.[5]However, David Cross, a product unit manager at Microsoft, stated during theRSA Conference2008 that UAC was in fact designed to "annoy users," and force independent software vendors to make their programs more secure so that UAC prompts would not be triggered.[35]Software written forWindows XP, and many peripherals, would no longer work in Windows Vista or 7 due to the extensive changes made in the introduction of UAC. The compatibility options were also insufficient. In response to these criticisms, Microsoft altered UAC activity inWindows 7. For example, by default users are not prompted to confirm many actions initiated with the mouse and keyboard alone such as operating Control Panel applets. In a controversial article,New York TimesGadgetwise writer Paul Boutin said "Turn off Vista's overly protective User Account Control. Those pop-ups are like having your mother hover over your shoulder while you work."[36]Computerworld journalist Preston Gralla described the NYT article as "...one of the worst pieces of technical advice ever issued."[37]
https://en.wikipedia.org/wiki/User_Account_Control
Compartmentalization, ininformation security, whether public or private, is the limiting ofaccess to informationto persons or other entities on aneed-to-knowbasis to perform certain tasks. It originated in the handling ofclassified informationinmilitaryandintelligenceapplications. It dates back toantiquity, and was successfully used to keep the secret ofGreek fire.[1] The basis for compartmentalization is the idea that, if fewer people know the details of a mission or task, the risk or likelihood that such information will be compromised or fall into the hands of the opposition is decreased. Hence, varying levels of clearance within organizations exist. Yet, even if someone has the highest clearance, certain "compartmentalized" information, identified bycodewordsreferring to particular types of secret information, may still be restricted to certain operators, even with a lower overall security clearance. Information marked this way is said to becodeword–classified. One famous example of this was theUltrasecret, where documents were marked "Top Secret Ultra": "Top Secret" marked its security level, and the "Ultra" keyword further restricted its readership to only those cleared to read "Ultra" documents.[2] Compartmentalization is now also used in commercialsecurity engineeringas a technique to protect information such asmedical records. An example of compartmentalization was theManhattan Project. Personnel atOak Ridgeconstructed and operatedcentrifugesto isolateuranium-235from naturally occurring uranium, but most did not know exactly what they were doing. Those that knew did not know why they were doing it. Parts of the weapon were separately designed by teams who did not know how the parts interacted.[citation needed]
https://en.wikipedia.org/wiki/Compartmentalization_(intelligence)
In software systems,encapsulationrefers to the bundling of data with the mechanisms or methods that operate on the data. It may also refer to the limiting of direct access to some of that data, such as an object's components.[1]Essentially, encapsulation prevents external code from being concerned with the internal workings of an object. Encapsulation allows developers to present a consistent interface that is independent of its internal implementation. As one example, encapsulation can be used to hide the values or state of a structured data object inside aclass. This prevents clients from directly accessing this information in a way that could expose hidden implementation details or violatestateinvariance maintained by the methods. Encapsulation also encourages programmers to put all the code that is concerned with a certain set of data in the same class, which organizes it for easy comprehension by other programmers. Encapsulation is a technique that encouragesdecoupling. Allobject-oriented programming(OOP) systems support encapsulation,[2][3]but encapsulation is not unique to OOP. Implementations ofabstract data types,modules, andlibrariesalso offer encapsulation. The similarity has been explained by programming language theorists in terms ofexistential types.[4] Inobject-oriented programming languages, and other related fields, encapsulation refers to one of two related but distinct notions, and sometimes to the combination thereof:[5][6] Some programming language researchers and academics use the first meaning alone or in combination with the second as a distinguishing feature ofobject-oriented programming, while some programming languages that providelexical closuresview encapsulation as a feature of the languageorthogonalto object orientation. The second definition reflects that in many object-oriented languages, and other related fields, the components are not hidden automatically and this can be overridden. Thus,information hidingis defined as a separate notion by those who prefer the second definition. The features of encapsulation are supported usingclassesin most object-oriented languages, although other alternatives also exist. Encapsulation may also refer to containing a repetitive or complex process in a single unit to be invoked. Object-oriented programming facilitate this at both the method and class levels. This definition is also applicable toprocedural programming.[10] The authors ofDesign Patternsdiscuss the tension betweeninheritanceand encapsulation at length and state that in their experience, designers overuse inheritance. They claim that inheritance often breaks encapsulation, given that inheritance exposes a subclass to the details of its parent's implementation.[11]As described by theyo-yo problem, overuse of inheritance and therefore encapsulation, can become too complicated and hard to debug. Under the definition that encapsulation "can be used to hide data members and member functions", the internal representation of anobjectis generally hidden outside of the object's definition. Typically, only the object's own methods can directly inspect or manipulate its fields. Hiding the internals of the object protects its integrity by preventing users from setting the internal data of the component into an invalid or inconsistent state. A supposed benefit of encapsulation is that it can reduce system complexity, and thus increaserobustness, by allowing the developer to limit the interdependencies between software components.[citation needed] Some languages likeSmalltalkandRubyonly allow access via object methods, but most others (e.g.,C++,C#,DelphiorJava[12]) offer the programmer some control over what is hidden, typically via keywords likepublicandprivate.[8]ISO C++ standard refers toprotected,privateandpublicas "access specifiers" and that they do not "hide any information". Information hiding is accomplished by furnishing a compiled version of the source code that is interfaced via a header file. Almost always, there is a way to override such protection – usually viareflectionAPI (Ruby, Java, C#, etc.), sometimes by mechanism likename mangling(Python), or special keyword usage likefriendin C++. Systems that provide object-levelcapability-based security(adhering to theobject-capability model) are an exception, and guarantee strong encapsulation. Languages likeC++,C#,Java,[12]PHP,Swift, andDelphioffer ways to restrict access to data fields. Below is an example inC#that shows how access to a data field can be restricted through the use of aprivatekeyword: Below is an example inJava: Encapsulation is also possible in non-object-oriented languages. InC, for example, a structure can be declared in the public API via the header file for a set of functions that operate on an item of data containing data members that are not accessible to clients of the API with theexternkeyword.[13] Clients call the API functions to allocate, operate on, and deallocate objects of anopaque data type. The contents of this type are known and accessible only to the implementation of the API functions; clients cannot directly access its contents. The source code for these functions defines the actual contents of the structure: Below is an example ofPython, which does not support variable access restrictions. However, the convention is that a variable whose name is prefixed by an underscore should be considered private.[14]
https://en.wikipedia.org/wiki/Encapsulation_(object-oriented_programming)
The term "need to know" (alternatively spelledneed-to-know), when used bygovernmentsand other organizations (particularly those related tomilitary[1]orintelligence[2]), describes the restriction of data which is considered veryconfidentialandsensitive. Under need-to-know restrictions, even if one has all the necessary official approvals (such as asecurity clearance) to access certain information, one would not be given access to such information, or read into aclandestine operation, unless one has a specificneed to know; that is, access to the information must be necessary for one to conduct one's official duties. This term also includes anyone that the people with the knowledge deemed necessary to share it with. As with most security mechanisms, the aim is to make it difficult for unauthorized access to occur, without inconveniencing legitimate access. Need-to-know also aims to discourage "browsing" of sensitive material by limiting access to the smallest possible number of people. TheBattle of Normandyin 1944 is an example of a need-to-know restriction. Though thousands of military personnel were involved in planning the invasion, only a small number of them knew the entire scope of the operation; the rest were only informed of data needed to complete a small part of the plan. The same is true of theTrinity project, the first test of a nuclear weapon in 1945. Like other security measures, need to know can be misused by persons who wish to refuse others access to information they hold in an attempt to increase their personal power, prevent unwelcome review of their work or prevent embarrassment resulting from actions or thoughts. Need to know can also be invoked to hide illegal activities. This may be considered a necessary use, or a detrimental abuse of such a policy when considered from different perspectives. Need to know can be detrimental to workers' efficiency. Even when done in good faith, one might not be fully aware of who actually needs to know the information, resulting in inefficiencies as some people may inevitably withhold information that they require to perform their duty. The speed of computations withIBMmechanical calculatorsatLos Alamosdramatically increased after the calculators' operators were told what the numbers meant:[3] What they had to do was work on IBM machines – punching holes, numbers that they didn't understand. Nobody told them what it was. The thing was going very slowly. I said that the first thing there has to be is that these technical guys know what we're doing.Oppenheimerwent and talked to the security and got special permission so I could give a nice lecture about what we were doing, and they were all excited: "We're fighting a war! We see what it is!" They knew what the numbers meant. If the pressure came out higher, that meant there was more energy released, and so on and so on. They knew what they were doing. Complete transformation! They began to invent ways of doing it better. They improved the scheme. They worked at night. They didn't need supervising in the night; they didn't need anything. They understood everything; they invented several of the programs that we used. Thediscretionary access controlmechanisms of someoperating systemscan be used to enforce need to know.[4]In this case, the owner of a file determines whether another person should have access. Need to know is often concurrently applied withmandatory access controlschemes,[5]in which the lack of an official approval (such as a clearance) may absolutely prohibit a person from accessing the information. This is because need to know can be a subjective assessment. Mandatory access control schemes can also audit accesses, in order to determine if need to know has been violated. The term is also used in the concept ofgraphical user interfacedesign where computers are controlling complex equipment such as airplanes. In this usage, when many different pieces of data are dynamically competing for finiteuser interfacespace, safety-related messages are given priority.
https://en.wikipedia.org/wiki/Need_to_know
In computer security,privilege bracketingis a temporary increase insoftware privilegewithin a process to perform a specific function, assuming those necessary privileges at the last possible moment and dismissing them as soon as no longer strictly necessary, therefore ostensibly avoiding fallout from erroneous code that unintentionally exploits more privilege than is merited. It is an example of the use ofprinciple of least privilegeindefensive programming. It should be distinguished fromprivilege separation, which is a much more effective security measure that separates the privileged parts of the system from its unprivileged parts by putting them into different processes, as opposed to switching between them within a single process. A known example of privilege bracketing is in Debian/Ubuntu: using the 'sudo' tool to temporarily acquire 'root' privileges to perform an administrative command.[1]A Microsoft Powershell equivalent is "Just In Time, Just Enough Admin".[2] Thiscomputer securityarticle is astub. You can help Wikipedia byexpanding it.
https://en.wikipedia.org/wiki/Privilege_bracketing
Privilege escalationis the act of exploiting abug, adesign flaw, or a configuration oversight in anoperating systemorsoftware applicationto gain elevated access toresourcesthat are normally protected from an application oruser. The result is that an application or user with moreprivilegesthan intended by theapplication developerorsystem administratorcan performunauthorizedactions. Most computer systems are designed for use with multiple user accounts, each of which has abilities known asprivileges. Common privileges include viewing and editing files or modifying system files. Privilege escalation means users receive privileges they are not entitled to. These privileges can be used to delete files, viewprivate information, or install unwanted programs such as viruses. It usually occurs when a system has abugthat allows security to be bypassed or, alternatively, has flawed design assumptions about how it will be used. Privilege escalation occurs in two forms: This type ofprivilegeescalation occurs when the user or process is able to obtain a higher level of access than an administrator or system developer intended, possibly by performingkernel-leveloperations. In some cases, a high-privilege application assumes that it would only be provided with input matching its interface specification, thus doesn't validate this input. Then, an attacker may be able to exploit this assumption, in order to run unauthorized code with the application's privileges: In computer security,jailbreakingis defined as the act of removing limitations that a vendor attempted to hard-code into its software or services.[3]A common example is the use of toolsets to break out of achrootorjailinUNIX-likeoperating systems[4]or bypassingdigital rights management(DRM). In the former case, it allows the user to see files outside of thefilesystemthat the administrator intends to make available to the application or user in question. In the context of DRM, this allows the user to run arbitrarily defined code on devices with DRM as well as break out of chroot-like restrictions. The term originated with theiPhone/iOSjailbreaking community and has also been used as a term forPlayStation Portablehacking; these devices have repeatedly been subject to jailbreaks, allowing the execution of arbitrary code, and sometimes have had those jailbreaks disabled by vendor updates. iOSsystems including theiPhone,iPad, andiPod Touchhave been subject toiOS jailbreakingefforts since they were released, and continuing with each firmware update.[5][6]iOS jailbreaking tools include the option to install package frontends such asCydiaandInstaller.app, third-party alternatives to theApp Store, as a way to find and install system tweaks and binaries. To prevent iOS jailbreaking, Apple has made the deviceboot ROMexecute checks forSHSH blobsin order to disallow uploads of custom kernels and prevent software downgrades to earlier, jailbreakable firmware. In an "untethered" jailbreak, the iBoot environment is changed to execute a boot ROM exploit and allow submission of a patched low level bootloader or hack the kernel to submit the jailbroken kernel after the SHSH check. A similar method of jailbreaking exists forS60 Platformsmartphones, where utilities such as HelloOX allow the execution of unsigned code and full access to system files.[7][8]or edited firmware (similar to the M33 hacked firmware used for thePlayStation Portable)[9]to circumvent restrictions onunsigned code.Nokiahas since issued updates to curb unauthorized jailbreaking, in a manner similar to Apple. In the case of gaming consoles, jailbreaking is often used to executehomebrew games. In 2011,Sony, with assistance from law firmKilpatrick Stockton, sued 21-year-oldGeorge Hotzand associates of the group fail0verflow for jailbreaking thePlayStation 3(seeSony Computer Entertainment America v. George HotzandPlayStation Jailbreak). Jailbreaking can also occur in systems and software that use generative artificial intelligence models, such asChatGPT. In jailbreaking attacks onartificial intelligencesystems, users are able to manipulate the model to behave differently than it was programmed, making it possible to reveal information about how the model was instructed and induce it to respond in an anomalous or harmful way.[10][11] Android phones can be officially rooted by either going through manufacturers controlled process, using an exploit to gain root, or installing a rooting modification. Manufacturers allow rooting through a process they control, while some allow the phone to be rooted simply by pressing specific key combinations at boot time, or by other self-administered methods. Using a manufacturers method almost always factory resets the device, making rooting useless to people who want to view the data, and also voids the warranty permanently, even if the device is derooted and reflashed. Software exploits commonly either target a root-level process that is accessible to the user, by using an exploit specific to the phone's kernel, or using a known Android exploit that has been patched in newer versions; by not upgrading the phone, or intentionally downgrading the version. Operating systems and users can use the following strategies to reduce the risk of privilege escalation: Recent research has shown what can effectively provide protection against privilege escalation attacks. These include the proposal of the additional kernel observer (AKO), which specifically prevents attacks focused on OS vulnerabilities. Research shows that AKO is in fact effective against privilege escalation attacks.[14] Horizontal privilege escalation occurs when an application allows the attacker to gain access toresourceswhich normally would have been protected from an application oruser. The result is that the application performs actions with the same user but different security context than intended by theapplication developerorsystem administrator; this is effectively a limited form of privilege escalation (specifically, the unauthorized assumption of the capability of impersonating other users). Compared to the vertical privilege escalation, horizontal requires no upgrading the privilege of accounts. It often relies on the bugs in the system.[15] This problem often occurs inweb applications. Consider the following example: This malicious activity may be possible due to common web application weaknesses or vulnerabilities. Potential web application vulnerabilities or situations that may lead to this condition include:
https://en.wikipedia.org/wiki/Privilege_escalation
Privilege revocationis the act of anentitygiving up some, or all of, theprivilegesthey possess, or someauthoritytaking those (privileged) rights away. Honoring thePrinciple of least privilegeat a granularity provided by the base system such assandboxingof (to that point successful) attacks to an unprivileged user account helps inreliabilityof computing services provided by the system. As the chances of restarting such a process are better, and other services on the same machine aren't affected (or at least probably not as much as in the alternative case: i.e. a privileged process gone haywire instead). Incomputing securityprivilege revocationis a measure taken by aprogramto protect thesystemagainst misuse of itself. Privilege revocation is a variant ofprivilege separationwhereby the program terminates the privileged part immediately after it has served its purpose. If a program doesn't revoke privileges, it risks theescalation of privileges. Revocation of privileges is a technique ofdefensive programming.
https://en.wikipedia.org/wiki/Privilege_revocation_(computing)
Incomputer programmingandcomputer security,privilege separation(privsep) is one software-based technique for implementing theprinciple of least privilege.[1][2]With privilege separation, aprogramis divided into parts which are limited to the specificprivilegesthey require in order to perform a specific task. This is used to mitigate the potential damage of a computer security vulnerability. A common method to implement privilege separation is to have a computer programforkinto twoprocesses. The main program dropsprivileges, and the smaller program keeps privileges in order to perform a certain task. The two halves then communicate via asocketpair. Thus, any successful attack against the larger program will gain minimal access, even though the pair of programs will be capable of performing privileged operations. Privilege separation is traditionally accomplished by distinguishing arealuser ID/group IDfrom theeffectiveuser ID/group ID, using thesetuid(2)/setgid(2) and relatedsystem calls, which were specified byPOSIX. If these are incorrectly positioned, gaps can allow widespread network penetration. Manynetworkservicedaemonshave to do a specific privileged operation such as open araw socketor anInternet socketin thewell known portsrange. Administrativeutilitiescan require particular privileges atrun-timeas well. Such software tends to separate privileges by revoking them completely after the critical section is done, and change the user it runs under to some unprivileged account after so doing. This action is known asdropping rootunderUnix-likeoperating systems. The unprivileged part is usually run under the "nobody" user or an equivalent separate user account. Privilege separation can also be done by splitting functionality of a single program into multiple smaller programs, and then assigning the extended privileges to particular parts usingfile system permissions. That way the different programs have to communicate with each other through the operating system, so the scope of the potential vulnerabilities is limited (since acrashin the less privileged part cannot beexploitedto gain privileges, merely to cause adenial-of-service attack). Another email server software designed with privilege separation and security in mind isDovecot.[3] Separation of privileges is one of the majorOpenBSD security features.[4][5] OpenSSH uses privilege separation to ensurepseudo terminal(pty) creation happens in a secure part of the process, away from per connection processes with network access.[6] The implementation ofPostfixwas focused on implementing comprehensive privilege separation.[7][8] Solarisimplements a separate set of functions forprivilege bracketing.[9]
https://en.wikipedia.org/wiki/Privilege_separation
Incomputer science,hierarchical protection domains,[1][2]often calledprotection rings, are mechanisms to protect data and functionality from faults (by improvingfault tolerance) and malicious behavior (by providingcomputer security). Computer operating systems provide different levels of access to resources. A protection ring is one of two or more hierarchicallevelsorlayersofprivilegewithin the architecture of acomputer system. This is generally hardware-enforced by someCPUarchitecturesthat provide differentCPU modesat the hardware ormicrocodelevel. Rings are arranged in a hierarchy from most privileged (most trusted, usually numbered zero) to least privileged (least trusted, usually with the highest ring number). On most operating systems, Ring 0 is the level with the most privileges and interacts most directly with the physical hardware such as certain CPU functionality (e.g. the control registers) and I/O controllers. Special mechanisms are provided to allow an outer ring to access an inner ring's resources in a predefined manner, as opposed to allowing arbitrary usage. Correctly gating access between rings can improve security by preventing programs from one ring or privilege level from misusing resources intended for programs in another. For example,spywarerunning as a user program in Ring 3 should be prevented from turning on a web camera without informing the user, since hardware access should be a Ring 1 function reserved fordevice drivers. Programs such as web browsers running in higher numbered rings must request access to the network, a resource restricted to a lower numbered ring. X86S, a canceled Intel architecture published in 2024, has only ring 0 and ring 3. Ring 1 and 2 were to be removed under X86S since modern OSes never utilize them.[3][4] Multiple rings of protection were among the most revolutionary concepts introduced by theMulticsoperating system, a highly secure predecessor of today'sUnixfamily of operating systems. TheGE 645mainframe computer did have some hardware access control, including the same two modes that the other GE-600 series machines had, and segment-level permissions in itsmemory management unit("Appending Unit"), but that was not sufficient to provide full support for rings in hardware, so Multics supported them by trapping ring transitions in software;[5]its successor, theHoneywell 6180, implemented them in hardware, with support for eight rings;[6]Protection rings in Multics were separate from CPU modes; code in all rings other than ring 0, and some ring 0 code, ran in slave mode.[7] However, most general-purpose systems use only two rings, even if the hardware they run on provides moreCPU modesthan that. For example, Windows 7 and Windows Server 2008 (and their predecessors) use only two rings, with ring 0 corresponding tokernel modeand ring 3 touser mode,[8]because earlier versions of Windows NT ran on processors that supported only two protection levels.[9] Many modern CPU architectures (including the popularIntelx86architecture) include some form of ring protection, although theWindows NToperating system, like Unix, does not fully utilize this feature.OS/2does, to some extent, use three rings:[10]ring 0 for kernel code and device drivers, ring 2 for privileged code (user programs with I/O access permissions), and ring 3 for unprivileged code (nearly all user programs). UnderDOS, the kernel, drivers and applications typically run on ring 3 (however, this is exclusive to the case where protected-mode drivers or DOS extenders are used; as a real-mode OS, the system runs with effectively no protection), whereas 386 memory managers such asEMM386run at ring 0. In addition to this,DR-DOS' EMM386 3.xx can optionally run some modules (such asDPMS) on ring 1 instead.OpenVMSuses four modes called (in order of decreasing privileges) Kernel, Executive, Supervisor and User. A renewed interest in this design structure came with the proliferation of theXenVMMsoftware,ongoing discussiononmonolithicvs.micro-kernels(particularly inUsenetnewsgroups andWeb forums), Microsoft'sRing-1design structure as part of theirNGSCBinitiative, andhypervisorsbased onx86 virtualizationsuch asIntel VT-x(formerly Vanderpool). The original Multics system had eight rings, but many modern systems have fewer. The hardware remains aware of the current ring of the executing instructionthreadat all times, with the help of a special machine register. In some systems, areas ofvirtual memoryare instead assigned ring numbers in hardware. One example is theData General Eclipse MV/8000, in which the top three bits of theprogram counter (PC)served as the ring register. Thus code executing with the virtual PC set to 0xE200000, for example, would automatically be in ring 7, and calling a subroutine in a different section of memory would automatically cause a ring transfer. The hardware severely restricts the ways in which control can be passed from one ring to another, and also enforces restrictions on the types of memory access that can be performed across rings. Using x86 as an example, there is a special[clarification needed]gatestructure which is referenced by thecallinstruction that transfers control in a secure way[clarification needed]towards predefined entry points in lower-level (more trusted) rings; this functions as asupervisor callin many operating systems that use the ring architecture. The hardware restrictions are designed to limit opportunities for accidental or malicious breaches of security. In addition, the most privileged ring may be given special capabilities (such as real memory addressing that bypasses the virtual memory hardware). ARMversion 7 architecture implements three privilege levels: application (PL0), operating system (PL1), and hypervisor (PL2). Unusually, level 0 (PL0) is the least-privileged level, while level 2 is the most-privileged level.[11]ARM version 8 implements four exception levels: application (EL0), operating system (EL1), hypervisor (EL2), and secure monitor / firmware (EL3), for AArch64[12]: D1-2454and AArch32.[12]: G1-6013 Ring protection can be combined withprocessor modes(master/kernel/privileged/supervisor modeversus slave/unprivileged/user mode) in some systems. Operating systems running on hardware supporting both may use both forms of protection or only one. Effective use of ring architecture requires close cooperation between hardware and the operating system.[why?]Operating systems designed to work on multiple hardware platforms may make only limited use of rings if they are not present on every supported platform. Often the security model is simplified to "kernel" and "user" even if hardware provides finer granularity through rings.[13] In computer terms,supervisor modeis a hardware-mediated flag that can be changed by code running in system-level software. System-level tasks or threads may[a]have this flag set while they are running, whereas user-level applications will not. This flag determines whether it would be possible to execute machine code operations such as modifying registers for various descriptor tables, or performing operations such as disabling interrupts. The idea of having two different modes to operate in comes from "with more power comes more responsibility" – a program in supervisor mode is trusted never to fail, since a failure may cause the whole computer system to crash. Supervisor mode is "an execution mode on some processors which enables execution of all instructions, including privileged instructions. It may also give access to a different address space, to memory management hardware and to other peripherals. This is the mode in which the operating system usually runs."[14] In amonolithic kernel, the operating system runs in supervisor mode and the applications run in user mode. Other types ofoperating systems, like those with anexokernelormicrokernel, do not necessarily share this behavior. Some examples from the PC world: Most processors have at least two different modes. Thex86-processors have four different modes divided into four different rings. Programs that run in Ring 0 can doanythingwith the system, and code that runs in Ring 3 should be able to fail at any time without impact to the rest of the computer system. Ring 1 and Ring 2 are rarely used, but could be configured with different levels of access. In most existing systems, switching from user mode to kernel mode has an associated high cost in performance. It has been measured, on the basic requestgetpid, to cost 1000–1500 cycles on most machines. Of these just around 100 are for the actual switch (70 from user to kernel space, and 40 back), the rest is "kernel overhead".[15][16]In theL3 microkernel, the minimization of this overhead reduced the overall cost to around 150 cycles.[15] Maurice Wilkeswrote:[17] ... it eventually became clear that the hierarchical protection that rings provided did not closely match the requirements of the system programmer and gave little or no improvement on the simple system of having two modes only. Rings of protection lent themselves to efficient implementation in hardware, but there was little else to be said for them. [...] The attractiveness of fine-grained protection remained, even after it was seen that rings of protection did not provide the answer... This again proved a blind alley... To gain performance and determinism, some systems place functions that would likely be viewed as application logic, rather than as device drivers, in kernel mode; security applications (access control,firewalls, etc.) and operating system monitors are cited as examples. At least one embedded database management system,eXtremeDB Kernel Mode, has been developed specifically for kernel mode deployment, to provide a local database for kernel-based application functions, and to eliminate thecontext switchesthat would otherwise occur when kernel functions interact with a database system running in user mode.[18] Functions are also sometimes moved across rings in the other direction. The Linux kernel, for instance, injects into processes avDSOsection which contains functions that would normally require a system call, i.e. a ring transition. Instead of doing a syscall these functions use static data provided by the kernel. This avoids the need for a ring transition and so is more lightweight than a syscall. The function gettimeofday can be provided this way. Recent CPUs from Intel and AMD offerx86 virtualizationinstructions for ahypervisorto control Ring 0 hardware access. Although they are mutually incompatible, bothIntel VT-x(codenamed "Vanderpool") andAMD-V(codenamed "Pacifica") allow a guest operating system to run Ring 0 operations natively without affecting other guests or the host OS. Beforehardware-assisted virtualization, guest operating systems ran under ring 1. Any attempt that requires a higher privilege level to perform (ring 0) will produce an interrupt and then be handled using software; this is called "Trap and Emulate". To assist virtualization and reduce overhead caused by the reason above, VT-x and AMD-V allow the guest to run under Ring 0. VT-x introduces VMX Root/Non-root Operation: The hypervisor runs in VMX Root Operation mode, possessing the highest privilege. Guest OS runs in VMX Non-Root Operation mode, which allows them to operate at ring 0 without having actual hardware privileges. VMX non-root operation and VMX transitions are controlled by a data structure called a virtual-machine control.[19]These hardware extensions allow classical "Trap and Emulate" virtualization to perform on x86 architecture but now with hardware support. Aprivilege levelin thex86instruction setcontrols the access of the program currently running on the processor to resources such as memory regions, I/O ports, and special instructions. There are 4 privilege levels ranging from 0 which is the most privileged, to 3 which is least privileged. Most modern operating systems use level 0 for the kernel/executive, and use level 3 for application programs. Any resource available to level n is also available to levels 0 to n, so the privilege levels are rings. When a lesser privileged process tries to access a higher privileged process, ageneral protection faultexception is reported to the OS. It is not necessary to use all four privilege levels. Currentoperating systemswith wide market share includingMicrosoft Windows,macOS,Linux,iOSandAndroidmostly use apagingmechanism with only one bit to specify the privilege level as either Supervisor or User (U/S Bit).Windows NTuses the two-level system.[20]The real mode programs in 8086 are executed at level 0 (highest privilege level) whereas virtual mode in 8086 executes all programs at level 3.[21] Potential future uses for the multiple privilege levels supported by the x86 ISA family includecontainerizationandvirtual machines. A host operating system kernel could use instructions with full privilege access (kernel mode), whereas applications running on the guest OS in a virtual machine or container could use the lowest level of privileges in user mode. The virtual machine and guest OS kernel could themselves use an intermediate level of instruction privilege to invoke andvirtualizekernel-mode operations such assystem callsfrom the point of view of the guest operating system.[22] TheIOPL(I/O Privilege level) flag is a flag found on all IA-32 compatiblex86 CPUs. It occupies bits 12 and 13 in theFLAGS register. Inprotected modeandlong mode, it shows the I/O privilege level of the current program or task. The Current Privilege Level (CPL) (CPL0, CPL1, CPL2, CPL3) of the task or program must be less than or equal to the IOPL in order for the task or program to accessI/O ports. The IOPL can be changed usingPOPF(D)andIRET(D)only when the current privilege level is Ring 0. Besides IOPL, theI/O Port Permissionsin the TSS also take part in determining the ability of a task to access an I/O port. In x86 systems, the x86 hardware virtualization (VT-xandSVM) is referred as "ring −1", theSystem Management Modeis referred as "ring −2", theIntel Management EngineandAMD Platform Security Processorare sometimes referred as "ring −3".[23] Many CPU hardware architectures provide far more flexibility than is exploited by theoperating systemsthat they normally run. Proper use of complex CPU modes requires very close cooperation between the operating system and the CPU, and thus tends to tie the OS to the CPU architecture. When the OS and the CPU are specifically designed for each other, this is not a problem (although some hardware features may still be left unexploited), but when the OS is designed to be compatible with multiple, different CPU architectures, a large part of the CPU mode features may be ignored by the OS. For example, the reason Windows uses only two levels (ring 0 and ring 3) is that some hardware architectures that were supported in the past (such asPowerPCorMIPS) implemented only two privilege levels.[8] Multicswas an operating system designed specifically for a special CPU architecture (which in turn was designed specifically for Multics), and it took full advantage of the CPU modes available to it. However, it was an exception to the rule. Today, this high degree of interoperation between the OS and the hardware is not often cost-effective, despite the potential advantages for security and stability. Ultimately, the purpose of distinct operating modes for the CPU is to provide hardware protection against accidental or deliberate corruption of the system environment (and corresponding breaches of system security) by software. Only "trusted" portions of system software are allowed to execute in the unrestricted environment of kernel mode, and then, in paradigmatic designs, only when absolutely necessary. All other software executes in one or more user modes. If a processor generates a fault or exception condition in a user mode, in most cases system stability is unaffected; if a processor generates a fault or exception condition in kernel mode, most operating systems will halt the system with an unrecoverable error. When a hierarchy of modes exists (ring-based security), faults and exceptions at one privilege level may destabilize only the higher-numbered privilege levels. Thus, a fault in Ring 0 (the kernel mode with the highest privilege) will crash the entire system, but a fault in Ring 2 will only affect Rings 3 and beyond and Ring 2 itself, at most. Transitions between modes are at the discretion of the executingthreadwhen the transition is from a level of high privilege to one of low privilege (as from kernel to user modes), but transitions from lower to higher levels of privilege can take place only through secure, hardware-controlled "gates" that are traversed by executing special instructions or when external interrupts are received. Microkerneloperating systems attempt to minimize the amount of code running in privileged mode, for purposes ofsecurityandelegance, but ultimately sacrificing performance.
https://en.wikipedia.org/wiki/Protection_ring
sudo(/suːduː/[4]) is ashellcommandonUnix-likeoperating systemsthat enables a user to run a program with the security privileges of another user, by default thesuperuser.[5]It originally stood for "superuser do",[6]as that was all it did, and this remains its most common usage;[7]however, the official Sudo project page lists it as "su 'do'".[8]The current Linux manual pages definesuas "substitute user",[9]making the correct meaning ofsudo"substitute user, do", becausesudocan run a command as other users as well.[10][11] Unlike the similar commandsu, users must, by default, supply their ownpasswordfor authentication, rather than the password of the target user. After authentication, and if theconfiguration file(typically/etc/sudoers) permits the user access, the system invokes the requested command. The configuration file offers detailed access permissions, including enabling commands only from the invoking terminal; requiring a password per user or group; requiring re-entry of a password every time or never requiring a password at all for a particular command line. It can also be configured to permit passing arguments or multiple commands. Robert Coggeshall and Cliff Spencer wrote the original subsystem around 1980 at the Department of Computer Science atSUNY/Buffalo.[12]Robert Coggeshall brought sudo with him to theUniversity of Colorado Boulder. Between 1986 and 1993, the code and features were substantially modified by the IT staff of theUniversity of Colorado Boulder Computer Science Departmentand the College of Engineering and Applied Science, including Todd C. Miller.[12]The current version has been publicly maintained byOpenBSDdeveloper Todd C. Miller since 1994,[12]and has been distributed under anISC-stylelicense since 1999.[12] In November 2009 Thomas Claburn, in response to concerns thatMicrosofthad patented sudo,[13]characterized such suspicions as overblown.[14]Theclaimswere narrowly framed to a particularGUI, rather than to the sudo concept.[15] The logo is a reference to anxkcdstrip, where an order for a sandwich is accepted when preceded withsudo.[16][17] Unlike forsu, users supply their personal password tosudo(if necessary)[18]rather than that of the superuser or other account. This allows authorized users to exercise altered privileges without compromising the secrecy of the other account's password.[19]Users must be in a certaingroupto use thesudocommand, typically either thewheelorsudogroup.[20]After authentication, and if the configuration file permits the user access, the system invokes the requested command.sudoretains the user's invocation rights through a grace period (typically 5 minutes) perpseudo terminal, allowing the user to execute several successive commands as the requested user without having to provide a password again.[21] As a security and auditing feature,sudomay be configured to log each command run. When a user attempts to invokesudowithout being listed in the configuration file, an exception indication is presented to the user indicating that the attempt has been recorded. If configured, the root user will be alerted viamail. By default, an entry is recorded in the system.[22] The/etc/sudoersfile contains a list of users or user groups with permission to execute a subset of commands while having the privileges of theroot useror another specified user. The file can be edited by using the commandsudo vi sudo. Sudo contains several configuration options such as allowing commands to be run assudowithout a password, changing which users can usesudo, and changing the message displayed upon entering an incorrect password.[23]Sudo features aneaster eggthat can be enabled from the configuration file that will display an insult every time an incorrect password is entered.[24] In some system distributions,sudohas largely supplanted the default use of a distinct superuser login for administrative tasks, most notably in someLinux distributionsas well as Apple'smacOS.[25][26]This allows for more secure logging of admin commands and prevents some exploits. In association withSELinux,sudocan be used to transition between roles inrole-based access control(RBAC).[27] visudois a command-line utility that allows editing the sudo configuration file in a fail-safe manner. It prevents multiple simultaneous edits withlocksand performssanity and syntax checks. Sudoedit is a program that symlinks to the sudo binary.[28]When sudo is run via its sudoedit alias, sudo behaves as if the -e flag has been passed and allows users to edit files that require additional privileges to write to.[29] Microsoft released its own tool also calledsudoforWindowsin February 2024. Its interface is similar to its Unix counterpart by giving the ability to run elevated commands from an unelevated console session, although its implementation is entirely different.[30]The programrunasprovides comparable functionality in Windows, but it cannot pass current directories, environment variables or long command lines to the child. And while it supports running the child as another user, it does not support simple elevation.Hamilton C shellalso includes truesuandsudofor Windows that can pass all of that state information and start the child either elevated or as another user (or both).[31][32] Graphical user interfacesexist for sudo – notablygksudo– but are deprecated inDebianand no longer included inUbuntu.[33][34]Other user interfaces are not directly built on sudo, but provide similar temporary privilege elevation for administrative purposes, such aspkexecin Unix-like operating systems,User Account ControlinMicrosoft WindowsandMac OS XAuthorization Services.[35] doas, available sinceOpenBSD5.8 (October 2015), has been written in order to replacesudoin theOpenBSDbase system, with the latter still being made available as aport.[36] gosu is a tool similar to sudo that is popular in containers where the terminal may not be fully functional or where there are undesirable effects from running sudo in a containerized environment.[37]
https://en.wikipedia.org/wiki/Sudo
Alphanumericalsoralphanumeric charactersare any collection of number characters and letters in a certainlanguage. Sometimes such characters may be mistaken one for the other. Merriam-Webstersuggests that the term "alphanumeric" may often additionally refer to other symbols, such as punctuation and mathematical symbols.[1] In the POSIX/C[2]locale, there are either 36 (A–Z and 0–9, case insensitive) or 62 (A–Z, a–z and 0–9,case-sensitive) alphanumeric characters. When a string of mixed alphabets and numerals is presented for human interpretation, ambiguities arise. The most obvious is the similarity of the lettersI,OandQto the numbers1and0.[3]Therefore, depending on theapplication, varioussubsetsof the alphanumeric were adopted to avoid misinterpretation by humans. In passenger aircraft,aircraft seat mapsand seats were designated by row number followed by column letter. For wide bodied jets, the seats can be 10 across, labeledABC-DEFG-HJK. The letterIis skipped to avoid mistaking it as row number1. Invehicle identification numbersused by motor vehicle manufacturers, the lettersI,OandQare omitted for their similarity to1or0. Tiny embossed letters are used to label pins on an V.35/M34 electrical connector. The lettersI,O,Q,S, andZwere dropped to ease eye strain with1,0,5,3, and2. That subset is named theDECAlphabet after the company that first used it. For alphanumerics that are frequently handwritten, in addition toIandO,Vis avoided because it looks likeUin cursive, andZfor its similarity to2.
https://en.wikipedia.org/wiki/Alphanumeric_code
Anexploitis a method or piece of code that takes advantage ofvulnerabilitiesinsoftware,applications,networks,operating systems, orhardware, typically for malicious purposes. The term "exploit" derives from the English verb "to exploit," meaning "to use something to one’s own advantage." Exploits are designed to identify flaws, bypass security measures, gain unauthorized access to systems, take control of systems, installmalware, orsteal sensitive data. While an exploit by itself may not be amalware, it serves as a vehicle for delivering malicious software by breachingsecurity controls.[1][2][3][4] Researchers estimate that malicious exploits cost theglobal economyover US$450 billion annually. In response to this threat, organizations are increasingly utilizingcyber threat intelligenceto identify vulnerabilities and prevent hacks before they occur.[5] Exploits target vulnerabilities, which are essentially flaws or weaknesses in a system's defenses. Common targets for exploits includeoperating systems,web browsers, and variousapplications, where hidden vulnerabilities can compromise the integrity andsecurityofcomputer systems. Exploits can cause unintended or unanticipated behavior in systems, potentially leading to severesecurity breaches.[6][7] Many exploits are designed to providesuperuser-level access to a computer system. Attackers may use multiple exploits in succession to first gain low-level access and thenescalate privilegesrepeatedly until they reach the highest administrative level, often referred to as "root." This technique of chaining several exploits together to perform a single attack is known as an exploit chain. Exploits that remain unknown to everyone except the individuals who discovered and developed them are referred to as zero-day or "0day" exploits. After an exploit is disclosed to the authors of the affected software, the associated vulnerability is often fixed through apatch, rendering the exploit unusable. This is why someblack hat hackers, as well as military or intelligence agency hackers, do not publish their exploits but keep them private. One scheme that offers zero-day exploits is known asexploit as a service.[8] There are several methods of classifying exploits. The most common is by how the exploit communicates to the vulnerable software. By Method of Communication:[9] By Targeted Component:[9] The classification of exploits based[10][11]on the type of vulnerability they exploit and the result of running the exploit (e.g., Elevation of Privilege (EoP), Denial of Service (DoS),spoofing) is a common practice in cybersecurity. This approach helps in systematically identifying and addressing security threats. For instance, the STRIDE threat model categorizes threats into six types, including Spoofing, Tampering, Repudiation, Information Disclosure, Denial of Service, and Elevation of Privilege.[12]Similarly, the National Vulnerability Database (NVD) categorizes vulnerabilities by types such as Authentication Bypass by Spoofing and Authorization Bypass.[13] By Type ofVulnerability: Another classification is by the action against the vulnerable system; unauthorized data access, arbitrary code execution, and denial of service are examples. Attackers employ various techniques to exploit vulnerabilities and achieve their objectives. Some common methods include:[9] A zero-click attack is an exploit that requires nouser interactionto operate – that is to say, no key-presses or mouse clicks.[14]These exploits are commonly the most sought after exploits (specifically on the underground exploit market) because the target typically has no way of knowing they have been compromised at the time of exploitation. FORCEDENTRY, discovered in 2021, is an example of a zero-click attack.[15][16] In 2022,NSO Groupwas reportedly selling zero-click exploits to governments for breaking into individuals' phones.[17] For mobile devices, theNational Security Agency(NSA) points out that timely updating of software and applications, avoiding public network connections, and turning the device Off and On at least once a week can mitigate the threat of zero-click attacks.[18][19][20]Experts say that protection practices for traditional endpoints are also applicable to mobile devices. Many exploits exist only inmemory, not in files. Theoretically, restarting the device can wipe malware payloads from memory, forcing attackers back to the beginning of the exploit chain.[21][22] Pivoting is a technique employed by both hackers andpenetration testersto expand their access within a target network. By compromising a system, attackers can leverage it as a platform to target other systems that are typically shielded from direct external access byfirewalls. Internal networks often contain a broader range of accessible machines compared to those exposed to the internet. For example, an attacker might compromise a web server on a corporate network and then utilize it to target other systems within the same network. This approach is often referred to as a multi-layered attack. Pivoting is also known asisland hopping. Pivoting can further be distinguished intoproxypivoting andVPNpivoting: Typically, the proxy or VPN applications enabling pivoting are executed on the target computer as thepayloadof an exploit. Pivoting is usually done by infiltrating a part of a network infrastructure (as an example, a vulnerable printer or thermostat) and using a scanner to find other devices connected to attack them. By attacking a vulnerable piece of networking, an attacker could infect most or all of a network and gain complete control.
https://en.wikipedia.org/wiki/Exploit_(computer_security)
Shell shoveling, innetwork security, is the act ofredirectingtheinput and outputof ashellto a service so that it can be remotely accessed, aremote shell.[1] Incomputing, the most basic method of interfacing with the operating system is the shell. OnMicrosoft Windowsbased systems, this is a program calledcmd.exeorCOMMAND.COM. OnUnixorUnix-likesystems, it may be any of a variety of programs such asbash,ksh, etc. This program accepts commands typed from a prompt and executes them, usually in real time, displaying the results to what is referred to asstandard output, usually a monitor or screen. In the shell shoveling process, one of these programs is set to run (perhaps silently or without notifying someone observing the computer) accepting input from a remote system and redirecting output to the same remote system; therefore the operator of theshoveledshell is able to operate the computer as if they were present at the console.[2]
https://en.wikipedia.org/wiki/Shell_shoveling
TheDOS APIis anAPIwhich originated with86-DOSand is used inMS-DOS/PC DOSand otherDOS-compatible operating systems. Most calls to the DOS API are invoked usingsoftware interrupt21h (INT21h). By calling INT 21h with a subfunction number in the AHprocessor registerand other parameters in other registers, various DOS services can be invoked. These include handling keyboard input, video output, disk file access, program execution, memory allocation, and various other activities. In the late 1980s,DOS extendersalong with theDOS Protected Mode Interface(DPMI) allow the programs to run in either 16-bit or 32-bit protected mode and still have access to the DOS API. The original DOS API in 86-DOS and MS-DOS 1.0 was designed to be functionally compatible withCP/M. Files were accessed usingfile control blocks(FCBs). The DOS API was greatly extended in MS-DOS 2.0 with severalUnixconcepts, including file access usingfile handles,hierarchical directoriesand device I/O control.[1]In DOS 3.1,network redirectorsupport was added. In MS-DOS 3.31, the INT 25h/26h functions were enhanced to support hard disks greater than 32 MB. MS-DOS 5 added support for usingupper memory blocks(UMBs). After MS-DOS 5, the DOS API was unchanged for the successive standalone releases of DOS. InWindows 9x, DOS loaded the protected-mode system and graphical shell. DOS was usually accessed from avirtual DOS machine(VDM) but it was also possible to boot directly to real modeMS-DOS 7.0without loading Windows. The DOS API was extended with enhanced internationalization support andlong filenamesupport, though the long filename support was only available in a VDM. WithWindows 95OSR2, DOS was updated to 7.1, which addedFAT32support, and functions were added to the DOS API to support this.Windows 98andWindows MEalso implement the MS-DOS 7.1 API, though Windows ME reports itself as MS-DOS 8.0. Windows NTand the systems based on it (e.g.Windows XPandWindows Vista) are not based on MS-DOS, but use avirtual machine,NTVDM, to handle the DOS API. NTVDM works by running a DOS program invirtual 8086 mode(an emulation ofreal modewithinprotected modeavailable on80386and higher processors). NTVDM supports the DOS 5.0 API.DOSEMUforLinuxuses a similar approach. The following is the list of interrupt vectors used by programs to invoke the DOS API functions. The following is the list of functions provided via the DOS API primary software interrupt vector.
https://en.wikipedia.org/wiki/DOS_API
TheLinux kernelprovides multiple interfaces touser-space and kernel-modecode. The interfaces can be classified as eitherapplication programming interface(API) orapplication binary interface(ABI), and they can be classified as either kernel–user space or kernel-internal. The Linux API includes the kernel–user space API, which allows code in user space to access system resources and services of the Linux kernel.[3]It is composed of the system call interface of the Linux kernel and the subroutines in theC standard library. The focus of the development of the Linux API has been to provide theusable featuresof the specifications defined inPOSIXin a way which is reasonably compatible, robust and performant, and to provide additional useful features not defined in POSIX, just as the kernel–user space APIs of other systems implementing the POSIX API also provide additional features not defined in POSIX. The Linux API, by choice, has been kept stable over the decades through a policy of not introducing breaking changes; this stability guarantees the portability ofsource code.[4]At the same time, Linux kernel developers have historically been conservative and meticulous about introducing new system calls.[citation needed] Much availablefree and open-source softwareis written for the POSIX API. Since so much more development flows into the Linux kernel as compared to the other POSIX-compliant combinations of kernel and C standard library,[citation needed]the Linux kernel and its API have been augmented with additional features. Programming for the full Linux API, rather than just the POSIX API, may provide advantages in cases where those additional features are useful. Well-known current examples areudev,systemdandWeston.[5]People such asLennart Poetteringopenly advocate to prefer the Linux API over the POSIX API, where this offers advantages.[6] AtFOSDEM2016,Michael Kerriskexplained some of the perceived issues with the Linux kernel's user-space API, describing that it contains multiple design errors by being non-extensible, unmaintainable, overly complex, of limited purpose, in violation of standards, and inconsistent. Most of those mistakes cannot be fixed because doing so would break the ABI that the kernel presents to the user space.[7] Thesystem call interfaceof a kernel is the set of all implemented and availablesystem callsin a kernel. In the Linux kernel, various subsystems, such as theDirect Rendering Manager(DRM), define their own system calls, all of which are part of the system call interface. Various issues with the organization of the Linux kernel system calls are being publicly discussed. Issues have been pointed out by Andy Lutomirski,Michael Kerriskand others.[8][9][10][11] AC standard libraryfor Linux includes wrappers around the system calls of the Linux kernel; the combination of the Linux kernel system call interface and a C standard library is what builds the Linux API. Some popular implementations of the C standard library are Although the landscape is shifting, amongst these options, glibc remains the most popular implementation, to the point of many treating it as the default and the term equivalent to libc. As in otherUnix-likesystems, additional capabilities of the Linux kernel exist that are not part of POSIX: DRMhas been paramount for the development and implementations of well-defined and performantfree and open-source graphics device driverswithout which no rendering acceleration would be available at all, only the 2D drivers would be available in theX.Org Server. DRM was developed for Linux, and since has been ported to other operating systems as well.[14] The Linux ABI is a kernel–user space ABI. As ABI is amachine codeinterface, the Linux ABI is bound to theinstruction set. Defining a useful ABI and keeping it stable is less the responsibility of the Linux kernel developers or of the developers of the GNU C Library, and more the task forLinux distributionsandindependent software vendors(ISVs) who wish to sell and provide support for their proprietary software as binaries only for such a single Linux ABI, as opposed to supporting multiple Linux ABIs. An ABI has to be defined for every instruction set, such asx86,x86-64,MIPS,ARMv7-A(32-Bit),ARMv8-A(64-Bit), etc. with theendianness, if both are supported. It should be able to compile the software with different compilers against the definitions specified in the ABI and achieve full binary compatibility. Compilers that arefree and open-source softwareare e.g.GNU Compiler Collection,LLVM/Clang. Many kernel-internal APIs exist, allowing kernel subsystems to interface with one another. These are being kept fairly stable, but there is no guarantee for stability. A kernel-internal API can be changed when such a need is indicated by new research or insights; all necessary modifications and testing have to be done by the author. The Linux kernel is a monolithic kernel, hence device drivers are kernel components. To ease the burden of companies maintaining their (proprietary) device drivers outside of the main kernel tree, stable APIs for the device drivers have been repeatedly requested. The Linux kernel developers have repeatedly denied guaranteeing stable in-kernel APIs for device drivers. Guaranteeing such would have faltered the development of the Linux kernel in the past and would still in the future and, due to the nature of free and open-source software, are not necessary. Ergo, by choice, the Linux kernel has nostablein-kernel API.[15] Since there are no stable in-kernel APIs, there cannot be stable in-kernel ABIs.[16] For many use cases, the Linux API is considered too low-level, so APIs of higher abstraction must be used. Higher-level APIs must be implemeted on top of lower-level APIs. Examples:
https://en.wikipedia.org/wiki/Linux_kernel_API
vDSO(virtual dynamic shared object) is a kernel mechanism for exporting a carefully selected set ofkernel spaceroutines touser spaceapplications so that applications can call these kernel space routines in-process, without incurring the performance penalty of amode switchfromuser modetokernel modethat is inherent when calling these same kernel space routines by means of thesystem callinterface.[1][2] vDSO uses standard mechanisms forlinkingandloadingi.e. standardExecutable and Linkable Format(ELF) format.[3][4]vDSO is a memory area allocated in user space which exposes some kernel functionalities. vDSO isdynamically allocated, offers improved safety throughaddress space layout randomization, and supports more than four system calls. SomeC standard libraries, likeglibc, may provide vDSO links so that if the kernel does not have vDSO support, a traditionalsyscallis made.[5]vDSO helps to reduce the calling overhead on simple kernel routines, and it also can work as a way to select the best system-call method on somecomputer architecturessuch asIA-32.[6]An advantage over other methods is that such exported routines can provide properDWARF(Debug With Attributed Record Format) debugging information. Implementation generally implies hooks in the dynamic linker to find the vDSOs. vDSO was developed to offer thevsyscallfeatures while overcoming its limitations: a small amount ofstatically allocatedmemory, which allows only four system calls, and the same addressesapplication binary interface(ABI) in each process, which compromises security. This security issue has been mitigated byemulating a virtual system call, but the emulation introduces additional latency.[5] glibchas support forgetrandom()vDSO.[7]
https://en.wikipedia.org/wiki/VDSO
Incomputer science, acall stackis astackdata structure that stores information about the activesubroutinesandinline blocksof acomputer program. This type of stack is also known as anexecution stack,program stack,control stack,run-time stack, ormachine stack, and is often shortened to simply the "stack". Although maintenance of the call stack is important for the proper functioning of mostsoftware, the details are normally hidden and automatic inhigh-level programming languages. Many computerinstruction setsprovide special instructions for manipulating stacks. A call stack is used for several related purposes, but the main reason for having one is to keep track of the point to which each active subroutine should return control when it finishes executing. An active subroutine is one that has been called, but is yet to complete execution, after which control should be handed back to the point of call. Such activations of subroutines may be nested to any level (recursive as a special case), hence the stack structure. For example, if a subroutineDrawSquarecalls a subroutineDrawLinefrom four different places,DrawLinemust know where to return when its execution completes. To accomplish this, theaddressfollowing theinstructionthat jumps toDrawLine, thereturn address, is pushed onto the top of the call stack as part of each call. Since the call stack is organized as astack, the caller of a procedure pushes the return address onto the stack, and the called subroutine, when it finishes,pulls or popsthe return address off the call stack and transfers control to that address; similarly, the prolog of an inline block pushes a stack frame and the epilog pops it. If a called subroutine calls on yet another subroutine, it will push another return address onto the call stack, and so on, with the information stacking up and unstacking as the program dictates. If the pushing consumes all of the space allocated for the call stack, an error called astack overflowoccurs, generally causing the program tocrash. Adding a block's or subroutine's entry to the call stack is sometimes called "winding", and removing entries "unwinding". There is usually exactly one call stack associated with a running program (or more accurately, with eachtaskorthreadof aprocess), although additional stacks may be created forsignalhandling orcooperative multitasking(as withsetcontext). Since there is only one in this important context, it can be referred to asthestack (implicitly "of the task"); however, in theForth programming languagethedata stackorparameter stackis accessed more explicitly than the call stack and is commonly referred to asthestack (see below). Inhigh-level programming languages, the specifics of the call stack are usually hidden from the programmer. They are given access only to a set of functions, and not the memory on the stack itself. This is an example ofabstraction. Mostassembly languages, on the other hand, require programmers to be involved in manipulating the stack. The actual details of the stack in aprogramming languagedepend upon thecompiler,operating system, and the availableinstruction set. As noted above, the primary purpose of a call stack is tostore the return addresses. When a subroutine is called, the location (address) of the instruction at which the calling routine can later resume must be saved somewhere. Using a stack to save the return address has important advantages over some alternativecalling conventions, such as saving the return address before the beginning of the called subroutine or in some other fixed location. One is that each task can have its own stack, and thus the subroutine can bethread-safe, that is, able to be active simultaneously for different tasks doing different things. Another benefit is that by providingreentrancy,recursionis automatically supported. When a function calls itself recursively, a return address needs to be stored for each activation of the function so that it can later be used to return from the function activation. Stack structures provide this capability automatically. Depending on the language, operating system, and machine environment, a call stack may serve additional purposes, including, for example: The typical call stack is used for the return address, locals, and parameters (known as acall frame). In some environments there may be more or fewer functions assigned to the call stack. In theForth programming language, for example, ordinarily only the return address, counted loop parameters and indexes, and possibly local variables are stored on the call stack (which in that environment is named thereturn stack), although any data can be temporarily placed there using special return-stack handling code so long as the needs of calls and returns are respected; parameters are ordinarily stored on a separatedata stackorparameter stack, typically calledthestack in Forth terminology even though there is a call stack since it is usually accessed more explicitly. Some Forths also have a third stack forfloating-pointparameters. A call stack is composed ofstack frames(also calledactivation recordsoractivation frames). These aremachine dependentandABI-dependent data structures containing subroutine state information. Each stack frame corresponds to an invocation of a subroutine that has not yet completed with a return.[1]The stack frame at the top of the stack is for the currently executing routine. For example, if a subroutine namedDrawLineis currently running, having been called by a subroutineDrawSquare, the top part of the call stack might be laid out like in the adjacent picture. A diagram like this can be drawn in either direction as long as the placement of the top, and so direction of stack growth, is understood. Architectures differ as to whether call stacks grow towards higher addresses or towards lower addresses, so the logic of any diagram is not dependent on this addressing choice by convention. While it is actively executing, with its frame at the stack top, a routine can access the information within its frame as needed.[2]The stack frame typically includes at least the following items (in the order pushed): When stack frame sizes can differ, such as between different functions or between invocations of a particular function, popping a frame off the stack does not constitute a fixed decrement of thestack pointer. At function return, the stack pointer is instead restored to theframe pointer, the value of the stack pointer just before the function was called. Each stack frame contains a stack pointer to the top of the frame immediately below. The stack pointer is a mutable register shared between all invocations. A frame pointer of a given invocation of a function is a copy of the stack pointer as it was before the function was invoked.[3] The locations of all other fields in the frame can be defined relative either to the top of the frame, as negative offsets of the stack pointer, or relative to the top of the frame below, as positive offsets of the frame pointer. The location of the frame pointer itself must inherently be defined as a negative offset of the stack pointer. In most systems a stack frame has a field to contain the previous value of the frame pointer register, the value it had while the caller was executing. For example, the stack frame ofDrawLinewould have a memory location holding the frame pointer value thatDrawSquareuses (not shown in the diagram above). The value is saved upon entry to the subroutine. Having such a field in a known location in the stack frame enables code to access each frame successively underneath the currently executing routine's frame, and also allows the routine to easily restore the frame pointer to thecaller'sframe, just before it returns. Programming languages that supportnested subroutinesalso have a field in the call frame that points to the stack frame of thelatestactivation of the procedure that most closely encapsulates the callee, i.e. the immediatescopeof the callee. This is called anaccess linkorstatic link(as it keeps track of static nesting during dynamic and recursive calls) and provides the routine (as well as any other routines it may invoke) access to the local data of its encapsulating routines at every nesting level. Some architectures, compilers, or optimization cases store one link for each enclosing level (not just the immediately enclosing), so that deeply nested routines that access shallow data do not have to traverse several links; this strategy is often called a "display".[4] Access links can be optimized away when an inner function does not access any (non-constant) local data in the encapsulation, as is the case with pure functions communicating only via arguments and return values, for example. Some historical computers, such as theElectrologica X8and somewhat later theBurroughs large systems, had special "display registers" to support nested functions, while compilers for most modern machines (such as the ubiquitous x86) simply reserve a few words on the stack for the pointers, as needed. For some purposes, the stack frame of a subroutine and that of its caller can be considered to overlap, the overlap consisting of the area where the parameters are passed from the caller to the callee. In some environments, the caller pushes each argument onto the stack, thus extending its stack frame, then invokes the callee. In other environments, the caller has a preallocated area at the top of its stack frame to hold the arguments it supplies to other subroutines it calls. This area is sometimes termed theoutgoing arguments areaorcallout area. Under this approach, the size of the area is calculated by the compiler to be the largest needed by any called subroutine. Usually the call stack manipulation needed at the site of a call to a subroutine is minimal (which is good since there can be many call sites for each subroutine to be called). The values for the actual arguments are evaluated at the call site, since they are specific to the particular call, and either pushed onto the stack or placed into registers, as determined by the usedcalling convention. The actual call instruction, such as "branch and link", is then typically executed to transfer control to the code of the target subroutine. In the called subroutine, the first code executed is usually termed thesubroutine prologue, since it does the necessary housekeeping before the code for the statements of the routine is begun. For instruction set architectures in which the instruction used to call a subroutine puts the return address into a register, rather than pushing it onto the stack, the prologue will commonly save the return address by pushing the value onto the call stack, although if the called subroutine does not call any other routines it may leave the value in the register. Similarly, the current stack pointer and/or frame pointer values may be pushed. If frame pointers are being used, the prologue will typically set the new value of the frame pointer register from the stack pointer. Space on the stack for local variables can then be allocated by incrementally changing the stack pointer. TheForth programming languageallows explicit winding of the call stack (called there the "return stack"). When a subroutine is ready to return, it executes an epilogue that undoes the steps of the prologue. This will typically restore saved register values (such as the frame pointer value) from the stack frame, pop the entire stack frame off the stack by changing the stack pointer value, and finally branch to the instruction at the return address. Under many calling conventions, the items popped off the stack by the epilogue include the original argument values, in which case there usually are no further stack manipulations that need to be done by the caller. With some calling conventions, however, it is the caller's responsibility to remove the arguments from the stack after the return. Returning from the called function will pop the top frame off the stack, perhaps leaving a return value. The more general act of popping one or more frames off the stack to resume execution elsewhere in the program is calledstack unwindingand must be performed when non-local control structures are used, such as those used forexception handling. In this case, the stack frame of a function contains one or more entries specifying exception handlers. When an exception is thrown, the stack is unwound until a handler is found that is prepared to handle (catch) the type of the thrown exception. Some languages have other control structures that require general unwinding.Pascalallows a globalgotostatement to transfer control out of a nested function and into a previously invoked outer function. This operation requires the stack to be unwound, removing as many stack frames as necessary to restore the proper context to transfer control to the target statement within the enclosing outer function. Similarly, C has thesetjmpandlongjmpfunctions that act as non-local gotos.Common Lispallows control of what happens when the stack is unwound by using theunwind-protectspecial operator. When applying acontinuation, the stack is (logically) unwound and then rewound with the stack of the continuation. This is not the only way to implement continuations; for example, using multiple, explicit stacks, application of a continuation can simply activate its stack and wind a value to be passed. TheScheme programming languageallows arbitrarythunksto be executed in specified points on "unwinding" or "rewinding" of the control stack when a continuation is invoked. The call stack can sometimes be inspected as the program is running. Depending on how the program is written and compiled, the information on the stack can be used to determine intermediate values and function call traces. This has been used to generate fine-grained automated tests,[5]and in cases like Ruby and Smalltalk, to implement first-class continuations. As an example, theGNU Debugger(GDB) implements interactive inspection of the call stack of a running, but paused, C program.[6] Taking regular-time samples of the call stack can be useful in profiling the performance of programs as, if a subroutine's address appears in the call stack sampling data many times, it is likely to act as a code bottleneck and should be inspected for performance problems. In a language with free pointers or non-checked array writes (such as in C), the mixing of control flow data which affects the execution of code (the return addresses or the saved frame pointers) and simple program data (parameters or return values) in a call stack is a security risk, and is possiblyexploitablethroughstack buffer overflows, which are the most common type ofbuffer overflow. One such attack involves filling one buffer with arbitrary executable code, and then overflowing this or some other buffer to overwrite some return address with a value that points directly to the executable code. As a result, when the function returns, the computer executes that code. This kind of an attack can be blocked withW^X,[citation needed]but similar attacks can succeed even with W^X protection enabled, including thereturn-to-libc attackor the attacks coming fromreturn-oriented programming. Various mitigations have been proposed, such as storing arrays in a completely separate location from the return stack, as is the case in the Forth programming language.[7]
https://en.wikipedia.org/wiki/Call_stack
Incomputer programming, areturn statementcausesexecutionto leave the currentsubroutineand resume at the point in the code immediately after the instruction which called the subroutine, known as itsreturn address. The return address is saved by the calling routine, today usually on theprocess'scall stackor in aregister. Return statements in manyprogramming languagesallow a function to specify areturn valueto be passed back to thecodethat called the function. InCandC++,returnexp;(whereexpis anexpression) is astatementthat tells a function to return execution of the program to the calling function, and report the value ofexp. If a function has the return typevoid, the return statement can be used without a value, in which case the program just breaks out of the current function and returns to the calling one.[1][2]Similar syntax is used in other languages includingModula-2[3]andPython.[4] InPascalthere is no return statement. Functions or procedures automatically return when reaching their last statement. The return value from a function is provided within the function by making an assignment to an identifier with the same name as the function.[5]However, some versions of Pascal provide a special functionExit(exp);that can be used to return a value immediately from a function, or, without parameters, to return immediately from a procedure.[6] Like Pascal,FORTRAN II,Fortran 66,Fortran 77, and later versions ofFortranspecify return values by an assignment to the function name, but also have a return statement; that statement does not specify a return value and, for a function, causes the value assigned to the function name to be returned.[5][7][8] In some other languages a user definedoutput parameteris used instead of the function identifier.[9] Oberon(Oberon-07) has a return clause instead of a return statement. The return clause is placed after the last statement of the procedure body.[10] Someexpression-oriented programming language, such asLisp,PerlandRuby, allow the programmer to omit an explicit return statement, specifying instead that the last evaluated expression is the return value of the subroutine. In other cases a Null value is returned if there is no explicit return statement: inPython, the valueNoneis returned when the return statement is omitted,[4]while in JavaScript the valueundefinedis returned. InWindows PowerShellall evaluated expressions which are not captured (e.g., assigned to a variable,casttovoidorpipedto$null) are returned from the subroutine as elements in an array, or as a single object in the case that only one object has not been captured. In Perl, a return value or values of a subroutine can depend on the context in which it was called. The most fundamental distinction is ascalarcontext where the calling code expects one value, alistcontext where the calling code expects a list of values and avoidcontext where the calling code doesn't expect any return value at all. A subroutine can check the context using thewantarrayfunction. A special syntax of return without arguments is used to return an undefined value in scalar context and an empty list in list context. The scalar context can be further divided intoBoolean, number,string, and variousreferencetypes contexts. Also, a context-sensitiveobjectcan be returned using a contextual return sequence, withlazy evaluationof scalar values. Manyoperating systemslet a program return a result (separate from normaloutput) when its process terminates; these values are referred toexit statuses. The amount of information that can be passed this way is quite limited, in practice often restricted to signalling success or fail. From within the program this return is typically achieved by callingExit (system call)(common even in C, where the alternative mechanism of returning from themain functionis available). Return statements come in many shapes. The following syntaxes are most common: In C[1]and C++,[2]undefined behaviorif function is value-returning In PHP,[12]returnsNULL In Javascript,[13]returns the valueundefined In Java and C#, not permitted if function is value-returning or a contextual return sequence or some more complicated combination of options In someassembly languages, for example that for theMOS Technology 6502, the mnemonic "RTS" (ReTurn from Subroutine) is used. Languages with an explicit return statement create the possibility of multiple return statements in the same function. Whether or not that is a good thing is controversial. Strong adherents ofstructured programmingmake sure each function has a single entry and a single exit (SESE). It has thus been argued[14]that one should eschew the use of the explicit return statement except at the textual end of a subroutine, considering that, when it is used to "return early", it may suffer from the same sort of problems that arise for theGOTOstatement. Conversely, it can be argued that using the return statement is worthwhile when the alternative is more convoluted code, such as deeper nesting, harming readability. In his 2004 textbook,David Wattwrites that "single-entry multi-exit control flows are often desirable". Using Tennent's framework notion ofsequencer, Watt uniformly describes the control flow constructs found in contemporary programming languages and attempts to explain why certain types of sequencers are preferable to others in the context of multi-exit control flows. Watt writes that unrestricted gotos (jump sequencers) are bad because the destination of the jump is not self-explanatory to the reader of a program until the reader finds and examines the actual label or address that is the target of the jump. In contrast, Watt argues that the conceptual intent of a return sequencer is clear from its own context, without having to examine its destination. Furthermore, Watt writes that a class of sequencers known asescape sequencers, defined as "sequencer that terminates execution of a textually enclosing command or procedure", encompasses bothbreaksfrom loops (including multi-level breaks) and return statements. Watt also notes that while jump sequencers (gotos) have been somewhat restricted in languages like C, where the target must be an inside the local block or an encompassing outer block, that restriction alone is not sufficient to make the intent of gotos in C self-describing and so they can still produce "spaghetti code". Watt also examines how exception sequencers differ from escape and jump sequencers; for details on this see the article on structured programming.[15] According to empirical studies cited byEric S. Roberts, student programmers had difficulty formulating correct solutions for several simple problems in a language like Pascal, which does not allow multiple exit points. For the problem of writing a function to linearly searching an element in an array, a 1980 study by Henry Shapiro (cited by Roberts) found that using only the Pascal-provided control structures, the correct solution was given by only 20% of the subjects, while no subject wrote incorrect code for this problem if allowed to write a return from the middle of a loop.[16] Others, includingKent BeckandMartin Fowlerargue that one or moreguard clauses—conditional "early exit" return statements near the beginning of a function—often make a function easier to read than the alternative.[17][18][19][20] The most common problem in early exit is that cleanup or final statements are not executed – for example, allocated memory is not unallocated, or open files are not closed, causing leaks. These must be done at each return site, which is brittle and can easily result in bugs. For instance, in later development, a return statement could be overlooked by a developer, and an action which should be performed at the end of a subroutine (e.g. atracestatement) might not be performed in all cases. Languages without a return statement, such as standard Pascal don't have this problem. Some languages, such as C++ and Python, employ concepts which allow actions to be performed automatically upon return (or exception throw) which mitigates some of these issues – these are often known as "try/finally" or similar. Functionality like these "finally" clauses can be implemented by a goto to the single return point of the subroutine. An alternative solution is to use the normal stack unwinding (variable deallocation) at function exit to unallocate resources, such as via destructors on local variables, or similar mechanisms such as Python's "with" statement. Some early implementations of languages such as the original Pascal and C restricted the types that can be returned by a function (e.g. not supportingrecordorstructtypes) to simplify theircompilers. InJava—and similar languages modeled after it, likeJavaScript—it is possible to execute code even after return statement, because thefinallyblock of atry-catch structureis always executed. So if thereturnstatement is placed somewhere withintryorcatchblocks the code withinfinally(if added) will be executed. It is even possible to alter the return value of a non primitive type (a property of an already returned object) because the exit occurs afterwards as well.[21] Cousin to return statements areyield statements: where a return causes asubroutine toterminate,a yield causes acoroutinetosuspend.The coroutine will later continue from where it suspended if it is called again. Coroutines are significantly more involved to implement than subroutines, and thus yield statements are less common than return statements, but they are found in a number of languages. A number of possible call/return sequences are possible depending on the hardware instruction set, including the following:
https://en.wikipedia.org/wiki/Return_address_(computing)
Automated theorem proving(also known asATPorautomated deduction) is a subfield ofautomated reasoningandmathematical logicdealing with provingmathematical theoremsbycomputer programs. Automated reasoning overmathematical proofwas a major motivating factor for the development ofcomputer science. While the roots of formalizedlogicgo back toAristotle, the end of the 19th and early 20th centuries saw the development of modern logic and formalized mathematics.Frege'sBegriffsschrift(1879) introduced both a completepropositional calculusand what is essentially modernpredicate logic.[1]HisFoundations of Arithmetic, published in 1884,[2]expressed (parts of) mathematics in formal logic. This approach was continued byRussellandWhiteheadin their influentialPrincipia Mathematica, first published 1910–1913,[3]and with a revised second edition in 1927.[4]Russell and Whitehead thought they could derive all mathematical truth usingaxiomsandinference rulesof formal logic, in principle opening up the process to automation. In 1920,Thoralf Skolemsimplified a previous result byLeopold Löwenheim, leading to theLöwenheim–Skolem theoremand, in 1930, to the notion of aHerbrand universeand aHerbrand interpretationthat allowed(un)satisfiabilityof first-order formulas (and hence thevalidityof a theorem) to be reduced to (potentially infinitely many) propositional satisfiability problems.[5] In 1929,Mojżesz Presburgershowed that thefirst-order theoryof thenatural numberswith addition and equality (now calledPresburger arithmeticin his honor) isdecidableand gave an algorithm that could determine if a givensentencein thelanguagewas true or false.[6][7] However, shortly after this positive result,Kurt GödelpublishedOn Formally Undecidable Propositions of Principia Mathematica and Related Systems(1931), showing that in any sufficiently strong axiomatic system, there are true statements that cannot be proved in the system. This topic was further developed in the 1930s byAlonzo ChurchandAlan Turing, who on the one hand gave two independent but equivalent definitions ofcomputability, and on the other gave concrete examples ofundecidable questions. In 1954,Martin Davisprogrammed Presburger's algorithm for aJOHNNIACvacuum-tube computerat theInstitute for Advanced Studyin Princeton, New Jersey. According to Davis, "Its great triumph was to prove that the sum of two even numbers is even".[7][8]More ambitious was theLogic Theoristin 1956, a deduction system for thepropositional logicof thePrincipia Mathematica, developed byAllen Newell,Herbert A. SimonandJ. C. Shaw. Also running on a JOHNNIAC, the Logic Theorist constructed proofs from a small set of propositional axioms and three deduction rules:modus ponens, (propositional)variable substitution, and the replacement of formulas by their definition. The system usedheuristicguidance, and managed to prove 38 of the first 52 theorems of thePrincipia.[7] The "heuristic" approach of the Logic Theorist tried to emulate human mathematicians, and could not guarantee that a proof could be found for every valid theorem even in principle. In contrast, other, more systematic algorithms achieved, at least theoretically,completenessfor first-order logic. Initial approaches relied on the results ofHerbrandandSkolemto convert a first-order formula into successively larger sets ofpropositional formulaeby instantiating variables withtermsfrom theHerbrand universe. The propositional formulas could then be checked for unsatisfiability using a number of methods. Gilmore's program used conversion todisjunctive normal form, a form in which the satisfiability of a formula is obvious.[7][9] Depending on the underlying logic, the problem of deciding the validity of a formula varies from trivial to impossible. For the common case ofpropositional logic, the problem is decidable butco-NP-complete, and hence onlyexponential-timealgorithms are believed to exist for general proof tasks. For afirst-order predicate calculus,Gödel's completeness theoremstates that the theorems (provable statements) are exactly the semantically validwell-formed formulas, so the valid formulas arecomputably enumerable: given unbounded resources, any valid formula can eventually be proven. However,invalidformulas (those that arenotentailed by a given theory), cannot always be recognized. The above applies to first-order theories, such asPeano arithmetic. However, for a specific model that may be described by a first-order theory, some statements may be true but undecidable in the theory used to describe the model. For example, byGödel's incompleteness theorem, we know that any consistent theory whose axioms are true for the natural numbers cannot prove all first-order statements true for the natural numbers, even if the list of axioms is allowed to be infinite enumerable. It follows that an automated theorem prover will fail to terminate while searching for a proof precisely when the statement being investigated is undecidable in the theory being used, even if it is true in the model of interest. Despite this theoretical limit, in practice, theorem provers can solve many hard problems, even in models that are not fully described by any first-order theory (such as theintegers). A simpler, but related, problem isproof verification, where an existing proof for a theorem is certified valid. For this, it is generally required that each individual proof step can be verified by aprimitive recursive functionor program, and hence the problem is always decidable. Since the proofs generated by automated theorem provers are typically very large, the problem ofproof compressionis crucial, and various techniques aiming at making the prover's output smaller, and consequently more easily understandable and checkable, have been developed. Proof assistantsrequire a human user to give hints to the system. Depending on the degree of automation, the prover can essentially be reduced to a proof checker, with the user providing the proof in a formal way, or significant proof tasks can be performed automatically. Interactive provers are used for a variety of tasks, but even fully automatic systems have proved a number of interesting and hard theorems, including at least one that has eluded human mathematicians for a long time, namely theRobbins conjecture.[10][11]However, these successes are sporadic, and work on hard problems usually requires a proficient user. Another distinction is sometimes drawn between theorem proving and other techniques, where a process is considered to be theorem proving if it consists of a traditional proof, starting with axioms and producing new inference steps using rules of inference. Other techniques would includemodel checking, which, in the simplest case, involves brute-force enumeration of many possible states (although the actual implementation of model checkers requires much cleverness, and does not simply reduce to brute force). There are hybrid theorem proving systems that use model checking as an inference rule. There are also programs that were written to prove a particular theorem, with a (usually informal) proof that if the program finishes with a certain result, then the theorem is true. A good example of this was the machine-aided proof of thefour color theorem, which was very controversial as the first claimed mathematical proof that was essentially impossible to verify by humans due to the enormous size of the program's calculation (such proofs are callednon-surveyable proofs). Another example of a program-assisted proof is the one that shows that the game ofConnect Fourcan always be won by the first player. Commercial use of automated theorem proving is mostly concentrated inintegrated circuit designand verification. Since thePentium FDIV bug, the complicatedfloating point unitsof modern microprocessors have been designed with extra scrutiny.AMD,Inteland others use automated theorem proving to verify that division and other operations are correctly implemented in their processors.[12] Other uses of theorem provers includeprogram synthesis, constructing programs that satisfy aformal specification.[13]Automated theorem provers have been integrated withproof assistants, includingIsabelle/HOL.[14] Applications of theorem provers are also found innatural language processingandformal semantics, where they are used to analyzediscourse representations.[15][16] In the late 1960s agencies funding research in automated deduction began to emphasize the need for practical applications.[citation needed]One of the first fruitful areas was that ofprogram verificationwhereby first-order theorem provers were applied to the problem of verifying the correctness of computer programs in languages such asPascal,Ada, etc. Notable among early program verification systems was the Stanford Pascal Verifier developed byDavid LuckhamatStanford University.[17][18][19]This was based on the Stanford Resolution Prover also developed at Stanford usingJohn Alan Robinson'sresolutionprinciple. This was the first automated deduction system to demonstrate an ability to solve mathematical problems that were announced in theNotices of the American Mathematical Societybefore solutions were formally published.[citation needed] First-ordertheorem proving is one of the most mature subfields of automated theorem proving. The logic is expressive enough to allow the specification of arbitrary problems, often in a reasonably natural and intuitive way. On the other hand, it is still semi-decidable, and a number of sound and complete calculi have been developed, enablingfullyautomated systems.[20]More expressive logics, such ashigher-order logics, allow the convenient expression of a wider range of problems than first-order logic, but theorem proving for these logics is less well developed.[21][22] There is substantial overlap between first-order automated theorem provers andSMT solvers. Generally, automated theorem provers focus on supporting full first-order logic with quantifiers, whereas SMT solvers focus more on supporting various theories (interpreted predicate symbols). ATPs excel at problems with lots of quantifiers, whereas SMT solvers do well on large problems without quantifiers.[23]The line is blurry enough that some ATPs participate in SMT-COMP, while some SMT solvers participate inCASC.[24] The quality of implemented systems has benefited from the existence of a large library of standardbenchmarkexamples—theThousands of Problems for Theorem Provers(TPTP) Problem Library[25]—as well as from theCADE ATP System Competition(CASC), a yearly competition of first-order systems for many important classes of first-order problems. Some important systems (all have won at least one CASC competition division) are listed below. The Theorem Prover Museum[27]is an initiative to conserve the sources of theorem prover systems for future analysis, since they are important cultural/scientific artefacts. It has the sources of many of the systems mentioned above.
https://en.wikipedia.org/wiki/Automated_theorem_proving
Incomputer science,model checkingorproperty checkingis a method for checking whether afinite-state modelof a system meets a givenspecification(also known ascorrectness). This is typically associated withhardwareorsoftware systems, where the specification contains liveness requirements (such as avoidance oflivelock) as well as safety requirements (such as avoidance of states representing asystem crash). In order to solve such a problemalgorithmically, both the model of the system and its specification are formulated in some precise mathematical language. To this end, the problem is formulated as a task inlogic, namely to check whether astructuresatisfies a given logical formula. This general concept applies to many kinds of logic and many kinds of structures. A simple model-checking problem consists of verifying whether a formula in thepropositional logicis satisfied by a given structure. Property checking is used forverificationwhen two descriptions are not equivalent. Duringrefinement, the specification is complemented with details that areunnecessaryin the higher-level specification. There is no need to verify the newly introduced properties against the original specification since this is not possible. Therefore, the strict bi-directional equivalence check is relaxed to a one-way property check. The implementation or design is regarded as a model of the system, whereas the specifications are properties that the model must satisfy.[2] An important class of model-checking methods has been developed for checking models ofhardwareandsoftwaredesigns where the specification is given by atemporal logicformula. Pioneering work in temporal logic specification was done byAmir Pnueli, who received the 1996 Turing award for "seminal work introducing temporal logic into computing science".[3]Model checking began with the pioneering work ofE. M. Clarke,E. A. Emerson,[4][5][6]by J. P. Queille, andJ. Sifakis.[7]Clarke, Emerson, and Sifakis shared the 2007Turing Awardfor their seminal work founding and developing the field of model checking.[8][9] Model checking is most often applied to hardware designs. For software, because of undecidability (seecomputability theory) the approach cannot be fully algorithmic, apply to all systems, and always give an answer; in the general case, it may fail to prove or disprove a given property. Inembedded-systemshardware, it is possible to validate a specification delivered, e.g., by means ofUML activity diagrams[10]or control-interpretedPetri nets.[11] The structure is usually given as a source code description in an industrialhardware description languageor a special-purpose language. Such a program corresponds to afinite-state machine(FSM), i.e., adirected graphconsisting of nodes (orvertices) andedges. A set of atomic propositions is associated with each node, typically stating which memory elements are one. Thenodesrepresent states of a system, the edges represent possible transitions that may alter the state, while the atomic propositions represent the basic properties that hold at a point of execution.[12] Formally, the problem can be stated as follows: given a desired property, expressed as a temporal logic formulap{\displaystyle p}, and a structureM{\displaystyle M}with initial states{\displaystyle s}, decide ifM,s⊨p{\displaystyle M,s\models p}. IfM{\displaystyle M}is finite, as it is in hardware, model checking reduces to agraph search. Instead of enumerating reachable states one at a time, the state space can sometimes be traversed more efficiently by considering large numbers of states at a single step. When such state-space traversal is based on representations of a set of states and transition relations as logical formulas,binary decision diagrams(BDD) or other related data structures, the model-checking method issymbolic. Historically, the first symbolic methods usedBDDs. After the success ofpropositional satisfiabilityin solving theplanningproblem inartificial intelligence(seesatplan) in 1996, the same approach was generalized to model checking forlinear temporal logic(LTL): the planning problem corresponds to model checking for safety properties. This method is known as bounded model checking.[13]The success ofBoolean satisfiability solversin bounded model checking led to the widespread use of satisfiability solvers in symbolic model checking.[14] One example of such a system requirement:Between the time an elevator is called at a floor and the time it opens its doors at that floor, the elevator can arrive at that floor at most twice. The authors of "Patterns in Property Specification for Finite-State Verification" translate this requirement into the following LTL formula:[15] Here,◻{\displaystyle \Box }should be read as "always",◊{\displaystyle \Diamond }as "eventually",U{\displaystyle {\mathcal {U}}}as "until" and the other symbols are standard logical symbols,∨{\displaystyle \lor }for "or",∧{\displaystyle \land }for "and" and¬{\displaystyle \lnot }for "not". Model-checking tools face a combinatorial blow up of the state-space, commonly known as thestate explosion problem, that must be addressed to solve most real-world problems. There are several approaches to combat this problem. Model-checking tools were initially developed to reason about the logical correctness ofdiscrete statesystems, but have since been extended to deal with real-time and limited forms ofhybrid systems. Model checking is also studied in the field ofcomputational complexity theory. Specifically, afirst-order logicalformula is fixed withoutfree variablesand the followingdecision problemis considered: Given a finiteinterpretation, for instance, one described as arelational database, decide whether the interpretation is a model of the formula. This problem is in thecircuit classAC0. It istractablewhen imposing some restrictions on the input structure: for instance, requiring that it hastreewidthbounded by a constant (which more generally implies the tractability of model checking formonadic second-order logic), bounding thedegreeof every domain element, and more general conditions such asbounded expansion, locally bounded expansion, and nowhere-dense structures.[21]These results have been extended to the task ofenumeratingall solutions to a first-order formula with free variables.[citation needed] Here is a list of significant model-checking tools:
https://en.wikipedia.org/wiki/Model_checking
This article listsmodel checkingtools and gives an overview of the functionality of each. The following table includes model checkers that have In the below table, the following abbreviations are used: There exists a few papers that systematically compare various model checkers on a common case study. The comparison usually discusses the modelling tradeoffs faced when using the input languages of each model checker, as well as the comparison of performances of the tools when verifying correctness properties. One can mention:
https://en.wikipedia.org/wiki/List_of_model_checking_tools
Formal equivalence checkingprocess is a part ofelectronic design automation(EDA), commonly used during the development ofdigitalintegrated circuits, to formallyprovethat two representations of acircuit designexhibit exactly the same behavior. In general, there is a wide range of possible definitions of functional equivalence covering comparisons between different levels of abstraction and varying granularity of timing details. Theregister transfer level(RTL) behavior of a digital chip is usually described with ahardware description language, such asVerilogorVHDL. This description is the golden reference model that describes in detail which operations will be executed during whichclock cycleand by which pieces of hardware. Once the logic designers, by simulations and other verification methods, have verified register transfer description, the design is usually converted into anetlistby alogic synthesistool. Equivalence is not to be confused with functional correctness, which must be determined byfunctional verification. The initialnetlistwill usually undergo a number of transformations such as optimization, addition ofDesign For Test(DFT) structures, etc., before it is used as the basis for the placement of the logic elements into aphysical layout. Contemporary physical design software will occasionally also make significant modifications (such as replacing logic elements with equivalent similar elements that have a higher or lowerdrive strength and/or area) to the netlist. Throughout every step of a very complex, multi-step procedure, the original functionality and the behavior described by the original code must be maintained. When the finaltape-outis made of a digital chip, many different EDA programs and possibly some manual edits will have altered the netlist. In theory, a logic synthesis tool guarantees that the first netlist islogically equivalentto the RTL source code. All the programs later in the process that make changes to the netlist also, in theory, ensure that these changes are logically equivalent to a previous version. In practice, programs have bugs and it would be a major risk to assume that all steps from RTL through the final tape-out netlist have been performed without error. Also, in real life, it is common for designers to make manual changes to a netlist, commonly known asEngineering Change Orders, or ECOs, thereby introducing a major additional error factor. Therefore, instead of blindly assuming that no mistakes were made, a verification step is needed to check the logical equivalence of the final version of the netlist to the original description of the design (golden reference model). Historically, one way to check the equivalence was to re-simulate, using the final netlist, the test cases that were developed for verifying the correctness of the RTL. This process is called gate levellogic simulation. However, the problem with this is that the quality of the check is only as good as the quality of the test cases. Also, gate-level simulations are notoriously slow to execute, which is a major problem as the size of digital designs continues to growexponentially. An alternative way to solve this is to formally prove that the RTL code and the netlist synthesized from it have exactly the same behavior in all (relevant) cases. This process is called formal equivalence checking and is a problem that is studied under the broader area offormal verification. A formal equivalence check can be performed between any two representations of a design: RTL <> netlist, netlist <> netlist or RTL <> RTL, though the latter is rare compared to the first two. Typically, a formal equivalence checking tool will also indicate with great precision at which point there exists a difference between two representations. There are two basic technologies used for boolean reasoning in equivalence checking programs: Major products in the Logic Equivalence Checking (LEC) area ofEDAare:
https://en.wikipedia.org/wiki/Formal_equivalence_checking
Incomputer scienceandmathematical logic, aproof assistantorinteractive theorem proveris a software tool to assist with the development offormal proofsby human–machine collaboration. This involves some sort of interactive proof editor, or otherinterface, with which a human can guide the search for proofs, the details of which are stored in, and some steps provided by, acomputer. A recent effort within this field is making these tools useartificial intelligenceto automate the formalization of ordinary mathematics.[1] A popular front-end for proof assistants is theEmacs-based Proof General, developed at theUniversity of Edinburgh. Coq includes CoqIDE, which is based on OCaml/Gtk. Isabelle includes Isabelle/jEdit, which is based onjEditand the Isabelle/Scalainfrastructure for document-oriented proof processing. More recently,Visual Studio Codeextensions have been developed for Coq,[9]Isabelle by Makarius Wenzel,[10]and for Lean 4 by the leanprover developers.[11] Freek Wiedijk has been keeping a ranking of proof assistants by the amount of formalized theorems out of a list of 100 well-known theorems. As of September 2023, only five systems have formalized proofs of more than 70% of the theorems, namely Isabelle, HOL Light, Rocq, Lean, and Metamath.[12][13] The following is a list of notable proofs that have been formalized within proof assistants.
https://en.wikipedia.org/wiki/Proof_checker
Property Specification Language(PSL) is atemporal logicextendinglinear temporal logicwith a range of operators for both ease of expression and enhancement of expressive power. PSL makes an extensive use ofregular expressionsand syntactic sugaring. It is widely used in the hardware design and verification industry, whereformal verificationtools (such asmodel checking) and/orlogic simulationtools are used to prove or refute that a given PSL formula holds on a given design. PSL was initially developed byAccellerafor specifyingpropertiesorassertionsabout hardware designs. Since September 2004 thestandardizationon the language has been done inIEEE1850 working group. In September 2005, the IEEE 1850 Standard for Property Specification Language (PSL) was announced. PSL can express that if some scenario happens now, then another scenario should happen some time later. For instance, the property "arequestshould always eventually begranted" can be expressed by the PSL formula: The property "everyrequestthat is immediately followed by anacksignal, should be followed by a completedata transfer, where a complete data transfer is a sequence starting with signalstart, ending with signalendin whichbusyholds at the meantime" can be expressed by the PSL formula: A trace satisfying this formula is given in the figure on the right. PSL's temporal operators can be roughly classified intoLTL-styleoperators andregular-expression-styleoperators. Many PSL operators come in two versions, a strong version, indicated by an exclamation mark suffix (!), and a weak version. Thestrong versionmakes eventuality requirements (i.e. require that something will hold in the future), while theweak versiondoes not. Anunderscore suffix(_) is used to differentiateinclusivevs.non-inclusiverequirements. The_aand_esuffixes are used to denoteuniversal(all) vs.existential(exists) requirements. Exact time windows are denoted by[n]and flexible by[m..n]. The most commonly used PSL operator is the "suffix-implication" operator (also known as the "triggers" operator), which is denoted by|=>. Its left operand is a PSL regular expression and its right operand is any PSL formula (be it in LTL style or regular expression style). The semantics ofr |=> pis that on every time point i such that the sequence of time points up to i constitute a match to the regular expression r, the path from i+1 should satisfy the property p. This is exemplified in the figures on the right. The regular expressions of PSL have the common operators for concatenation (;), Kleene-closure (*), and union (|), as well as operator for fusion (:), intersection (&&) and a weaker version (&), and many variations for consecutive counting[*n]and in-consecutive counting e.g.[=n]and[->n]. The trigger operator comes in several variations, shown in the table below. Heresandtare PSL-regular expressions, andpis a PSL formula. Operators for concatenation, fusion, union, intersection and their variations are shown in the table below. Heresandtare PSL regular expressions. Operators for consecutive repetitions are shown in the table below. Heresis a PSL regular expression. Operators for non-consecutive repetitions are shown in the table below. Herebis any PSL Boolean expression. Below is a sample of some LTL-style operators of PSL. Herepandqare any PSL formulas. Sometimes it is desirable to change the definition of thenext time-point, for instance in multiply-clocked designs, or when a higher level of abstraction is desired. Thesampling operator(also known as theclock operator), denoted@, is used for this purpose. The formulap @ cwherepis a PSL formula andca PSL Boolean expressions holds on a given path ifpon that path projected on the cycles in whichcholds, as exemplified in the figures to the right. The first property states that "everyrequestthat is immediately followed by anacksignal, should be followed by a completedata transfer, where a complete data transfer is a sequence starting with signalstart, ending with signalendin whichdatashould hold at least 8 times: But sometimes it is desired to consider only the cases where the above signals occur on a cycle whereclkis high. This is depicted in the second figure in which although the formula usesdata[*3]and[*n]is consecutive repetition, the matching trace has 3 non-consecutive time points wheredataholds, but when considering only the time points whereclkholds, the time points wheredatahold become consecutive. The semantics of formulas with nested @ is a little subtle. The interested reader is referred to [2]. PSL has several operators to deal with truncated paths (finite paths that may correspond to a prefix of the computation). Truncated paths occur in bounded-model checking, due to resets and in many other scenarios. The abort operators, specify how eventualities should be dealt with when a path has been truncated. They rely on the truncated semantics proposed in [1]. Herepis any PSL formula andbis any PSL Boolean expression. PSL subsumes the temporal logicLTLand extends its expressive power to that of theomega-regular languages. The augmentation in expressive power, compared to that of LTL, which has the expressive power of the star-free ω-regular expressions, can be attributed to thesuffix implication, also known as thetriggersoperator, denoted "|->". The formular |-> fwhereris a regular expression andfis a temporal logic formula holds on a computationwif any prefix ofwmatchingrhas a continuation satisfyingf. Other non-LTL operators of PSL are the@operator, for specifying multiply-clocked designs, theabortoperators, for dealing with hardware resets, andlocal variablesfor succinctness. PSL is defined in 4 layers: theBoolean layer, thetemporal layer, themodeling layerand theverification layer. Property Specification Language can be used with multiple electronic system design languages (HDLs) such as: When PSL is used in conjunction with one of the above HDLs, its Boolean layer uses the operators of the respective HDL.
https://en.wikipedia.org/wiki/Property_Specification_Language
Incomputer science,model checkingorproperty checkingis a method for checking whether afinite-state modelof a system meets a givenspecification(also known ascorrectness). This is typically associated withhardwareorsoftware systems, where the specification contains liveness requirements (such as avoidance oflivelock) as well as safety requirements (such as avoidance of states representing asystem crash). In order to solve such a problemalgorithmically, both the model of the system and its specification are formulated in some precise mathematical language. To this end, the problem is formulated as a task inlogic, namely to check whether astructuresatisfies a given logical formula. This general concept applies to many kinds of logic and many kinds of structures. A simple model-checking problem consists of verifying whether a formula in thepropositional logicis satisfied by a given structure. Property checking is used forverificationwhen two descriptions are not equivalent. Duringrefinement, the specification is complemented with details that areunnecessaryin the higher-level specification. There is no need to verify the newly introduced properties against the original specification since this is not possible. Therefore, the strict bi-directional equivalence check is relaxed to a one-way property check. The implementation or design is regarded as a model of the system, whereas the specifications are properties that the model must satisfy.[2] An important class of model-checking methods has been developed for checking models ofhardwareandsoftwaredesigns where the specification is given by atemporal logicformula. Pioneering work in temporal logic specification was done byAmir Pnueli, who received the 1996 Turing award for "seminal work introducing temporal logic into computing science".[3]Model checking began with the pioneering work ofE. M. Clarke,E. A. Emerson,[4][5][6]by J. P. Queille, andJ. Sifakis.[7]Clarke, Emerson, and Sifakis shared the 2007Turing Awardfor their seminal work founding and developing the field of model checking.[8][9] Model checking is most often applied to hardware designs. For software, because of undecidability (seecomputability theory) the approach cannot be fully algorithmic, apply to all systems, and always give an answer; in the general case, it may fail to prove or disprove a given property. Inembedded-systemshardware, it is possible to validate a specification delivered, e.g., by means ofUML activity diagrams[10]or control-interpretedPetri nets.[11] The structure is usually given as a source code description in an industrialhardware description languageor a special-purpose language. Such a program corresponds to afinite-state machine(FSM), i.e., adirected graphconsisting of nodes (orvertices) andedges. A set of atomic propositions is associated with each node, typically stating which memory elements are one. Thenodesrepresent states of a system, the edges represent possible transitions that may alter the state, while the atomic propositions represent the basic properties that hold at a point of execution.[12] Formally, the problem can be stated as follows: given a desired property, expressed as a temporal logic formulap{\displaystyle p}, and a structureM{\displaystyle M}with initial states{\displaystyle s}, decide ifM,s⊨p{\displaystyle M,s\models p}. IfM{\displaystyle M}is finite, as it is in hardware, model checking reduces to agraph search. Instead of enumerating reachable states one at a time, the state space can sometimes be traversed more efficiently by considering large numbers of states at a single step. When such state-space traversal is based on representations of a set of states and transition relations as logical formulas,binary decision diagrams(BDD) or other related data structures, the model-checking method issymbolic. Historically, the first symbolic methods usedBDDs. After the success ofpropositional satisfiabilityin solving theplanningproblem inartificial intelligence(seesatplan) in 1996, the same approach was generalized to model checking forlinear temporal logic(LTL): the planning problem corresponds to model checking for safety properties. This method is known as bounded model checking.[13]The success ofBoolean satisfiability solversin bounded model checking led to the widespread use of satisfiability solvers in symbolic model checking.[14] One example of such a system requirement:Between the time an elevator is called at a floor and the time it opens its doors at that floor, the elevator can arrive at that floor at most twice. The authors of "Patterns in Property Specification for Finite-State Verification" translate this requirement into the following LTL formula:[15] Here,◻{\displaystyle \Box }should be read as "always",◊{\displaystyle \Diamond }as "eventually",U{\displaystyle {\mathcal {U}}}as "until" and the other symbols are standard logical symbols,∨{\displaystyle \lor }for "or",∧{\displaystyle \land }for "and" and¬{\displaystyle \lnot }for "not". Model-checking tools face a combinatorial blow up of the state-space, commonly known as thestate explosion problem, that must be addressed to solve most real-world problems. There are several approaches to combat this problem. Model-checking tools were initially developed to reason about the logical correctness ofdiscrete statesystems, but have since been extended to deal with real-time and limited forms ofhybrid systems. Model checking is also studied in the field ofcomputational complexity theory. Specifically, afirst-order logicalformula is fixed withoutfree variablesand the followingdecision problemis considered: Given a finiteinterpretation, for instance, one described as arelational database, decide whether the interpretation is a model of the formula. This problem is in thecircuit classAC0. It istractablewhen imposing some restrictions on the input structure: for instance, requiring that it hastreewidthbounded by a constant (which more generally implies the tractability of model checking formonadic second-order logic), bounding thedegreeof every domain element, and more general conditions such asbounded expansion, locally bounded expansion, and nowhere-dense structures.[21]These results have been extended to the task ofenumeratingall solutions to a first-order formula with free variables.[citation needed] Here is a list of significant model-checking tools:
https://en.wikipedia.org/wiki/Temporal_logic_in_finite-state_verification
Post-silicon validation and debugis the last step in the development of a semiconductorintegrated circuit. During the pre-silicon process, engineers test devices in a virtual environment with sophisticatedsimulation,emulation, andformal verificationtools. In contrast, post-silicon validation tests occur on actual devices running at-speed in commercial, real-world system boards usinglogic analyzerandassertion-basedtools. Large semiconductor companies spend millions creating new components; these are the "sunk costs" of design implementation. Consequently, it is imperative that the new chip function in full and perfect compliance to its specification, and be delivered to the market within tight consumer windows. Even a delay of a few weeks can cost tens of millions of dollars. Post-silicon validation is therefore one of the most highly leveraged steps in successful design implementation. Chips comprising 500,000logic elementsare the silicon brains inside cell phones, MP3 players, computer printers and peripherals, digital television sets, medical imaging systems, components used in transportation safety and comfort, and even building management systems. Either because of their broad consumer proliferation, or because of their mission-critical application, the manufacturer must be absolutely certain that the device is thoroughly validated. The best way to achieve high confidence is to leverage the pre-silicon verification work — which can comprise as much as 30% of the overall cost of the implementation — and use that knowledge in the post-silicon system. Today, much of this work is done manually, which partially explains the high costs associated with system validation. However, there are some tools that have been recently introduced to automate post-silicon system validation. Simulation-based design environments enjoy the tremendous advantage of nearly perfectobservability, meaning the designer can see any signal at nearly any time. They suffer, however, from the restricted amount of data they can generate during post-silicon system validation. Many complicated devices indicate their problems only after days or weeks of testing, and they produce a volume of data that would take centuries to reproduce on a simulator.FPGA-based emulators, a well-established part of most implementation techniques, are faster than software simulators but will not deliver the comprehensive at-system-speed tests needed for device reliability. Moreover, the problem of post-silicon validation is getting worse, as design complexity increases because of the terrific advances in semiconductor materials processing. The duration from prototype silicon — so-called "first silicon" — to volume production is increasing, and bugs do escape to the customers. The expense associated with IP-hardening is increasing. The industry today is focused on techniques that allow designers to better amortize their investment in pre-silicon verification to post-silicon validation. The best of these solutions enable affordable, scalable, automated, on-chip wire-scale visibility. Post-silicon validation encompasses all that validation effort that is poured onto a system after the first few silicon prototypes become available, but before product release. While in the past most of this effort was dedicated to validating electrical aspects of the design, or diagnosing systematic manufacturing defects, today a growing portion of the effort focuses on functional system validation. This trend is for the most part due to the increasing complexity of digital systems, which limits the verification coverage provided by traditional pre-silicon methodologies. As a result, a number of functional bugs survive into manufactured silicon, and it is the job of post-silicon validation to detect and diagnose them so that they do not escape into the released system. The bugs in this category are often system-level bugs and rare corner-case situations buried deep in the design state space: since these problems encompass many design modules, they are difficult to identify with pre-silicon tools, characterized by limited scalability and performance. Post-silicon validation, on the other hand, benefits from very high raw performance, since tests are executed directly on manufactured silicon. At the same time, it poses several challenges to traditional validation methodologies, because of the limited internal observability and difficulty of applying modifications to manufactured silicon chips. These two factors lead in turn to critical challenges in error diagnosis and correction.
https://en.wikipedia.org/wiki/Post-silicon_validation
Intelligent Verification, includingintelligent testbench automation, is a form offunctional verificationofelectronic hardwaredesigns used to verify that a design conforms to specification before device fabrication. Intelligent verification uses information derived from the design and specification(s) to expose bugs in and betweenhardware IPs. Intelligent verification tools require considerably less engineering effort and user guidance to achieve verification results that meet or exceed the standard approach of writing a testbench program. The first generation of intelligent verification tools optimized one part of the verification process known asRegression testingwith a feature calledautomated coverage feedback. With automated coverage feedback, the test description is automatically adjusted to target design functionality that has not been previously verified (or "covered") by other tests existing tests. A key property of automated coverage feedback is that, given the same test environment, the software will automatically change the tests to improve functional design coverage in response to changes in the design. Newer intelligent verification tools are able to derive the essential functions one would expect of a testbench (stimulus, coverage, and checking) from a single, compact, high-level model. Using a single model that represents and resembles the original specification greatly reduces the chance ofhuman errorin the testbench development process that can lead to both missed bugs and false failures. Other properties of intelligent verification may include: "Intelligent Verification" uses existinglogic simulationtestbenches, and automatically targets and maximizes the following types of design coverage: Achieving confidence that a design is functionally correct continues to become more difficult. To counter these problems, in the late 1980s fastlogic simulatorsand specializedhardware description languagessuch asVerilogandVHDLbecame popular. In the 1990s, constrained random simulation methodologies emerged usinghardware verification languagessuch as Vera[1]ande, as well asSystemVerilog(in 2002), to further improve verification quality and time. Intelligent verification approaches supplement constrained random simulation methodologies, which bases test generation on external input rather than design structure.[2]Intelligent verification is intended to automatically utilize design knowledge during simulation, which has become increasingly important over the last decade due to increased design size and complexity, and a separation between the engineering team that created a design and the team verifying its correct operation.[1] There has been substantial research into the intelligent verification area, and commercial tools that leverage this technique are just beginning to emerge.
https://en.wikipedia.org/wiki/Intelligent_verification
Runtime verificationis a computing system analysis and execution approach based on extracting information from a running system and using it to detect and possibly react to observed behaviors satisfying or violating certain properties.[1]Some very particular properties, such asdataraceanddeadlockfreedom, are typically desired to be satisfied by all systems and may be best implemented algorithmically. Other properties can be more conveniently captured asformal specifications. Runtime verification specifications are typically expressed in trace predicate formalisms, such asfinite-state machines,regular expressions,context-freepatterns,linear temporal logics, etc., or extensions of these. This allows for a less ad-hoc approach thannormal testing. However, any mechanism for monitoring an executing system is considered runtime verification, including verifying against test oracles and reference implementations[citation needed]. When formal requirements specifications are provided, monitors are synthesized from them and infused within the system by means of instrumentation. Runtime verification can be used for many purposes, such as security or safetypolicy monitoring, debugging, testing, verification, validation, profiling, fault protection, behavior modification (e.g., recovery), etc. Runtime verification avoids the complexity of traditionalformal verificationtechniques, such asmodel checkingand theorem proving, by analyzing only one or a few execution traces and by working directly with the actual system, thus scaling up relatively well and giving more confidence in the results of the analysis (because it avoids the tedious and error-prone step of formally modelling the system), at the expense of less coverage. Moreover, through its reflective capabilities runtime verification can be made an integral part of the target system, monitoring and guiding its execution during deployment. Checking formally or informally specified properties against executing systems or programs is an old topic (notable examples aredynamic typingin software, or fail-safe devices or watchdog timers in hardware), whose precise roots are hard to identify. The terminologyruntime verificationwas formally introduced as the name of a 2001 workshop[2]aimed at addressing problems at the boundary between formal verification and testing. For large code bases, manually writing test cases turns out to be very time consuming. In addition, not all errors can be detected during development. Early contributions to automated verification were made at the NASA Ames Research Center by Klaus Havelund andGrigore Rosuto archive high safety standards in spacecraft, rovers and avionics technology.[3]They proposed a tool to verify specifications in temporal logic and to detectrace conditionsand deadlocks inJavaprograms by analyzing single execution paths. Currently, runtime verification techniques are often presented with various alternative names, such as runtime monitoring, runtime checking, runtime reflection, runtime analysis,dynamic analysis, runtime/dynamic symbolic analysis, trace analysis, log file analysis, etc., all referring to instances of the same high-level concept applied either to different areas or by scholars from different communities. Runtime verification is intimately related to other well-established areas, such as testing (particularly model-based testing) when used before deployment andfault-tolerant systemswhen used during deployment. Within the broad area of runtime verification, one can distinguish several categories, such as: The broad field of runtime verification methods can be classified by three dimensions:[9] Nevertheless, the basic process in runtime verification remains similar:[9] The examples below discuss some simple properties that have been considered, possibly with small variations, by several runtime verification groups by the time of this writing (April 2011). To make them more interesting, each property below uses a different specification formalism and all of them are parametric. Parametric properties are properties about traces formed with parametric events, which are events that bind data to parameters. Here a parametric property has the form∀parameters:φ{\displaystyle \forall parameters:\varphi }, whereφ{\displaystyle \varphi }is a specification in some appropriate formalism referring to generic (uninstantiated) parametric events. The intuition for such parametric properties is that the property expressed byφ{\displaystyle \varphi }must hold for all parameter instances encountered (through parametric events) in the observed trace. None of the following examples are specific to any particular runtime verification system, though support for parameters is obviously needed. In the following examples Java syntax is assumed, thus "==" is logical equality, while "=" is assignment. Some methods (e.g.,update()in the UnsafeEnumExample) are dummy methods, which are not part of the Java API, that are used for clarity. The JavaIteratorinterface requires that thehasNext()method be called and return true before thenext()method is called. If this does not occur, it is very possible that a user will iterate "off the end of" aCollection. The figure to the right shows a finite-state machine that defines a possible monitor for checking and enforcing this property with runtime verification. From theunknownstate, it is always an error to call thenext()method because such an operation could be unsafe. IfhasNext()is called and returnstrue, it is safe to callnext(), so the monitor enters themorestate. If, however, thehasNext()method returnsfalse, there are no more elements, and the monitor enters thenonestate. In themoreandnonestates, calling thehasNext()method provides no new information. It is safe to call thenext()method from themorestate, but it becomes unknown if more elements exist, so the monitor reenters the initialunknownstate. Finally, calling thenext()method from thenonestate results in entering theerrorstate. What follows is a representation of this property using parametric past timelinear temporal logic. ∀Iteratorii.next()→⊙(i.hasNext()==true){\displaystyle \forall ~{\text{Iterator}}~i\quad i.{\text{next}}()~\rightarrow ~\odot (i.{\text{hasNext}}()==true)} This formula says that any call to thenext()method must be immediately preceded by a call tohasNext()method that returns true. The property here is parametric in the Iteratori. Conceptually, this means that there will be one copy of the monitor for each possible Iterator in a test program, although runtime verification systems need not implement their parametric monitors this way. The monitor for this property would be set to trigger a handler when the formula is violated (equivalently when the finite-state machine enters theerrorstate), which will occur when eithernext()is called without first callinghasNext(), or whenhasNext()is called beforenext(), but returnedfalse. TheVectorclass in Java has two means for iterating over its elements. One may use the Iterator interface, as seen in the previous example, or one may use theEnumerationinterface. Besides the addition of a remove method for the Iterator interface, the main difference is that Iterator is "fail fast" while Enumeration is not. What this means is that if one modifies the Vector (other than by using the Iterator remove method) when one is iterating over the Vector using an Iterator, aConcurrentModificationExceptionis thrown. However, when using an Enumeration this is not a case, as mentioned. This can result in non-deterministic results from a program because the Vector is left in an inconsistent state from the perspective of the Enumeration. For legacy programs that still use the Enumeration interface, one may wish to enforce that Enumerations are not used when their underlying Vector is modified. The following parametric regular pattern can be used to enforce this behavior: This pattern is parametric in both the Enumeration and the Vector. Intuitively, and as above runtime verification systems need not implement their parametric monitors this way, one may think of the parametric monitor for this property as creating and keeping track of a non-parametric monitor instance for each possible pair of Vector and Enumeration. Some events may concern several monitors at the same time, such asv.update(), so the runtime verification system must (again conceptually) dispatch them to all interested monitors. Here the property is specified so that it states the bad behaviors of the program. This property, then, must be monitored for the match of the pattern. The figure to the right shows Java code that matches this pattern, thus violating the property. The Vector, v, is updated after the Enumeration, e, is created, and e is then used. The previous two examples show finite state properties, but properties used in runtime verification may be much more complex. The SafeLock property enforces the policy that the number of acquires and releases of a (reentrant) Lock class are matched within a given method call. This, of course, disallows release of Locks in methods other than the ones that acquire them, but this is very possibly a desirable goal for the tested system to achieve. Below is a specification of this property using a parametric context-free pattern: The pattern specifies balanced sequences of nested begin/end and acquire/release pairs for each Thread and Lock (ϵ{\displaystyle \epsilon }is the empty sequence). Here begin and end refer to the begin and end of every method in the program (except the calls to acquire and release themselves). They are parametric in the Thread because it is necessary to associate the beginning and end of methods if and only if they belong to the same Thread. The acquire and release events are also parametric in the Thread for the same reason. They are, additionally, parametric in Lock because we do not wish to associate the releases of one Lock with the acquires of another. In the extreme, it is possible that there will be an instance of the property, i.e., a copy of the context-free parsing mechanism, for each possible combination of Thread with Lock; this happens, again, intuitively, because runtime verification systems may implement the same functionality differently. For example, if a system has Threadst1{\displaystyle t_{1}},t2{\displaystyle t_{2}}, andt3{\displaystyle t_{3}}with Locksl1{\displaystyle l_{1}}andl2{\displaystyle l_{2}}, then it is possible to have to maintain property instances for the pairs <t1{\displaystyle t_{1}},l1{\displaystyle l_{1}}>, <t1{\displaystyle t_{1}},l2{\displaystyle l_{2}}>, <t2{\displaystyle t_{2}},l1{\displaystyle l_{1}}>, <t2{\displaystyle t_{2}},l2{\displaystyle l_{2}}>, <t3{\displaystyle t_{3}},l1{\displaystyle l_{1}}>, and <t3{\displaystyle t_{3}},l2{\displaystyle l_{2}}>. This property should be monitored for failures to match the pattern because the pattern specified correct behavior. The figure to the right shows a trace that produces two violations of this property. The steps down in the figure represent the beginning of a method, while the steps up are the end. The grey arrows in the figure show the matching between given acquires and releases of the same Lock. For simplicity, the trace shows only one Thread and one Lock. Most of the runtime verification research addresses one or more of the topics listed below. Observing an executing system typically incurs some runtime overhead (hardware monitors may make an exception). It is important to reduce the overhead of runtime verification tools as much as possible, particularly when the generated monitors are deployed with the system. Runtime overhead reducing techniques include: One of the major practical impediments of all formal approaches is that their users are reluctant to, or don't know and don't want to learn how to read or write specifications. In some cases the specifications are implicit, such as those for deadlocks and data-races, but in most cases they need to be produced. An additional inconvenience, particularly in the context of runtime verification, is that many existing specification languages are not expressive enough to capture the intended properties. The capability of a runtime verifier to detect errors strictly depends on its capability to analyze execution traces. When the monitors are deployed with the system, instrumentation is typically minimal and the execution traces are as simple as possible to keep the runtime overhead low. When runtime verification is used for testing, one can afford more comprehensive instrumentations that augment events with important system information that can be used by the monitors to construct and therefore analyze more refined models of the executing system. For example, augmenting events withVector clockinformation and with data and control flow information allows the monitors to construct acausal modelof the running system in which the observed execution was only one possible instance. Any other permutation of events that is consistent with the model is a feasible execution of the system, which could happen under a different thread interleaving. Detecting property violations in such inferred executions (by monitoring them) makes the monitorpredicterrors that did not happen in the observed execution, but which can happen in another execution of the same system. An important research challenge is to extract models from execution traces that comprise as many other execution traces as possible. Unlike testing or exhaustive verification, runtime verification holds the promise to allow the system to recover from detected violations, through reconfiguration, micro-resets, or through finer intervention mechanisms sometimes referred to as tuning or steering. Implementation of these techniques within the rigorous framework of runtime verification gives rise to additional challenges. Researchers in Runtime Verification recognized the potential for usingAspect-oriented Programmingas a technique for defining program instrumentation in a modular way. Aspect-oriented programming (AOP) generally promotes the modularization of crosscutting concerns. Runtime Verification naturally is one such concern and can hence benefit from certain properties of AOP. Aspect-oriented monitor definitions are largely declarative, and hence tend to be simpler to reason about than instrumentation expressed through aprogram transformationwritten in an imperative programming language. Further, static analyses can reason about monitoring aspects more easily than about other forms of program instrumentation, as all instrumentation is contained within a single aspect. Many current runtime verification tools are hence built in the form of specification compilers, that take an expressive high-level specification as input and produce as output code written in some Aspect-oriented programming language (such asAspectJ). Runtime verification, if used in combination with provably correct recovery code, can provide an invaluable infrastructure for program verification, which can significantly lower the latter's complexity. For example, formally verifying heap-sort algorithm is very challenging. One less challenging technique to verify it is to monitor its output to be sorted (a linear complexity monitor) and, if not sorted, then sort it using some easily verifiable procedure, say insertion sort. The resulting sorting program is now more easily verifiable, the only thing being required from heap-sort is that it does not destroy the original elements regarded as a multiset, which is much easier to prove. Looking at from the other direction, one can use formal verification to reduce the overhead of runtime verification, as already mentioned above for static analysis instead of formal verification. Indeed, one can start with a fully runtime verified, but probably slow program. Then one can use formal verification (or static analysis) to discharge monitors, same way a compiler uses static analysis to discharge runtime checks of type correctness ormemory safety. Compared to the more traditional verification approaches, an immediate disadvantage of runtime verification is its reduced coverage. This is not problematic when the runtime monitors are deployed with the system (together with appropriate recovery code to be executed when the property is violated), but it may limit the effectiveness of runtime verification when used to find errors in systems. Techniques to increase the coverage of runtime verification for error detection purposes include:
https://en.wikipedia.org/wiki/Runtime_verification
Software verificationis a discipline ofsoftware engineering,programming languages, andtheory of computationwhose goal is to assure that software satisfies the expected requirements. A broad definition of verification makes it related tosoftware testing. In that case, there are two fundamental approaches to verification: Under theACM Computing Classification System, software verification topics appear under "Software and its engineering", within "Software creation", whereasProgram verificationalso appears underTheory of computationunder Semantics and reasoning, Program reasoning. Dynamic verification is performed during the execution of software, and dynamically checks its behavior; it is commonly known as theTestphase. Verification is a Review Process. Depending on the scope of tests, we can categorize them in three families: The aim of software dynamic verification is to find the errors introduced by an activity (for example, having a medical software to analyze bio-chemical data); or by the repetitive performance of one or more activities (such as a stress test for a web server, i.e. check if the current product of the activity is as correct as it was at the beginning of the activity). Static verification is the process of checking that software meets requirements by inspecting the code before it runs. For example: Verification by Analysis - The analysis verification method applies to verification by investigation, mathematical calculations, logical evaluation, and calculations using classical textbook methods or accepted general use computer methods. Analysis includes sampling and correlating measured data and observed test results with calculated expected values to establish conformance with requirements. When it is defined more strictly, verification is equivalent only to static testing and it is intended to be applied to artifacts. And, validation (of the whole software product) would be equivalent to dynamic testing and intended to be applied to the running software product (not its artifacts, except requirements). Notice that requirements validation can be performed statically and dynamically (Seeartifact validation). Software verification is often confused with software validation. The difference betweenverificationandvalidation:
https://en.wikipedia.org/wiki/Software_verification
Electronic design automation(EDA), also referred to aselectronic computer-aided design(ECAD),[1]is a category ofsoftware toolsfor designingelectronic systemssuch asintegrated circuitsandprinted circuit boards. The tools work together in adesign flowthat chip designers use to design and analyze entiresemiconductorchips. Since a modernsemiconductorchip can have billions of components, EDA tools are essential for their design; this article in particular describes EDA specifically with respect tointegrated circuits(ICs). The earliest electronic design automation is attributed toIBMwith the documentation of its700 seriescomputers in the 1950s.[2] Prior to the development of EDA,integrated circuitswere designed by hand and manually laid out.[3]Some advanced shops used geometric software to generate tapes for aGerberphotoplotter, responsible for generating a monochromatic exposure image, but even those copied digital recordings of mechanically drawn components. The process was fundamentally graphic, with the translation from electronics to graphics done manually; the best-known company from this era wasCalma, whoseGDSIIformat is still in use today. By the mid-1970s, developers started to automate circuit design in addition to drafting and the firstplacement and routingtools were developed; as this occurred, the proceedings of theDesign Automation Conferencecatalogued the large majority of the developments of the time.[3] The next era began following the publication of "Introduction toVLSISystems" byCarver MeadandLynn Conwayin 1980,[4]and is considered the standard textbook for chip design.[5]The result was an increase in the complexity of the chips that could be designed, with improved access todesign verificationtools that usedlogic simulation. The chips were easier to lay out and more likely to function correctly, since their designs could be simulated more thoroughly prior to construction. Although the languages and tools have evolved, this general approach of specifying the desired behavior in a textual programming language and letting the tools derive the detailed physical design remains the basis of digital IC design today. The earliest EDA tools were produced academically. One of the most famous was the "Berkeley VLSI Tools Tarball", a set ofUNIXutilities used to design early VLSI systems. Widely used were theEspresso heuristic logic minimizer,[6]responsible for circuit complexity reductions andMagic,[7]a computer-aided design platform. Another crucial development was the formation ofMOSIS,[8]a consortium of universities and fabricators that developed an inexpensive way to train student chip designers by producing real integrated circuits. The basic concept was to use reliable, low-cost, relatively low-technology IC processes and pack a large number of projects perwafer, with several copies of chips from each project remaining preserved. Cooperating fabricators either donated the processed wafers or sold them at cost, as they saw the program as helpful to their own long-term growth. 1981 marked the beginning of EDA as an industry. For many years, the larger electronic companies, such asHewlett-Packard,TektronixandIntel, had pursued EDA internally, with managers and developers beginning to spin out of these companies to concentrate on EDA as a business.Daisy Systems,Mentor GraphicsandValid Logic Systemswere all founded around this time and collectively referred to as DMV. In 1981, theU.S. Department of Defenseadditionally began funding ofVHDLas a hardware description language. Within a few years, there were many companies specializing in EDA, each with a slightly different emphasis. The first trade show for EDA was held at theDesign Automation Conferencein 1984 and in 1986,Verilog, another popular high-level design language, was first introduced as a hardware description language byGateway Design Automation. Simulators quickly followed these introductions, permitting direct simulation of chip designs and executable specifications. Within several years, back-ends were developed to performlogic synthesis. Current digital flows are extremely modular, with front ends producing standardized design descriptions that compile into invocations of units similar to cells without regard to their individual technology. Cells implement logic or other electronic functions via the utilisation of a particular integrated circuit technology. Fabricators generally provide libraries of components for their production processes, with simulation models that fit standard simulation tools. Most analog circuits are still designed in a manual fashion, requiring specialist knowledge that is unique to analog design (such as matching concepts).[9]Hence, analog EDA tools are far less modular, since many more functions are required, they interact more strongly and the components are, in general, less ideal. EDA for electronics has rapidly increased in importance with the continuous scaling ofsemiconductortechnology.[10]Some users arefoundryoperators, who operate thesemiconductor fabricationfacilities ("fabs") and additional individuals responsible for utilising the technology design-service companies who use EDA software to evaluate an incoming design for manufacturing readiness. EDA tools are also used for programming design functionality intoFPGAsor field-programmable gate arrays, customisable integrated circuit designs. Design flow primarily remains characterised via several primary components; these include: Market capitalizationand company name as of March 2023: Market capitalization and company name as of December 2011[update]:[19] Many EDA companies acquire small companies with software or other technology that can be adapted to their core business.[24]Most of the market leaders are amalgamations of many smaller companies and this trend is helped by the tendency of software companies to design tools as accessories that fit naturally into a larger vendor's suite of programs ondigital circuitry; many new tools incorporate analog design and mixed systems.[25]This is happening due to a trend to placeentire electronic systems on a single chip.
https://en.wikipedia.org/wiki/Hardware_verification
Cyclomatic complexityis asoftware metricused to indicate thecomplexity of a program. It is a quantitative measure of the number of linearly independentpathsthrough a program'ssource code. It was developed byThomas J. McCabe, Sr.in 1976. Cyclomatic complexity is computed using thecontrol-flow graphof the program. The nodes of thegraphcorrespond to indivisible groups of commands of a program, and adirected edgeconnects two nodes if the second command might be executed immediately after the first command. Cyclomatic complexity may also be applied to individualfunctions,modules,methods, orclasseswithin a program. Onetestingstrategy, calledbasis path testingby McCabe who first proposed it, is to test each linearly independent path through the program. In this case, the number of test cases will equal the cyclomatic complexity of the program.[1] There are multiple ways to define cyclomatic complexity of a section ofsource code. One common way is the number of linearly independentpathswithin it. A setS{\displaystyle S}of paths is linearly independent if the edge set of any pathP{\displaystyle P}inS{\displaystyle S}is not the union of edge sets of the paths in some subset ofS/P{\displaystyle S/P}. If the source code contained nocontrol flow statements(conditionals or decision points) the complexity would be 1, since there would be only a single path through the code. If the code had one single-conditionIF statement, there would be two paths through the code: one where the IF statement is TRUE and another one where it is FALSE. Here, the complexity would be 2. Two nested single-condition IFs, or one IF with two conditions, would produce a complexity of 3. Another way to define the cyclomatic complexity of a program is to look at itscontrol-flow graph, adirected graphcontaining thebasic blocksof the program, with an edge between two basic blocks if control may pass from the first to the second. The complexityMis then defined as[2] M=E−N+2P,{\displaystyle M=E-N+2P,} where An alternative formulation of this, as originally proposed, is to use a graph in which each exit point is connected back to the entry point. In this case, the graph isstrongly connected. Here, the cyclomatic complexity of the program is equal to thecyclomatic numberof its graph (also known as thefirst Betti number), which is defined as[2]M=E−N+P.{\displaystyle M=E-N+P.} This may be seen as calculating the number oflinearly independent cyclesthat exist in the graph: those cycles that do not contain other cycles within themselves. Because each exit point loops back to the entry point, there is at least one such cycle for each exit point. For a single program (or subroutine or method),Palways equals 1; a simpler formula for a single subroutine is[3]M=E−N+2.{\displaystyle M=E-N+2.} Cyclomatic complexity may be applied to several such programs or subprograms at the same time (to all of the methods in a class, for example). In these cases,Pwill equal the number of programs in question, and each subprogram will appear as a disconnected subset of the graph. McCabe showed that the cyclomatic complexity of a structured program with only one entry point and one exit point is equal to the number of decision points ("if" statements or conditional loops) contained in that program plus one. This is true only for decision points counted at the lowest, machine-level instructions.[4]Decisions involving compound predicates like those found inhigh-level languageslikeIF cond1 AND cond2 THEN ...should be counted in terms of predicate variables involved. In this example, one should count two decision points because at machine level it is equivalent toIF cond1 THEN IF cond2 THEN ....[2][5] Cyclomatic complexity may be extended to a program with multiple exit points. In this case, it is equal toπ−s+2,{\displaystyle \pi -s+2,}whereπ{\displaystyle \pi }is the number of decision points in the program andsis the number of exit points.[5][6] In his presentation "Software Quality Metrics to Identify Risk"[7]for the Department of Homeland Security, Tom McCabe introduced the following categorization of cyclomatic complexity: An even subgraph of a graph (also known as anEulerian subgraph) is one in which everyvertexisincidentwith an even number of edges. Such subgraphs are unions of cycles and isolated vertices. Subgraphs will be identified with their edge sets, which is equivalent to only considering those even subgraphs which contain all vertices of the full graph. The set of all even subgraphs of a graph is closed undersymmetric difference, and may thus be viewed as avector spaceoverGF(2). This vector space is called the cycle space of the graph. Thecyclomatic numberof the graph is defined as thedimensionof this space. Since GF(2) has two elements and the cycle space is necessarily finite, the cyclomatic number is also equal to the2-logarithmof the number of elements in the cycle space. Abasisfor the cycle space is easily constructed by first fixing aspanning forestof the graph, and then considering the cycles formed by one edge not in the forest and the path in the forest connecting the endpoints of that edge. These cycles form a basis for the cycle space. The cyclomatic number also equals the number of edges not in a maximal spanning forest of a graph. Since the number of edges in a maximal spanning forest of a graph is equal to the number of vertices minus the number of components, the formulaE−N+P{\displaystyle E-N+P}defines the cyclomatic number.[8] Cyclomatic complexity can also be defined as a relativeBetti number, the size of arelative homologygroup:M:=b1(G,t):=rank⁡H1(G,t),{\displaystyle M:=b_{1}(G,t):=\operatorname {rank} H_{1}(G,t),} which is read as "the rank of the firsthomologygroup of the graphGrelative to theterminal nodest". This is a technical way of saying "the number of linearly independent paths through the flow graph from an entry to an exit", where: This cyclomatic complexity can be calculated. It may also be computed via absoluteBetti numberby identifying the terminal nodes on a given component, or drawing paths connecting the exits to the entrance. The new, augmented graphG~{\displaystyle {\tilde {G}}}obtainsM=b1(G~)=rank⁡H1(G~).{\displaystyle M=b_{1}({\tilde {G}})=\operatorname {rank} H_{1}({\tilde {G}}).} It can also be computed viahomotopy. If a (connected) control-flow graph is considered a one-dimensionalCW complexcalledX{\displaystyle X}, thefundamental groupofX{\displaystyle X}will beπ1(X)≅Z∗n{\displaystyle \pi _{1}(X)\cong \mathbb {Z} ^{*n}}. The value ofn+1{\displaystyle n+1}is the cyclomatic complexity. The fundamental group counts how many loops there are through the graph up to homotopy, aligning as expected. One of McCabe's original applications was to limit the complexity of routines during program development. He recommended that programmers should count the complexity of the modules they are developing, and split them into smaller modules whenever the cyclomatic complexity of the module exceeded 10.[2]This practice was adopted by theNISTStructured Testing methodology, which observed that since McCabe's original publication, the figure of 10 had received substantial corroborating evidence. However, it also noted that in some circumstances it may be appropriate to relax the restriction and permit modules with a complexity as high as 15. As the methodology acknowledged that there were occasional reasons for going beyond the agreed-upon limit, it phrased its recommendation as "For each module, either limit cyclomatic complexity to [the agreed-upon limit] or provide a written explanation of why the limit was exceeded."[9] Section VI of McCabe's 1976 paper is concerned with determining what the control-flow graphs (CFGs) of non-structured programslook like in terms of their subgraphs, which McCabe identified. (For details, seestructured program theorem.) McCabe concluded that section by proposing a numerical measure of how close to the structured programming ideal a given program is, i.e. its "structuredness". McCabe called the measure he devised for this purposeessential complexity.[2] To calculate this measure, the original CFG is iteratively reduced by identifying subgraphs that have a single-entry and a single-exit point, which are then replaced by a single node. This reduction corresponds to what a human would do if they extracted a subroutine from the larger piece of code. (Nowadays such a process would fall under the umbrella term ofrefactoring.) McCabe's reduction method was later calledcondensationin some textbooks, because it was seen as a generalization of thecondensation to components used in graph theory.[10]If a program is structured, then McCabe's reduction/condensation process reduces it to a single CFG node. In contrast, if the program is not structured, the iterative process will identify the irreducible part. The essential complexity measure defined by McCabe is simply the cyclomatic complexity of this irreducible graph, so it will be precisely 1 for all structured programs, but greater than one for non-structured programs.[9]: 80 Another application of cyclomatic complexity is in determining the number of test cases that are necessary to achieve thorough test coverage of a particular module. It is useful because of two properties of the cyclomatic complexity,M, for a specific module: All three of the above numbers may be equal: branch coverage≤{\displaystyle \leq }cyclomatic complexity≤{\displaystyle \leq }number of paths. For example, consider a program that consists of two sequential if-then-else statements. In this example, two test cases are sufficient to achieve a complete branch coverage, while four are necessary for complete path coverage. The cyclomatic complexity of the program is 3 (as the strongly connected graph for the program contains 8 edges, 7 nodes, and 1 connected component) (8 − 7 + 2). In general, in order to fully test a module, all execution paths through the module should be exercised. This implies a module with a high complexity number requires more testing effort than a module with a lower value since the higher complexity number indicates more pathways through the code. This also implies that a module with higher complexity is more difficult to understand since the programmer must understand the different pathways and the results of those pathways. Unfortunately, it is not always practical to test all possible paths through a program. Considering the example above, each time an additional if-then-else statement is added, the number of possible paths grows by a factor of 2. As the program grows in this fashion, it quickly reaches the point where testing all of the paths becomes impractical. One common testing strategy, espoused for example by the NIST Structured Testing methodology, is to use the cyclomatic complexity of a module to determine the number ofwhite-box teststhat are required to obtain sufficient coverage of the module. In almost all cases, according to such a methodology, a module should have at least as many tests as its cyclomatic complexity. In most cases, this number of tests is adequate to exercise all the relevant paths of the function.[9] As an example of a function that requires more than mere branch coverage to test accurately, reconsider the above function. However, assume that to avoid a bug occurring, any code that calls eitherf1()orf3()must also call the other.[a]Assuming that the results ofc1()andc2()are independent, the function as presented above contains a bug. Branch coverage allows the method to be tested with just two tests, such as the following test cases: Neither of these cases exposes the bug. If, however, we use cyclomatic complexity to indicate the number of tests we require, the number increases to 3. We must therefore test one of the following paths: Either of these tests will expose the bug. Multiple studies have investigated the correlation between McCabe's cyclomatic complexity number with the frequency of defects occurring in a function or method.[11]Some studies[12]find a positive correlation between cyclomatic complexity and defects; functions and methods that have the highest complexity tend to also contain the most defects. However, the correlation between cyclomatic complexity and program size (typically measured inlines of code) has been demonstrated many times.Les Hattonhas claimed[13]that complexity has the same predictive ability as lines of code. Studies that controlled for program size (i.e., comparing modules that have different complexities but similar size) are generally less conclusive, with many finding no significant correlation, while others do find correlation. Some researchers question the validity of the methods used by the studies finding no correlation.[14]Although this relation likely exists, it is not easily used in practice.[15]Since program size is not a controllable feature of commercial software, the usefulness of McCabe's number has been questioned.[11]The essence of this observation is that larger programs tend to be more complex and to have more defects. Reducing the cyclomatic complexity of code isnot provento reduce the number of errors or bugs in that code. International safety standards likeISO 26262, however, mandate coding guidelines that enforce low code complexity.[16]
https://en.wikipedia.org/wiki/Cyclomatic_complexity
Linear code sequence and jump(LCSAJ), in the broad sense, is a software analysis method used to identify structural units in code under test. Its primary use is with dynamic software analysis to help answer the question "How much testing is enough?".[1]Dynamic software analysis is used to measure the quality and efficacy of software test data, where the quantification is performed in terms of structural units of the code under test. When used to quantify the structural units exercised by a given set of test data, dynamic analysis is also referred to asstructural coverage analysis. In a narrower sense, an LCSAJ is a well-defined linear region of a program's code. When used in this sense, LCSAJ is also calledJJ-path, standing for jump-to-jump path. The LCSAJ analysis method was devised by ProfessorMichael Hennellin order to perform quality assessments on the mathematical libraries on which hisnuclear physicsresearch at theUniversity of Liverpooldepended.[2][3]Professor Hennell later founded theLiverpool Data Research Associates(LDRA) company to commercialize the software test-bed produced for this work, resulting in theLDRA Testbedproduct. Introduced in 1976, the LCSAJ[4]is now also referred to as the jump-to-jump path (JJ-path).[5]It has also been called Liverpool's Contribution to Silly Acronyms and Jokes.[citation needed] An LCSAJ is a software code path fragment consisting of a sequence of code (a linear code sequence) followed by a control flow Jump, and consists of the following three items:[6] Unlike (maximal)basic blocks, LCSAJs can overlap with each other because a jump (out) may occur in the middle of an LCSAJ, while it isn't allowed in the middle of a basic block. In particular, conditional jumps generate overlapping LCSAJs: one which runs through to where the condition evaluates to false and another that ends at the jump when the condition evaluates to true (the example given further below in this article illustrates such an occurrence). According to a monograph from 1986, LCSAJs were typically four times larger than basic blocks.[7] The formal definition of a LCSAJ can be given in terms of basic blocks as follows:[8] a sequence of one or more consecutively numbered basic blocks,p, (p+1), ...,q, of a code unit, followed by a control flow jump either out of the code [unit] or to a basic block numberedr, wherer≠(q+1), and eitherp=1 or there exists a control flow jump to blockpfrom some other block in the unit. (A basic block to which such a control flow jump can be made is referred to as a target of the [LCSAJ] jump.) According to Jorgensen's 2013 textbook, outside Great Britain andISTQBliterature, the same notion is calledDD-path.[9][dubious–discuss] Coverage analysis metrics are used to gauge how much testing has been achieved. The most basic metric is the proportion of statements executed, Test Effectiveness Ratio 1 (TER1):[10] TER1=number of statements executed by the test datatotal number of executable statements{\displaystyle TER_{\text{1}}={\frac {\text{number of statements executed by the test data}}{\text{total number of executable statements}}}} Higher level coverage metrics can also be generated, in particular:[11] TER2=number of control-flow branches executed by the test datatotal number of control-flow branches{\displaystyle TER_{\text{2}}={\frac {\text{number of control-flow branches executed by the test data}}{\text{total number of control-flow branches}}}} TER3=number of LCSAJs executed by the test datatotal number of LCSAJs{\displaystyle TER_{\text{3}}={\frac {\text{number of LCSAJs executed by the test data}}{\text{total number of LCSAJs}}}} These metrics satisfy a pure hierarchy, whereby when TER3 = 100% has been achieved it follows that TER2 = 100% and TER1 = 100% have also been achieved. Both the TER1 & TER2 metrics were in use in the early 1970s and the third dates from the late 1970s. The requirement for achieving TER1 = 100% was the level originally selected for the DO-178 avionics standard until it was supplemented by the MCDC (modified condition/decision coverage) additional requirement in 1992.[12]Higher levels TER3 = 100% have been mandated for many other projects, including aerospace, telephony, and banking.[citation needed]One practical problem of using TER3 is that many LCSAJs can never be executed due to the conflicting conditions they contain. Consider the following C code: From this example it can be seen that the basic block identified by an LCSAJ triple may span a decision point, reflecting the conditions that must be in place in order for the LCSAJ to be executed. For instance, LCSAJ 2 for the above example includes thewhilestatement where the condition(count < ITERATIONS)evaluates to true. Each line of code has an LCSAJ 'density' associated with it; line 17, for instance, appears within 6 unique LCSAJs - i.e. it has an LCSAJ density of 6. This is helpful when evaluating the maintainability of the code; If a line of code is to be changed then the density is indicative of how many LCSAJs will be affected by that change. A coverage level of TER3 = 100% would be achieved when the test data used causes the execution of each of these LCSAJs at least once.
https://en.wikipedia.org/wiki/Linear_code_sequence_and_jump
Modified condition/decision coverage(MC/DC) is acode coveragecriterion used insoftware testing. MC/DC requires all of the below during testing:[1] Independence of a condition is shown by proving that only one condition changes at a time. MC/DC is used in avionics software development guidanceDO-178BandDO-178Cto ensure adequatetestingof the most critical (Level A)software, which is defined as that software which couldprovide (or prevent failure of)continued safe flight and landing of an aircraft. It is also highly recommended forSIL4 in part 3 Annex B of the basic safety publication[2]andASILD in part 6 of automotive standardISO 26262.[3] Additionally, NASA requires 100% MC/DC coverage for any safety critical software component in Section 3.7.4 of NPR 7150.2D.[4] It is a misunderstanding that by purely syntactic rearrangements of decisions (breaking them into several independently evaluated conditions using temporary variables, the values of which are then used in the decision) which do not change the semantics of a program can lower the difficulty of obtaining complete MC/DC coverage.[5] This is because MC/DC is driven by the program syntax. However, this kind of "cheating" can be done to simplify expressions, not simply to avoid MC/DC complexities. For example, assignment of the number of days in a month (excluding leap years) could be achieved by using either a switch statement or by using a table with an enumeration value as an index. The number of tests required based on the source code could be considerably different depending upon the coverage required, although semantically we would want to test both approaches with a minimum number of tests.[citation needed] Another example that could be considered as "cheating" to achieve higher MC/DC is: if the definition of a decision is treated as if it is a boolean expression that changes the control flow of the program (the text in brackets in an 'if' statement) then one may think that Function B is likely to have higher MC/DC than Function A for a given set of test cases (easier to test because it needs less tests to achieve 100% MC/DC coverage), even though functionally both are the same.[6] However, what is wrong in the previous statement is the definition of decision. A decision includes 'any' boolean expression, even for assignments to variables. In this case, the three assignments should be treated as a decision for MC/DC purposes and therefore the changed code needs exactly the same tests and number of tests to achieve MC/DC than the first one. Some code coverage tools do not use this strict interpretation of a decision and may produce false positives (reporting 100% code coverage when indeed this is not the case).[citation needed] In 2002Sergiy Vilkomirproposedreinforced condition/decision coverage(RC/DC) as a stronger version of the MC/DC coverage criterion that is suitable forsafety-critical systems.[7][8] Jonathan Bowenand his co-author analyzed several variants of MC/DC and RC/DC and concluded that at least some MC/DC variants have superior coverage over RC/DC.[9]
https://en.wikipedia.org/wiki/Modified_condition/decision_coverage
Mutation testing(ormutation analysisorprogram mutation) is used to design new software tests and evaluate the quality of existing software tests. Mutation testing involves modifying a program in small ways.[1]Each mutated version is called amutantand tests detect and reject mutants by causing the behaviour of the original version to differ from the mutant. This is calledkillingthe mutant. Test suites are measured by the percentage of mutants that they kill. New tests can be designed to kill additional mutants. Mutants are based on well-definedmutation operatorsthat either mimic typical programming errors (such as using the wrong operator or variable name) or force the creation of valuable tests (such as dividing each expression by zero). The purpose is to help the tester develop effective tests or locate weaknesses in the test data used for the program or in sections of the code that are seldom or never accessed duringexecution. Mutation testing is a form ofwhite-box testing.[2][3] Most of this article is about "program mutation", in which the program is modified. A more general definition ofmutation analysisis using well-defined rules defined on syntactic structures to make systematic changes to software artifacts.[4]Mutation analysis has been applied to other problems, but is usually applied to testing. Somutation testingis defined as using mutation analysis to design new software tests or to evaluate existing software tests.[4]Thus, mutation analysis and testing can be applied to design models, specifications, databases, tests, XML, and other types of software artifacts, although program mutation is the most common.[5] Tests can be created to verify the correctness of the implementation of a given software system, but the creation of tests still poses the question whether the tests are correct and sufficiently cover the requirements that have originated the implementation.[6](This technological problem is itself an instance of a deeper philosophical problem named "Quis custodiet ipsos custodes?" ["Who will guard the guards?"].) The idea behind mutation testing is that if a mutant is introduced, this normally causes a bug in the program's functionality which the tests should find. This way, the tests are tested. If a mutant is not detected by the test suite, this typically indicates that the test suite is unable to locate the faults represented by the mutant, but it can also indicate that the mutation introduces no faults, that is, the mutation is a valid change that does not affect functionality. One (common) way a mutant can be valid is that the code that has been changed is "dead code" that is never executed. For mutation testing to function at scale, a large number of mutants are usually introduced, leading to the compilation and execution of an extremely large number of copies of the program. This problem of the expense of mutation testing had reduced its practical use as a method of software testing. However, the increased use ofobject oriented programming languagesandunit testingframeworks has led to the creation of mutation testing tools that test individual portions of an application. The goals of mutation testing are multiple: Mutation testing was originally proposed by Richard Lipton as a student in 1971,[8]and first developed and published by DeMillo, Lipton and Sayward.[1]The first implementation of a mutation testing tool was by Timothy Budd as part of hisPhDwork (titledMutation Analysis) in 1980 fromYale University.[9] Recently, with the availability of massive computing power, there has been a resurgence of mutation analysis within the computer science community, and work has been done to define methods of applying mutation testing toobject oriented programming languagesand non-procedural languages such asXML,SMV, andfinite-state machines. In 2004, a company called Certess Inc. (now part ofSynopsys) extended many of the principles into the hardware verification domain. Whereas mutation analysis only expects to detect a difference in the output produced, Certess extends this by verifying that a checker in the testbench will actually detect the difference. This extension means that all three stages of verification, namely: activation, propagation, and detection are evaluated. They called this functional qualification. Fuzzingcan be considered to be a special case of mutation testing. In fuzzing, the messages or data exchanged inside communication interfaces (both inside and between software instances) are mutated to catch failures or differences in processing the data.Codenomicon[10](2001) andMu Dynamics(2005) evolved fuzzing concepts to a fully stateful mutation testing platform, complete with monitors for thoroughly exercising protocol implementations. Mutation testing is based on two hypotheses. The first is thecompetent programmerhypothesis. This hypothesis states that competent programmers write programs that are close to being correct.[1]"Close" is intended to be based on behavior, not syntax. The second hypothesis is called thecoupling effect. The coupling effect asserts that simple faults can cascade orcoupleto form other emergent faults.[11][12] Subtle and important faults are also revealed by higher-order mutants, which further support the coupling effect.[13][14][7][15][16]Higher-order mutants are enabled by creating mutants with more than one mutation. Mutation testing is done by selecting a set of mutation operators and then applying them to the source program one at a time for each applicable piece of the source code. The result of applying one mutation operator to the program is called amutant. If the test suite is able to detect the change (i.e. one of the tests fails), then the mutant is said to bekilled. For example, consider the following C++ code fragment: The condition mutation operator would replace&&with||and produce the following mutant: Now, for the test to kill this mutant, the following three conditions should be met: These conditions are collectively called theRIP model.[8] Weak mutation testing(orweak mutation coverage) requires that only the first and second conditions are satisfied.Strong mutation testingrequires that all three conditions are satisfied. Strong mutation is more powerful, since it ensures that the test suite can really catch the problems. Weak mutation is closely related tocode coveragemethods. It requires much less computing power to ensure that the test suite satisfies weak mutation testing than strong mutation testing. However, there are cases where it is not possible to find a test case that could kill this mutant. The resulting program is behaviorally equivalent to the original one. Such mutants are calledequivalent mutants. Equivalent mutants detection is one of biggest obstacles for practical usage of mutation testing. The effort needed to check if mutants are equivalent or not can be very high even for small programs.[17]A 2014 systematic literature review of a wide range of approaches to overcome the Equivalent Mutant Problem[18]identified 17 relevant techniques (in 22 articles) and three categories of techniques: detecting (DEM); suggesting (SEM); and avoiding equivalent mutant generation (AEMG). The experiment indicated that Higher Order Mutation in general and JudyDiffOp strategy in particular provide a promising approach to the Equivalent Mutant Problem. In addition to equivalent mutants, there aresubsumed mutantswhich are mutants that exist in the same source code location as another mutant, and are said to be "subsumed" by the other mutant. Subsumed mutants are not visible to a mutation testing tool, and do not contribute to coverage metrics. For example, let's say you have two mutants, A and B, that both change a line of code in the same way. Mutant A is tested first, and the result is that the code is not working correctly. Mutant B is then tested, and the result is the same as with mutant A. In this case, Mutant B is considered to be subsumed by Mutant A, since the result of testing Mutant B is the same as the result of testing Mutant A. Therefore, Mutant B does not need to be tested, as the result will be the same as Mutant A. To make syntactic changes to a program, a mutation operator serves as a guideline that substitutes portions of the source code. Given that mutations depend on these operators, scholars have created a collection of mutation operators to accommodate different programming languages, like Java. The effectiveness of these mutation operators plays a pivotal role in mutation testing.[19] Many mutation operators have been explored by researchers. Here are some examples of mutation operators for imperative languages: These mutation operators are also called traditional mutation operators. There are also mutation operators for object-oriented languages,[22]for concurrent constructions,[23]complex objects like containers,[24]etc. Operators for containers are calledclass-levelmutation operators. Operators at the class level alter the program's structure by adding, removing, or changing the expressions being examined. Specific operators have been established for each category of changes.[19]For example, the muJava tool offers various class-level mutation operators such as Access Modifier Change, Type Cast Operator Insertion, and Type Cast Operator Deletion. Mutation operators have also been developed to perform security vulnerability testing of programs.[25] Apart from theclass-leveloperators, MuJava also includesmethod-levelmutation operators, referred to as traditional operators. These traditional operators are designed based on features commonly found in procedural languages. They carry out changes to statements by adding, substituting, or removing primitive operators. These operators fall into six categories:Arithmetic operators,Relational operators,Conditional operators,Shift operators,Logical operatorsandAssignment operators.[19] There are three types of mutation testing; Statement mutation is a process where a block of code is intentionally modified by either deleting or copying certain statements. Moreover, it allows for the reordering of statements within the code block to generate various sequences.[26]This technique is crucial in software testing as it helps identify potential weaknesses or errors in the code. By deliberately making changes to the code and observing how it behaves, developers can uncover hidden bugs or flaws that might go unnoticed during regular testing.[27]Statement mutation is like a diagnostic tool that provides insights into the code's robustness and resilience, helping programmers improve the overall quality and reliability of their software. For example, in the code snippet below, entire 'else' section is removed: Value mutation occurs when modification is executed to the parameter and/or constant values within the code. This typically involves adjusting the values by adding or subtracting 1, but it can also involve making more substantial changes to the values. The specific alterations made during value mutation include two main scenarios: Firstly, there's the transformation from a small value to a higher value. This entails replacing a small value in the code with a larger one. The purpose of this change is to assess how the code responds when it encounters larger inputs. It helps ensure that the code can accurately and efficiently process these larger values without encountering errors or unexpected issues.[26] Conversely, the second scenario involves changing a higher value to a smaller one. In this case, we replace a higher value within the code with a smaller value. This test aims to evaluate how the code handles smaller inputs. Ensuring that the code performs correctly with smaller values is essential to prevent unforeseen problems or errors when dealing with such input data.[26] For example: Decision mutation testing centers on the identification of design errors within the code, with a particular emphasis on detecting flaws or weaknesses in the program's decision-making logic. This method involves deliberately altering arithmetic and logical operators to expose potential issues.[26]By manipulating these operators, developers can systematically evaluate how the code responds to different decision scenarios. This process helps ensure that the program's decision-making pathways are robust and accurate, preventing costly errors that could arise from faulty logic. Decision mutation testing serves as a valuable tool in software development, enabling developers to enhance the reliability and effectiveness of their decision-making code segments. For example:
https://en.wikipedia.org/wiki/Mutation_testing
Regression testing(rarely,non-regression testing[1]) is re-runningfunctionalandnon-functional teststo ensure that previously developed and tested software still performs as expected after a change.[2]If not, that would be called aregression. Changes that may require regression testing includebugfixes, software enhancements,configurationchanges, and even substitution ofelectronic components(hardware).[3]As regressiontest suitestend to grow with each found defect, test automation is frequently involved. The evident exception is theGUIsregression testing, which normally must be executed manually. Sometimes achange impact analysisis performed to determine an appropriate subset of tests (non-regression analysis[4]). As software is updated or changed, or reused on a modified target, emergence of new faults and/or re-emergence of old faults is quite common. Sometimes re-emergence occurs because a fix gets lost through poorrevision controlpractices (or simplehuman errorin revision control). Often, a fix for a problem will be "fragile" in that it fixes the problem in the narrow case where it was first observed but not in more general cases which may arise over the lifetime of the software. Frequently, a fix for a problem in one area inadvertently causes asoftware bugin another area. It may happen that when a feature is redesigned some of the same mistakes that were made in the original implementation of the feature also occur in the redesign. In most software development situations, it is consideredgood coding practice, when a bug is located and fixed, to record a test that exposes the bug and re-run that test regularly after subsequent changes to the program.[5] Although this may be done throughmanual testingprocedures using programming techniques, it is often done usingautomated testingtools.[6]Such atest suitecontains software tools that allow the testing environment to execute all the regressiontest casesautomatically; many projects have automatedContinuous integrationsystems to re-run all regression tests at specified intervals and report any failures (which could imply a regression or an out-of-date test).[7] Common strategies are to run such a system after every successful compile (for small projects), every night, or once a week. Those strategies can be automated by an external tool. Regression testing is an integral part of theextreme programmingsoftware development method. In this method, design documents are replaced by extensive, repeatable, and automated testing of the entire software package throughout each stage of thesoftware development process. Regression testing is done after functional testing has concluded, to verify that the other functionalities are working. In the corporate world, regression testing has traditionally been performed by asoftware quality assuranceteam after the development team has completed work. However, defects found at this stage are the most costly to fix. This problem is being addressed by the rise ofunit testing. Although developers have always written test cases as part of the development cycle, these test cases have generally been eitherfunctional testsorunit teststhat verify only intended outcomes. Developer testing compels a developer to focus on unit testing and to include both positive and negative test cases.[8] The various regression testing techniques are: This technique checks all the test cases on the current program to check its integrity. Though it is expensive as it needs to re-run all the cases, it ensures that there are no errors because of the modified code.[9] Unlike Retest all, this technique runs a part of thetest suite(owing to the cost of retest all) if the cost of selecting the part of the test suite is less than the Retest all technique.[9] Prioritize the test cases so as to increase a test suite's rate of fault detection. Test case prioritization techniques schedule test cases so that the test cases that are higher in priority are executed before the test cases that have a lower priority.[9] This technique is a hybrid of regression test selection and test case prioritization.[9] Regression testing is performed when changes are made to the existing functionality of the software or if there is a bug fix in the software. Regression testing can be achieved through multiple approaches; if atest allapproach is followed, it provides certainty that the changes made to the software have not affected the existing functionalities, which are unaltered.[10] Inagile software development—where the software development life cycles are very short, resources are scarce, and changes to the software are very frequent—regression testing might introduce a lot of unnecessaryoverhead.[10] In a software development environment which tends to useblack boxcomponents from a third party, performing regression testing can be tricky, as any change in the third-party component may interfere with the rest of the system (and performing regression testing on a third-party component is difficult, because it is an unknown entity).[10] Regression testing can be used not only for testing thecorrectnessof a program but often also for tracking the quality of its output.[11]For instance, in the design of acompiler, regression testing could track the code size and the time it takes to compile and execute the test suite cases. Also as a consequence of the introduction of new bugs, program maintenance requires far more system testing per statement written than any other programming. Theoretically, after each fix, one must run the entire batch of test cases previously run against the system to ensure that it has not been damaged in an obscure way. In practice, suchregression testingmust indeed approximate this theoretical idea, and it is very costly. Regression tests can be broadly categorized asfunctional testsorunit tests. Functional tests exercise the complete program with various inputs. Unit tests exercise individual functions,subroutines, or object methods. Both functional testing tools and unit-testing tools tend to be automated and are often third-party products that are not part of the compiler suite. A functional test may be a scripted series of program inputs, possibly even involving an automated mechanism for controlling mouse movements and clicks. A unit test may be a set of separate functions within the code itself or a driver layer that links to the code without altering the code being tested.
https://en.wikipedia.org/wiki/Regression_testing
Insoftware engineeringanddevelopment, asoftware metricis a standard of measure of a degree to which asoftware systemor process possesses some property.[1][2]Even if a metric is not a measurement (metrics are functions, while measurements are the numbers obtained by the application of metrics), often the two terms are used as synonyms. Sincequantitative measurementsare essential in all sciences, there is a continuous effort bycomputer sciencepractitioners and theoreticians to bring similar approaches to software development. The goal is obtaining objective, reproducible and quantifiable measurements, which may have numerous valuable applications in schedule and budget planning, cost estimation, quality assurance, testing, softwaredebugging, softwareperformance optimization, and optimal personnel task assignments. Common software measurements include: As software development is a complex process, with high variance on both methodologies and objectives, it is difficult to define or measure software qualities and quantities and to determine a valid and concurrent measurement metric, especially when making such a prediction prior to the detail design. Another source of difficulty and debate is in determining which metrics matter, and what they mean.[8][9]The practical utility of software measurements has therefore been limited to the following domains: A specific measurement may target one or more of the above aspects, or the balance between them, for example as an indicator of team motivation or project performance.[10]Additionally metrics vary between static and dynamic program code, as well as for object oriented software (systems).[11][12] Some software development practitioners point out that simplistic measurements can cause more harm than good.[13]Others have noted that metrics have become an integral part of the software development process.[8]Impact of measurement on programmer psychology have raised concerns for harmful effects to performance due to stress, performance anxiety, and attempts to cheat the metrics, while others find it to have positive impact on developers value towards their own work, and prevent them being undervalued. Some argue that the definition of many measurement methodologies are imprecise, and consequently it is often unclear how tools for computing them arrive at a particular result,[14]while others argue that imperfect quantification is better than none (“You can’t control what you can't measure.”).[15]Evidence shows that software metrics are being widely used by government agencies, the US military, NASA,[16]IT consultants, academic institutions,[17]and commercial and academicdevelopment estimation software.
https://en.wikipedia.org/wiki/Software_metric
Java code coverage toolsare of two types: first, tools that add statements to theJavasource codeand require its recompilation. Second, tools that instrument thebytecode, either before or during execution. The goal is to find out which parts of the code are tested by registering the lines ofcode executedwhen running a test. JaCoCois anopen-sourcetoolkit for measuring and reportingJavacode coverage. JaCoCo is distributed under the terms of theEclipse Public License. It was developed as a replacement for EMMA,[1]under the umbrella of the EclEmma plug-in for Eclipse. JaCoCo offers instructions, line and branch coverage. In contrast toAtlassian CloverandOpenClover, which require instrumenting the source code, JaCoCo can instrument Java bytecode using two different approaches: And can be configured to store the collected data in a file, or send it via TCP. Files from multiple runs or code parts can be merged easily.[3]Unlike Cobertura andEMMAit fully supports Java 7, Java 8,[4]Java 9, Java 10, Java 11, Java 12, Java 13, Java 14, Java 15, Java 16, Java 17, Java 18, Java 19 and Java 20. JCov is the tool which has been developed and used with Sun JDK (and later Oracle JDK) from the very beginning of Java: from the version 1.1. JCov is capable of measuring and reportingJavacode coverage. JCov is distributed under the terms of theGNU General Public License(version 2, with the Classpath Exception). JCov has become open-source as a part of OpenJDK code tools project in 2014. JCov is capable of reporting the following types of code coverage: JCov implements two different ways to save the collected data: JCov works by instrumenting Java bytecode using two different approaches: JCov has a few more distinctive features which include, but are not limited to: OpenClover is a free and open-source successor of Atlassian Clover, created as aforkfrom the Clover code base published by Atlassian in 2017. It contains all features of the original Clover (the server edition). The OpenClover project is led by developers who maintained Clover in years 2012–2017.[15] OpenClover uses source code instrumentation technique and handles Java,GroovyandAspectJlanguages. Some of its features include: fine control over scope of coverage measurement, test optimisation and sophisticated reports. OpenClover integrates withAnt,Maven,Gradle,Grails,Eclipse,IntelliJ IDEA,Bamboo,Jenkins,Hudson,Griffon,SonarQubeand AspectJ. IntelliJ IDEA Code Coverage Agentis acode coveragetool integrated in IntelliJ IDEA IDE and TeamCity CI server. It supports branch coverage and per-test coverage tracking. Testwell CTC++is acode coveragetool forC,C++,JavaandC#. The development of this tool started in 1989 at Testwell in Finland. Since 2013 support and development has been continued by Verifysoft Technology, a company fromOffenburg,Germany. Testwell CTC++ analyses for all code coverage levels up toModified condition/decision coverageand Multicondition Coverage.[16]The tool works with allcompilers.[17] Cloveris a Javacode coverageanalysis utility bought and further developed byAtlassian. In April 2017 Atlassian announced end-of-life of Clover and at the same time open-sourced it under Apache 2.0 license. Clover uses a source code instrumentation technique (as opposed to Cobertura and JaCoCo, which use byte code instrumentation), which has its advantages (such as an ability to collect code metrics) and disadvantages (re-compilation of sources is necessary).[18]Some of its features include historical reporting, huge control over the coverage gathering process, command line toolset and API for legacy integration and more. Clover also allows testing time to be reduced by only running the tests that cover the application code that was modified since the previous build. This is called Test Optimization[19]and can lead to huge drops in the amount of time spent waiting for automated tests to complete. Clover comes with a number of integrations both developed by Atlassian (Ant, Maven, Grails, Eclipse, IDEA, Bamboo) and by open source community (Gradle, Griffon, Jenkins, Hudson, Sonar). In April 2017, Atlassian announced that they would no longer release new versions of Clover after version 4.1.2, and its code was made available asopen-source softwarehosted onBitbucket.[20][21] Cobertura is anopen-sourcetool for measuring code coverage. It does so by instrumenting the byte code. It was the predecessor to JaCoCo. EMMAis anopen-sourcetoolkit for measuring and reportingJavacode coverage. EMMA is distributed under the terms ofCommon Public Licensev1.0. EMMA is not currently under active development; the last stable release took place in mid-2005. As replacement, JaCoCo was developed.[22]EMMA works by wrapping each line of code and each condition with a flag, which is set when that line is executed.[23] Serenityis anopen-sourcetool creating better-automated software acceptance tests in less time. It and measures and reportsJavacode coverage. It also generates easy-to-understand reports that describe what the application does and how it works, including which tests were run andwhat requirements were met. It works with Selenium WebDriver, Appium, and BDD tools. Major code metrics such ascyclometric complexity, stability, abstractness, and distance from main are measured. The report data is persisted to an object database and made available via Jenkins/Hudson. The interface visually replicates the Eclipse IDE interface. Serenity dynamically enhances the byte code, making a post-compile step unnecessary. Ant and Maven projects are supported. Configuration is done in xml, an Ant example would be: And a Maven configuration example would be: For a full example of a configuration please refer to the Jenkins wiki athttps://wiki.jenkins-ci.org/display/JENKINS/Serenity+Plugin. Jenkins slaves as well as Maven multi module projects are supported.
https://en.wikipedia.org/wiki/Java_code_coverage_tools
Inmathematics, aBézout domainis anintegral domainin which the sum of twoprincipal idealsis also a principal ideal. This means thatBézout's identityholds for every pair of elements, and that everyfinitely generated idealis principal. Bézout domains are a form ofPrüfer domain. Anyprincipal ideal domain(PID) is a Bézout domain, but a Bézout domain need not be aNoetherian ring, so it could have non-finitely generated ideals; if so, it is not aunique factorization domain(UFD), but is still aGCD domain. The theory of Bézout domains retains many of the properties of PIDs, without requiring the Noetherian property. Bézout domains are named after theFrenchmathematicianÉtienne Bézout. A ring is a Bézout domain if and only if it is an integral domain in which any two elements have agreatest common divisorthat is alinear combinationof them: this is equivalent to the statement that an ideal which is generated by two elements is also generated by a single element, and induction demonstrates that all finitely generated ideals are principal. The expression of the greatest common divisor of two elements of a PID as a linear combination is often calledBézout's identity, whence the terminology. Note that the above gcd condition is stronger than the mere existence of a gcd. An integral domain where a gcd exists for any two elements is called aGCD domainand thus Bézout domains are GCD domains. In particular, in a Bézout domain,irreduciblesareprime(but as the algebraic integer example shows, they need not exist). For a Bézout domainR, the following conditions are all equivalent: The equivalence of (1) and (2) was noted above. Since a Bézout domain is a GCD domain, it follows immediately that (3), (4) and (5) are equivalent. Finally, ifRis not Noetherian, then there exists an infinite ascending chain of finitely generated ideals, so in a Bézout domain an infinite ascending chain of principal ideals. (4) and (2) are thus equivalent. A Bézout domain is aPrüfer domain, i.e., a domain in which each finitely generated ideal is invertible, or said another way, a commutativesemihereditarydomain.) Consequently, one may view the equivalence "Bézout domain iff Prüfer domain and GCD-domain" as analogous to the more familiar "PID iffDedekind domainand UFD". Prüfer domains can be characterized as integral domains whoselocalizationsat allprime(equivalently, at allmaximal) ideals arevaluation domains. So the localization of a Bézout domain at a prime ideal is a valuation domain. Since an invertible ideal in alocal ringis principal, a local ring is a Bézout domain iff it is a valuation domain. Moreover, a valuation domain with noncyclic (equivalently non-discrete) value group is not Noetherian, and everytotally orderedabelian groupis the value group of some valuation domain. This gives many examples of non-Noetherian Bézout domains. In noncommutative algebra,right Bézout domainsare domains whose finitely generated right ideals are principal right ideals, that is, of the formxRfor somexinR. One notable result is that a right Bézout domain is a rightOre domain. This fact is not interesting in the commutative case, sinceeverycommutative domain is an Ore domain. Right Bézout domains are also right semihereditary rings. Some facts about modules over a PID extend to modules over a Bézout domain. LetRbe a Bézout domain andMfinitely generated module overR. ThenMis flat if and only if it is torsion-free.[2]
https://en.wikipedia.org/wiki/B%C3%A9zout_domain
Inmathematics, thelowest common denominatororleast common denominator(abbreviatedLCD) is thelowest common multipleof thedenominatorsof a set offractions. It simplifies adding, subtracting, and comparing fractions. The lowest commondenominatorof a set offractionsis the lowest number that is amultipleof all the denominators: theirlowest common multiple. The product of the denominators is always a common denominator, as in: but it is not always the lowest common denominator, as in: Here, 36 is the least common multiple of 12 and 18. Their product, 216, is also a common denominator, but calculating with that denominator involves larger numbers: With variables rather than numbers, the same principles apply:[1] Some methods of calculating the LCD are atLeast common multiple § Calculation. The same fraction can be expressed in many different forms. As long as the ratio between numerator and denominator is the same, the fractions represent the same number. For example: because they are all multiplied by 1 written as a fraction: It is usually easiest to add, subtract, or compare fractions when each is expressed with the same denominator, called a "common denominator". For example, the numerators of fractions with common denominators can simply be added, such that512+612=1112{\displaystyle {\frac {5}{12}}+{\frac {6}{12}}={\frac {11}{12}}}and that512<1112{\displaystyle {\frac {5}{12}}<{\frac {11}{12}}}, since each fraction has the common denominator 12. Without computing a common denominator, it is not obvious as to what512+1118{\displaystyle {\frac {5}{12}}+{\frac {11}{18}}}equals, or whether512{\displaystyle {\frac {5}{12}}}is greater than or less than1118{\displaystyle {\frac {11}{18}}}. Any common denominator will do, but usually the lowest common denominator is desirable because it makes the rest of the calculation as simple as possible.[2] The LCD has many practical uses, such as determining the number of objects of two different lengths necessary to align them in a row which starts and ends at the same place, such as inbrickwork,tiling, andtessellation. It is also useful in planningwork scheduleswith employees withydays off everyxdays. In musical rhythm, the LCD is used incross-rhythmsandpolymetersto determine the fewest notes necessary tocount timegiven two or moremetricdivisions. For example, much African music is recorded in Western notation using128because each measure is divided by 4 and by 3, the LCD of which is 12. The expression "lowest common denominator" is used to describe (usually in a disapproving manner) a rule, proposal, opinion, or media that is deliberately simplified so as to appeal to the largest possible number of people.[3]
https://en.wikipedia.org/wiki/Lowest_common_denominator
Inmathematics, anatural numberais aunitary divisor(orHall divisor) of a numberbifais adivisorofband ifaandba{\displaystyle {\frac {b}{a}}}arecoprime, having no common factor other than 1. Equivalently, a divisoraofbis a unitary divisorif and only ifeveryprimefactor ofahas the samemultiplicityinaas it has inb. The concept of a unitary divisor originates fromR. Vaidyanathaswamy(1931),[1]who used the termblock divisor. The integer 5 is a unitary divisor of 60, because 5 and605=12{\displaystyle {\frac {60}{5}}=12}have only 1 as a common factor. On the contrary, 6 is a divisor but not a unitary divisor of 60, as 6 and606=10{\displaystyle {\frac {60}{6}}=10}have a common factor other than 1, namely 2. The sum-of-unitary-divisors function is denoted by the lowercase Greek letter sigma thus: σ*(n). The sum of thek-thpowersof the unitary divisors is denoted by σ*k(n): It is amultiplicative function. If theproperunitary divisors of a given number add up to that number, then that number is called aunitary perfect number. Number 1 is a unitary divisor of every natural number. The number of unitary divisors of a numbernis 2k, wherekis the number of distinct prime factors ofn. This is because eachintegerN> 1 is the product of positive powersprpof distinct prime numbersp. Thus every unitary divisor ofNis the product, over a given subsetSof the prime divisors {p} ofN, of the prime powersprpforp∈S. If there arekprime factors, then there are exactly 2ksubsetsS, and the statement follows. The sum of the unitary divisors ofnisoddifnis apower of 2(including 1), andevenotherwise. Both the count and the sum of the unitary divisors ofnaremultiplicative functionsofnthat are notcompletely multiplicative. TheDirichlet generating functionis Every divisor ofnis unitary if and only ifnissquare-free. The set of all unitary divisors ofnforms aBoolean algebrawith meet given by thegreatest common divisorand join by theleast common multiple. Equivalently, the set of unitary divisors ofnforms a Boolean ring, where the addition and multiplication are given by where(a,b){\displaystyle (a,b)}denotes the greatest common divisor ofaandb.[2] The sum of thek-th powers of the odd unitary divisors is It is also multiplicative, with Dirichlet generating function A divisordofnis abi-unitary divisorif the greatest common unitary divisor ofdandn/dis 1. This concept originates from D. Suryanarayana (1972). [The number of bi-unitary divisors of an integer, in The Theory of Arithmetic Functions, Lecture Notes in Mathematics 251: 273–282, New York, Springer–Verlag]. The number of bi-unitary divisors ofnis a multiplicative function ofnwithaverage orderAlog⁡x{\displaystyle A\log x}where[3] Abi-unitary perfect numberis one equal to the sum of its bi-unitary aliquot divisors. The only such numbers are 6, 60 and 90.[4]
https://en.wikipedia.org/wiki/Unitary_divisor
Inabstract algebra, thegroup isomorphism problemis thedecision problemof determining whether two givenfinite group presentationsrefer toisomorphicgroups. The isomorphism problem was formulated byMax Dehn,[1]and together with theword problemandconjugacy problem, is one of three fundamental decision problems in group theory he identified in 1911.[2]All three problems, formulated as ranging over all finitely presented groups, areundecidable. In the case of the isomorphism problem, this means that there does not exist a computer algorithm that takes two finite group presentations and decides whether or not the groups are isomorphic, regardless of how (finitely) much time is allowed for the algorithm to run and how (finitely) much memory is available. In fact the problem of deciding whether a finitely presented group is trivial is undecidable,[3]a consequence of theAdian–Rabin theoremdue toSergei AdianandMichael O. Rabin. However, there are some classes of finitely presented groups for which the restriction of the isomorphism problem is known to be decidable. They includefinitely generated abelian groups,finite groups,Gromov-hyperbolic groups,[4]virtuallytorsion-freerelatively hyperbolic groupswithnilpotentparabolics,[5]one-relator groupswith non-trivialcenter,[6]and two-generator one-relator groups with torsion.[7] The group isomorphism problem, restricted to the groups that are given by multiplication tables, can be reduced to agraph isomorphism problembut not vice versa.[8]Both havequasi-polynomial-timealgorithms, the former since 1978 attributed toRobert Tarjan[9]and the latter since 2015 byLászló Babai.[10]A small but important improvement for the casep-groupsof class 2 was obtained in 2023 by Xiaorui Sun.[11][8] Thisabstract algebra-related article is astub. You can help Wikipedia byexpanding it. This article about thehistory of mathematicsis astub. You can help Wikipedia byexpanding it.
https://en.wikipedia.org/wiki/Group_isomorphism_problem
Channel capacity, inelectrical engineering,computer science, andinformation theory, is the theoretical maximum rate at whichinformationcan be reliably transmitted over acommunication channel. Following the terms of thenoisy-channel coding theorem, the channel capacity of a givenchannelis the highest information rate (in units ofinformationper unit time) that can be achieved with arbitrarily small error probability.[1][2] Information theory, developed byClaude E. Shannonin 1948, defines the notion of channel capacity and provides a mathematical model by which it may be computed. The key result states that the capacity of the channel, as defined above, is given by the maximum of themutual informationbetween the input and output of the channel, where the maximization is with respect to the input distribution.[3] The notion of channel capacity has been central to the development of modern wireline and wireless communication systems, with the advent of novelerror correction codingmechanisms that have resulted in achieving performance very close to the limits promised by channel capacity. The basic mathematical model for a communication system is the following: where: LetX{\displaystyle X}andY{\displaystyle Y}be modeled as random variables. Furthermore, letpY|X(y|x){\displaystyle p_{Y|X}(y|x)}be theconditional probability distributionfunction ofY{\displaystyle Y}givenX{\displaystyle X}, which is an inherent fixed property of the communication channel. Then the choice of themarginal distributionpX(x){\displaystyle p_{X}(x)}completely determines thejoint distributionpX,Y(x,y){\displaystyle p_{X,Y}(x,y)}due to the identity which, in turn, induces amutual informationI(X;Y){\displaystyle I(X;Y)}. Thechannel capacityis defined as where thesupremumis taken over all possible choices ofpX(x){\displaystyle p_{X}(x)}. Channel capacity is additive over independent channels.[4]It means that using two independent channels in a combined manner provides the same theoretical capacity as using them independently. More formally, letp1{\displaystyle p_{1}}andp2{\displaystyle p_{2}}be two independent channels modelled as above;p1{\displaystyle p_{1}}having an input alphabetX1{\displaystyle {\mathcal {X}}_{1}}and an output alphabetY1{\displaystyle {\mathcal {Y}}_{1}}. Idem forp2{\displaystyle p_{2}}. We define the product channelp1×p2{\displaystyle p_{1}\times p_{2}}as∀(x1,x2)∈(X1,X2),(y1,y2)∈(Y1,Y2),(p1×p2)((y1,y2)|(x1,x2))=p1(y1|x1)p2(y2|x2){\displaystyle \forall (x_{1},x_{2})\in ({\mathcal {X}}_{1},{\mathcal {X}}_{2}),\;(y_{1},y_{2})\in ({\mathcal {Y}}_{1},{\mathcal {Y}}_{2}),\;(p_{1}\times p_{2})((y_{1},y_{2})|(x_{1},x_{2}))=p_{1}(y_{1}|x_{1})p_{2}(y_{2}|x_{2})} This theorem states:C(p1×p2)=C(p1)+C(p2){\displaystyle C(p_{1}\times p_{2})=C(p_{1})+C(p_{2})} We first show thatC(p1×p2)≥C(p1)+C(p2){\displaystyle C(p_{1}\times p_{2})\geq C(p_{1})+C(p_{2})}. LetX1{\displaystyle X_{1}}andX2{\displaystyle X_{2}}be two independent random variables. LetY1{\displaystyle Y_{1}}be a random variable corresponding to the output ofX1{\displaystyle X_{1}}through the channelp1{\displaystyle p_{1}}, andY2{\displaystyle Y_{2}}forX2{\displaystyle X_{2}}throughp2{\displaystyle p_{2}}. By definitionC(p1×p2)=suppX1,X2(I(X1,X2:Y1,Y2)){\displaystyle C(p_{1}\times p_{2})=\sup _{p_{X_{1},X_{2}}}(I(X_{1},X_{2}:Y_{1},Y_{2}))}. SinceX1{\displaystyle X_{1}}andX2{\displaystyle X_{2}}are independent, as well asp1{\displaystyle p_{1}}andp2{\displaystyle p_{2}},(X1,Y1){\displaystyle (X_{1},Y_{1})}is independent of(X2,Y2){\displaystyle (X_{2},Y_{2})}. We can apply the following property ofmutual information:I(X1,X2:Y1,Y2)=I(X1:Y1)+I(X2:Y2){\displaystyle I(X_{1},X_{2}:Y_{1},Y_{2})=I(X_{1}:Y_{1})+I(X_{2}:Y_{2})} For now we only need to find a distributionpX1,X2{\displaystyle p_{X_{1},X_{2}}}such thatI(X1,X2:Y1,Y2)≥I(X1:Y1)+I(X2:Y2){\displaystyle I(X_{1},X_{2}:Y_{1},Y_{2})\geq I(X_{1}:Y_{1})+I(X_{2}:Y_{2})}. In fact,π1{\displaystyle \pi _{1}}andπ2{\displaystyle \pi _{2}}, two probability distributions forX1{\displaystyle X_{1}}andX2{\displaystyle X_{2}}achievingC(p1){\displaystyle C(p_{1})}andC(p2){\displaystyle C(p_{2})}, suffice: ie.C(p1×p2)≥C(p1)+C(p2){\displaystyle C(p_{1}\times p_{2})\geq C(p_{1})+C(p_{2})} Now let us show thatC(p1×p2)≤C(p1)+C(p2){\displaystyle C(p_{1}\times p_{2})\leq C(p_{1})+C(p_{2})}. Letπ12{\displaystyle \pi _{12}}be some distribution for the channelp1×p2{\displaystyle p_{1}\times p_{2}}defining(X1,X2){\displaystyle (X_{1},X_{2})}and the corresponding output(Y1,Y2){\displaystyle (Y_{1},Y_{2})}. LetX1{\displaystyle {\mathcal {X}}_{1}}be the alphabet ofX1{\displaystyle X_{1}},Y1{\displaystyle {\mathcal {Y}}_{1}}forY1{\displaystyle Y_{1}}, and analogouslyX2{\displaystyle {\mathcal {X}}_{2}}andY2{\displaystyle {\mathcal {Y}}_{2}}. By definition of mutual information, we have I(X1,X2:Y1,Y2)=H(Y1,Y2)−H(Y1,Y2|X1,X2)≤H(Y1)+H(Y2)−H(Y1,Y2|X1,X2){\displaystyle {\begin{aligned}I(X_{1},X_{2}:Y_{1},Y_{2})&=H(Y_{1},Y_{2})-H(Y_{1},Y_{2}|X_{1},X_{2})\\&\leq H(Y_{1})+H(Y_{2})-H(Y_{1},Y_{2}|X_{1},X_{2})\end{aligned}}} Let us rewrite the last term ofentropy. H(Y1,Y2|X1,X2)=∑(x1,x2)∈X1×X2P(X1,X2=x1,x2)H(Y1,Y2|X1,X2=x1,x2){\displaystyle H(Y_{1},Y_{2}|X_{1},X_{2})=\sum _{(x_{1},x_{2})\in {\mathcal {X}}_{1}\times {\mathcal {X}}_{2}}\mathbb {P} (X_{1},X_{2}=x_{1},x_{2})H(Y_{1},Y_{2}|X_{1},X_{2}=x_{1},x_{2})} By definition of the product channel,P(Y1,Y2=y1,y2|X1,X2=x1,x2)=P(Y1=y1|X1=x1)P(Y2=y2|X2=x2){\displaystyle \mathbb {P} (Y_{1},Y_{2}=y_{1},y_{2}|X_{1},X_{2}=x_{1},x_{2})=\mathbb {P} (Y_{1}=y_{1}|X_{1}=x_{1})\mathbb {P} (Y_{2}=y_{2}|X_{2}=x_{2})}. For a given pair(x1,x2){\displaystyle (x_{1},x_{2})}, we can rewriteH(Y1,Y2|X1,X2=x1,x2){\displaystyle H(Y_{1},Y_{2}|X_{1},X_{2}=x_{1},x_{2})}as: H(Y1,Y2|X1,X2=x1,x2)=∑(y1,y2)∈Y1×Y2P(Y1,Y2=y1,y2|X1,X2=x1,x2)log⁡(P(Y1,Y2=y1,y2|X1,X2=x1,x2))=∑(y1,y2)∈Y1×Y2P(Y1,Y2=y1,y2|X1,X2=x1,x2)[log⁡(P(Y1=y1|X1=x1))+log⁡(P(Y2=y2|X2=x2))]=H(Y1|X1=x1)+H(Y2|X2=x2){\displaystyle {\begin{aligned}H(Y_{1},Y_{2}|X_{1},X_{2}=x_{1},x_{2})&=\sum _{(y_{1},y_{2})\in {\mathcal {Y}}_{1}\times {\mathcal {Y}}_{2}}\mathbb {P} (Y_{1},Y_{2}=y_{1},y_{2}|X_{1},X_{2}=x_{1},x_{2})\log(\mathbb {P} (Y_{1},Y_{2}=y_{1},y_{2}|X_{1},X_{2}=x_{1},x_{2}))\\&=\sum _{(y_{1},y_{2})\in {\mathcal {Y}}_{1}\times {\mathcal {Y}}_{2}}\mathbb {P} (Y_{1},Y_{2}=y_{1},y_{2}|X_{1},X_{2}=x_{1},x_{2})[\log(\mathbb {P} (Y_{1}=y_{1}|X_{1}=x_{1}))+\log(\mathbb {P} (Y_{2}=y_{2}|X_{2}=x_{2}))]\\&=H(Y_{1}|X_{1}=x_{1})+H(Y_{2}|X_{2}=x_{2})\end{aligned}}} By summing this equality over all(x1,x2){\displaystyle (x_{1},x_{2})}, we obtainH(Y1,Y2|X1,X2)=H(Y1|X1)+H(Y2|X2){\displaystyle H(Y_{1},Y_{2}|X_{1},X_{2})=H(Y_{1}|X_{1})+H(Y_{2}|X_{2})}. We can now give an upper bound over mutual information: I(X1,X2:Y1,Y2)≤H(Y1)+H(Y2)−H(Y1|X1)−H(Y2|X2)=I(X1:Y1)+I(X2:Y2){\displaystyle {\begin{aligned}I(X_{1},X_{2}:Y_{1},Y_{2})&\leq H(Y_{1})+H(Y_{2})-H(Y_{1}|X_{1})-H(Y_{2}|X_{2})\\&=I(X_{1}:Y_{1})+I(X_{2}:Y_{2})\end{aligned}}} This relation is preserved at the supremum. Therefore Combining the two inequalities we proved, we obtain the result of the theorem: IfGis anundirected graph, it can be used to define a communications channel in which the symbols are the graph vertices, and two codewords may be confused with each other if their symbols in each position are equal or adjacent. The computational complexity of finding the Shannon capacity of such a channel remains open, but it can be upper bounded by another important graph invariant, theLovász number.[5] Thenoisy-channel coding theoremstates that for any error probability ε > 0 and for any transmissionrateRless than the channel capacityC, there is an encoding and decoding scheme transmitting data at rateRwhose error probability is less than ε, for a sufficiently large block length. Also, for any rate greater than the channel capacity, the probability of error at the receiver goes to 0.5 as the block length goes to infinity. An application of the channel capacity concept to anadditive white Gaussian noise(AWGN) channel withBHzbandwidthandsignal-to-noise ratioS/Nis theShannon–Hartley theorem: Cis measured inbits per secondif thelogarithmis taken in base 2, ornatsper second if thenatural logarithmis used, assumingBis inhertz; the signal and noise powersSandNare expressed in a linearpower unit(like watts or volts2). SinceS/Nfigures are often cited indB, a conversion may be needed. For example, a signal-to-noise ratio of 30 dB corresponds to a linear power ratio of1030/10=103=1000{\displaystyle 10^{30/10}=10^{3}=1000}. To determine the channel capacity, it is necessary to find the capacity-achieving distributionpX(x){\displaystyle p_{X}(x)}and evaluate themutual informationI(X;Y){\displaystyle I(X;Y)}. Research has mostly focused on studying additive noise channels under certain power constraints and noise distributions, as analytical methods are not feasible in the majority of other scenarios. Hence, alternative approaches such as, investigation on the input support,[6]relaxations[7]and capacity bounds,[8]have been proposed in the literature. The capacity of a discrete memoryless channel can be computed using theBlahut-Arimoto algorithm. Deep learningcan be used to estimate the channel capacity. In fact, the channel capacity and the capacity-achieving distribution of any discrete-time continuous memoryless vector channel can be obtained using CORTICAL,[9]a cooperative framework inspired bygenerative adversarial networks. CORTICAL consists of two cooperative networks: a generator with the objective of learning to sample from the capacity-achieving input distribution, and a discriminator with the objective to learn to distinguish between paired and unpaired channel input-output samples and estimatesI(X;Y){\displaystyle I(X;Y)}. This section[10]focuses on the single-antenna, point-to-point scenario. For channel capacity in systems with multiple antennas, see the article onMIMO. If the average received power isP¯{\displaystyle {\bar {P}}}[W], the total bandwidth isW{\displaystyle W}in Hertz, and the noisepower spectral densityisN0{\displaystyle N_{0}}[W/Hz], the AWGN channel capacity is whereP¯N0W{\displaystyle {\frac {\bar {P}}{N_{0}W}}}is the received signal-to-noise ratio (SNR). This result is known as theShannon–Hartley theorem.[11] When the SNR is large (SNR ≫ 0 dB), the capacityC≈Wlog2⁡P¯N0W{\displaystyle C\approx W\log _{2}{\frac {\bar {P}}{N_{0}W}}}is logarithmic in power and approximately linear in bandwidth. This is called thebandwidth-limited regime. When the SNR is small (SNR ≪ 0 dB), the capacityC≈P¯N0ln⁡2{\displaystyle C\approx {\frac {\bar {P}}{N_{0}\ln 2}}}is linear in power but insensitive to bandwidth. This is called thepower-limited regime. The bandwidth-limited regime and power-limited regime are illustrated in the figure. The capacity of thefrequency-selectivechannel is given by so-calledwater fillingpower allocation, wherePn∗=max{(1λ−N0|h¯n|2),0}{\displaystyle P_{n}^{*}=\max \left\{\left({\frac {1}{\lambda }}-{\frac {N_{0}}{|{\bar {h}}_{n}|^{2}}}\right),0\right\}}and|h¯n|2{\displaystyle |{\bar {h}}_{n}|^{2}}is the gain of subchanneln{\displaystyle n}, withλ{\displaystyle \lambda }chosen to meet the power constraint. In aslow-fading channel, where the coherence time is greater than the latency requirement, there is no definite capacity as the maximum rate of reliable communications supported by the channel,log2⁡(1+|h|2SNR){\displaystyle \log _{2}(1+|h|^{2}SNR)}, depends on the random channel gain|h|2{\displaystyle |h|^{2}}, which is unknown to the transmitter. If the transmitter encodes data at rateR{\displaystyle R}[bits/s/Hz], there is a non-zero probability that the decoding error probability cannot be made arbitrarily small, in which case the system is said to be in outage. With a non-zero probability that the channel is in deep fade, the capacity of the slow-fading channel in strict sense is zero. However, it is possible to determine the largest value ofR{\displaystyle R}such that the outage probabilitypout{\displaystyle p_{out}}is less thanϵ{\displaystyle \epsilon }. This value is known as theϵ{\displaystyle \epsilon }-outage capacity. In afast-fading channel, where the latency requirement is greater than the coherence time and the codeword length spans many coherence periods, one can average over many independent channel fades by coding over a large number of coherence time intervals. Thus, it is possible to achieve a reliable rate of communication ofE(log2⁡(1+|h|2SNR)){\displaystyle \mathbb {E} (\log _{2}(1+|h|^{2}SNR))}[bits/s/Hz] and it is meaningful to speak of this value as the capacity of the fast-fading channel. Feedback capacity is the greatest rate at whichinformationcan be reliably transmitted, per unit time, over a point-to-pointcommunication channelin which the receiver feeds back the channel outputs to the transmitter. Information-theoretic analysis of communication systems that incorporate feedback is more complicated and challenging than without feedback. Possibly, this was the reasonC.E. Shannonchose feedback as the subject of the first Shannon Lecture, delivered at the 1973 IEEE International Symposium on Information Theory in Ashkelon, Israel. The feedback capacity is characterized by the maximum of thedirected informationbetween the channel inputs and the channel outputs, where the maximization is with respect to the causal conditioning of the input given the output. Thedirected informationwas coined byJames Massey[12]in 1990, who showed that its an upper bound on feedback capacity. Formemoryless channels, Shannon showed[13]that feedback does not increase the capacity, and the feedback capacity coincides with the channel capacity characterized by themutual informationbetween the input and the output. The feedback capacity is known as a closed-form expression only for several examples such as the trapdoor channel,[14]Ising channel,[15][16]. For some other channels, it is characterized through constant-size optimization problems such as the binary erasure channel with a no-consecutive-ones input constraint,[17]NOST channel.[18] The basic mathematical model for a communication system is the following: Here is the formal definition of each element (where the only difference with respect to the nonfeedback capacity is the encoder definition): That is, for each timei{\displaystyle i}there exists a feedback of the previous outputYi−1{\displaystyle Y_{i-1}}such that the encoder has access to all previous outputsYi−1{\displaystyle Y^{i-1}}. An(2nR,n){\displaystyle (2^{nR},n)}code is a pair of encoding and decoding mappings withW=[1,2,…,2nR]{\displaystyle {\mathcal {W}}=[1,2,\dots ,2^{nR}]}, andW{\displaystyle W}is uniformly distributed. A rateR{\displaystyle R}is said to beachievableif there exists a sequence of codes(2nR,n){\displaystyle (2^{nR},n)}such that theaverage probability of error:Pe(n)≜Pr(W^≠W){\displaystyle P_{e}^{(n)}\triangleq \Pr({\hat {W}}\neq W)}tends to zero asn→∞{\displaystyle n\to \infty }. Thefeedback capacityis denoted byCfeedback{\displaystyle C_{\text{feedback}}}, and is defined as the supremum over all achievable rates. LetX{\displaystyle X}andY{\displaystyle Y}be modeled as random variables. Thecausal conditioningP(yn||xn)≜∏i=1nP(yi|yi−1,xi){\displaystyle P(y^{n}||x^{n})\triangleq \prod _{i=1}^{n}P(y_{i}|y^{i-1},x^{i})}describes the given channel. The choice of thecausally conditional distributionP(xn||yn−1)≜∏i=1nP(xi|xi−1,yi−1){\displaystyle P(x^{n}||y^{n-1})\triangleq \prod _{i=1}^{n}P(x_{i}|x^{i-1},y^{i-1})}determines thejoint distributionpXn,Yn(xn,yn){\displaystyle p_{X^{n},Y^{n}}(x^{n},y^{n})}due to the chain rule for causal conditioning[19]P(yn,xn)=P(yn||xn)P(xn||yn−1){\displaystyle P(y^{n},x^{n})=P(y^{n}||x^{n})P(x^{n}||y^{n-1})}which, in turn, induces adirected informationI(XN→YN)=E[log⁡P(YN||XN)P(YN)]{\displaystyle I(X^{N}\rightarrow Y^{N})=\mathbf {E} \left[\log {\frac {P(Y^{N}||X^{N})}{P(Y^{N})}}\right]}. Thefeedback capacityis given by where thesupremumis taken over all possible choices ofPXn||Yn−1(xn||yn−1){\displaystyle P_{X^{n}||Y^{n-1}}(x^{n}||y^{n-1})}. When the Gaussian noise is colored, the channel has memory. Consider for instance the simple case on anautoregressive modelnoise processzi=zi−1+wi{\displaystyle z_{i}=z_{i-1}+w_{i}}wherewi∼N(0,1){\displaystyle w_{i}\sim N(0,1)}is an i.i.d. process. The feedback capacity is difficult to solve in the general case. There are some techniques that are related to control theory andMarkov decision processesif the channel is discrete.
https://en.wikipedia.org/wiki/Channel_capacity
Ininformation theory, thenoisy-channel coding theorem(sometimesShannon's theoremorShannon's limit), establishes that for any given degree of noise contamination of a communication channel, it is possible (in theory) to communicate discrete data (digitalinformation) nearly error-free up to a computable maximum rate through the channel. This result was presented byClaude Shannonin 1948 and was based in part on earlier work and ideas ofHarry NyquistandRalph Hartley. TheShannon limitorShannon capacityof a communication channel refers to the maximumrateof error-free data that can theoretically be transferred over the channel if the link is subject to random data transmission errors, for a particular noise level. It was first described by Shannon (1948), and shortly after published in a book by Shannon andWarren WeaverentitledThe Mathematical Theory of Communication(1949). This founded the modern discipline ofinformation theory. Stated byClaude Shannonin 1948, the theorem describes the maximum possible efficiency oferror-correcting methodsversus levels of noise interference and data corruption. Shannon's theorem has wide-ranging applications in both communications anddata storage. This theorem is of foundational importance to the modern field ofinformation theory. Shannon only gave an outline of the proof. The first rigorous proof for the discrete case is given in (Feinstein 1954). The Shannon theorem states that given a noisy channel withchannel capacityCand information transmitted at a rateR, then ifR<C{\displaystyle R<C}there existcodesthat allow theprobability of errorat the receiver to be made arbitrarily small. This means that, theoretically, it is possible to transmit information nearly without error at any rate below a limiting rate,C. The converse is also important. IfR>C{\displaystyle R>C}, an arbitrarily small probability of error is not achievable. All codes will have a probability of error greater than a certain positive minimal level, and this level increases as the rate increases. So, information cannot be guaranteed to be transmitted reliably across a channel at rates beyond the channel capacity. The theorem does not address the rare situation in which rate and capacity are equal. The channel capacityC{\displaystyle C}can be calculated from the physical properties of a channel; for a band-limited channel with Gaussian noise, using theShannon–Hartley theorem. Simple schemes such as "send the message 3 times and use a best 2 out of 3 voting scheme if the copies differ" are inefficient error-correction methods, unable to asymptotically guarantee that a block of data can be communicated free of error. Advanced techniques such asReed–Solomon codesand, more recently,low-density parity-check(LDPC) codes andturbo codes, come much closer to reaching the theoretical Shannon limit, but at a cost of high computational complexity. Using these highly efficient codes and with the computing power in today'sdigital signal processors, it is now possible to reach very close to the Shannon limit. In fact, it was shown that LDPC codes can reach within 0.0045 dB of the Shannon limit (for binaryadditive white Gaussian noise(AWGN) channels, with very long block lengths).[1] The basic mathematical model for a communication system is the following: AmessageWis transmitted through a noisy channel by using encoding and decoding functions. AnencodermapsWinto a pre-defined sequence of channel symbols of lengthn. In its most basic model, the channel distorts each of these symbols independently of the others. The output of the channel –the received sequence– is fed into adecoderwhich maps the sequence into an estimate of the message. In this setting, the probability of error is defined as: Theorem(Shannon, 1948): (MacKay (2003), p. 162; cf Gallager (1968), ch.5; Cover and Thomas (1991), p. 198; Shannon (1948) thm. 11) As with the several other major results in information theory, the proof of the noisy channel coding theorem includes an achievability result and a matching converse result. These two components serve to bound, in this case, the set of possible rates at which one can communicate over a noisy channel, and matching serves to show that these bounds are tight bounds. The following outlines are only one set of many different styles available for study in information theory texts. This particular proof of achievability follows the style of proofs that make use of theasymptotic equipartition property(AEP). Another style can be found in information theory texts usingerror exponents. Both types of proofs make use of a random coding argument where the codebook used across a channel is randomly constructed - this serves to make the analysis simpler while still proving the existence of a code satisfying a desired low probability of error at any data rate below thechannel capacity. By an AEP-related argument, given a channel, lengthn{\displaystyle n}strings of source symbolsX1n{\displaystyle X_{1}^{n}}, and lengthn{\displaystyle n}strings of channel outputsY1n{\displaystyle Y_{1}^{n}}, we can define ajointly typical setby the following: We say that two sequencesX1n{\displaystyle {X_{1}^{n}}}andY1n{\displaystyle Y_{1}^{n}}arejointly typicalif they lie in the jointly typical set defined above. Steps The probability of error of this scheme is divided into two parts: Define:Ei={(X1n(i),Y1n)∈Aε(n)},i=1,2,…,2nR{\displaystyle E_{i}=\{(X_{1}^{n}(i),Y_{1}^{n})\in A_{\varepsilon }^{(n)}\},i=1,2,\dots ,2^{nR}} as the event that message i is jointly typical with the sequence received when message 1 is sent. We can observe that asn{\displaystyle n}goes to infinity, ifR<I(X;Y){\displaystyle R<I(X;Y)}for the channel, the probability of error will go to 0. Finally, given that the average codebook is shown to be "good," we know that there exists a codebook whose performance is better than the average, and so satisfies our need for arbitrarily low error probability communicating across the noisy channel. Suppose a code of2nR{\displaystyle 2^{nR}}codewords. Let W be drawn uniformly over this set as an index. LetXn{\displaystyle X^{n}}andYn{\displaystyle Y^{n}}be the transmitted codewords and received codewords, respectively. The result of these steps is thatPe(n)≥1−1nR−CR{\displaystyle P_{e}^{(n)}\geq 1-{\frac {1}{nR}}-{\frac {C}{R}}}. As the block lengthn{\displaystyle n}goes to infinity, we obtainPe(n){\displaystyle P_{e}^{(n)}}is bounded away from 0 if R is greater than C - we can get arbitrarily low rates of error only if R is less than C. A strong converse theorem, proven by Wolfowitz in 1957,[3]states that, for some finite positive constantA{\displaystyle A}. While the weak converse states that the error probability is bounded away from zero asn{\displaystyle n}goes to infinity, the strong converse states that the error goes to 1. Thus,C{\displaystyle C}is a sharp threshold between perfectly reliable and completely unreliable communication. We assume that the channel is memoryless, but its transition probabilities change with time, in a fashion known at the transmitter as well as the receiver. Then the channel capacity is given by The maximum is attained at the capacity achieving distributions for each respective channel. That is,C=liminf1n∑i=1nCi{\displaystyle C=\lim \inf {\frac {1}{n}}\sum _{i=1}^{n}C_{i}}whereCi{\displaystyle C_{i}}is the capacity of the ithchannel. The proof runs through in almost the same way as that of channel coding theorem. Achievability follows from random coding with each symbol chosen randomly from the capacity achieving distribution for that particular channel. Typicality arguments use the definition of typical sets for non-stationary sources defined in theasymptotic equipartition propertyarticle. The technicality oflim infcomes into play when1n∑i=1nCi{\displaystyle {\frac {1}{n}}\sum _{i=1}^{n}C_{i}}does not converge.
https://en.wikipedia.org/wiki/Noisy_channel
Incoding theory,list decodingis an alternative to unique decoding oferror-correcting codesfor large error rates. The notion was proposed byEliasin the 1950s. The main idea behind list decoding is that the decoding algorithm instead of outputting a single possible message outputs a list of possibilities one of which is correct. This allows for handling a greater number of errors than that allowed by unique decoding. The unique decoding model incoding theory, which is constrained to output a single valid codeword from the received word could not tolerate a greater fraction of errors. This resulted in a gap between the error-correction performance forstochasticnoise models (proposed byShannon) and the adversarial noise model (considered byRichard Hamming). Since the mid 90s, significant algorithmic progress by the coding theory community has bridged this gap. Much of this progress is based on a relaxed error-correction model called list decoding, wherein the decoder outputs a list of codewords for worst-case pathological error patterns where the actual transmitted codeword is included in the output list. In case of typical error patterns though, the decoder outputs a unique single codeword, given a received word, which is almost always the case (However, this is not known to be true for all codes). The improvement here is significant in that the error-correction performance doubles. This is because now the decoder is not confined by the half-the-minimum distance barrier. This model is very appealing because having a list of codewords is certainly better than just giving up. The notion of list-decoding has many interesting applications incomplexity theory. The way the channel noise is modeled plays a crucial role in that it governs the rate at which reliable communication is possible. There are two main schools of thought in modeling the channel behavior: The highlight of list-decoding is that even under adversarial noise conditions, it is possible to achieve the information-theoretic optimal trade-off between rate and fraction of errors that can be corrected. Hence, in a sense this is like improving the error-correction performance to that possible in case of a weaker, stochastic noise model. LetC{\displaystyle {\mathcal {C}}}be a(n,k,d)q{\displaystyle (n,k,d)_{q}}error-correcting code; in other words,C{\displaystyle {\mathcal {C}}}is a code of lengthn{\displaystyle n}, dimensionk{\displaystyle k}and minimum distanced{\displaystyle d}over an alphabetΣ{\displaystyle \Sigma }of sizeq{\displaystyle q}. The list-decoding problem can now be formulated as follows: Input:Received wordx∈Σn{\displaystyle x\in \Sigma ^{n}},error bounde{\displaystyle e} Output:A list of all codewordsx1,x2,…,xm∈C{\displaystyle x_{1},x_{2},\ldots ,x_{m}\in {\mathcal {C}}}whosehamming distancefromx{\displaystyle x}is at moste{\displaystyle e}. Given a received wordy{\displaystyle y}, which is a noisy version of some transmitted codewordc{\displaystyle c}, the decoder tries to output the transmitted codeword by placing its bet on a codeword that is “nearest” to the received word. The Hamming distance between two codewords is used as a metric in finding the nearest codeword, given the received word by the decoder. Ifd{\displaystyle d}is the minimum Hamming distance of a codeC{\displaystyle {\mathcal {C}}}, then there exists two codewordsc1{\displaystyle c_{1}}andc2{\displaystyle c_{2}}that differ in exactlyd{\displaystyle d}positions. Now, in the case where the received wordy{\displaystyle y}is equidistant from the codewordsc1{\displaystyle c_{1}}andc2{\displaystyle c_{2}}, unambiguous decoding becomes impossible as the decoder cannot decide which one ofc1{\displaystyle c_{1}}andc2{\displaystyle c_{2}}to output as the original transmitted codeword. As a result, the half-the minimum distance acts as a combinatorial barrier beyond which unambiguous error-correction is impossible, if we only insist on unique decoding. However, received words such asy{\displaystyle y}considered above occur only in the worst-case and if one looks at the wayHamming ballsare packed in high-dimensional space, even for error patternse{\displaystyle e}beyond half-the minimum distance, there is only a single codewordc{\displaystyle c}within Hamming distancee{\displaystyle e}from the received word. This claim has been shown to hold with high probability for a random code picked from a natural ensemble and more so for the case ofReed–Solomon codeswhich is well studied and quite ubiquitous in the real world applications. In fact, Shannon's proof of the capacity theorem forq-ary symmetric channels can be viewed in light of the above claim for random codes. Under the mandate of list-decoding, for worst-case errors, the decoder is allowed to output a small list of codewords. With some context specific or side information, it may be possible to prune the list and recover the original transmitted codeword. Hence, in general, this seems to be a stronger error-recovery model than unique decoding. For a polynomial-time list-decoding algorithm to exist, we need the combinatorial guarantee that any Hamming ball of radiuspn{\displaystyle pn}around a received wordr{\displaystyle r}(wherep{\displaystyle p}is the fraction of errors in terms of the block lengthn{\displaystyle n}) has a small number of codewords. This is because the list size itself is clearly a lower bound on the running time of the algorithm. Hence, we require the list size to be a polynomial in the block lengthn{\displaystyle n}of the code. A combinatorial consequence of this requirement is that it imposes an upper bound on the rate of a code. List decoding promises to meet this upper bound. It has been shown non-constructively that codes of rateR{\displaystyle R}exist that can be list decoded up to a fraction of errors approaching1−R{\displaystyle 1-R}. The quantity1−R{\displaystyle 1-R}is referred to in the literature as the list-decoding capacity. This is a substantial gain compared to the unique decoding model as we now have the potential to correct twice as many errors. Naturally, we need to have at least a fractionR{\displaystyle R}of the transmitted symbols to be correct in order to recover the message. This is an information-theoretic lower bound on the number of correct symbols required to perform decoding and with list decoding, we can potentially achieve this information-theoretic limit. However, to realize this potential, we need explicit codes (codes that can be constructed in polynomial time) and efficient algorithms to perform encoding and decoding. For any error fraction0⩽p⩽1{\displaystyle 0\leqslant p\leqslant 1}and an integerL⩾1{\displaystyle L\geqslant 1}, a codeC⊆Σn{\displaystyle {\mathcal {C}}\subseteq \Sigma ^{n}}is said to be list decodable up to a fractionp{\displaystyle p}of errors with list size at mostL{\displaystyle L}or(p,L){\displaystyle (p,L)}-list-decodable if for everyy∈Σn{\displaystyle y\in \Sigma ^{n}}, the number of codewordsc∈C{\displaystyle c\in C}within Hamming distancepn{\displaystyle pn}fromy{\displaystyle y}is at mostL.{\displaystyle L.} The relation between list decodability of a code and other fundamental parameters such as minimum distance and rate have been fairly well studied. It has been shown that every code can be list decoded using small lists beyond half the minimum distance up to a bound called the Johnson radius. This is quite significant because it proves the existence of(p,L){\displaystyle (p,L)}-list-decodable codes of good rate with a list-decoding radius much larger thand2.{\displaystyle {\tfrac {d}{2}}.}In other words, theJohnson boundrules out the possibility of having a large number of codewords in a Hamming ball of radius slightly greater thand2{\displaystyle {\tfrac {d}{2}}}which means that it is possible to correct far more errors with list decoding. What this means is that for rates approaching the channel capacity, there exists list decodable codes with polynomial sized lists enabling efficient decoding algorithms whereas for rates exceeding the channel capacity, the list size becomes exponential which rules out the existence of efficient decoding algorithms. The proof for list-decoding capacity is a significant one in that it exactly matches the capacity of aq{\displaystyle q}-ary symmetric channelqSCp{\displaystyle qSC_{p}}. In fact, the term "list-decoding capacity" should actually be read as the capacity of an adversarial channel under list decoding. Also, the proof for list-decoding capacity is an important result that pin points the optimal trade-off between rate of a code and the fraction of errors that can be corrected under list decoding. The idea behind the proof is similar to that of Shannon's proof for capacity of thebinary symmetric channelBSCp{\displaystyle BSC_{p}}where a random code is picked and showing that it is(p,L){\displaystyle (p,L)}-list-decodable with high probability as long as the rateR⩽1−Hq(p)−1L.{\displaystyle R\leqslant 1-H_{q}(p)-{\tfrac {1}{L}}.}For rates exceeding the above quantity, it can be shown that the list sizeL{\displaystyle L}becomes super-polynomially large. A "bad" event is defined as one in which, given a received wordy∈[q]n{\displaystyle y\in [q]^{n}}andL+1{\displaystyle L+1}messagesm0,…,mL∈[q]k,{\displaystyle m_{0},\ldots ,m_{L}\in [q]^{k},}it so happens thatC(mi)∈B(y,pn){\displaystyle {\mathcal {C}}(m_{i})\in B(y,pn)}, for every0⩽i⩽L{\displaystyle 0\leqslant i\leqslant L}wherep{\displaystyle p}is the fraction of errors that we wish to correct andB(y,pn){\displaystyle B(y,pn)}is the Hamming ball of radiuspn{\displaystyle pn}with the received wordy{\displaystyle y}as the center. Now, the probability that a codewordC(mi){\displaystyle {\mathcal {C}}(m_{i})}associated with a fixed messagemi∈[q]k{\displaystyle m_{i}\in [q]^{k}}lies in a Hamming ballB(y,pn){\displaystyle B(y,pn)}is given by where the quantityVolq(y,pn){\displaystyle Vol_{q}(y,pn)}is the volume of a Hamming ball of radiuspn{\displaystyle pn}with the received wordy{\displaystyle y}as the center. The inequality in the above relation follows from the upper bound on the volume of a Hamming ball. The quantityqHq(p){\displaystyle q^{H_{q}(p)}}gives a very good estimate on the volume of a Hamming ball of radiusp{\displaystyle p}centered on any word in[q]n.{\displaystyle [q]^{n}.}Put another way, the volume of a Hamming ball is translation invariant. To continue with the proof sketch, we conjure theunion boundin probability theory which tells us that the probability of a bad event happening for a given(y,m0,…,mL){\displaystyle (y,m_{0},\dots ,m_{L})}is upper bounded by the quantityq−n(L+1)(1−Hq(p)){\displaystyle q^{-n(L+1)(1-H_{q}(p))}}. With the above in mind, the probability of "any" bad event happening can be shown to be less than1{\displaystyle 1}. To show this, we work our way over all possible received wordsy∈[q]n{\displaystyle y\in [q]^{n}}and every possible subset ofL{\displaystyle L}messages in[q]k.{\displaystyle [q]^{k}.} Now turning to the proof of part (ii), we need to show that there are super-polynomially many codewords around everyy∈[q]n{\displaystyle y\in [q]^{n}}when the rate exceeds the list-decoding capacity. We need to show that|C∩B(y,pn)|{\displaystyle |{\mathcal {C}}\cap B(y,pn)|}is super-polynomially large if the rateR⩾1−Hq(p)+ϵ{\displaystyle R\geqslant 1-H_{q}(p)+\epsilon }. Fix a codewordc∈C{\displaystyle c\in {\mathcal {C}}}. Now, for everyy∈[q]n{\displaystyle y\in [q]^{n}}picked at random, we have since Hamming balls are translation invariant. From the definition of the volume of a Hamming ball and the fact thaty{\displaystyle y}is chosen uniformly at random from[q]n{\displaystyle [q]^{n}}we also have Let us now define an indicator variableXc{\displaystyle X_{c}}such that Taking the expectation of the volume of a Hamming ball we have Therefore, by the probabilistic method, we have shown that if the rate exceeds the list-decoding capacity, then the list size becomes super-polynomially large. This completes the proof sketch for the list-decoding capacity. In 2023, building upon three seminal works,[1][2][3]coding theorists showed that, with high probability,Reed-Solomon codesdefined over random evaluation points are list decodable up to the list-decoding capacity over linear size alphabets. In the period from 1995 to 2007, the coding theory community developed progressively more efficient list-decoding algorithms. Algorithms forReed–Solomon codesthat can decode up to the Johnson radius which is1−1−δ{\displaystyle 1-{\sqrt {1-\delta }}}exist whereδ{\displaystyle \delta }is the normalised distance or relative distance. However, for Reed-Solomon codes,δ=1−R{\displaystyle \delta =1-R}which means a fraction1−R{\displaystyle 1-{\sqrt {R}}}of errors can be corrected. Some of the most prominent list-decoding algorithms are the following: Because of their ubiquity and the nice algebraic properties they possess, list-decoding algorithms for Reed–Solomon codes were a main focus of researchers. The list-decoding problem for Reed–Solomon codes can be formulated as follows: Input: For an[n,k+1]q{\displaystyle [n,k+1]_{q}}Reed-Solomon code, we are given the pair(αi,yi){\displaystyle (\alpha _{i},y_{i})}for1≤i≤n{\displaystyle 1\leq i\leq n}, whereyi{\displaystyle y_{i}}is thei{\displaystyle i}th bit of the received word and theαi{\displaystyle \alpha _{i}}'s are distinct points in the finite fieldFq{\displaystyle F_{q}}and an error parametere=n−t{\displaystyle e=n-t}. Output: The goal is to find all the polynomialsP(X)∈Fq[X]{\displaystyle P(X)\in F_{q}[X]}of degree at mostk{\displaystyle k}which is the message length such thatp(αi)=yi{\displaystyle p(\alpha _{i})=y_{i}}for at leastt{\displaystyle t}values ofi{\displaystyle i}. Here, we would like to havet{\displaystyle t}as small as possible so that a greater number of errors can be tolerated. With the above formulation, the general structure of list-decoding algorithms for Reed-Solomon codes is as follows: Step 1: (Interpolation) Find a non-zero bivariate polynomialQ(X,Y){\displaystyle Q(X,Y)}such thatQ(αi,yi)=0{\displaystyle Q(\alpha _{i},y_{i})=0}for1≤i≤n{\displaystyle 1\leq i\leq n}. Step 2: (Root finding/Factorization) Output all degreek{\displaystyle k}polynomialsp(X){\displaystyle p(X)}such thatY−p(X){\displaystyle Y-p(X)}is a factor ofQ(X,Y){\displaystyle Q(X,Y)}i.e.Q(X,p(X))=0{\displaystyle Q(X,p(X))=0}. For each of these polynomials, check ifp(αi)=yi{\displaystyle p(\alpha _{i})=y_{i}}for at leastt{\displaystyle t}values ofi∈[n]{\displaystyle i\in [n]}. If so, include such a polynomialp(X){\displaystyle p(X)}in the output list. Given the fact that bivariate polynomials can be factored efficiently, the above algorithm runs in polynomial time. Algorithms developed for list decoding of several interesting code families have found interesting applications incomputational complexityand the field ofcryptography. Following is a sample list of applications outside of coding theory:
https://en.wikipedia.org/wiki/List_decoding
Ingeometry, asphere packingis an arrangement of non-overlappingsphereswithin a containing space. The spheres considered are usually all of identical size, and the space is usually three-dimensionalEuclidean space. However, spherepacking problemscan be generalised to consider unequal spheres, spaces of other dimensions (where the problem becomescircle packingin two dimensions, orhyperspherepacking in higher dimensions) or tonon-Euclideanspaces such ashyperbolic space. A typical sphere packing problem is to find an arrangement in which the spheres fill as much of the space as possible. The proportion of space filled by the spheres is called thepacking densityof the arrangement. As the local density of a packing in an infinite space can vary depending on the volume over which it is measured, the problem is usually to maximise theaverageorasymptoticdensity, measured over a large enough volume. For equal spheres in three dimensions, the densest packing uses approximately 74% of the volume. A random packing of equal spheres generally has a density around 63.5%.[1] Alatticearrangement (commonly called aregulararrangement) is one in which the centers of the spheres form a very symmetric pattern which needs onlynvectors to be uniquely defined (inn-dimensionalEuclidean space). Lattice arrangements are periodic. Arrangements in which the spheres do not form a lattice (often referred to asirregular) can still be periodic, but alsoaperiodic(properly speakingnon-periodic) orrandom. Because of their high degree ofsymmetry, lattice packings are easier to classify than non-lattice ones. Periodic lattices always have well-defined densities. In three-dimensional Euclidean space, the densest packing of equal spheres is achieved by a family of structures calledclose-packedstructures. One method for generating such a structure is as follows. Consider a plane with a compact arrangement of spheres on it. Call it A. For any three neighbouring spheres, a fourth sphere can be placed on top in the hollow between the three bottom spheres. If we do this for half of the holes in a second plane above the first, we create a new compact layer. There are two possible choices for doing this, call them B and C. Suppose that we chose B. Then one half of the hollows of B lies above the centers of the balls in A and one half lies above the hollows of A which were not used for B. Thus the balls of a third layer can be placed either directly above the balls of the first one, yielding a layer of type A, or above the holes of the first layer which were not occupied by the second layer, yielding a layer of type C. Combining layers of types A, B, and C produces various close-packed structures. Two simple arrangements within the close-packed family correspond to regular lattices. One is called cubic close packing (orface-centred cubic, "FCC")—where the layers are alternated in the ABCABC... sequence. The other is calledhexagonal close packing("HCP"), where the layers are alternated in the ABAB... sequence.[dubious–discuss]But many layer stacking sequences are possible (ABAC, ABCBA, ABCBAC, etc.), and still generate a close-packed structure. In all of these arrangements each sphere touches 12 neighboring spheres,[2]and the average density is In 1611,Johannes Keplerconjectured that this is the maximum possible density amongst both regular and irregular arrangements—this became known as theKepler conjecture.Carl Friedrich Gaussproved in 1831 that these packings have the highest density amongst all possible lattice packings.[3]In 1998,Thomas Callister Hales, following the approach suggested byLászló Fejes Tóthin 1953, announced a proof of the Kepler conjecture. Hales' proof is aproof by exhaustioninvolving checking of many individual cases using complex computer calculations. Referees said that they were "99% certain" of the correctness of Hales' proof. On 10 August 2014, Hales announced the completion of a formal proof usingautomated proof checking, removing any doubt.[4] Some other lattice packings are often found in physical systems. These include the cubic lattice with a density ofπ6≈0.5236{\displaystyle {\frac {\pi }{6}}\approx 0.5236}, the hexagonal lattice with a density ofπ33≈0.6046{\displaystyle {\frac {\pi }{3{\sqrt {3}}}}\approx 0.6046}and the tetrahedral lattice with a density ofπ316≈0.3401{\displaystyle {\frac {\pi {\sqrt {3}}}{16}}\approx 0.3401}.[5] Packings where all spheres are constrained by their neighbours to stay in one location are called rigid orjammed. The strictly jammed (mechanically stable even as a finite system) regular sphere packing with the lowest known density is a diluted ("tunneled") fcc crystal with a density of onlyπ√2/9 ≈ 0.49365.[6]The loosest known regular jammed packing has a density of approximately 0.0555.[7] If we attempt to build a densely packed collection of spheres, we will be tempted to always place the next sphere in a hollow between three packed spheres. If five spheres are assembled in this way, they will be consistent with one of the regularly packed arrangements described above. However, the sixth sphere placed in this way will render the structure inconsistent with any regular arrangement. This results in the possibility of arandom close packingof spheres which is stable against compression.[8]Vibration of a random loose packing can result in the arrangement of spherical particles into regular packings, a process known asgranular crystallisation. Such processes depend on the geometry of the container holding the spherical grains.[2] When spheres are randomly added to a container and then compressed, they will generally form what is known as an "irregular" or "jammed" packing configuration when they can be compressed no more. This irregular packing will generally have a density of about 64%. Recent research predicts analytically that it cannot exceed a density limit of 63.4%[9]This situation is unlike the case of one or two dimensions, where compressing a collection of 1-dimensional or 2-dimensional spheres (that is, line segments or circles) will yield a regular packing. The sphere packing problem is the three-dimensional version of a class of ball-packing problems in arbitrary dimensions. In two dimensions, the equivalent problem ispacking circleson a plane. In one dimension it is packing line segments into a linear universe.[10] In dimensions higher than three, the densest lattice packings of hyperspheres are known for 8 and 24 dimensions.[11]Very little is known about irregular hypersphere packings; it is possible that in some dimensions the densest packing may be irregular. Some support for this conjecture comes from the fact that in certain dimensions (e.g. 10) the densest known irregular packing is denser than the densest known regular packing.[12] In 2016,Maryna Viazovskaannounced a proof that theE8latticeprovides the optimal packing (regardless of regularity) in eight-dimensional space,[13]and soon afterwards she and a group of collaborators announced a similar proof that theLeech latticeis optimal in 24 dimensions.[14]This result built on and improved previous methods which showed that these two lattices are very close to optimal.[15]The new proofs involve using theLaplace transformof a carefully chosenmodular functionto construct aradially symmetricfunctionfsuch thatfand itsFourier transformf̂both equal 1 at theorigin, and both vanish at all other points of the optimal lattice, withfnegative outside the central sphere of the packing andf̂positive. Then, thePoisson summation formulaforfis used to compare the density of the optimal lattice with that of any other packing.[16]Before the proof had beenformally refereedand published, mathematicianPeter Sarnakcalled the proof "stunningly simple" and wrote that "You just start reading the paper and you know this is correct."[17] Another line of research in high dimensions is trying to findasymptoticbounds for the density of the densest packings. It is known that for largen, the densest lattice in dimensionnhas densityθ(n){\displaystyle \theta (n)}betweencn⋅ 2−n(for some constantc) and2−(0.599+o(1))n.[18]Conjectural bounds lie in between.[19]In a 2023 preprint, Marcelo Campos, Matthew Jenssen, Marcus Michelen andJulian Sahasrabudheannounced an improvement to the lower bound of the maximal density toθ(n)≥(1−o(1))nln⁡n2n+1{\displaystyle \theta (n)\geq (1-o(1)){\frac {n\ln n}{2^{n+1}}}},[20][21]among their techniques they make use of theRödl nibble. Many problems in the chemical and physical sciences can be related to packing problems where more than one size of sphere is available. Here there is a choice between separating the spheres into regions of close-packed equal spheres, or combining the multiple sizes of spheres into a compound orinterstitialpacking. When many sizes of spheres (or adistribution) are available, the problem quickly becomes intractable, but some studies of binary hard spheres (two sizes) are available. When the second sphere is much smaller than the first, it is possible to arrange the large spheres in a close-packed arrangement, and then arrange the small spheres within the octahedral and tetrahedral gaps. The density of this interstitial packing depends sensitively on the radius ratio, but in the limit of extreme size ratios, the smaller spheres can fill the gaps with the same density as the larger spheres filled space.[23]Even if the large spheres are not in a close-packed arrangement, it is always possible to insert some smaller spheres of up to 0.29099 of the radius of the larger sphere.[24] When the smaller sphere has a radius greater than 0.41421 of the radius of the larger sphere, it is no longer possible to fit into even the octahedral holes of the close-packed structure. Thus, beyond this point, either the host structure must expand to accommodate the interstitials (which compromises the overall density), or rearrange into a more complex crystalline compound structure. Structures are known which exceed the close packing density for radius ratios up to 0.659786.[22][25] Upper bounds for the density that can be obtained in such binary packings have also been obtained.[26] In many chemical situations such asionic crystals, thestoichiometryis constrained by the charges of the constituent ions. This additional constraint on the packing, together with the need to minimize theCoulomb energyof interacting charges leads to a diversity of optimal packing arrangements. The upper bound for the density of a strictly jammed sphere packing with any set of radii is 1 – an example of such a packing of spheres is the Apollonian sphere packing. The lower bound for such a sphere packing is 0 – an example is the Dionysian sphere packing.[27] Although the concept of circles and spheres can be extended tohyperbolic space, finding the densest packing becomes much more difficult. In a hyperbolic space there is no limit to the number of spheres that can surround another sphere (for example,Ford circlescan be thought of as an arrangement of identical hyperbolic circles in which each circle is surrounded by aninfinitenumber of other circles). The concept of average density also becomes much more difficult to define accurately. The densest packings in any hyperbolic space are almost always irregular.[28] Despite this difficulty, K. Böröczky gives a universal upper bound for the density of sphere packings of hyperbolicn-space wheren≥ 2.[29]In three dimensions the Böröczky bound is approximately 85.327613%, and is realized by thehorospherepacking of theorder-6 tetrahedral honeycombwithSchläfli symbol{3,3,6}.[30]In addition to this configuration at least three otherhorospherepackings are known to exist in hyperbolic 3-space that realize the density upper bound.[31] Thecontact graphof an arbitrary finite packing of unit balls is the graph whose vertices correspond to the packing elements and whose two vertices are connected by an edge if the corresponding two packing elements touch each other. The cardinality of the edge set of the contact graph gives the number of touching pairs, the number of 3-cycles in the contact graph gives the number of touching triplets, and the number of tetrahedrons in the contact graph gives the number of touching quadruples (in general for a contact graph associated with a sphere packing inndimensions that the cardinality of the set ofn-simplices in the contact graph gives the number of touching (n+ 1)-tuples in the sphere packing). In the case of 3-dimensional Euclidean space, non-trivial upper bounds on the number of touching pairs, triplets, and quadruples[32]were proved byKaroly Bezdekand Samuel Reid at the University of Calgary. The problem of finding the arrangement ofnidentical spheres that maximizes the number of contact points between the spheres is known as the "sticky-sphere problem". The maximum is known forn≤ 11, and only conjectural values are known for largern.[33] Sphere packing on the corners of a hypercube (withHamming balls, spheres defined byHamming distance) corresponds to designingerror-correcting codes: if the spheres have radiust, then their centers are codewords of a (2t+ 1)-error-correcting code. Lattice packings correspond to linear codes. There are other, subtler relationships between Euclidean sphere packing and error-correcting codes. For example, thebinary Golay codeis closely related to the 24-dimensional Leech lattice. For further details on these connections, see the bookSphere Packings, Lattices and GroupsbyConwayandSloane.[34]
https://en.wikipedia.org/wiki/Sphere_packing
Intelecommunication, aBerger codeis a unidirectionalerror detecting code, named after its inventor, J. M. Berger. Berger codes can detect all unidirectional errors. Unidirectional errors are errors that only flip ones into zeroes or only zeroes into ones, such as in asymmetric channels. Thecheck bitsof Berger codes are computed by counting all the zeroes in the information word, and expressing that number in natural binary. If the information word consists ofn{\displaystyle n}bits, then the Berger code needsk=⌈log2⁡(n+1)⌉{\displaystyle k=\lceil \log _{2}(n+1)\rceil }"check bits", giving a Berger code of length k+n. (In other words, thek{\displaystyle k}check bits are enough to check up ton=2k−1{\displaystyle n=2^{k}-1}information bits). Berger codes can detect any number of one-to-zero bit-flip errors, as long as no zero-to-one errors occurred in the same code word. Similarly, Berger codes can detect any number of zero-to-one bit-flip errors, as long as no one-to-zero bit-flip errors occur in the same code word. Berger codes cannot correct any error. Like all unidirectional error detecting codes, Berger codes can also be used indelay-insensitivecircuits. As stated above, Berger codes detectanynumber of unidirectional errors. For agiven code word, if the only errors that have occurred are that some (or all) bits with value 1 have changed to value 0, then this transformation will be detected by the Berger code implementation. To understand why, consider that there are three such cases: For case 1, the number of 0-valued bits in the information section will, by definition of the error, increase. Therefore, our Berger check code will be lower than the actual 0-bit-count for the data, and so the check will fail. For case 2, the number of 0-valued bits in the information section have stayed the same, but the value of the check data has changed. Since we know some 1s turned into 0s, but no 0s have turned into 1s (that's how we defined the error model in this case), the encoded binary value of the check data will go down (e.g., from binary 1011 to 1010, or to 1001, or 0011). Since the information data has stayed the same, it has the same number of zeros it did before, and that will no longer match the mutated check value. For case 3, where bits have changed in both the information and the check sections, notice that the number of zeros in the information section hasgone up, as described for case 1, and the binary value stored in the check portion hasgone down, as described for case 2. Therefore, there is no chance that the two will end up mutating in such a way as to become a different valid code word. A similar analysis can be performed, and is perfectly valid, in the case where the only errors that occur are that some 0-valued bits change to 1. Therefore, if all the errors that occur on a specific codeword all occur in the same direction, these errors will be detected. For the next code word being transmitted (for instance), the errors can go in the opposite direction, and they will still be detected, as long as they all go in the same direction as each other. Unidirectional errors are common in certain situations. For instance, inflash memory, bits can more easily be programmed to a 0 than can be reset to a 1.
https://en.wikipedia.org/wiki/Berger_code
Incoding theory,burst error-correcting codesemploy methods of correctingburst errors, which are errors that occur in many consecutive bits rather than occurring in bits independently of each other. Many codes have been designed to correctrandom errors. Sometimes, however, channels may introduce errors which are localized in a short interval. Such errors occur in a burst (calledburst errors) because they occur in many consecutive bits. Examples of burst errors can be found extensively in storage mediums. These errors may be due to physical damage such as scratch on a disc or a stroke of lightning in case of wireless channels. They are not independent; they tend to be spatially concentrated. If one bit has an error, it is likely that the adjacent bits could also be corrupted. The methods used to correct random errors are inefficient to correct burst errors. A burst of lengthℓ[1] Say a codewordC{\displaystyle C}is transmitted, and it is received asY=C+E.{\displaystyle Y=C+E.}Then, the error vectorE{\displaystyle E}is called a burst of lengthℓ{\displaystyle \ell }if the nonzero components ofE{\displaystyle E}are confined toℓ{\displaystyle \ell }consecutive components. For example,E=(010000110){\displaystyle E=(0{\textbf {1000011}}0)}is a burst of lengthℓ=7.{\displaystyle \ell =7.} Although this definition is sufficient to describe what a burst error is, the majority of the tools developed for burst error correction rely on cyclic codes. This motivates our next definition. A cyclic burst of lengthℓ[1] An error vectorE{\displaystyle E}is called a cyclic burst error of lengthℓ{\displaystyle \ell }if its nonzero components are confined toℓ{\displaystyle \ell }cyclically consecutive components. For example, the previously considered error vectorE=(010000110){\displaystyle E=(010000110)}, is a cyclic burst of lengthℓ=5{\displaystyle \ell =5}, since we consider the error starting at position6{\displaystyle 6}and ending at position1{\displaystyle 1}. Notice the indices are0{\displaystyle 0}-based, that is, the first element is at position0{\displaystyle 0}. For the remainder of this article, we will use the term burst to refer to a cyclic burst, unless noted otherwise. It is often useful to have a compact definition of a burst error, that encompasses not only its length, but also the pattern, and location of such error. We define a burst description to be a tuple(P,L){\displaystyle (P,L)}whereP{\displaystyle P}is the pattern of the error (that is the string of symbols beginning with the first nonzero entry in the error pattern, and ending with the last nonzero symbol), andL{\displaystyle L}is the location, on the codeword, where the burst can be found.[1] For example, the burst description of the error patternE=(010000110){\displaystyle E=(010000110)}isD=(1000011,1){\displaystyle D=(1000011,1)}. Notice that such description is not unique, becauseD′=(11001,6){\displaystyle D'=(11001,6)}describes the same burst error. In general, if the number of nonzero components inE{\displaystyle E}isw{\displaystyle w}, thenE{\displaystyle E}will havew{\displaystyle w}different burst descriptions each starting at a different nonzero entry ofE{\displaystyle E}. To remedy the issues that arise by the ambiguity of burst descriptions with the theorem below, however before doing so we need a definition first. Definition.The number of symbols in a given error patterny,{\displaystyle y,}is denoted bylength(y).{\displaystyle \mathrm {length} (y).} Theorem (Uniqueness of burst descriptions)—SupposeE{\displaystyle E}is an error vector of lengthn{\displaystyle n}with two burst descriptions(P1,L1){\displaystyle (P_{1},L_{1})}and(P2,L2){\displaystyle (P_{2},L_{2})}. Iflength(P1)+length(P2)⩽n+1,{\displaystyle \mathrm {length} (P_{1})+\mathrm {length} (P_{2})\leqslant n+1,}then the two descriptions are identical that is, their components are equivalent.[2] Letw{\displaystyle w}be thehamming weight(or the number of nonzero entries) ofE{\displaystyle E}. ThenE{\displaystyle E}has exactlyw{\displaystyle w}error descriptions. Forw=0,1,{\displaystyle w=0,1,}there is nothing to prove. So we assume thatw⩾2{\displaystyle w\geqslant 2}and that the descriptions are not identical. We notice that each nonzero entry ofE{\displaystyle E}will appear in the pattern, and so, the components ofE{\displaystyle E}not included in the pattern will form a cyclic run of zeros, beginning after the last nonzero entry, and continuing just before the first nonzero entry of the pattern. We call the set of indices corresponding to this run as the zero run. We immediately observe that each burst description has a zero run associated with it and that each zero run is disjoint. Since we havew{\displaystyle w}zero runs, and each is disjoint, we have a total ofn−w{\displaystyle n-w}distinct elements in all the zero runs. On the other hand we have:n−w=number of zeros inE⩾(n−length(P1))+(n−length(P2))=2n−(length(P1)+length(P2))⩾2n−(n+1)length(P1)+length(P2)⩽n+1=n−1{\displaystyle {\begin{aligned}n-w={\text{number of zeros in }}E&\geqslant (n-\mathrm {length} (P_{1}))+(n-\mathrm {length} (P_{2}))\\&=2n-\left(\mathrm {length} (P_{1})+\mathrm {length} (P_{2})\right)\\&\geqslant 2n-(n+1)&&\mathrm {length} (P_{1})+\mathrm {length} (P_{2})\leqslant n+1\\&=n-1\end{aligned}}}This contradictsw⩾2.{\displaystyle w\geqslant 2.}Thus, the burst error descriptions are identical. Acorollaryof the above theorem is that we cannot have two distinct burst descriptions for bursts of length12(n+1).{\displaystyle {\tfrac {1}{2}}(n+1).} Cyclic codesare defined as follows: think of theq{\displaystyle q}symbols as elements inFq{\displaystyle \mathbb {F} _{q}}. Now, we can think of words as polynomials overFq,{\displaystyle \mathbb {F} _{q},}where the individual symbols of a word correspond to the different coefficients of the polynomial. To define a cyclic code, we pick a fixed polynomial, calledgenerator polynomial. The codewords of this cyclic code are all the polynomials that are divisible by this generator polynomial. Codewords are polynomials of degree⩽n−1{\displaystyle \leqslant n-1}. Suppose that the generator polynomialg(x){\displaystyle g(x)}has degreer{\displaystyle r}. Polynomials of degree⩽n−1{\displaystyle \leqslant n-1}that are divisible byg(x){\displaystyle g(x)}result from multiplyingg(x){\displaystyle g(x)}by polynomials of degree⩽n−1−r{\displaystyle \leqslant n-1-r}. We haveqn−r{\displaystyle q^{n-r}}such polynomials. Each one of them corresponds to a codeword. Therefore,k=n−r{\displaystyle k=n-r}for cyclic codes. Cyclic codes can detect all bursts of length up toℓ=n−k=r{\displaystyle \ell =n-k=r}. We will see later that the burst error detection ability of any(n,k){\displaystyle (n,k)}code is bounded from above byℓ⩽n−k{\displaystyle \ell \leqslant n-k}. Cyclic codes are considered optimal for burst error detection since they meet this upper bound: Theorem (Cyclic burst correction capability)—Every cyclic code with generator polynomial of degreer{\displaystyle r}can detect all bursts of length⩽r.{\displaystyle \leqslant r.} We need to prove that if you add a burst of length⩽r{\displaystyle \leqslant r}to a codeword (i.e. to a polynomial that is divisible byg(x){\displaystyle g(x)}), then the result is not going to be a codeword (i.e. the corresponding polynomial is not divisible byg(x){\displaystyle g(x)}). It suffices to show that no burst of length⩽r{\displaystyle \leqslant r}is divisible byg(x){\displaystyle g(x)}. Such a burst has the formxib(x){\displaystyle x^{i}b(x)}, wheredeg⁡(b(x))<r.{\displaystyle \deg(b(x))<r.}Therefore,b(x){\displaystyle b(x)}is not divisible byg(x){\displaystyle g(x)}(because the latter has degreer{\displaystyle r}).g(x){\displaystyle g(x)}is not divisible byx{\displaystyle x}(Otherwise, all codewords would start with0{\displaystyle 0}). Therefore,xi{\displaystyle x^{i}}is not divisible byg(x){\displaystyle g(x)}as well. The above proof suggests a simple algorithm for burst error detection/correction in cyclic codes: given a transmitted word (i.e. a polynomial of degree⩽n−1{\displaystyle \leqslant n-1}), compute the remainder of this word when divided byg(x){\displaystyle g(x)}. If the remainder is zero (i.e. if the word is divisible byg(x){\displaystyle g(x)}), then it is a valid codeword. Otherwise, report an error. To correct this error, subtract this remainder from the transmitted word. The subtraction result is going to be divisible byg(x){\displaystyle g(x)}(i.e. it is going to be a valid codeword). By the upper bound on burst error detection (ℓ⩽n−k=r{\displaystyle \ell \leqslant n-k=r}), we know that a cyclic code can not detectallbursts of lengthℓ>r{\displaystyle \ell >r}. However cyclic codes can indeed detectmostbursts of length>r{\displaystyle >r}. The reason is that detection fails only when the burst is divisible byg(x){\displaystyle g(x)}. Over binary alphabets, there exist2ℓ−2{\displaystyle 2^{\ell -2}}bursts of lengthℓ{\displaystyle \ell }. Out of those, only2ℓ−2−r{\displaystyle 2^{\ell -2-r}}are divisible byg(x){\displaystyle g(x)}. Therefore, the detection failure probability is very small (2−r{\displaystyle 2^{-r}}) assuming a uniform distribution over all bursts of lengthℓ{\displaystyle \ell }. We now consider a fundamental theorem about cyclic codes that will aid in designing efficient burst-error correcting codes, by categorizing bursts into different cosets. Theorem (DistinctCosets)—A linear codeC{\displaystyle C}is anℓ{\displaystyle \ell }-burst-error-correcting code if all the burst errors of length⩽ℓ{\displaystyle \leqslant \ell }lie in distinctcosetsofC{\displaystyle C}. Lete1,e2{\displaystyle \mathbf {e} _{1},\mathbf {e} _{2}}be distinct burst errors of length⩽ℓ{\displaystyle \leqslant \ell }which lie in same coset of codeC{\displaystyle C}. Thenc=e1−e2{\displaystyle \mathbf {c} =\mathbf {e} _{1}-\mathbf {e} _{2}}is a codeword. Hence, if we receivee1,{\displaystyle \mathbf {e} _{1},}we can decode it either to0{\displaystyle \mathbf {0} }orc{\displaystyle \mathbf {c} }. In contrast, if all the burst errorse1{\displaystyle \mathbf {e} _{1}}ande2{\displaystyle \mathbf {e} _{2}}do not lie in same coset, then each burst error is determined by its syndrome. The error can then be corrected through its syndrome. Thus, a linear codeC{\displaystyle C}is anℓ{\displaystyle \ell }-burst-error-correcting code if and only if all the burst errors of length⩽ℓ{\displaystyle \leqslant \ell }lie in distinct cosets ofC{\displaystyle C}. Theorem (Burst error codeword classification)—LetC{\displaystyle C}be a linearℓ{\displaystyle \ell }-burst-error-correcting code. Then no nonzero burst of length⩽2ℓ{\displaystyle \leqslant 2\ell }can be a codeword. Letc{\displaystyle c}be a codeword with a burst of length⩽2ℓ{\displaystyle \leqslant 2\ell }. Thus it has the pattern(0,1,u,v,1,0){\displaystyle (0,1,u,v,1,0)}, whereu{\displaystyle u}andv{\displaystyle v}are words of length⩽ℓ−1.{\displaystyle \leqslant \ell -1.}Hence, the wordsw=(0,1,u,0,0,0){\displaystyle w=(0,1,u,0,0,0)}andc−w=(0,0,0,v,1,0){\displaystyle c-w=(0,0,0,v,1,0)}are two bursts of length⩽ℓ{\displaystyle \leqslant \ell }. For binary linear codes, they belong to the same coset. This contradicts the Distinct Cosets Theorem, therefore no nonzero burst of length⩽2ℓ{\displaystyle \leqslant 2\ell }can be a codeword. By upper bound, we mean a limit on our error detection ability that we can never go beyond. Suppose that we want to design an(n,k){\displaystyle (n,k)}code that can detect all burst errors of length⩽ℓ.{\displaystyle \leqslant \ell .}A natural question to ask is: givenn{\displaystyle n}andk{\displaystyle k}, what is the maximumℓ{\displaystyle \ell }that we can never achieve beyond? In other words, what is the upper bound on the lengthℓ{\displaystyle \ell }of bursts that we can detect using any(n,k){\displaystyle (n,k)}code? The following theorem provides an answer to this question. Theorem (Burst error detection ability)—The burst error detection ability of any(n,k){\displaystyle (n,k)}code isℓ⩽n−k.{\displaystyle \ell \leqslant n-k.} First we observe that a code can detect all bursts of length⩽ℓ{\displaystyle \leqslant \ell }if and only if no two codewords differ by a burst of length⩽ℓ{\displaystyle \leqslant \ell }. Suppose that we have two code wordsc1{\displaystyle \mathbf {c} _{1}}andc2{\displaystyle \mathbf {c} _{2}}that differ by a burstb{\displaystyle \mathbf {b} }of length⩽ℓ{\displaystyle \leqslant \ell }. Upon receivingc1{\displaystyle \mathbf {c} _{1}}, we can not tell whether the transmitted word is indeedc1{\displaystyle \mathbf {c} _{1}}with no transmission errors, or whether it isc2{\displaystyle \mathbf {c} _{2}}with a burst errorb{\displaystyle \mathbf {b} }that occurred during transmission. Now, suppose that every two codewords differ by more than a burst of lengthℓ.{\displaystyle \ell .}Even if the transmitted codewordc1{\displaystyle \mathbf {c} _{1}}is hit by a burstb{\displaystyle \mathbf {b} }of lengthℓ{\displaystyle \ell }, it is not going to change into another valid codeword. Upon receiving it, we can tell that this isc1{\displaystyle \mathbf {c} _{1}}with a burstb.{\displaystyle \mathbf {b} .}By the above observation, we know that no two codewords can share the firstn−ℓ{\displaystyle n-\ell }symbols. The reason is that even if they differ in all the otherℓ{\displaystyle \ell }symbols, they are still going to be different by a burst of lengthℓ.{\displaystyle \ell .}Therefore, the number of codewordsqk{\displaystyle q^{k}}satisfiesqk⩽qn−ℓ.{\displaystyle q^{k}\leqslant q^{n-\ell }.}Applyinglogq{\displaystyle \log _{q}}to both sides and rearranging, we can see thatℓ⩽n−k{\displaystyle \ell \leqslant n-k}. Now, we repeat the same question but for error correction: givenn{\displaystyle n}andk{\displaystyle k}, what is the upper bound on the lengthℓ{\displaystyle \ell }of bursts that we can correct using any(n,k){\displaystyle (n,k)}code? The following theorem provides a preliminary answer to this question: Theorem (Burst error correction ability)—The burst error correction ability of any(n,k){\displaystyle (n,k)}code satisfiesℓ⩽n−k−logq⁡(n−ℓ)+2{\displaystyle \ell \leqslant n-k-\log _{q}(n-\ell )+2} First we observe that a code can correct all bursts of length⩽ℓ{\displaystyle \leqslant \ell }if and only if no two codewords differ by the sum of two bursts of length⩽ℓ.{\displaystyle \leqslant \ell .}Suppose that two codewordsc1{\displaystyle \mathbf {c} _{1}}andc2{\displaystyle \mathbf {c} _{2}}differ by burstsb1{\displaystyle \mathbf {b} _{1}}andb2{\displaystyle \mathbf {b} _{2}}of length⩽ℓ{\displaystyle \leqslant \ell }each. Upon receivingc1{\displaystyle \mathbf {c} _{1}}hit by a burstb1{\displaystyle \mathbf {b} _{1}}, we could interpret that as if it wasc2{\displaystyle \mathbf {c} _{2}}hit by a burst−b2{\displaystyle -\mathbf {b} _{2}}. We can not tell whether the transmitted word isc1{\displaystyle \mathbf {c} _{1}}orc2{\displaystyle \mathbf {c} _{2}}. Now, suppose that every two codewords differ by more than two bursts of lengthℓ{\displaystyle \ell }. Even if the transmitted codewordc1{\displaystyle \mathbf {c} _{1}}is hit by a burst of lengthℓ{\displaystyle \ell }, it is not going to look like another codeword that has been hit by another burst. For each codewordc,{\displaystyle \mathbf {c} ,}letB(c){\displaystyle B(\mathbf {c} )}denote the set of all words that differ fromc{\displaystyle \mathbf {c} }by a burst of length⩽ℓ.{\displaystyle \leqslant \ell .}Notice thatB(c){\displaystyle B(\mathbf {c} )}includesc{\displaystyle \mathbf {c} }itself. By the above observation, we know that for two different codewordsci{\displaystyle \mathbf {c} _{i}}andcj,B(ci){\displaystyle \mathbf {c} _{j},B(\mathbf {c} _{i})}andB(cj){\displaystyle B(\mathbf {c} _{j})}are disjoint. We haveqk{\displaystyle q^{k}}codewords. Therefore, we can say thatqk|B(c)|⩽qn{\displaystyle q^{k}|B(\mathbf {c} )|\leqslant q^{n}}. Moreover, we have(n−ℓ)qℓ−2⩽|B(c)|{\displaystyle (n-\ell )q^{\ell -2}\leqslant |B(\mathbf {c} )|}. By plugging the latter inequality into the former, then taking the baseq{\displaystyle q}logarithm and rearranging, we get the above theorem. A stronger result is given by the Rieger bound: Theorem (Rieger bound)—Ifℓ{\displaystyle \ell }is the burst error correcting ability of an(n,k){\displaystyle (n,k)}linear block code, then2ℓ⩽n−k{\displaystyle 2\ell \leqslant n-k}. Any linear code that can correct any burst pattern of length⩽ℓ{\displaystyle \leqslant \ell }cannot have a burst of length⩽2ℓ{\displaystyle \leqslant 2\ell }as a codeword. If it had a burst of length⩽2ℓ{\displaystyle \leqslant 2\ell }as a codeword, then a burst of lengthℓ{\displaystyle \ell }could change the codeword to a burst pattern of lengthℓ{\displaystyle \ell }, which also could be obtained by making a burst error of lengthℓ{\displaystyle \ell }in all zero codeword. If vectors are non-zero in first2ℓ{\displaystyle 2\ell }symbols, then the vectors should be from different subsets of an array so that their difference is not a codeword of bursts of length2ℓ{\displaystyle 2\ell }. Ensuring this condition, the number of such subsets is at least equal to number of vectors. Thus, the number of subsets would be at leastq2ℓ{\displaystyle q^{2\ell }}. Hence, we have at least2ℓ{\displaystyle 2\ell }distinct symbols, otherwise, the difference of two such polynomials would be a codeword that is a sum of two bursts of length⩽ℓ.{\displaystyle \leqslant \ell .}Thus, this proves the Rieger Bound. Definition.A linear burst-error-correcting code achieving the above Rieger bound is called an optimal burst-error-correcting code. There is more than one upper bound on the achievable code rate of linear block codes for multiple phased-burst correction (MPBC). One such bound is constrained to a maximum correctable cyclic burst length within every subblock, or equivalently a constraint on the minimum error free length or gap within every phased-burst. This bound, when reduced to the special case of a bound for single burst correction, is the Abramson bound (a corollary of theHamming boundfor burst-error correction) when the cyclic burst length is less than half the block length.[3] Theorem (number of bursts)—For1⩽ℓ⩽12(n+1),{\displaystyle 1\leqslant \ell \leqslant {\tfrac {1}{2}}(n+1),}over a binary alphabet, there aren2ℓ−1+1{\displaystyle n2^{\ell -1}+1}vectors of lengthn{\displaystyle n}which are bursts of length⩽ℓ{\displaystyle \leqslant \ell }.[1] Since the burst length is⩽12(n+1),{\displaystyle \leqslant {\tfrac {1}{2}}(n+1),}there is a unique burst description associated with the burst. The burst can begin at any of then{\displaystyle n}positions of the pattern. Each pattern begins with1{\displaystyle 1}and contain a length ofℓ{\displaystyle \ell }. We can think of it as the set of all strings that begin with1{\displaystyle 1}and have lengthℓ{\displaystyle \ell }. Thus, there are a total of2ℓ−1{\displaystyle 2^{\ell -1}}possible such patterns, and a total ofn2ℓ−1{\displaystyle n2^{\ell -1}}bursts of length⩽ℓ.{\displaystyle \leqslant \ell .}If we include the all-zero burst, we haven2ℓ−1+1{\displaystyle n2^{\ell -1}+1}vectors representing bursts of length⩽ℓ.{\displaystyle \leqslant \ell .} Theorem (Bound on the number of codewords)—If1⩽ℓ⩽12(n+1),{\displaystyle 1\leqslant \ell \leqslant {\tfrac {1}{2}}(n+1),}a binaryℓ{\displaystyle \ell }-burst error correcting code has at most2n/(n2ℓ−1+1){\displaystyle 2^{n}/(n2^{\ell -1}+1)}codewords. Sinceℓ⩽12(n+1){\displaystyle \ell \leqslant {\tfrac {1}{2}}(n+1)}, we know that there aren2ℓ−1+1{\displaystyle n2^{\ell -1}+1}bursts of length⩽ℓ{\displaystyle \leqslant \ell }. Say the code hasM{\displaystyle M}codewords, then there areMn2ℓ−1{\displaystyle Mn2^{\ell -1}}codewords that differ from a codeword by a burst of length⩽ℓ{\displaystyle \leqslant \ell }. Each of theM{\displaystyle M}words must be distinct, otherwise the code would have distance<1{\displaystyle <1}. Therefore,M(2ℓ−1+1)⩽2n{\displaystyle M(2^{\ell -1}+1)\leqslant 2^{n}}impliesM⩽2n/(n2ℓ−1+1).{\displaystyle M\leqslant 2^{n}/(n2^{\ell -1}+1).} Theorem (Abramson's bounds)—If1⩽ℓ⩽12(n+1){\displaystyle 1\leqslant \ell \leqslant {\tfrac {1}{2}}(n+1)}is a binarylinear(n,k),ℓ{\displaystyle (n,k),\ell }-burst error correcting code, its block-length must satisfy:n⩽2n−k−ℓ+1−1.{\displaystyle n\leqslant 2^{n-k-\ell +1}-1.} For a linear(n,k){\displaystyle (n,k)}code, there are2k{\displaystyle 2^{k}}codewords. By our previous result, we know that2k⩽2nn2ℓ−1+1.{\displaystyle 2^{k}\leqslant {\frac {2^{n}}{n2^{\ell -1}+1}}.}Isolatingn{\displaystyle n}, we getn⩽2n−k−ℓ+1−2−ℓ+1{\displaystyle n\leqslant 2^{n-k-\ell +1}-2^{-\ell +1}}. Sinceℓ⩾1{\displaystyle \ell \geqslant 1}andn{\displaystyle n}must be an integer, we haven⩽2n−k−ℓ+1−1{\displaystyle n\leqslant 2^{n-k-\ell +1}-1}. Remark.r=n−k{\displaystyle r=n-k}is called the redundancy of the code and in an alternative formulation for the Abramson's bounds isr⩾⌈log2⁡(n+1)⌉+ℓ−1.{\displaystyle r\geqslant \lceil \log _{2}(n+1)\rceil +\ell -1.} Sources:[3][4][5] Whilecyclic codesin general are powerful tools for detecting burst errors, we now consider a family of binary cyclic codes named Fire Codes, which possess good single burst error correction capabilities. By single burst, say of lengthℓ{\displaystyle \ell }, we mean that all errors that a received codeword possess lie within a fixed span ofℓ{\displaystyle \ell }digits. Letp(x){\displaystyle p(x)}be anirreducible polynomialof degreem{\displaystyle m}overF2{\displaystyle \mathbb {F} _{2}}, and letp{\displaystyle p}be the period ofp(x){\displaystyle p(x)}. The period ofp(x){\displaystyle p(x)}, and indeed of any polynomial, is defined to be the least positive integerr{\displaystyle r}such thatp(x)|xr−1.{\displaystyle p(x)|x^{r}-1.}Letℓ{\displaystyle \ell }be a positive integer satisfyingℓ⩽m{\displaystyle \ell \leqslant m}and2ℓ−1{\displaystyle 2\ell -1}not divisible byp{\displaystyle p}, wherem{\displaystyle m}andp{\displaystyle p}are the degree and period ofp(x){\displaystyle p(x)}, respectively. Define the Fire CodeG{\displaystyle G}by the followinggenerator polynomial:g(x)=(x2ℓ−1+1)p(x).{\displaystyle g(x)=\left(x^{2\ell -1}+1\right)p(x).} We will show thatG{\displaystyle G}is anℓ{\displaystyle \ell }-burst-error correcting code. Lemma 1—gcd(p(x),x2ℓ−1+1)=1.{\displaystyle \gcd \left(p(x),x^{2\ell -1}+1\right)=1.} Letd(x){\displaystyle d(x)}be the greatest common divisor of the two polynomials. Sincep(x){\displaystyle p(x)}is irreducible,deg⁡(d(x))=0{\displaystyle \deg(d(x))=0}ordeg⁡(p(x)){\displaystyle \deg(p(x))}. Assumedeg⁡(d(x))≠0,{\displaystyle \deg(d(x))\neq 0,}thenp(x)=cd(x){\displaystyle p(x)=cd(x)}for some constantc{\displaystyle c}. But,(1/c)p(x){\displaystyle (1/c)p(x)}is a divisor ofx2ℓ−1+1{\displaystyle x^{2\ell -1}+1}sinced(x){\displaystyle d(x)}is a divisor ofx2ℓ−1+1{\displaystyle x^{2\ell -1}+1}. But this contradicts our assumption thatp(x){\displaystyle p(x)}does not dividex2ℓ−1+1.{\displaystyle x^{2\ell -1}+1.}Thus,deg⁡(d(x))=0,{\displaystyle \deg(d(x))=0,}proving the lemma. Lemma 2—Ifp(x){\displaystyle p(x)}is a polynomial of periodp{\displaystyle p}, thenp(x)|xk−1{\displaystyle p(x)|x^{k}-1}if and only ifp|k.{\displaystyle p|k.} Ifp|k{\displaystyle p|k}, thenxk−1=(xp−1)(1+xp+x2p+⋯+xk/p){\displaystyle x^{k}-1=(x^{p}-1)(1+x^{p}+x^{2p}+\dots +x^{k/p})}. Thus,p(x)|xk−1.{\displaystyle p(x)|x^{k}-1.} Now supposep(x)|xk−1{\displaystyle p(x)|x^{k}-1}. Then,k⩾p{\displaystyle k\geqslant p}. We show thatk{\displaystyle k}is divisible byp{\displaystyle p}by induction onk{\displaystyle k}. The base casek=p{\displaystyle k=p}follows. Therefore, assumek>p{\displaystyle k>p}. We know thatp(x){\displaystyle p(x)}divides both (since it has periodp{\displaystyle p})xp−1=(x−1)(1+x+⋯+xp−1)andxk−1=(x−1)(1+x+⋯+xk−1).{\displaystyle x^{p}-1=(x-1)\left(1+x+\dots +x^{p-1}\right)\quad {\text{and}}\quad x^{k}-1=(x-1)\left(1+x+\dots +x^{k-1}\right).}Butp(x){\displaystyle p(x)}is irreducible, therefore it must divide both(1+x+⋯+xp−1){\displaystyle (1+x+\dots +x^{p-1})}and(1+x+⋯+xk−1){\displaystyle (1+x+\dots +x^{k-1})}; thus, it also divides the difference of the last two polynomials,xp(1+x+⋯+xp−k−1){\displaystyle x^{p}(1+x+\dots +x^{p-k-1})}. Then, it follows thatp(x){\displaystyle p(x)}divides(1+x+⋯+xp−k−1){\displaystyle (1+x+\cdots +x^{p-k-1})}. Finally, it also divides:xk−p−1=(x−1)(1+x+⋯+xp−k−1){\displaystyle x^{k-p}-1=(x-1)(1+x+\dots +x^{p-k-1})}. By the induction hypothesis,p|k−p{\displaystyle p|k-p}, thenp|k{\displaystyle p|k}. A corollary to Lemma 2 is that sincep(x)=xp−1{\displaystyle p(x)=x^{p}-1}has periodp{\displaystyle p}, thenp(x){\displaystyle p(x)}dividesxk−1{\displaystyle x^{k}-1}if and only ifp|k{\displaystyle p|k}. Theorem—The Fire Code isℓ{\displaystyle \ell }-burst error correcting[4][5] If we can show that all bursts of lengthℓ{\displaystyle \ell }or less occur in differentcosets, we can use them ascoset leadersthat form correctable error patterns. The reason is simple: we know that each coset has a uniquesyndrome decodingassociated with it, and if all bursts of different lengths occur in different cosets, then all have unique syndromes, facilitating error correction. Letxia(x){\displaystyle x^{i}a(x)}andxjb(x){\displaystyle x^{j}b(x)}be polynomials with degreesℓ1−1{\displaystyle \ell _{1}-1}andℓ2−1{\displaystyle \ell _{2}-1}, representing bursts of lengthℓ1{\displaystyle \ell _{1}}andℓ2{\displaystyle \ell _{2}}respectively withℓ1,ℓ2⩽ℓ.{\displaystyle \ell _{1},\ell _{2}\leqslant \ell .}The integersi,j{\displaystyle i,j}represent the starting positions of the bursts, and are less than the block length of the code. For contradiction sake, assume thatxia(x){\displaystyle x^{i}a(x)}andxjb(x){\displaystyle x^{j}b(x)}are in the same coset. Then,v(x)=xia(x)+xjb(x){\displaystyle v(x)=x^{i}a(x)+x^{j}b(x)}is a valid codeword (since both terms are in the same coset).Without loss of generality, picki⩽j{\displaystyle i\leqslant j}. By thedivision theoremwe can write:j−i=g(2ℓ−1)+r,{\displaystyle j-i=g(2\ell -1)+r,}for integersg{\displaystyle g}andr,0⩽r<2ℓ−1{\displaystyle r,0\leqslant r<2\ell -1}. We rewrite the polynomialv(x){\displaystyle v(x)}as follows:v(x)=xia(x)+xi+g(2ℓ−1)+r=xia(x)+xi+g(2ℓ−1)+r+2xi+rb(x)=xi(a(x)+xbb(x))+xi+rb(x)(xg(2ℓ−1)+1){\displaystyle v(x)=x^{i}a(x)+x^{i+g(2\ell -1)+r}=x^{i}a(x)+x^{i+g(2\ell -1)+r}+2x^{i+r}b(x)=x^{i}\left(a(x)+x^{b}b(x)\right)+x^{i+r}b(x)\left(x^{g(2\ell -1)}+1\right)} Notice that at the second manipulation, we introduced the term2xi+rb(x){\displaystyle 2x^{i+r}b(x)}. We are allowed to do so, since Fire Codes operate onF2{\displaystyle \mathbb {F} _{2}}. By our assumption,v(x){\displaystyle v(x)}is a valid codeword, and thus, must be a multiple ofg(x){\displaystyle g(x)}. As mentioned earlier, since the factors ofg(x){\displaystyle g(x)}are relatively prime,v(x){\displaystyle v(x)}has to be divisible byx2ℓ−1+1{\displaystyle x^{2\ell -1}+1}. Looking closely at the last expression derived forv(x){\displaystyle v(x)}we notice thatxg(2ℓ−1)+1{\displaystyle x^{g(2\ell -1)}+1}is divisible byx2ℓ−1+1{\displaystyle x^{2\ell -1}+1}(by the corollary of Lemma 2). Therefore,a(x)+xbb(x){\displaystyle a(x)+x^{b}b(x)}is either divisible byx2ℓ−1+1{\displaystyle x^{2\ell -1}+1}or is0{\displaystyle 0}. Applying the division theorem again, we see that there exists a polynomiald(x){\displaystyle d(x)}with degreeδ{\displaystyle \delta }such that:a(x)+xbb(x)=d(x)(x2ℓ−1+1){\displaystyle a(x)+x^{b}b(x)=d(x)(x^{2\ell -1}+1)} Then we may write:δ+2ℓ−1=deg⁡(d(x)(x2ℓ−1+1))=deg⁡(a(x)+xbb(x))=deg⁡(xbb(x))deg⁡(a(x))=ℓ1−1<2ℓ−1=b+ℓ2−1{\displaystyle {\begin{aligned}\delta +2\ell -1&=\deg \left(d(x)\left(x^{2\ell -1}+1\right)\right)\\&=\deg \left(a(x)+x^{b}b(x)\right)\\&=\deg \left(x^{b}b(x)\right)&&\deg(a(x))=\ell _{1}-1<2\ell -1\\&=b+\ell _{2}-1\end{aligned}}} Equating the degree of both sides, gives usb=2ℓ−ℓ2+δ.{\displaystyle b=2\ell -\ell _{2}+\delta .}Sinceℓ1,ℓ2⩽ℓ{\displaystyle \ell _{1},\ell _{2}\leqslant \ell }we can concludeb⩾ℓ+δ,{\displaystyle b\geqslant \ell +\delta ,}which impliesb>ℓ−1{\displaystyle b>\ell -1}andb>δ{\displaystyle b>\delta }. Notice that in the expansion:a(x)+xbb(x)=1+a1x+a2x2+⋯+xℓ1−1+xb(1+b1x+b2x2+⋯+xℓ2−1).{\displaystyle a(x)+x^{b}b(x)=1+a_{1}x+a_{2}x^{2}+\dots +x^{\ell _{1}-1}+x^{b}\left(1+b_{1}x+b_{2}x^{2}+\dots +x^{\ell _{2}-1}\right).}The termxb{\displaystyle x^{b}}appears, but sinceδ<b<2ℓ−1{\displaystyle \delta <b<2\ell -1}, the resulting expressiond(x)(x2ℓ−1+1){\displaystyle d(x)(x^{2\ell -1}+1)}does not containxb{\displaystyle x^{b}}, therefored(x)=0{\displaystyle d(x)=0}and subsequentlya(x)+xbb(x)=0.{\displaystyle a(x)+x^{b}b(x)=0.}This requires thatb=0{\displaystyle b=0}, anda(x)=b(x){\displaystyle a(x)=b(x)}. We can further revise our division ofj−i{\displaystyle j-i}byg(2ℓ−1){\displaystyle g(2\ell -1)}to reflectb=0,{\displaystyle b=0,}that isj−i=g(2ℓ−1){\displaystyle j-i=g(2\ell -1)}.Substituting back intov(x){\displaystyle v(x)}gives us,v(x)=xib(x)(xj−1+1).{\displaystyle v(x)=x^{i}b(x)\left(x^{j-1}+1\right).} Sincedeg⁡(b(x))=ℓ2−1<ℓ{\displaystyle \deg(b(x))=\ell _{2}-1<\ell }, we havedeg⁡(b(x))<deg⁡(p(x))=m{\displaystyle \deg(b(x))<\deg(p(x))=m}. Butp(x){\displaystyle p(x)}is irreducible, thereforeb(x){\displaystyle b(x)}andp(x){\displaystyle p(x)}must be relatively prime. Sincev(x){\displaystyle v(x)}is a codeword,xj−1+1{\displaystyle x^{j-1}+1}must be divisible byp(x){\displaystyle p(x)}, as it cannot be divisible byx2ℓ−1+1{\displaystyle x^{2\ell -1}+1}. Therefore,j−i{\displaystyle j-i}must be a multiple ofp{\displaystyle p}. But it must also be a multiple of2ℓ−1{\displaystyle 2\ell -1}, which implies it must be a multiple ofn=lcm(2ℓ−1,p){\displaystyle n={\text{lcm}}(2\ell -1,p)}but that is precisely the block-length of the code. Therefore,j−i{\displaystyle j-i}cannot be a multiple ofn{\displaystyle n}since they are both less thann{\displaystyle n}. Thus, our assumption ofv(x){\displaystyle v(x)}being a codeword is incorrect, and thereforexia(x){\displaystyle x^{i}a(x)}andxjb(x){\displaystyle x^{j}b(x)}are in different cosets, with unique syndromes, and therefore correctable. With the theory presented in the above section, consider the construction of a5{\displaystyle 5}-burst error correcting Fire Code. Remember that to construct a Fire Code, we need an irreducible polynomialp(x){\displaystyle p(x)}, an integerℓ{\displaystyle \ell }, representing the burst error correction capability of our code, and we need to satisfy the property that2ℓ−1{\displaystyle 2\ell -1}is not divisible by the period ofp(x){\displaystyle p(x)}. With these requirements in mind, consider the irreducible polynomialp(x)=1+x2+x5{\displaystyle p(x)=1+x^{2}+x^{5}}, and letℓ=5{\displaystyle \ell =5}. Sincep(x){\displaystyle p(x)}is a primitive polynomial, its period is25−1=31{\displaystyle 2^{5}-1=31}. We confirm that2ℓ−1=9{\displaystyle 2\ell -1=9}is not divisible by31{\displaystyle 31}. Thus,g(x)=(x9+1)(1+x2+x5)=1+x2+x5+x9+x11+x14{\displaystyle g(x)=(x^{9}+1)\left(1+x^{2}+x^{5}\right)=1+x^{2}+x^{5}+x^{9}+x^{11}+x^{14}}is a Fire Code generator. We can calculate the block-length of the code by evaluating theleast common multipleofp{\displaystyle p}and2ℓ−1{\displaystyle 2\ell -1}. In other words,n=lcm(9,31)=279{\displaystyle n={\text{lcm}}(9,31)=279}. Thus, the Fire Code above is a cyclic code capable of correcting any burst of length5{\displaystyle 5}or less. Certain families of codes, such asReed–Solomon, operate on alphabet sizes larger than binary. This property awards such codes powerful burst error correction capabilities. Consider a code operating onF2m{\displaystyle \mathbb {F} _{2^{m}}}. Each symbol of the alphabet can be represented bym{\displaystyle m}bits. IfC{\displaystyle C}is an(n,k){\displaystyle (n,k)}Reed–Solomon code overF2m{\displaystyle \mathbb {F} _{2^{m}}}, we can think ofC{\displaystyle C}as an[mn,mk]2{\displaystyle [mn,mk]_{2}}code overF2{\displaystyle \mathbb {F} _{2}}. The reason such codes are powerful for burst error correction is that each symbol is represented bym{\displaystyle m}bits, and in general, it is irrelevant how many of thosem{\displaystyle m}bits are erroneous; whether a single bit, or all of them{\displaystyle m}bits contain errors, from a decoding perspective it is still a single symbol error. In other words, since burst errors tend to occur in clusters, there is a strong possibility of several binary errors contributing to a single symbol error. Notice that a burst of(m+1){\displaystyle (m+1)}errors can affect at most2{\displaystyle 2}symbols, and a burst of2m+1{\displaystyle 2m+1}can affect at most3{\displaystyle 3}symbols. Then, a burst oftm+1{\displaystyle tm+1}can affect at mostt+1{\displaystyle t+1}symbols; this implies that at{\displaystyle t}-symbols-error correcting code can correct a burst of length at most(t−1)m+1{\displaystyle (t-1)m+1}. In general, at{\displaystyle t}-error correcting Reed–Solomon code overF2m{\displaystyle \mathbb {F} _{2^{m}}}can correct any combination oft1+⌊(l+m−2)/m⌋{\displaystyle {\frac {t}{1+\lfloor (l+m-2)/m\rfloor }}}or fewer bursts of lengthl{\displaystyle l}, on top of being able to correctt{\displaystyle t}-random worst case errors. LetG{\displaystyle G}be a[255,223,33]{\displaystyle [255,223,33]}RS code overF28{\displaystyle \mathbb {F} _{2^{8}}}. This code was employed byNASAin theirCassini-Huygensspacecraft.[6]It is capable of correcting⌊33/2⌋=16{\displaystyle \lfloor 33/2\rfloor =16}symbol errors. We now construct a Binary RS CodeG′{\displaystyle G'}fromG{\displaystyle G}. Each symbol will be written using⌈log2⁡(255)⌉=8{\displaystyle \lceil \log _{2}(255)\rceil =8}bits. Therefore, the Binary RS code will have[2040,1784,33]2{\displaystyle [2040,1784,33]_{2}}as its parameters. It is capable of correcting any single burst of lengthl=121{\displaystyle l=121}. Interleaving is used to convert convolutional codes from random error correctors to burst error correctors. The basic idea behind the use of interleaved codes is to jumble symbols at the transmitter. This leads to randomization of bursts of received errors which are closely located and we can then apply the analysis for random channel. Thus, the main function performed by the interleaver at transmitter is to alter the input symbol sequence. At the receiver, the deinterleaver will alter the received sequence to get back the original unaltered sequence at the transmitter. Theorem—If the burst error correcting ability of some code isℓ,{\displaystyle \ell ,}then the burst error correcting ability of itsλ{\displaystyle \lambda }-way interleave isλℓ.{\displaystyle \lambda \ell .} Suppose that we have an(n,k){\displaystyle (n,k)}code that can correct all bursts of length⩽ℓ.{\displaystyle \leqslant \ell .}Interleavingcan provide us with a(λn,λk){\displaystyle (\lambda n,\lambda k)}code that can correct all bursts of length⩽λℓ,{\displaystyle \leqslant \lambda \ell ,}for any givenλ{\displaystyle \lambda }. If we want to encode a message of an arbitrary length using interleaving, first we divide it into blocks of lengthλk{\displaystyle \lambda k}. We write theλk{\displaystyle \lambda k}entries of each block into aλ×k{\displaystyle \lambda \times k}matrix using row-major order. Then, we encode each row using the(n,k){\displaystyle (n,k)}code. What we will get is aλ×n{\displaystyle \lambda \times n}matrix. Now, this matrix is read out and transmitted in column-major order. The trick is that if there occurs a burst of lengthh{\displaystyle h}in the transmitted word, then each row will contain approximatelyhλ{\displaystyle {\tfrac {h}{\lambda }}}consecutive errors (More specifically, each row will contain a burst of length at least⌊hλ⌋{\displaystyle \lfloor {\tfrac {h}{\lambda }}\rfloor }and at most⌈hλ⌉{\displaystyle \lceil {\tfrac {h}{\lambda }}\rceil }). Ifh⩽λℓ,{\displaystyle h\leqslant \lambda \ell ,}thenhλ⩽ℓ{\displaystyle {\tfrac {h}{\lambda }}\leqslant \ell }and the(n,k){\displaystyle (n,k)}code can correct each row. Therefore, the interleaved(λn,λk){\displaystyle (\lambda n,\lambda k)}code can correct the burst of lengthh{\displaystyle h}. Conversely, ifh>λℓ,{\displaystyle h>\lambda \ell ,}then at least one row will contain more thanhλ{\displaystyle {\tfrac {h}{\lambda }}}consecutive errors, and the(n,k){\displaystyle (n,k)}code might fail to correct them. Therefore, the error correcting ability of the interleaved(λn,λk){\displaystyle (\lambda n,\lambda k)}code is exactlyλℓ.{\displaystyle \lambda \ell .}The BEC efficiency of the interleaved code remains the same as the original(n,k){\displaystyle (n,k)}code. This is true because:2λℓλn−λk=2ℓn−k{\displaystyle {\frac {2\lambda \ell }{\lambda n-\lambda k}}={\frac {2\ell }{n-k}}} The figure below shows a 4 by 3 interleaver. The above interleaver is called as ablock interleaver. Here, the input symbols are written sequentially in the rows and the output symbols are obtained by reading the columns sequentially. Thus, this is in the form ofM×N{\displaystyle M\times N}array. Generally,N{\displaystyle N}is length of the codeword. Capacity of block interleaver: For anM×N{\displaystyle M\times N}block interleaver and burst of lengthℓ,{\displaystyle \ell ,}the upper limit on number of errors isℓM.{\displaystyle {\tfrac {\ell }{M}}.}This is obvious from the fact that we are reading the output column wise and the number of rows isM{\displaystyle M}. By the theorem above for error correction capacity up tot,{\displaystyle t,}the maximum burst length allowed isMt.{\displaystyle Mt.}For burst length ofMt+1{\displaystyle Mt+1}, the decoder may fail. Efficiency of block interleaver (γ{\displaystyle \gamma }):It is found by taking ratio of burst length where decoder may fail to the interleaver memory. Thus, we can formulateγ{\displaystyle \gamma }asγ=Mt+1MN≈tN.{\displaystyle \gamma ={\frac {Mt+1}{MN}}\approx {\frac {t}{N}}.} Drawbacks of block interleaver :As it is clear from the figure, the columns are read sequentially, the receiver can interpret single row only after it receives complete message and not before that. Also, the receiver requires a considerable amount of memory in order to store the received symbols and has to store the complete message. Thus, these factors give rise to two drawbacks, one is the latency and other is the storage (fairly large amount of memory). These drawbacks can be avoided by using the convolutional interleaver described below. Cross interleaver is a kind of multiplexer-demultiplexer system. In this system, delay lines are used to progressively increase length. Delay line is basically an electronic circuit used to delay the signal by certain time duration. Letn{\displaystyle n}be the number of delay lines andd{\displaystyle d}be the number of symbols introduced by each delay line. Thus, the separation between consecutive inputs =nd{\displaystyle nd}symbols. Let the length of codeword⩽n.{\displaystyle \leqslant n.}Thus, each symbol in the input codeword will be on distinct delay line. Let a burst error of lengthℓ{\displaystyle \ell }occur. Since the separation between consecutive symbols isnd,{\displaystyle nd,}the number of errors that the deinterleaved output may contain isℓnd+1.{\displaystyle {\tfrac {\ell }{nd+1}}.}By the theorem above, for error correction capacity up tot{\displaystyle t}, maximum burst length allowed is(nd+1)(t−1).{\displaystyle (nd+1)(t-1).}For burst length of(nd+1)(t−1)+1,{\displaystyle (nd+1)(t-1)+1,}decoder may fail. Efficiency of cross interleaver (γ{\displaystyle \gamma }):It is found by taking the ratio of burst length where decoder may fail to the interleaver memory. In this case, the memory of interleaver can be calculated as(0+1+2+3+⋯+(n−1))d=n(n−1)2d.{\displaystyle (0+1+2+3+\cdots +(n-1))d={\frac {n(n-1)}{2}}d.} Thus, we can formulateγ{\displaystyle \gamma }as follows:γ=(nd+1)(t−1)+1n(n−1)2d.{\displaystyle \gamma ={\frac {(nd+1)(t-1)+1}{{\frac {n(n-1)}{2}}d}}.} Performance of cross interleaver :As shown in the above interleaver figure, the output is nothing but the diagonal symbols generated at the end of each delay line. In this case, when the input multiplexer switch completes around half switching, we can read first row at the receiver. Thus, we need to store maximum of around half message at receiver in order to read first row. This drastically brings down the storage requirement by half. Since just half message is now required to read first row, the latency is also reduced by half which is good improvement over the block interleaver. Thus, the total interleaver memory is split between transmitter and receiver. Without error correcting codes, digital audio would not be technically feasible.[7]TheReed–Solomon codescan correct a corrupted symbol with a single bit error just as easily as it can correct a symbol with all bits wrong. This makes the RS codes particularly suitable for correcting burst errors.[5]By far, the most common application of RS codes is in compact discs. In addition to basic error correction provided by RS codes, protection against burst errors due to scratches on the disc is provided by a cross interleaver.[3] Current compact disc digital audio system was developed by N. V. Philips of The Netherlands and Sony Corporation of Japan (agreement signed in 1979). A compact disc comprises a 120 mm aluminized disc coated with a clear plastic coating, with spiral track, approximately 5 km in length, which is optically scanned by a laser of wavelength ~0.8 μm, at a constant speed of ~1.25 m/s. For achieving this constant speed, rotation of the disc is varied from ~8 rev/s while scanning at the inner portion of the track to ~3.5 rev/s at the outer portion. Pits and lands are the depressions (0.12 μm deep) and flat segments constituting the binary data along the track (0.6 μm width).[8] The CD process can be abstracted as a sequence of the following sub-processes: The process is subject to both burst errors and random errors.[7]Burst errors include those due to disc material (defects of aluminum reflecting film, poor reflective index of transparent disc material), disc production (faults during disc forming and disc cutting etc.), disc handling (scratches – generally thin, radial and orthogonal to direction of recording) and variations in play-back mechanism. Random errors include those due to jitter of reconstructed signal wave and interference in signal. CIRC (Cross-Interleaved Reed–Solomon code) is the basis for error detection and correction in the CD process. It corrects error bursts up to 3,500 bits in sequence (2.4 mm in length as seen on CD surface) and compensates for error bursts up to 12,000 bits (8.5 mm) that may be caused by minor scratches. Encoding:Sound-waves are sampled and converted to digital form by an A/D converter. The sound wave is sampled for amplitude (at 44.1 kHz or 44,100 pairs, one each for the left and right channels of the stereo sound). The amplitude at an instance is assigned a binary string of length 16. Thus, each sample produces two binary vectors fromF216{\displaystyle \mathbb {F} _{2}^{16}}or 4F28{\displaystyle \mathbb {F} _{2}^{8}}bytes of data. Every second of sound recorded results in 44,100 × 32 = 1,411,200 bits (176,400 bytes) of data.[5]The 1.41 Mbit/s sampled data stream passes through the error correction system eventually getting converted to a stream of 1.88 Mbit/s. Input for the encoder consists of input frames each of 24 8-bit symbols (12 16-bit samples from the A/D converter, 6 each from left and right data (sound) sources). A frame can be represented byL1R1L2R2…L6R6{\displaystyle L_{1}R_{1}L_{2}R_{2}\ldots L_{6}R_{6}}whereLi{\displaystyle L_{i}}andRi{\displaystyle R_{i}}are bytes from the left and right channels from theith{\displaystyle i^{th}}sample of the frame. Initially, the bytes are permuted to form new frames represented byL1L3L5R1R3R5L2L4L6R2R4R6{\displaystyle L_{1}L_{3}L_{5}R_{1}R_{3}R_{5}L_{2}L_{4}L_{6}R_{2}R_{4}R_{6}}whereLi,Ri{\displaystyle L_{i},R_{i}}representi{\displaystyle i}-th left and right samples from the frame after 2 intervening frames. Next, these 24 message symbols are encoded using C2 (28,24,5) Reed–Solomon code which is a shortened RS code overF256{\displaystyle \mathbb {F} _{256}}. This is two-error-correcting, being of minimum distance 5. This adds 4 bytes of redundancy,P1P2{\displaystyle P_{1}P_{2}}forming a new frame:L1L3L5R1R3R5P1P2L2L4L6R2R4R6{\displaystyle L_{1}L_{3}L_{5}R_{1}R_{3}R_{5}P_{1}P_{2}L_{2}L_{4}L_{6}R_{2}R_{4}R_{6}}. The resulting 28-symbol codeword is passed through a (28.4) cross interleaver leading to 28 interleaved symbols. These are then passed through C1 (32,28,5) RS code, resulting in codewords of 32 coded output symbols. Further regrouping of odd numbered symbols of a codeword with even numbered symbols of the next codeword is done to break up any short bursts that may still be present after the above 4-frame delay interleaving. Thus, for every 24 input symbols there will be 32 output symbols givingR=24/32{\displaystyle R=24/32}. Finally one byte of control and display information is added.[5]Each of the 33 bytes is then converted to 17 bits through EFM (eight to fourteen modulation) and addition of 3 merge bits. Therefore, the frame of six samples results in 33 bytes × 17 bits (561 bits) to which are added 24 synchronization bits and 3 merging bits yielding a total of 588 bits. Decoding:The CD player (CIRC decoder) receives the 32 output symbol data stream. This stream passes through the decoder D1 first. It is up to individual designers of CD systems to decide on decoding methods and optimize their product performance. Being of minimum distance 5 The D1, D2 decoders can each correct a combination ofe{\displaystyle e}errors andf{\displaystyle f}erasures such that2e+f<5{\displaystyle 2e+f<5}.[5]In most decoding solutions, D1 is designed to correct single error. And in case of more than 1 error, this decoder outputs 28 erasures. The deinterleaver at the succeeding stage distributes these erasures across 28 D2 codewords. Again in most solutions, D2 is set to deal with erasures only (a simpler and less expensive solution). If more than 4 erasures were to be encountered, 24 erasures are output by D2. Thereafter, an error concealment system attempts to interpolate (from neighboring symbols) in case of uncorrectable symbols, failing which sounds corresponding to such erroneous symbols get muted. Performance of CIRC:[7]CIRC conceals long bust errors by simple linear interpolation. 2.5 mm of track length (4000 bits) is the maximum completely correctable burst length. 7.7 mm track length (12,300 bits) is the maximum burst length that can be interpolated. Sample interpolation rate is one every 10 hours at Bit Error Rate (BER)=10−4{\displaystyle =10^{-4}}and 1000 samples per minute at BER =10−3{\displaystyle 10^{-3}}Undetectable error samples (clicks): less than one every 750 hours at BER =10−3{\displaystyle 10^{-3}}and negligible at BER =10−4{\displaystyle 10^{-4}}.
https://en.wikipedia.org/wiki/Burst_error-correcting_code
Error correction code memory(ECC memory) is a type ofcomputer data storagethat uses anerror correction code[a](ECC) to detect and correctn-bitdata corruptionwhich occurs in memory. Typically, ECC memory maintains a memory system immune to single-bit errors: the data that is read from eachwordis always the same as the data that had been written to it, even if one of the bits actually stored has been flipped to the wrong state. Most non-ECC memory cannot detect errors, although some non-ECC memory with parity support allows detection but not correction. ECC memory is used in most computers where data corruption cannot be tolerated, like industrial control applications, critical databases, and infrastructural memory caches. Error correction codes protect against undetected data corruption and are used in computers where such corruption is unacceptable, examples being scientific and financial computing applications, or indatabase and file servers. ECC can also reduce the number of crashes in multi-user server applications and maximum-availability systems. Electrical or magnetic interference inside a computer system can cause a single bit ofdynamic random-access memory(DRAM) to spontaneously flip to the opposite state. It was initially thought that this was mainly due toalpha particlesemitted by contaminants in chip packaging material, but research has shown that the majority of one-offsoft errorsin DRAM chips occur as a result ofbackground radiation, chieflyneutronsfromcosmic raysecondaries, which may change the contents of one or morememory cellsor interfere with the circuitry used to read or write to them.[2]Hence, the error rates increase rapidly with rising altitude; for example, compared to sea level, the rate ofneutron fluxis 3.5 times higher at 1.5 km and 300 times higher at 10–12 km (the cruising altitude of commercial airplanes).[3]As a result, systems operating at high altitudes require special provisions for reliability. As an example, the spacecraftCassini–Huygens, launched in 1997, contained two identical flight recorders, each with 2.5 gigabits of memory in the form of arrays of commercial DRAM chips. Due to built-inEDACfunctionality, the spacecraft's engineering telemetry reported the number of (correctable) single-bit-per-word errors and (uncorrectable) double-bit-per-word errors. During the first 2.5 years of flight, the spacecraft reported a nearly constant single-bit error rate of about 280 errors per day. However, on November 6, 1997, during the first month in space, the number of errors increased by more than a factor of four on that single day. This was attributed to asolar particle eventthat had been detected by the satelliteGOES 9.[4] There was some concern that as DRAM density increases further, and thus the components on chips get smaller, while operating voltages continue to fall, DRAM chips will be affected by such radiation more frequently, since lower-energy particles will be able to change a memory cell's state.[3]On the other hand, smaller cells make smaller targets, and moves to technologies such asSOImay make individual cells less susceptible and so counteract, or even reverse, this trend. Recent studies[5]show that single-event upsets due to cosmic radiation have been dropping dramatically with process geometry, and previous concerns over increasing bit cell error rates are unfounded. Work published between 2007 and 2009 showed widely varying error rates with over 7 orders of magnitude difference, ranging from10−10error/(bit·h), roughly one bit error per hour per gigabyte of memory, to10−17error/(bit·h), roughly one bit error per millennium per gigabyte of memory.[5][6][7]A large-scale study based onGoogle's very large number of servers was presented at the SIGMETRICS/Performance '09 conference.[6]The actual error rate found was several orders of magnitude higher than the previous small-scale or laboratory studies, with between 25,000 (2.5×10−11error/(bit·h)) and 70,000 (7.0×10−11error/(bit·h), or 1 bit error per gigabyte of RAM per 1.8 hours) errors per billion device hours per megabit. More than 8% of DIMM memory modules were affected by errors per year. The consequence of a memory error is system-dependent. In systems without ECC, an error can lead either to a crash or to corruption of data; in large-scale production sites, memory errors are one of the most-common hardware causes of machine crashes.[6]Memory errors can cause security vulnerabilities.[6]A memory error can have no consequences if it changes a bit which neither causes observable malfunctioning nor affects data used in calculations or saved. A 2010 simulation study showed that, for a web browser, only a small fraction of memory errors caused data corruption, although, as many memory errors are intermittent and correlated, the effects of memory errors were greater than would be expected for independent soft errors.[8] Some tests conclude that the isolation ofDRAMmemory cells can be circumvented by unintended side effects of specially crafted accesses to adjacent cells. Thus, accessing data stored in DRAM causes memory cells to leak their charges and interact electrically, as a result of high cell density in modern memory, altering the content of nearby memory rows that actually were not addressed in the original memory access. This effect is known asrow hammer, and it has also been used in someprivilege escalationcomputer securityexploits.[9][10] An example of a single-bit error that would be ignored by a system with no error-checking, would halt a machine with parity checking or be invisibly corrected by ECC: a single bit is stuck at 1 due to a faulty chip, or becomes changed to 1 due to background or cosmic radiation; a spreadsheet storing numbers in ASCII format is loaded, and the character "8" (decimal value 56 in the ASCII encoding) is stored in the byte that contains the stuck bit at its lowest bit position; then, a change is made to the spreadsheet and it is saved. As a result, the "8" (0011 1000binary) has silently become a "9" (0011 1001). Several approaches have been developed to deal with unwanted bit-flips, including immunity-aware programming,RAM paritymemory, andECCmemory. This problem can be mitigated by using DRAM modules that include extra memory bits and memory controllers that exploit these bits. These extra bits are used to recordparityor to use anerror-correcting code(ECC). Parity allows the detection of all single-bit errors (actually, any odd number of wrong bits). The most-common error correcting code, asingle-error correction and double-error detection(SECDED)Hamming code, allows a single-bit error to be corrected and (in the usual configuration, with an extra parity bit) double-bit errors to be detected.ChipkillECC is a more effective version that also corrects for multiple bit errors, including the loss of an entire memory chip. Seymour Crayfamously said "parity is for farmers" when asked why he left this out of theCDC 6600.[11]Later,he includedparity in theCDC 7600, which caused pundits to remark that "apparently a lot of farmers buy computers". The originalIBM PCand all PCs until the early 1990s used parity checking.[12]Later ones mostly did not. An ECC-capable memory controller can generally[a]detect and correct errors of a single bit perword[b](the unit ofbustransfer), and detect (but not correct) errors of two bits per word. TheBIOSin some computers, when matched with operating systems such as some versions ofLinux,BSD, andWindows(Windows 2000and later[13]), allows counting of detected and corrected memory errors, in part to help identify failing memory modules before the problem becomes catastrophic. Some DRAM chips include "internal" on-chip error-correction circuits, which allow systems with non-ECC memory controllers to still gain most of the benefits of ECC memory.[14][15]In some systems, a similar effect may be achieved by usingEOS memorymodules. Error detection and correctiondepends on an expectation of the kinds of errors that occur. Implicitly, it is assumed that the failure of each bit in a word of memory is independent, resulting in improbability of two simultaneous errors. This used to be the case when memory chips were one-bit wide, what was typical in the first half of the 1980s; later developments moved many bits into the same chip. This weakness is addressed by various technologies, includingIBM'sChipkill,Sun Microsystems'Extended ECC,Hewlett-Packard'sChipspare, andIntel'sSingle Device Data Correction(SDDC). DRAMmemory may provide increased protection againstsoft errorsby relying on error-correcting codes. Sucherror-correcting memory, known asECCorEDAC-protectedmemory, is particularly desirable for highly fault-tolerant applications, such as servers, as well as deep-space applications due to increasedradiation. Some systems also "scrub" the memory, by periodically reading all addresses and writing back corrected versions if necessary to remove soft errors. Interleavingallows distribution of the effect of a single cosmic ray, potentially upsetting multiple physically neighboring bits across multiple words by associating neighboring bits to different words. As long as asingle-event upset(SEU) does not exceed the error threshold (e.g., a single error) in any particular word between accesses, it can be corrected (e.g., by a single-bit error-correcting code), and an effectively error-free memory system may be maintained.[16] Error-correcting memory controllers traditionally useHamming codes, although some usetriple modular redundancy(TMR). The latter is preferred because its hardware is faster than that of Hamming error-correction scheme.[16]Space satellite systems often use TMR,[17][18][19]although satellite RAM usually uses Hamming error correction.[20] Many early implementations of ECC memory mask correctable errors, acting "as if" the error never occurred, and only report uncorrectable errors. Modern implementations log both correctable errors (CE) and uncorrectable errors (UE). Some people proactively replace memory modules that exhibit high error rates, in order to reduce the likelihood of uncorrectable error events.[21] Many ECC memory systems use an "external" EDAC circuit between the CPU and the memory. A few systems with ECC memory use both internal and external EDAC systems; the external EDAC system should be designed to correct certain errors that the internal EDAC system is unable to correct.[14]Modern desktop and server CPUs integrate the EDAC circuit into the CPU,[22]even before the shift toward CPU-integrated memory controllers, which are related to theNUMAarchitecture. CPU integration enables a zero-penalty EDAC system during error-free operation. As of 2009, the most-common error-correction codes use Hamming or Hsiao codes that provide single-bit error correction and double-bit error detection (SEC-DED). Other error-correction codes have been proposed for protecting memory – double-bit error correcting and triple-bit error detecting (DEC-TED) codes, single-nibble error correcting and double-nibble error detecting (SNC-DND) codes,Reed–Solomon error correctioncodes, etc. However, in practice, multi-bit correction is usually implemented by interleaving multiple SEC-DED codes.[23][24] Early research attempted to minimize the area and delay overheads of ECC circuits. Hamming first demonstrated that SEC-DED codes were possible with one particular check matrix. Hsiao showed that an alternative matrix with odd-weight columns provides SEC-DED capability with less hardware area and shorter delay than traditional Hamming SEC-DED codes.[25]More recent research also attempts to minimize power in addition to minimizing area and delay.[26][27] Many CPUs use error-correction codes in theon-chip cache, including the IntelItanium,Xeon,CoreandPentium(sinceP6 microarchitecture)[28][29]processors, the AMDAthlon,Opteron, allZen-[30]andZen+-based[31]processors (EPYC,EPYC Embedded,RyzenandRyzen Threadripper), and the DEC Alpha 21264.[23][32] As of 2006[update], EDC/ECC and ECC/ECC are the two most-common cache error-protection techniques used in commercial microprocessors. The EDC/ECC technique uses an error-detecting code (EDC) in the level 1 cache. If an error is detected, data is recovered from ECC-protected level 2 cache. The ECC/ECC technique uses an ECC-protected level 1 cache and an ECC-protected level 2 cache.[33]CPUs that use the EDC/ECC technique alwayswrite-throughall STOREs to the level 2 cache, so that when an error is detected during a read from the level 1 data cache, a copy of that data can be recovered from the level 2 cache. Registered, or buffered, memory is not the same as ECC; the technologies perform different functions. It is usual for memory used in servers to be both registered, to allow many memory modules to be used without electrical problems, and ECC, for data integrity. Ultimately, there is a trade-off between protection against unusual loss of data and a higher cost. ECC memory usually[vague]costs more than[when?]non-ECC memory, due to additional hardware required for producing ECC memory modules[citation needed], and due to lower production volumes of ECC memory and associated system hardware[citation needed][when?]. Motherboards,chipsetsand processors that support ECC may also be more expensive[vague]. ECC support varies among motherboard manufacturers, so ECC memory may simply not be recognized by an ECC-incompatible motherboard. Most[vague][when?]motherboardsand processors for less critical applications are not designed to support ECC. Some ECC-enabled boards and processors are able to support unbuffered (unregistered) ECC, but will also work with non-ECC memory; system firmware enables ECC functionality if ECC memory is installed. ECC may lower memory performance by around 2–3 percent on some systems, depending on the application and implementation, due to the additional time needed for ECC memory controllers to perform error checking.[34]However, modern systems integrate ECC testing into the CPU, generating no additional delay to memory accesses as long as no errors are detected.[22][35][36] This is not the case forin-band ECC, which stores tables used for protection in a reserved region of main system memory,[37][38]supported byIntelforChromebooks, which showed little impact onweb browsingand productivity tasks, but caused up to a 25% reduction ingamingandvideo editingbenchmarks.[39] ECC supporting memory may contribute to additional power consumption due to error-correcting circuitry.[citation needed]
https://en.wikipedia.org/wiki/ECC_memory
Link adaptation, comprisingadaptive coding and modulation(ACM) and others (such as Power Control), is a term used inwireless communicationsto denote the matching of themodulation,codingand othersignalandprotocolparameters to the conditions on theradio link(e.g. thepathloss, theinterferencedue to signals coming from other transmitters, the sensitivity of the receiver, the available transmitter power margin, etc.). For example,WiMAXuses a rate adaptation algorithm that adapts the modulation and coding scheme (MCS) according to the quality of the radio channel, and thus the bit rate and robustness of data transmission.[1]The process of link adaptation is a dynamic one and the signal and protocol parameters change as the radio link conditions change—for example inHigh-Speed Downlink Packet Access(HSDPA) inUniversal Mobile Telecommunications System(UMTS) this can take place every 2 ms.[2] Adaptive modulation systems invariably require somechannel state informationat the transmitter. This could be acquired intime-division duplexsystems by assuming the channel from the transmitter to thereceiveris approximately the same as the channel from the receiver to the transmitter. Alternatively, the channel knowledge can also be directly measured at the receiver, and fed back to the transmitter. Adaptive modulation systems improverate of transmission, and/orbit error rates, by exploiting thechannel state informationthat is present at the transmitter. Especially overfading channelswhich modelwirelesspropagation environments, adaptive modulation systems exhibit great performance enhancements compared to systems that do not exploit channel knowledge at the transmitter.[3] In HSDPA link adaptation is performed by: Thus HSDPA adapts to achieve very high bit rates, of the order of 14 megabit/sec, on clear channels using 16-QAM and close to 1/1 coding rate. On noisy channels HSDPA adapts to provide reliable communications using QPSK and 1/3 coding rate but the information bit rate drops to about 2.4 megabit/sec. This adaptation is performed up to 500 times per second.
https://en.wikipedia.org/wiki/Link_adaptation
Analgorithmis fundamentally a set of rules or defined procedures that is typically designed and used to solve a specific problem or a broad set of problems. Broadly, algorithms define process(es), sets of rules, or methodologies that are to be followed in calculations, data processing, data mining, pattern recognition, automated reasoning or other problem-solving operations. With the increasing automation of services, more and more decisions are being made by algorithms. Some general examples are; risk assessments, anticipatory policing, and pattern recognition technology.[1] The following is alist of well-known algorithmsalong with one-line descriptions for each. HybridAlgorithms
https://en.wikipedia.org/wiki/List_of_algorithms#Error_detection_and_correction
Incoding theory,Hamming(7,4)is alinear error-correcting codethat encodes fourbitsof data into seven bits by adding threeparity bits. It is a member of a larger family ofHamming codes, but the termHamming codeoften refers to this specific code thatRichard W. Hammingintroduced in 1950. At the time, Hamming worked atBell Telephone Laboratoriesand was frustrated with the error-pronepunched cardreader, which is why he started working on error-correcting codes.[1] The Hamming code adds three additional check bits to every four data bits of the message. Hamming's (7,4)algorithmcan correct any single-bit error, or detect all single-bit and two-bit errors. In other words, the minimalHamming distancebetween any two correct codewords is 3, and received words can be correctly decoded if they are at a distance of at most one from the codeword that was transmitted by the sender. This means that for transmission medium situations whereburst errorsdo not occur, Hamming's (7,4) code is effective (as the medium would have to be extremely noisy for two out of seven bits to be flipped). Inquantum information, the Hamming (7,4) is used as the base for theSteane code, a type ofCSS codeused forquantum error correction. The goal of the Hamming codes is to create a set ofparity bitsthat overlap so that a single-bit error in a data bitora parity bit can be detected and corrected. While multiple overlaps can be created, the general method is presented inHamming codes. This table describes which parity bits cover which transmitted bits in the encoded word. For example,p2provides an even parity for bits 2, 3, 6, and 7. It also details which transmitted bit is covered by which parity bit by reading the column. For example,d1is covered byp1andp2but notp3This table will have a striking resemblance to the parity-check matrix (H) in the next section. Furthermore, if the parity columns in the above table were removed then resemblance to rows 1, 2, and 4 of the code generator matrix (G) below will also be evident. So, by picking the parity bit coverage correctly, all errors with a Hamming distance of 1 can be detected and corrected, which is the point of using a Hamming code. Hamming codes can be computed inlinear algebraterms throughmatricesbecause Hamming codes arelinear codes. For the purposes of Hamming codes, twoHamming matricescan be defined: thecodegenerator matrixGand theparity-check matrixH: As mentioned above, rows 1, 2, and 4 ofGshould look familiar as they map the data bits to their parity bits: The remaining rows (3, 5, 6, 7) map the data to their position in encoded form and there is only 1 in that row so it is an identical copy. In fact, these four rows arelinearly independentand form theidentity matrix(by design, not coincidence). Also as mentioned above, the three rows ofHshould be familiar. These rows are used to compute thesyndrome vectorat the receiving end and if the syndrome vector is thenull vector(all zeros) then the received word is error-free; if non-zero then the value indicates which bit has been flipped. The four data bits — assembled as a vectorp— is pre-multiplied byG(i.e.,GTp{\displaystyle G^{T}p}) and takenmodulo2 to yield the encoded value that is transmitted. The original 4 data bits are converted to seven bits (hence the name "Hamming(7,4)") with three parity bits added to ensure even parity using the above data bit coverages. The first table above shows the mapping between each data and parity bit into its final bit position (1 through 7) but this can also be presented in aVenn diagram. The first diagram in this article shows three circles (one for each parity bit) and encloses data bits that each parity bit covers. The second diagram (shown to the right) is identical but, instead, the bit positions are marked. For the remainder of this section, the following 4 bits (shown as a column vector) will be used as a running example: Suppose we want to transmit this data (1011) over anoisycommunications channel. Specifically, abinary symmetric channelmeaning that error corruption does not favor either zero or one (it is symmetric in causing errors). Furthermore, all source vectors are assumed to be equiprobable. We take the product ofGandp, with entries modulo 2, to determine the transmitted codewordx: This means that0110011would be transmitted instead of transmitting1011. Programmers concerned about multiplication should observe that each row of the result is the least significant bit of thePopulation Countof set bits resulting from the row and column beingBitwise ANDedtogether rather than multiplied. In the adjacent diagram, the seven bits of the encoded word are inserted into their respective locations; from inspection it is clear that the parity of the red, green, and blue circles are even: What will be shown shortly is that if, during transmission, a bit is flipped then the parity of two or all three circles will be incorrect and the errored bit can be determined (even if one of the parity bits) by knowing that the parity of all three of these circles should be even. If no error occurs during transmission, then the received codewordris identical to the transmitted codewordx: The receiver multipliesHandrto obtain thesyndromevectorz, which indicates whether an error has occurred, and if so, for which codeword bit. Performing this multiplication (again, entries modulo 2): Since the syndromezis thenull vector, the receiver can conclude that no error has occurred. This conclusion is based on the observation that when the data vector is multiplied byG, achange of basisoccurs into a vector subspace that is thekernelofH. As long as nothing happens during transmission,rwill remain in the kernel ofHand the multiplication will yield the null vector. Otherwise, suppose, we can write modulo 2, whereeiis theith{\displaystyle i_{th}}unit vector, that is, a zero vector with a 1 in theith{\displaystyle i^{th}}, counting from 1. Thus the above expression signifies a single bit error in theith{\displaystyle i^{th}}place. Now, if we multiply this vector byH: Sincexis the transmitted data, it is without error, and as a result, the product ofHandxis zero. Thus Now, the product ofHwith theith{\displaystyle i^{th}}standard basisvector picks out that column ofH, we know the error occurs in the place where this column ofHoccurs. For example, suppose we have introduced a bit error on bit #5 The diagram to the right shows the bit error (shown in blue text) and the bad parity created (shown in red text) in the red and green circles. The bit error can be detected by computing the parity of the red, green, and blue circles. If a bad parity is detected then the data bit that overlapsonlythe bad parity circles is the bit with the error. In the above example, the red and green circles have bad parity so the bit corresponding to the intersection of red and green but not blue indicates the errored bit. Now, which corresponds to the fifth column ofH. Furthermore, the general algorithm used (seeHamming code#General algorithm) was intentional in its construction so that the syndrome of 101 corresponds to the binary value of 5, which indicates the fifth bit was corrupted. Thus, an error has been detected in bit 5, and can be corrected (simply flip or negate its value): This corrected received value indeed, now, matches the transmitted valuexfrom above. Once the received vector has been determined to be error-free or corrected if an error occurred (assuming only zero or one bit errors are possible) then the received data needs to be decoded back into the original four bits. First, define a matrixR: Then the received value,pr, is equal toRr. Using the running example from above It is not difficult to show that only single bit errors can be corrected using this scheme. Alternatively, Hamming codes can be used to detect single and double bit errors, by merely noting that the product ofHis nonzero whenever errors have occurred. In the adjacent diagram, bits 4 and 5 were flipped. This yields only one circle (green) with an invalid parity but the errors are not recoverable. However, the Hamming (7,4) and similar Hamming codes cannot distinguish between single-bit errors and two-bit errors. That is, two-bit errors appear the same as one-bit errors. If error correction is performed on a two-bit error the result will be incorrect. Similarly, Hamming codes cannot detect or recover from an arbitrary three-bit error; Consider the diagram: if the bit in the green circle (colored red) were 1, the parity checking would return the null vector, indicating that there is no error in the codeword. Since the source is only 4 bits then there are only 16 possible transmitted words. Included is the eight-bit value if an extra parity bit is used (seeHamming(7,4) code with an additional parity bit). (The data bits are shown in blue; the parity bits are shown in red; and the extra parity bit shown in green.) The Hamming(7,4) code is closely related to theE7latticeand, in fact, can be used to construct it, or more precisely, its dual lattice E7∗(a similar construction for E7uses thedual code[7,3,4]2). In particular, taking the set of all vectorsxinZ7withxcongruent (modulo 2) to a codeword of Hamming(7,4), and rescaling by 1/√2, gives the lattice E7∗ This is a particular instance of a more general relation between lattices and codes. For instance, the extended (8,4)-Hamming code, which arises from the addition of a parity bit, is also related to theE8lattice.[2]
https://en.wikipedia.org/wiki/Hamming_code_(7,4)
Incoding theory,decodingis the process of translating received messages intocodewordsof a givencode. There have been many common methods of mapping messages to codewords. These are often used to recover messages sent over anoisy channel, such as abinary symmetric channel. C⊂F2n{\displaystyle C\subset \mathbb {F} _{2}^{n}}is considered abinary codewith the lengthn{\displaystyle n};x,y{\displaystyle x,y}shall be elements ofF2n{\displaystyle \mathbb {F} _{2}^{n}}; andd(x,y){\displaystyle d(x,y)}is the distance between those elements. One may be given the messagex∈F2n{\displaystyle x\in \mathbb {F} _{2}^{n}}, thenideal observer decodinggenerates the codewordy∈C{\displaystyle y\in C}. The process results in this solution: For example, a person can choose the codewordy{\displaystyle y}that is most likely to be received as the messagex{\displaystyle x}after transmission. Each codeword does not have an expected possibility: there may be more than one codeword with an equal likelihood of mutating into the received message. In such a case, the sender and receiver(s) must agree ahead of time on a decoding convention. Popular conventions include: Given a received vectorx∈F2n{\displaystyle x\in \mathbb {F} _{2}^{n}}maximum likelihooddecodingpicks a codewordy∈C{\displaystyle y\in C}thatmaximizes that is, the codewordy{\displaystyle y}that maximizes the probability thatx{\displaystyle x}was received,given thaty{\displaystyle y}was sent. If all codewords are equally likely to be sent then this scheme is equivalent to ideal observer decoding. In fact, byBayes' theorem, Upon fixingP(xreceived){\displaystyle \mathbb {P} (x{\mbox{ received}})},x{\displaystyle x}is restructured andP(ysent){\displaystyle \mathbb {P} (y{\mbox{ sent}})}is constant as all codewords are equally likely to be sent. Therefore,P(xreceived∣ysent){\displaystyle \mathbb {P} (x{\mbox{ received}}\mid y{\mbox{ sent}})}is maximised as a function of the variabley{\displaystyle y}precisely whenP(ysent∣xreceived){\displaystyle \mathbb {P} (y{\mbox{ sent}}\mid x{\mbox{ received}})}is maximised, and the claim follows. As with ideal observer decoding, a convention must be agreed to for non-unique decoding. The maximum likelihood decoding problem can also be modeled as aninteger programmingproblem.[1] The maximum likelihood decoding algorithm is an instance of the "marginalize a product function" problem which is solved by applying thegeneralized distributive law.[2] Given a received codewordx∈F2n{\displaystyle x\in \mathbb {F} _{2}^{n}},minimum distance decodingpicks a codewordy∈C{\displaystyle y\in C}to minimise theHamming distance: i.e. choose the codewordy{\displaystyle y}that is as close as possible tox{\displaystyle x}. Note that if the probability of error on adiscrete memoryless channelp{\displaystyle p}is strictly less than one half, thenminimum distance decodingis equivalent tomaximum likelihood decoding, since if then: which (sincepis less than one half) is maximised by minimisingd. Minimum distance decoding is also known asnearest neighbour decoding. It can be assisted or automated by using astandard array. Minimum distance decoding is a reasonable decoding method when the following conditions are met: These assumptions may be reasonable for transmissions over abinary symmetric channel. They may be unreasonable for other media, such as a DVD, where a single scratch on the disk can cause an error in many neighbouring symbols or codewords. As with other decoding methods, a convention must be agreed to for non-unique decoding. Syndrome decodingis a highly efficient method of decoding alinear codeover anoisy channel, i.e. one on which errors are made. In essence, syndrome decoding isminimum distance decodingusing a reduced lookup table. This is allowed by the linearity of the code.[3] Suppose thatC⊂F2n{\displaystyle C\subset \mathbb {F} _{2}^{n}}is a linear code of lengthn{\displaystyle n}and minimum distanced{\displaystyle d}withparity-check matrixH{\displaystyle H}. Then clearlyC{\displaystyle C}is capable of correcting up to errors made by the channel (since if no more thant{\displaystyle t}errors are made then minimum distance decoding will still correctly decode the incorrectly transmitted codeword). Now suppose that a codewordx∈F2n{\displaystyle x\in \mathbb {F} _{2}^{n}}is sent over the channel and the error patterne∈F2n{\displaystyle e\in \mathbb {F} _{2}^{n}}occurs. Thenz=x+e{\displaystyle z=x+e}is received. Ordinary minimum distance decoding would lookup the vectorz{\displaystyle z}in a table of size|C|{\displaystyle |C|}for the nearest match - i.e. an element (not necessarily unique)c∈C{\displaystyle c\in C}with for ally∈C{\displaystyle y\in C}. Syndrome decoding takes advantage of the property of the parity matrix that: for allx∈C{\displaystyle x\in C}. Thesyndromeof the receivedz=x+e{\displaystyle z=x+e}is defined to be: To performML decodingin abinary symmetric channel, one has to look-up a precomputed table of size2n−k{\displaystyle 2^{n-k}}, mappingHe{\displaystyle He}toe{\displaystyle e}. Note that this is already of significantly less complexity than that of astandard array decoding. However, under the assumption that no more thant{\displaystyle t}errors were made during transmission, the receiver can look up the valueHe{\displaystyle He}in a further reduced table of size This is a family ofLas Vegas-probabilistic methods all based on the observation that it is easier to guess enough error-free positions, than it is to guess all the error-positions. The simplest form is due to Prange: LetG{\displaystyle G}be thek×n{\displaystyle k\times n}generator matrix ofC{\displaystyle C}used for encoding. Selectk{\displaystyle k}columns ofG{\displaystyle G}at random, and denote byG′{\displaystyle G'}the corresponding submatrix ofG{\displaystyle G}. With reasonable probabilityG′{\displaystyle G'}will have full rank, which means that if we letc′{\displaystyle c'}be the sub-vector for the corresponding positions of any codewordc=mG{\displaystyle c=mG}ofC{\displaystyle C}for a messagem{\displaystyle m}, we can recoverm{\displaystyle m}asm=c′G′−1{\displaystyle m=c'G'^{-1}}. Hence, if we were lucky that thesek{\displaystyle k}positions of the received wordy{\displaystyle y}contained no errors, and hence equalled the positions of the sent codeword, then we may decode. Ift{\displaystyle t}errors occurred, the probability of such a fortunate selection of columns is given by(n−tk)/(nk){\displaystyle \textstyle {\binom {n-t}{k}}/{\binom {n}{k}}}. This method has been improved in various ways, e.g. by Stern[4]andCanteautand Sendrier.[5] Partial response maximum likelihood (PRML) is a method for converting the weak analog signal from the head of a magnetic disk or tape drive into a digital signal. A Viterbi decoder uses the Viterbi algorithm for decoding a bitstream that has been encoded usingforward error correctionbased on a convolutional code. TheHamming distanceis used as a metric for hard decision Viterbi decoders. ThesquaredEuclidean distanceis used as a metric for soft decision decoders. Optimal decision decoding algorithm (ODDA) for an asymmetric TWRC system.[clarification needed][6]
https://en.wikipedia.org/wiki/Decoding_methods
Inversive congruential generatorsare a type of nonlinear congruentialpseudorandom number generator, which use themodular multiplicative inverse(if it exists) to generate the next number in a sequence. The standard formula for an inversive congruential generator, modulo some primeqis: Such a generator is denoted symbolically asICG(q,a,c,seed)and is said to be an ICG with parametersq,a,cand seedseed. The sequence(xn)n≥0{\displaystyle (x_{n})_{n\geq 0}}must havexi=xj{\displaystyle x_{i}=x_{j}}after finitely many steps, and since the next element depends only on its direct predecessor, alsoxi+1=xj+1{\displaystyle x_{i+1}=x_{j+1}}etc. The maximum possibleperiodfor the modulusqisqitself, i.e. the sequence includes every value from 0 toq− 1 before repeating. A sufficient condition for the sequence to have the maximum possible period is to chooseaandcsuch that thepolynomialf(x)=x2−cx−a∈Fq[x]{\displaystyle f(x)=x^{2}-cx-a\in \mathbb {F} _{q}[x]}(polynomial ring overFq{\displaystyle \mathbb {F} _{q}}) isprimitive. This is not a necessary condition; there are choices ofq,aandcfor whichf(x){\displaystyle f(x)}is not primitive, but the sequence nevertheless has a period ofq. Any polynomial, primitive or not, that leads to a maximal-period sequence is called an inversive maximal-period (IMP) polynomial. Chou describes analgorithmfor choosing the parametersaandcto get such polynomials.[1] Eichenauer-Herrmann, Lehn, Grothe andNiederreiterhave shown that inversive congruential generators have good uniformity properties, in particular with regard to lattice structure and serial correlations. ICG(5, 2, 3, 1) gives the sequence 1, 0, 3, 2, 4, 1, 0, 3, 2, 4, 1, 0, ... In this example,f(x)=x2−3x−2{\displaystyle f(x)=x^{2}-3x-2}is irreducible inF5[x]{\displaystyle \mathbb {F} _{5}[x]}, as none of 0, 1, 2, 3 or 4 is a root. It can also be verified thatxis aprimitive elementofF5[x]/(f){\displaystyle \mathbb {F} _{5}[x]/(f)}and hencefis primitive. The construction of acompound inversive generator(CIG) relies on combining two or more inversive congruential generators according to the method described below. Letp1,…,pr{\displaystyle p_{1},\dots ,p_{r}}be distinct prime integers, eachpj≥5{\displaystyle p_{j}\geq 5}. For each indexj,1≤j≤r, let(xn)n≥0{\displaystyle (x_{n})_{n\geq 0}}be a sequence of elements ofFpj{\displaystyle \mathbb {F} _{p_{j}}}periodic with period lengthpj{\displaystyle p_{j}}. In other words,{xn(j)∣0≤n≤pj}∈Fpj{\displaystyle \{x_{n}^{(j)}\mid 0\leq n\leq p_{j}\}\in \mathbb {F} _{p_{j}}}. For each indexj, 1 ≤j≤ r, we considerTj=T/pj{\displaystyle T_{j}=T/p_{j}}, whereT=p1⋯pr{\displaystyle T=p_{1}\cdots p_{r}}is the period length of the following sequence(xn)n≥0{\displaystyle (x_{n})_{n\geq 0}}. The sequence(xn)n≥0{\displaystyle (x_{n})_{n\geq 0}}of compound pseudorandom numbers is defined as the sum The compound approach allows combining inversive congruential generators, provided they have full period, in parallel generation systems. The CIG are accepted for practical purposes for a number of reasons. Firstly, binary sequences produced in this way are free of undesirable statistical deviations. Inversive sequences extensively tested with variety of statistical tests remain stable under the variation of parameter.[2][3][4] Secondly, there exists a steady and simple way of parameter choice, based on the Chou algorithm[1]that guarantees maximum period length. Thirdly, compound approach has the same properties as single inversive generators,[5][6]but it also provides period length significantly greater than obtained by a single inversive congruential generator. They seem to be designed for application with multiprocessor parallel hardware platforms. There exists an algorithm[7]that allows designing compound generators with predictable period length, predictable linear complexity level, with excellent statistical properties of produced bit streams. The procedure of designing this complex structure starts with defining finite field ofpelements and ends with choosing the parametersaandcfor each inversive congruential generator being the component of the compound generator. It means that each generator is associated to a fixed IMP polynomial. Such a condition is sufficient for maximum period of each inversive congruential generator[8]and finally for maximum period of the compound generator. The construction of IMP polynomials is the most efficient approach to find parameters for inversive congruential generator with maximum period length. Equidistribution and statistical independence properties of the generated sequences, which are very important for their usability in astochastic simulation, can be analyzed based on thediscrepancyofs-tuples of successive pseudorandom numbers withs=1{\displaystyle s=1}ands=2{\displaystyle s=2}respectively. The discrepancy computes the distance of a generator from a uniform one. A low discrepancy means that the sequence generated can be used forcryptographicpurposes, and the first aim of the inversive congruential generator is to provide pseudorandom numbers. ForNarbitrary pointst1,…,tN−1∈[0,1){\displaystyle {\mathbf {t} }_{1},\dots ,{\mathbf {t} }_{N-1}\in [0,1)}the discrepancy is defined byDN(t1,…,tN−1)=supJ|FN(J)−V(J)|{\displaystyle D_{N}({\mathbf {t} }_{1},\dots ,{\mathbf {t} }_{N-1})={\rm {sup}}_{J}|F_{N}(J)-V(J)|}, where the supremum is extended over all subintervalsJof[0,1)s{\displaystyle [0,1)^{s}},FN(J){\displaystyle F_{N}(J)}isN−1{\displaystyle N^{-1}}times the number of points amongt1,…,tN−1{\displaystyle {\mathbf {t} }_{1},\dots ,{\mathbf {t} }_{N-1}}falling intoJand⁠V(J){\displaystyle V(J)}⁠denotes thes-dimensional volume ofJ. Until now, we had sequences of integers from 0 to⁠T−1{\displaystyle T-1}⁠, in order to have sequences of[0,1)s{\displaystyle [0,1)^{s}}, one can divide a sequences of integers by its periodT. From this definition, we can say that if the sequencet1,…,tN−1{\displaystyle {\mathbf {t} }_{1},\dots ,{\mathbf {t} }_{N-1}}is perfectly random then its well distributed on the intervalJ=[0,1)s{\displaystyle J=[0,1)^{s}}thenV(J)=1{\displaystyle V(J)=1}and all points are inJsoFN(J)=N/N=1{\displaystyle F_{N}(J)=N/N=1}henceDN(t1,…,tN−1)=0{\displaystyle D_{N}({\mathbf {t} }_{1},\dots ,{\mathbf {t} }_{N-1})=0}but instead if the sequence is concentrated close to one point then the subintervalJis very smallV(j)≈0{\displaystyle V(j)\approx 0}andFN(j)≈N/N≈1{\displaystyle F_{N}(j)\approx N/N\approx 1}soDN(t1,…,tN−1)=1{\displaystyle D_{N}({\mathbf {t} }_{1},\dots ,{\mathbf {t} }_{N-1})=1}Then we have from the better and worst case: Some further notation is necessary. For integersk≥1{\displaystyle k\geq 1}andq≥2{\displaystyle q\geq 2}letCk(q){\displaystyle C_{k}(q)}be the set of nonzero lattice points(h1,…,hk)∈Zk{\displaystyle (h_{1},\dots ,h_{k})\in Z^{k}}with−q/2<hj<q/2{\displaystyle -q/2<h_{j}<q/2}for1≤j≤k{\displaystyle 1\leq j\leq k}. Define and forh=(h1,…,hk)∈Ck(q){\displaystyle {\mathbf {h} }=(h_{1},\dots ,h_{k})\in C_{k}(q)}. For realt{\displaystyle t}the abbreviatione(t)=exp(2π⋅it){\displaystyle e(t)={\rm {exp}}(2\pi \cdot it)}is used, andu⋅v{\displaystyle u\cdot v}stands for the standard inner product ofu,v{\displaystyle u,v}inRk{\displaystyle R^{k}}. LetN≥1{\displaystyle N\geq 1}andq≥2{\displaystyle q\geq 2}be integers. Lettn=yn/q∈[0,1)k{\displaystyle {\mathbf {t} }_{n}=y_{n}/q\in [0,1)^{k}}withyn∈{0,1,…,q−1}k{\displaystyle y_{n}\in \{0,1,\dots ,q-1\}^{k}}for0≤n<N{\displaystyle 0\leq n<N}. Then the discrepancy of the pointst0,…,tN−1{\displaystyle {\mathbf {t} }_{0},\dots ,{\mathbf {t} }_{N-1}}satisfies The discrepancy ofN{\displaystyle N}arbitrary pointst1,…,tN−1∈[0,1)k{\displaystyle \mathbf {t} _{1},\dots ,\mathbf {t} _{N-1}\in [0,1)^{k}}satisfies for any nonzero lattice pointh=(h1,…,hk)∈Zk{\displaystyle {\mathbf {h} }=(h_{1},\dots ,h_{k})\in Z^{k}}, wherel{\displaystyle l}denotes the number of nonzero coordinates ofh{\displaystyle {\mathbf {h} }}. These two theorems show that the CIG is not perfect because the discrepancy is greater strictly than a positive value but also the CIG is not the worst generator as the discrepancy is lower than a value less than 1. There exist also theorems which bound the average value of the discrepancy for Compound Inversive Generators and also ones which take values such that the discrepancy is bounded by some value depending on the parameters. For more details see the original paper.[9]
https://en.wikipedia.org/wiki/Inversive_congruential_generator
Incoding theory, theBose–Chaudhuri–Hocquenghem codes(BCH codes) form a class ofcyclicerror-correcting codesthat are constructed usingpolynomialsover afinite field(also called aGalois field). BCH codes were invented in 1959 by French mathematicianAlexis Hocquenghem, and independently in 1960 byRaj Chandra BoseandD. K. Ray-Chaudhuri.[1][2][3]The nameBose–Chaudhuri–Hocquenghem(and the acronymBCH) arises from the initials of the inventors' surnames (mistakenly, in the case of Ray-Chaudhuri). One of the key features of BCH codes is that during code design, there is a precise control over the number of symbol errors correctable by the code. In particular, it is possible to design binary BCH codes that can correct multiple bit errors. Another advantage of BCH codes is the ease with which they can be decoded, namely, via analgebraicmethod known assyndrome decoding. This simplifies the design of the decoder for these codes, using small low-power electronic hardware. BCH codes are used in applications such as satellite communications,[4]compact discplayers,DVDs,disk drives,USB flash drives,solid-state drives,[5]andtwo-dimensional bar codes. Given aprime numberqandprime powerqmwith positive integersmanddsuch thatd≤qm− 1, a primitive narrow-sense BCH code over thefinite field(or Galois field)GF(q)with code lengthn=qm− 1anddistanceat leastdis constructed by the following method. Letαbe aprimitive elementofGF(qm). For any positive integeri, letmi(x)be theminimal polynomialwith coefficients inGF(q)ofαi. Thegenerator polynomialof the BCH code is defined as theleast common multipleg(x) = lcm(m1(x),…,md− 1(x)). It can be seen thatg(x)is a polynomial with coefficients inGF(q)and dividesxn− 1. Therefore, thepolynomial codedefined byg(x)is a cyclic code. Letq= 2andm= 4(thereforen= 15). We will consider different values ofdforGF(16) = GF(24)based on the reducing polynomialz4+z+ 1, using primitive elementα(z) =z. There are fourteen minimum polynomialsmi(x)with coefficients inGF(2)satisfying The minimal polynomials are The BCH code withd=2,3{\displaystyle d=2,3}has the generator polynomial It has minimalHamming distanceat least 3 and corrects up to one error. Since the generator polynomial is of degree 4, this code has 11 data bits and 4 checksum bits. It is also denoted as:(15, 11) BCHcode. The BCH code withd=4,5{\displaystyle d=4,5}has the generator polynomial It has minimal Hamming distance at least 5 and corrects up to two errors. Since the generator polynomial is of degree 8, this code has 7 data bits and 8 checksum bits. It is also denoted as:(15, 7) BCHcode. The BCH code withd=6,7{\displaystyle d=6,7}has the generator polynomial It has minimal Hamming distance at least 7 and corrects up to three errors. Since the generator polynomial is of degree 10, this code has 5 data bits and 10 checksum bits. It is also denoted as:(15, 5) BCHcode. (This particular generator polynomial has a real-world application, in the "format information" of theQR code.) The BCH code withd=8{\displaystyle d=8}and higher has the generator polynomial This code has minimal Hamming distance 15 and corrects 7 errors. It has 1 data bit and 14 checksum bits. It is also denoted as:(15, 1) BCHcode. In fact, this code has only two codewords: 000000000000000 and 111111111111111 (a trivialrepetition code). General BCH codes differ from primitive narrow-sense BCH codes in two respects. First, the requirement thatα{\displaystyle \alpha }be a primitive element ofGF(qm){\displaystyle \mathrm {GF} (q^{m})}can be relaxed. By relaxing this requirement, the code length changes fromqm−1{\displaystyle q^{m}-1}toord(α),{\displaystyle \mathrm {ord} (\alpha ),}theorderof the elementα.{\displaystyle \alpha .} Second, the consecutive roots of the generator polynomial may run fromαc,…,αc+d−2{\displaystyle \alpha ^{c},\ldots ,\alpha ^{c+d-2}}instead ofα,…,αd−1.{\displaystyle \alpha ,\ldots ,\alpha ^{d-1}.} Definition.Fix a finite fieldGF(q),{\displaystyle GF(q),}whereq{\displaystyle q}is a prime power. Choose positive integersm,n,d,c{\displaystyle m,n,d,c}such that2≤d≤n,{\displaystyle 2\leq d\leq n,}gcd(n,q)=1,{\displaystyle {\rm {gcd}}(n,q)=1,}andm{\displaystyle m}is themultiplicative orderofq{\displaystyle q}modulon.{\displaystyle n.} As before, letα{\displaystyle \alpha }be aprimitiven{\displaystyle n}th root of unityinGF(qm),{\displaystyle GF(q^{m}),}and letmi(x){\displaystyle m_{i}(x)}be theminimal polynomialoverGF(q){\displaystyle GF(q)}ofαi{\displaystyle \alpha ^{i}}for alli.{\displaystyle i.}The generator polynomial of the BCH code is defined as theleast common multipleg(x)=lcm(mc(x),…,mc+d−2(x)).{\displaystyle g(x)={\rm {lcm}}(m_{c}(x),\ldots ,m_{c+d-2}(x)).} Note:ifn=qm−1{\displaystyle n=q^{m}-1}as in the simplified definition, thengcd(n,q){\displaystyle {\rm {gcd}}(n,q)}is 1, and the order ofq{\displaystyle q}modulon{\displaystyle n}ism.{\displaystyle m.}Therefore, the simplified definition is indeed a special case of the general one. The generator polynomialg(x){\displaystyle g(x)}of a BCH code has coefficients fromGF(q).{\displaystyle \mathrm {GF} (q).}In general, a cyclic code overGF(qp){\displaystyle \mathrm {GF} (q^{p})}withg(x){\displaystyle g(x)}as the generator polynomial is called a BCH code overGF(qp).{\displaystyle \mathrm {GF} (q^{p}).}The BCH code overGF(qm){\displaystyle \mathrm {GF} (q^{m})}and generator polynomialg(x){\displaystyle g(x)}with successive powers ofα{\displaystyle \alpha }as roots is one type ofReed–Solomon codewhere the decoder (syndromes) alphabet is the same as the channel (data and generator polynomial) alphabet, all elements ofGF(qm){\displaystyle \mathrm {GF} (q^{m})}.[6]The other type of Reed Solomon code is anoriginal view Reed Solomon codewhich is not a BCH code. The generator polynomial of a BCH code has degree at most(d−1)m{\displaystyle (d-1)m}. Moreover, ifq=2{\displaystyle q=2}andc=1{\displaystyle c=1}, the generator polynomial has degree at mostdm/2{\displaystyle dm/2}. Each minimal polynomialmi(x){\displaystyle m_{i}(x)}has degree at mostm{\displaystyle m}. Therefore, the least common multiple ofd−1{\displaystyle d-1}of them has degree at most(d−1)m{\displaystyle (d-1)m}. Moreover, ifq=2,{\displaystyle q=2,}thenmi(x)=m2i(x){\displaystyle m_{i}(x)=m_{2i}(x)}for alli{\displaystyle i}. Therefore,g(x){\displaystyle g(x)}is the least common multiple of at mostd/2{\displaystyle d/2}minimal polynomialsmi(x){\displaystyle m_{i}(x)}for odd indicesi,{\displaystyle i,}each of degree at mostm{\displaystyle m}. A BCH code has minimal Hamming distance at leastd{\displaystyle d}. Suppose thatp(x){\displaystyle p(x)}is a code word with fewer thand{\displaystyle d}non-zero terms. Then Recall thatαc,…,αc+d−2{\displaystyle \alpha ^{c},\ldots ,\alpha ^{c+d-2}}are roots ofg(x),{\displaystyle g(x),}hence ofp(x){\displaystyle p(x)}. This implies thatb1,…,bd−1{\displaystyle b_{1},\ldots ,b_{d-1}}satisfy the following equations, for eachi∈{c,…,c+d−2}{\displaystyle i\in \{c,\dotsc ,c+d-2\}}: In matrix form, we have The determinant of this matrix equals The matrixV{\displaystyle V}is seen to be aVandermonde matrix, and its determinant is which is non-zero. It therefore follows thatb1,…,bd−1=0,{\displaystyle b_{1},\ldots ,b_{d-1}=0,}hencep(x)=0.{\displaystyle p(x)=0.} A BCH code is cyclic. A polynomial code of lengthn{\displaystyle n}is cyclic if and only if its generator polynomial dividesxn−1.{\displaystyle x^{n}-1.}Sinceg(x){\displaystyle g(x)}is the minimal polynomial with rootsαc,…,αc+d−2,{\displaystyle \alpha ^{c},\ldots ,\alpha ^{c+d-2},}it suffices to check that each ofαc,…,αc+d−2{\displaystyle \alpha ^{c},\ldots ,\alpha ^{c+d-2}}is a root ofxn−1.{\displaystyle x^{n}-1.}This follows immediately from the fact thatα{\displaystyle \alpha }is, by definition, ann{\displaystyle n}th root of unity. Because any polynomial that is a multiple of the generator polynomial is a valid BCH codeword, BCH encoding is merely the process of finding some polynomial that has the generator as a factor. The BCH code itself is not prescriptive about the meaning of the coefficients of the polynomial; conceptually, a BCH decoding algorithm's sole concern is to find the valid codeword with the minimal Hamming distance to the received codeword. Therefore, the BCH code may be implemented either as asystematic codeor not, depending on how the implementor chooses to embed the message in the encoded polynomial. The most straightforward way to find a polynomial that is a multiple of the generator is to compute the product of some arbitrary polynomial and the generator. In this case, the arbitrary polynomial can be chosen using the symbols of the message as coefficients. As an example, consider the generator polynomialg(x)=x10+x9+x8+x6+x5+x3+1{\displaystyle g(x)=x^{10}+x^{9}+x^{8}+x^{6}+x^{5}+x^{3}+1}, chosen for use in the (31, 21) binary BCH code used byPOCSAGand others. To encode the 21-bit message {101101110111101111101}, we first represent it as a polynomial overGF(2){\displaystyle GF(2)}: Then, compute (also overGF(2){\displaystyle GF(2)}): Thus, the transmitted codeword is {1100111010010111101011101110101}. The receiver can use these bits as coefficients ins(x){\displaystyle s(x)}and, after error-correction to ensure a valid codeword, can recomputep(x)=s(x)/g(x){\displaystyle p(x)=s(x)/g(x)} A systematic code is one in which the message appears verbatim somewhere within the codeword. Therefore, systematic BCH encoding involves first embedding the message polynomial within the codeword polynomial, and then adjusting the coefficients of the remaining (non-message) terms to ensure thats(x){\displaystyle s(x)}is divisible byg(x){\displaystyle g(x)}. This encoding method leverages the fact that subtracting the remainder from a dividend results in a multiple of the divisor. Hence, if we take our message polynomialp(x){\displaystyle p(x)}as before and multiply it byxn−k{\displaystyle x^{n-k}}(to "shift" the message out of the way of the remainder), we can then useEuclidean divisionof polynomials to yield: Here, we see thatq(x)g(x){\displaystyle q(x)g(x)}is a valid codeword. Asr(x){\displaystyle r(x)}is always of degree less thann−k{\displaystyle n-k}(which is the degree ofg(x){\displaystyle g(x)}), we can safely subtract it fromp(x)xn−k{\displaystyle p(x)x^{n-k}}without altering any of the message coefficients, hence we have ours(x){\displaystyle s(x)}as OverGF(2){\displaystyle GF(2)}(i.e. with binary BCH codes), this process is indistinguishable from appending acyclic redundancy check, and if a systematic binary BCH code is used only for error-detection purposes, we see that BCH codes are just a generalization of themathematics of cyclic redundancy checks. The advantage to the systematic coding is that the receiver can recover the original message by discarding everything after the firstk{\displaystyle k}coefficients, after performing error correction. There are many algorithms for decoding BCH codes. The most common ones follow this general outline: During some of these steps, the decoding algorithm may determine that the received vector has too many errors and cannot be corrected. For example, if an appropriate value oftis not found, then the correction would fail. In a truncated (not primitive) code, an error location may be out of range. If the received vector has more errors than the code can correct, the decoder may unknowingly produce an apparently valid message that is not the one that was sent. The received vectorR{\displaystyle R}is the sum of the correct codewordC{\displaystyle C}and an unknown error vectorE.{\displaystyle E.}The syndrome values are formed by consideringR{\displaystyle R}as a polynomial and evaluating it atαc,…,αc+d−2.{\displaystyle \alpha ^{c},\ldots ,\alpha ^{c+d-2}.}Thus the syndromes are[7] forj=c{\displaystyle j=c}toc+d−2.{\displaystyle c+d-2.} Sinceαj{\displaystyle \alpha ^{j}}are the zeros ofg(x),{\displaystyle g(x),}of whichC(x){\displaystyle C(x)}is a multiple,C(αj)=0.{\displaystyle C\left(\alpha ^{j}\right)=0.}Examining the syndrome values thus isolates the error vector so one can begin to solve for it. If there is no error,sj=0{\displaystyle s_{j}=0}for allj.{\displaystyle j.}If the syndromes are all zero, then the decoding is done. If there are nonzero syndromes, then there are errors. The decoder needs to figure out how many errors and the location of those errors. If there is a single error, write this asE(x)=exi,{\displaystyle E(x)=e\,x^{i},}wherei{\displaystyle i}is the location of the error ande{\displaystyle e}is its magnitude. Then the first two syndromes are so together they allow us to calculatee{\displaystyle e}and provide some information abouti{\displaystyle i}(completely determining it in the case of Reed–Solomon codes). If there are two or more errors, It is not immediately obvious how to begin solving the resulting syndromes for the unknownsek{\displaystyle e_{k}}andik.{\displaystyle i_{k}.} The first step is finding, compatible with computed syndromes and with minimal possiblet,{\displaystyle t,}locator polynomial: Three popular algorithms for this task are: Peterson's algorithm is the step 2 of the generalized BCH decoding procedure. Peterson's algorithm is used to calculate the error locator polynomial coefficientsλ1,λ2,…,λv{\displaystyle \lambda _{1},\lambda _{2},\dots ,\lambda _{v}}of a polynomial Now the procedure of the Peterson–Gorenstein–Zierler algorithm.[8]Expect we have at least 2tsyndromessc, …,sc+2t−1. Letv=t. Now that you have theΛ(x){\displaystyle \Lambda (x)}polynomial, its roots can be found in the formΛ(x)=(αi1x−1)(αi2x−1)⋯(αivx−1){\displaystyle \Lambda (x)=\left(\alpha ^{i_{1}}x-1\right)\left(\alpha ^{i_{2}}x-1\right)\cdots \left(\alpha ^{i_{v}}x-1\right)}by brute force for example using theChien searchalgorithm. The exponential powers of the primitive elementα{\displaystyle \alpha }will yield the positions where errors occur in the received word; hence the name 'error locator' polynomial. The zeros of Λ(x) areα−i1, …,α−iv. Once the error locations are known, the next step is to determine the error values at those locations. The error values are then used to correct the received values at those locations to recover the original codeword. For the case of binary BCH, (with all characters readable) this is trivial; just flip the bits for the received word at these positions, and we have the corrected code word. In the more general case, the error weightsej{\displaystyle e_{j}}can be determined by solving the linear system However, there is a more efficient method known as theForney algorithm. Let And the error evaluator polynomial[9] Finally: where Than if syndromes could be explained by an error word, which could be nonzero only on positionsik{\displaystyle i_{k}}, then error values are For narrow-sense BCH codes,c= 1, so the expression simplifies to: It is based onLagrange interpolationand techniques ofgenerating functions. ConsiderS(x)Λ(x),{\displaystyle S(x)\Lambda (x),}and for the sake of simplicity supposeλk=0{\displaystyle \lambda _{k}=0}fork>v,{\displaystyle k>v,}andsk=0{\displaystyle s_{k}=0}fork>c+d−2.{\displaystyle k>c+d-2.}Then We want to compute unknownsej,{\displaystyle e_{j},}and we could simplify the context by removing the(xαij)d−1{\displaystyle \left(x\alpha ^{i_{j}}\right)^{d-1}}terms. This leads to the error evaluator polynomial Thanks tov⩽d−1{\displaystyle v\leqslant d-1}we have Thanks toΛ{\displaystyle \Lambda }(the Lagrange interpolation trick) the sum degenerates to only one summand forx=α−ik{\displaystyle x=\alpha ^{-i_{k}}} To getek{\displaystyle e_{k}}we just should get rid of the product. We could compute the product directly from already computed rootsα−ij{\displaystyle \alpha ^{-i_{j}}}ofΛ,{\displaystyle \Lambda ,}but we could use simpler form. Asformal derivative we get again only one summand in So finally This formula is advantageous when one computes the formal derivative ofΛ{\displaystyle \Lambda }form yielding: where An alternate process of finding both the polynomial Λ and the error locator polynomial is based on Yasuo Sugiyama's adaptation of theExtended Euclidean algorithm.[10]Correction of unreadable characters could be incorporated to the algorithm easily as well. Letk1,...,kk{\displaystyle k_{1},...,k_{k}}be positions of unreadable characters. One creates polynomial localising these positionsΓ(x)=∏i=1k(xαki−1).{\displaystyle \Gamma (x)=\prod _{i=1}^{k}\left(x\alpha ^{k_{i}}-1\right).}Set values on unreadable positions to 0 and compute the syndromes. As we have already defined for the Forney formula letS(x)=∑i=0d−2sc+ixi.{\displaystyle S(x)=\sum _{i=0}^{d-2}s_{c+i}x^{i}.} Let us run extended Euclidean algorithm for locating least common divisor of polynomialsS(x)Γ(x){\displaystyle S(x)\Gamma (x)}andxd−1.{\displaystyle x^{d-1}.}The goal is not to find the least common divisor, but a polynomialr(x){\displaystyle r(x)}of degree at most⌊(d+k−3)/2⌋{\displaystyle \lfloor (d+k-3)/2\rfloor }and polynomialsa(x),b(x){\displaystyle a(x),b(x)}such thatr(x)=a(x)S(x)Γ(x)+b(x)xd−1.{\displaystyle r(x)=a(x)S(x)\Gamma (x)+b(x)x^{d-1}.}Low degree ofr(x){\displaystyle r(x)}guarantees, thata(x){\displaystyle a(x)}would satisfy extended (byΓ{\displaystyle \Gamma }) defining conditions forΛ.{\displaystyle \Lambda .} DefiningΞ(x)=a(x)Γ(x){\displaystyle \Xi (x)=a(x)\Gamma (x)}and usingΞ{\displaystyle \Xi }on the place ofΛ(x){\displaystyle \Lambda (x)}in the Fourney formula will give us error values. The main advantage of the algorithm is that it meanwhile computesΩ(x)=S(x)Ξ(x)modxd−1=r(x){\displaystyle \Omega (x)=S(x)\Xi (x){\bmod {x}}^{d-1}=r(x)}required in the Forney formula. The goal is to find a codeword which differs from the received word minimally as possible on readable positions. When expressing the received word as a sum of nearest codeword and error word, we are trying to find error word with minimal number of non-zeros on readable positions. Syndromsi{\displaystyle s_{i}}restricts error word by condition We could write these conditions separately or we could create polynomial and compare coefficients near powers0{\displaystyle 0}tod−2.{\displaystyle d-2.} Suppose there is unreadable letter on positionk1,{\displaystyle k_{1},}we could replace set of syndromes{sc,⋯,sc+d−2}{\displaystyle \{s_{c},\cdots ,s_{c+d-2}\}}by set of syndromes{tc,⋯,tc+d−3}{\displaystyle \{t_{c},\cdots ,t_{c+d-3}\}}defined by equationti=αk1si−si+1.{\displaystyle t_{i}=\alpha ^{k_{1}}s_{i}-s_{i+1}.}Suppose for an error word all restrictions by original set{sc,⋯,sc+d−2}{\displaystyle \{s_{c},\cdots ,s_{c+d-2}\}}of syndromes hold, than New set of syndromes restricts error vector the same way the original set of syndromes restricted the error vectorej.{\displaystyle e_{j}.}Except the coordinatek1,{\displaystyle k_{1},}where we havefk1=0,{\displaystyle f_{k_{1}}=0,}anfj{\displaystyle f_{j}}is zero, ifej=0.{\displaystyle e_{j}=0.}For the goal of locating error positions we could change the set of syndromes in the similar way to reflect all unreadable characters. This shortens the set of syndromes byk.{\displaystyle k.} In polynomial formulation, the replacement of syndromes set{sc,⋯,sc+d−2}{\displaystyle \{s_{c},\cdots ,s_{c+d-2}\}}by syndromes set{tc,⋯,tc+d−3}{\displaystyle \{t_{c},\cdots ,t_{c+d-3}\}}leads to Therefore, After replacement ofS(x){\displaystyle S(x)}byS(x)Γ(x){\displaystyle S(x)\Gamma (x)}, one would require equation for coefficients near powersk,⋯,d−2.{\displaystyle k,\cdots ,d-2.} One could consider looking for error positions from the point of view of eliminating influence of given positions similarly as for unreadable characters. If we foundv{\displaystyle v}positions such that eliminating their influence leads to obtaining set of syndromes consisting of all zeros, than there exists error vector with errors only on these coordinates. IfΛ(x){\displaystyle \Lambda (x)}denotes the polynomial eliminating the influence of these coordinates, we obtain In Euclidean algorithm, we try to correct at most12(d−1−k){\displaystyle {\tfrac {1}{2}}(d-1-k)}errors (on readable positions), because with bigger error count there could be more codewords in the same distance from the received word. Therefore, forΛ(x){\displaystyle \Lambda (x)}we are looking for, the equation must hold for coefficients near powers starting from In Forney formula,Λ(x){\displaystyle \Lambda (x)}could be multiplied by a scalar giving the same result. It could happen that the Euclidean algorithm findsΛ(x){\displaystyle \Lambda (x)}of degree higher than12(d−1−k){\displaystyle {\tfrac {1}{2}}(d-1-k)}having number of different roots equal to its degree, where the Fourney formula would be able to correct errors in all its roots, anyway correcting such many errors could be risky (especially with no other restrictions on received word). Usually after gettingΛ(x){\displaystyle \Lambda (x)}of higher degree, we decide not to correct the errors. Correction could fail in the caseΛ(x){\displaystyle \Lambda (x)}has roots with higher multiplicity or the number of roots is smaller than its degree. Fail could be detected as well by Forney formula returning error outside the transmitted alphabet. Using the error values and error location, correct the errors and form a corrected code vector by subtracting error values at error locations. Consider a BCH code in GF(24) withd=7{\displaystyle d=7}andg(x)=x10+x8+x5+x4+x2+x+1{\displaystyle g(x)=x^{10}+x^{8}+x^{5}+x^{4}+x^{2}+x+1}. (This is used inQR codes.) Let the message to be transmitted be [1 1 0 1 1], or in polynomial notation,M(x)=x4+x3+x+1.{\displaystyle M(x)=x^{4}+x^{3}+x+1.}The "checksum" symbols are calculated by dividingx10M(x){\displaystyle x^{10}M(x)}byg(x){\displaystyle g(x)}and taking the remainder, resulting inx9+x4+x2{\displaystyle x^{9}+x^{4}+x^{2}}or [ 1 0 0 0 0 1 0 1 0 0 ]. These are appended to the message, so the transmitted codeword is [ 1 1 0 1 1 1 0 0 0 0 1 0 1 0 0 ]. Now, imagine that there are two bit-errors in the transmission, so the received codeword is [ 100 1 1 1 0 0 011 0 1 0 0 ]. In polynomial notation: In order to correct the errors, first calculate the syndromes. Takingα=0010,{\displaystyle \alpha =0010,}we haves1=R(α1)=1011,{\displaystyle s_{1}=R(\alpha ^{1})=1011,}s2=1001,{\displaystyle s_{2}=1001,}s3=1011,{\displaystyle s_{3}=1011,}s4=1101,{\displaystyle s_{4}=1101,}s5=0001,{\displaystyle s_{5}=0001,}ands6=1001.{\displaystyle s_{6}=1001.}Next, apply the Peterson procedure by row-reducing the following augmented matrix. Due to the zero row,S3×3is singular, which is no surprise since only two errors were introduced into the codeword. However, the upper-left corner of the matrix is identical to[S2×2|C2×1], which gives rise to the solutionλ2=1000,{\displaystyle \lambda _{2}=1000,}λ1=1011.{\displaystyle \lambda _{1}=1011.}The resulting error locator polynomial isΛ(x)=1000x2+1011x+0001,{\displaystyle \Lambda (x)=1000x^{2}+1011x+0001,}which has zeros at0100=α−13{\displaystyle 0100=\alpha ^{-13}}and0111=α−5.{\displaystyle 0111=\alpha ^{-5}.}The exponents ofα{\displaystyle \alpha }correspond to the error locations. There is no need to calculate the error values in this example, as the only possible value is 1. Suppose the same scenario, but the received word has two unreadable characters [ 100 ? 1 1 ? 0 011 0 1 0 0 ]. We replace the unreadable characters by zeros while creating the polynomial reflecting their positionsΓ(x)=(α8x−1)(α11x−1).{\displaystyle \Gamma (x)=\left(\alpha ^{8}x-1\right)\left(\alpha ^{11}x-1\right).}We compute the syndromess1=α−7,s2=α1,s3=α4,s4=α2,s5=α5,{\displaystyle s_{1}=\alpha ^{-7},s_{2}=\alpha ^{1},s_{3}=\alpha ^{4},s_{4}=\alpha ^{2},s_{5}=\alpha ^{5},}ands6=α−7.{\displaystyle s_{6}=\alpha ^{-7}.}(Using log notation which is independent on GF(24) isomorphisms. For computation checking we can use the same representation for addition as was used in previous example. Hexadecimal description of the powers ofα{\displaystyle \alpha }are consecutively 1,2,4,8,3,6,C,B,5,A,7,E,F,D,9 with the addition based on bitwise xor.) Let us make syndrome polynomial compute Run the extended Euclidean algorithm: We have reached polynomial of degree at most 3, and as we get Therefore, LetΛ(x)=α3+α−5x+α6x2.{\displaystyle \Lambda (x)=\alpha ^{3}+\alpha ^{-5}x+\alpha ^{6}x^{2}.}Don't worry thatλ0≠1.{\displaystyle \lambda _{0}\neq 1.}Find by brute force a root ofΛ.{\displaystyle \Lambda .}The roots areα2,{\displaystyle \alpha ^{2},}andα10{\displaystyle \alpha ^{10}}(after finding for exampleα2{\displaystyle \alpha ^{2}}we can divideΛ{\displaystyle \Lambda }by corresponding monom(x−α2){\displaystyle \left(x-\alpha ^{2}\right)}and the root of resulting monom could be found easily). Let Let us look for error values using formula whereα−ij{\displaystyle \alpha ^{-i_{j}}}are roots ofΞ(x).{\displaystyle \Xi (x).}Ξ′(x)=α2x2.{\displaystyle \Xi '(x)=\alpha ^{2}x^{2}.}We get Fact, thate3=e4=1,{\displaystyle e_{3}=e_{4}=1,}should not be surprising. Corrected code is therefore [ 11011 100 001 0 1 0 0]. Let us show the algorithm behaviour for the case with small number of errors. Let the received word is [ 100 ? 1 1 ? 0 0 0 1 0 1 0 0 ]. Again, replace the unreadable characters by zeros while creating the polynomial reflecting their positionsΓ(x)=(α8x−1)(α11x−1).{\displaystyle \Gamma (x)=\left(\alpha ^{8}x-1\right)\left(\alpha ^{11}x-1\right).}Compute the syndromess1=α4,s2=α−7,s3=α1,s4=α1,s5=α0,{\displaystyle s_{1}=\alpha ^{4},s_{2}=\alpha ^{-7},s_{3}=\alpha ^{1},s_{4}=\alpha ^{1},s_{5}=\alpha ^{0},}ands6=α2.{\displaystyle s_{6}=\alpha ^{2}.}Create syndrome polynomial Let us run the extended Euclidean algorithm: We have reached polynomial of degree at most 3, and as we get Therefore, LetΛ(x)=α3+α1x.{\displaystyle \Lambda (x)=\alpha ^{3}+\alpha ^{1}x.}Don't worry thatλ0≠1.{\displaystyle \lambda _{0}\neq 1.}The root ofΛ(x){\displaystyle \Lambda (x)}isα3−1.{\displaystyle \alpha ^{3-1}.} Let Let us look for error values using formulaej=−Ω(α−ij)/Ξ′(α−ij),{\displaystyle e_{j}=-\Omega \left(\alpha ^{-i_{j}}\right)/\Xi '\left(\alpha ^{-i_{j}}\right),}whereα−ij{\displaystyle \alpha ^{-i_{j}}}are roots of polynomialΞ(x).{\displaystyle \Xi (x).} We get The fact thate3=1{\displaystyle e_{3}=1}should not be surprising. Corrected code is therefore [ 11011 100 0 0 1 0 1 0 0].
https://en.wikipedia.org/wiki/BCH_code
TheBerlekamp–Massey algorithmis analgorithmthat will find the shortestlinear-feedback shift register(LFSR) for a given binary output sequence. The algorithm will also find theminimal polynomialof a linearlyrecurrent sequencein an arbitraryfield. The field requirement means that the Berlekamp–Massey algorithm requires all non-zero elements to have a multiplicative inverse.[1]Reeds and Sloane offer an extension to handle aring.[2] Elwyn Berlekampinvented an algorithm for decodingBose–Chaudhuri–Hocquenghem (BCH) codes.[3][4]James Masseyrecognized its application to linear feedback shift registers and simplified the algorithm.[5][6]Massey termed the algorithm the LFSR Synthesis Algorithm (Berlekamp Iterative Algorithm),[7]but it is now known as the Berlekamp–Massey algorithm. The Berlekamp–Massey algorithm is an alternative to theReed–Solomon Peterson decoderfor solving the set of linear equations. It can be summarized as finding the coefficients Λjof a polynomial Λ(x) so that for all positionsiin an input streamS: In the code examples below,C(x) is a potential instance ofΛ(x). The error locator polynomialC(x) forLerrors is defined as: or reversed: The goal of the algorithm is to determine the minimal degreeLandC(x) which results in allsyndromes being equal to 0: Algorithm:C(x) is initialized to 1,Lis the current number of assumed errors, and initialized to zero.Nis the total number of syndromes.nis used as the main iterator and to index the syndromes from 0 toN−1.B(x) is a copy of the lastC(x) sinceLwas updated and initialized to 1.bis a copy of the last discrepancyd(explained below) sinceLwas updated and initialized to 1.mis the number of iterations sinceL,B(x), andbwere updated and initialized to 1. Each iteration of the algorithm calculates a discrepancyd. At iterationkthis would be: Ifdis zero, the algorithm assumes thatC(x) andLare correct for the moment, incrementsm, and continues. Ifdis not zero, the algorithm adjustsC(x) so that a recalculation ofdwould be zero: ThexmtermshiftsB(x) so it follows the syndromes corresponding tob. If the previous update ofLoccurred on iterationj, thenm=k−j, and a recalculated discrepancy would be: This would change a recalculated discrepancy to: The algorithm also needs to increaseL(number of errors) as needed. IfLequals the actual number of errors, then during the iteration process, the discrepancies will become zero beforenbecomes greater than or equal to 2L. OtherwiseLis updated and the algorithm will updateB(x),b, increaseL, and resetm= 1. The formulaL= (n+ 1 −L) limitsLto the number of available syndromes used to calculate discrepancies, and also handles the case whereLincreases by more than 1. The algorithm fromMassey (1969, p. 124) for an arbitrary field: In the case of binary GF(2) BCH code, the discrepancy d will be zero on all odd steps, so a check can be added to avoid calculating it.
https://en.wikipedia.org/wiki/Berlekamp%E2%80%93Massey_algorithm
TheBerlekamp–Welch algorithm, also known as theWelch–Berlekamp algorithm, is named forElwyn R. BerlekampandLloyd R. Welch. This is a decoder algorithm that efficiently corrects errors inReed–Solomon codesfor an RS(n,k), code based on the Reed Solomon original view where a messagem1,⋯,mk{\displaystyle m_{1},\cdots ,m_{k}}is used as coefficients of a polynomialF(ai){\displaystyle F(a_{i})}or used withLagrange interpolationto generate the polynomialF(ai){\displaystyle F(a_{i})}of degree <kfor inputsa1,⋯,ak{\displaystyle a_{1},\cdots ,a_{k}}and thenF(ai){\displaystyle F(a_{i})}is applied toak+1,⋯,an{\displaystyle a_{k+1},\cdots ,a_{n}}to create an encoded codewordc1,⋯,cn{\displaystyle c_{1},\cdots ,c_{n}}. The goal of the decoder is to recover the original encoding polynomialF(ai){\displaystyle F(a_{i})}, using the known inputsa1,⋯,an{\displaystyle a_{1},\cdots ,a_{n}}and received codewordb1,⋯,bn{\displaystyle b_{1},\cdots ,b_{n}}with possible errors. It also computes an error polynomialE(ai){\displaystyle E(a_{i})}whereE(ai)=0{\displaystyle E(a_{i})=0}corresponding to errors in the received codeword. Defininge= number of errors, the key set ofnequations is Where E(ai) = 0 for theecases when bi≠ F(ai), and E(ai) ≠ 0 for then-enon error cases wherebi= F(ai) . These equations can't be solved directly, but by defining Q() as the product of E() and F(): and adding the constraint that the most significant coefficient of E(ai) =ee= 1, the result will lead to a set of equations that can be solved with linear algebra. whereq=n-e- 1. Sinceeeis constrained to be 1, the equations become: resulting in a set of equations which can be solved using linear algebra, with time complexityO(n3){\displaystyle O(n^{3})}. The algorithm begins assuming the maximum number of errorse= ⌊(n-k)/2⌋. If the equations can not be solved (due to redundancy),eis reduced by 1 and the process repeated, until the equations can be solved oreis reduced to 0, indicating no errors. If Q()/E() has remainder = 0, then F() = Q()/E() and the code word values F(ai) are calculated for the locations where E(ai) = 0 to recover the original code word. If the remainder ≠ 0, then an uncorrectable error has been detected. Consider RS(7,3) (n= 7,k= 3) defined inGF(7)withα= 3 and input values:ai= i-1 : {0,1,2,3,4,5,6}. The message to be systematically encoded is {1,6,3}. Using Lagrange interpolation,F(ai)= 3 x2+ 2 x + 1, and applyingF(ai)fora4= 3 toa7= 6, results in the code word {1,6,3,6,1,2,2}. Assume errors occur atc2andc5resulting in the received code word {1,5,3,6,3,2,2}. Start off withe= 2 and solve the linear equations: Starting from the bottom of the right matrix, and the constrainte2= 1: Q(ai)=3x4+1x3+3x2+3x+4{\displaystyle Q(a_{i})=3x^{4}+1x^{3}+3x^{2}+3x+4} E(ai)=1x2+2x+4{\displaystyle E(a_{i})=1x^{2}+2x+4} F(ai)=Q(ai)/E(ai)=3x2+2x+1{\displaystyle F(a_{i})=Q(a_{i})/E(a_{i})=3x^{2}+2x+1}with remainder = 0. E(ai) = 0 ata2= 1 anda5= 4 Calculate F(a2= 1) = 6 and F(a5= 4) = 1 to produce corrected code word {1,6,3,6,1,2,2}.
https://en.wikipedia.org/wiki/Berlekamp%E2%80%93Welch_algorithm
Inabstract algebra, theChien search, named afterRobert Tienwen Chien, is a fast algorithm for determiningrootsofpolynomialsdefined over afinite field. Chien search is commonly used to find the roots of error-locator polynomials encountered in decodingReed-Solomon codesandBCH codes. The problem is to find the roots of the polynomialΛ(x)(over the finite fieldGF(q)):Λ(x)=λ0+λ1x+λ2x2+⋯+λtxt{\displaystyle \Lambda (x)=\lambda _{0}+\lambda _{1}x+\lambda _{2}x^{2}+\cdots +\lambda _{t}x^{t}} The roots may be found using brute force: there are a finite number ofx, so the polynomial can be evaluated for each elementxi. If the polynomial evaluates to zero, then that element is a root. For the trivial casex= 0, only the coefficientλ0need be tested for zero. Below, the only concern will be for non-zeroxi. A straightforward evaluation of the polynomial involvesO(t2)general multiplications andO(t)additions. A more efficient scheme would useHorner's methodforO(t)general multiplications andO(t)additions. Both of these approaches may evaluate the elements of the finite field in any order. Chien search improves upon the above by selecting a specific order for the non-zero elements. In particular, the finite field has a (constant) generator elementα. Chien tests the elements in the generator's orderα1, α2, α3, ..... Consequently, Chien search needs onlyO(t)multiplications by constants andO(t)additions. The multiplications by constants are less complex than general multiplications. The Chien search is based on two observations: In other words, we may define eachΛ(αi){\displaystyle \Lambda (\alpha ^{i})}as the sum of a set of terms{γj,i∣0≤j≤t}{\displaystyle \{\gamma _{j,i}\mid 0\leq j\leq t\}}, from which the next set of coefficients may be derived thus:γj,i+1=γj,iαj{\displaystyle \gamma _{j,i+1}=\gamma _{j,i}\,\alpha ^{j}} In this way, we may start ati=0{\displaystyle i=0}withγj,0=λj{\displaystyle \gamma _{j,0}=\lambda _{j}}, and iterate through each value ofi{\displaystyle i}up to(q−1){\displaystyle (q-1)}. If at any stage the resultant summation is zero, i.e.∑j=0tγj,i=0,{\displaystyle \sum _{j=0}^{t}\gamma _{j,i}=0,}thenΛ(αi)=0{\displaystyle \Lambda (\alpha ^{i})=0}also, soαi{\displaystyle \alpha ^{i}}is a root. In this way, we check every element in the field. When implemented in hardware, this approach significantly reduces the complexity, as all multiplications consist of one variable and one constant, rather than two variables as in the brute-force approach.
https://en.wikipedia.org/wiki/Chien_search
Incoding theory, acyclic codeis ablock code, where thecircular shiftsof each codeword gives another word that belongs to the code. They areerror-correcting codesthat have algebraic properties that are convenient for efficienterror detection and correction. LetC{\displaystyle {\mathcal {C}}}be alinear codeover afinite field(also calledGalois field)GF(q){\displaystyle GF(q)}ofblock lengthn{\displaystyle n}.C{\displaystyle {\mathcal {C}}}is called acyclic codeif, for everycodewordc=(c1,…,cn){\displaystyle c=(c_{1},\ldots ,c_{n})}fromC{\displaystyle {\mathcal {C}}}, the word(cn,c1,…,cn−1){\displaystyle (c_{n},c_{1},\ldots ,c_{n-1})}inGF(q)n{\displaystyle GF(q)^{n}}obtained by acyclic right shiftof components is again a codeword. Because one cyclic right shift is equal ton−1{\displaystyle n-1}cyclic left shifts, a cyclic code may also be defined via cyclic left shifts. Therefore, the linear codeC{\displaystyle {\mathcal {C}}}is cyclic precisely when it is invariant under all cyclic shifts. Cyclic codes have some additional structural constraint on the codes. They are based onGalois fieldsand because of their structural properties they are very useful for error controls. Their structure is strongly related to Galois fields because of which the encoding and decoding algorithms for cyclic codes are computationally efficient. Cyclic codes can be linked to ideals in certain rings. LetR=A[x]/(xn−1){\displaystyle R=A[x]/(x^{n}-1)}be a quotient of apolynomial ringover the finite fieldA=GF(q){\displaystyle A=GF(q)}. Identify the elements of the cyclic codeC{\displaystyle {\mathcal {C}}}with polynomials inR{\displaystyle R}such that(c0,…,cn−1){\displaystyle (c_{0},\ldots ,c_{n-1})}maps to the polynomialc0+c1x+⋯+cn−1xn−1{\displaystyle c_{0}+c_{1}x+\cdots +c_{n-1}x^{n-1}}: thus multiplication byx{\displaystyle x}corresponds to a cyclic shift. ThenC{\displaystyle {\mathcal {C}}}is anidealinR{\displaystyle R}, and henceprincipal, sinceR{\displaystyle R}is aprincipal ideal ring. The ideal is generated by the unique monic element inC{\displaystyle {\mathcal {C}}}of minimum degree, thegenerator polynomialg{\displaystyle g}.[1]This must be a divisor ofxn−1{\displaystyle x^{n}-1}. It follows that every cyclic code is apolynomial code. If the generator polynomialg{\displaystyle g}has degreed{\displaystyle d}then the rank of the codeC{\displaystyle {\mathcal {C}}}isn−d{\displaystyle n-d}. IfC{\displaystyle {\mathcal {C}}}is a cyclic code, thedual codeC⊥{\displaystyle {\mathcal {C}}^{\perp }}is also a cyclic code. The generator polynomialh(x){\displaystyle h(x)}forC⊥{\displaystyle {\mathcal {C}}^{\perp }}is also called theparity-check polynomialor simplycheck polynomialforC{\displaystyle {\mathcal {C}}}. It can also be shown thatg(x)h∗(x)=xn−1{\displaystyle g(x)h^{*}(x)=x^{n}-1}, whereh∗(x){\displaystyle h^{*}(x)}denotes thereciprocal polynomialofh(x){\displaystyle h(x)}.[2] TheidempotentofC{\displaystyle {\mathcal {C}}}is a codeworde{\displaystyle e}such thate2=e{\displaystyle e^{2}=e}(that is,e{\displaystyle e}is anidempotent elementofC{\displaystyle {\mathcal {C}}}) ande{\displaystyle e}is an identity for the code, that ise⋅c=c{\displaystyle e\cdot c=c}for every codewordc{\displaystyle c}. Ifn{\displaystyle n}andq{\displaystyle q}arecoprimesuch a word always exists and is unique;[3]it is a generator of the code. Anirreducible codeis a cyclic code in which the code, as an ideal is irreducible, i.e. is minimal inR{\displaystyle R}, so that its check polynomial is anirreducible polynomial. For example, ifA=F2{\displaystyle A=\mathbb {F} _{2}}andn=3{\displaystyle n=3}, the set of codewords contained in the cyclic code generated by(1,1,0){\displaystyle (1,1,0)}is precisely {(0,0,0),(1,1,0),(0,1,1),(1,0,1)}.{\displaystyle \{(0,0,0),(1,1,0),(0,1,1),(1,0,1)\}.} This code corresponds to the ideal inF2[x]/(x3−1){\displaystyle \mathbb {F} _{2}[x]/(x^{3}-1)}generated by(1+x){\displaystyle (1+x)}. The polynomial(1+x){\displaystyle (1+x)}is irreducible in the polynomial ring, and hence the code is an irreducible code. The idempotent of this code is the polynomialx+x2{\displaystyle x+x^{2}}, corresponding to the codeword(0,1,1){\displaystyle (0,1,1)}. Trivial examples of cyclic codes areAn{\displaystyle A^{n}}itself and the code containing only the zero codeword. These correspond to generators1{\displaystyle 1}andxn−1{\displaystyle x^{n}-1}respectively: these two polynomials must always be factors ofxn−1{\displaystyle x^{n}-1}. OverGF(2){\displaystyle GF(2)}theparity bitcode, consisting of all words of even weight, corresponds to generatorx+1{\displaystyle x+1}. Again overGF(2){\displaystyle GF(2)}this must always be a factor ofxn−1{\displaystyle x^{n}-1}. Many types of commonly used error-correcting codes can be represented as cyclic codes, includingBCH codes,Reed-Solomon codes, and some classes oflow-density parity-check codesdefined from finite geometries.[4] Cyclic codes can be used tocorrect errors, likeHamming codesas cyclic codes can be used for correcting single error. Likewise, they are also used to correct double errors and burst errors. All types of error corrections are covered briefly in the further subsections. The (7,4) Hamming code has agenerator polynomialg(x)=x3+x+1{\displaystyle g(x)=x^{3}+x+1}. This polynomial has a zero inGalois extension fieldGF(8){\displaystyle GF(8)}at the primitive elementα{\displaystyle \alpha }, and all codewords satisfyC(α)=0{\displaystyle {\mathcal {C}}(\alpha )=0}. Cyclic codes can also be used to correct double errors over the fieldGF(2){\displaystyle GF(2)}. Blocklength will ben{\displaystyle n}equal to2m−1{\displaystyle 2^{m}-1}and primitive elementsα{\displaystyle \alpha }andα3{\displaystyle \alpha ^{3}}as zeros in theGF(2m){\displaystyle GF(2^{m})}because we are considering the case of two errors here, so each will represent one error. The received word is a polynomial of degreen−1{\displaystyle n-1}given asv(x)=a(x)g(x)+e(x){\displaystyle v(x)=a(x)g(x)+e(x)} wheree(x){\displaystyle e(x)}can have at most two nonzero coefficients corresponding to 2 errors. We define thesyndrome polynomial,S(x){\displaystyle S(x)}as the remainder of polynomialv(x){\displaystyle v(x)}when divided by the generator polynomialg(x){\displaystyle g(x)}i.e. S(x)≡v(x)≡(a(x)g(x)+e(x))≡e(x)modg(x){\displaystyle S(x)\equiv v(x)\equiv (a(x)g(x)+e(x))\equiv e(x)\mod g(x)}as(a(x)g(x))≡0modg(x){\displaystyle (a(x)g(x))\equiv 0\mod g(x)}. Let the field elementsX1{\displaystyle X_{1}}andX2{\displaystyle X_{2}}be the two error location numbers. If only one error occurs thenX2{\displaystyle X_{2}}is equal to zero and if none occurs both are zero. LetS1=v(α){\displaystyle S_{1}={v}(\alpha )}andS3=v(α3){\displaystyle S_{3}={v}(\alpha ^{3})}. These field elements are called "syndromes". Now becauseg(x){\displaystyle g(x)}is zero at primitive elementsα{\displaystyle \alpha }andα3{\displaystyle \alpha ^{3}}, so we can writeS1=e(α){\displaystyle S_{1}=e(\alpha )}andS3=e(α3){\displaystyle S_{3}=e(\alpha ^{3})}. If say two errors occur, then S1=αi+αi′{\displaystyle S_{1}=\alpha ^{i}+\alpha ^{i'}}andS3=α3i+α3i′{\displaystyle S_{3}=\alpha ^{3i}+\alpha ^{3i'}}. And these two can be considered as two pair of equations inGF(2m){\displaystyle GF(2^{m})}with two unknowns and hence we can write S1=X1+X2{\displaystyle S_{1}=X_{1}+X_{2}}andS3=(X1)3+(X2)3{\displaystyle S_{3}=(X_{1})^{3}+(X_{2})^{3}}. Hence if the two pair of nonlinear equations can be solved cyclic codes can used to correct two errors. TheHamming(7,4)code may be written as a cyclic code over GF(2) with generator1+x+x3{\displaystyle 1+x+x^{3}}. In fact, any binary Hamming code of the form Ham(r, 2) is equivalent to a cyclic code,[5]and any Hamming code of the form Ham(r,q) with r and q-1 relatively prime is also equivalent to a cyclic code.[6]Given a Hamming code of the form Ham(r,2) withr≥3{\displaystyle r\geq 3}, the set of even codewords forms a cyclic[2r−1,2r−r−2,4]{\displaystyle [2^{r}-1,2^{r}-r-2,4]}-code.[7] A code whose minimum distance is at least 3, have a check matrix all of whose columns are distinct and non zero. If a check matrix for a binary code hasm{\displaystyle m}rows, then each column is anm{\displaystyle m}-bit binary number. There are2m−1{\displaystyle 2^{m}-1}possible columns. Therefore, if a check matrix of a binary code withdmin{\displaystyle d_{min}}at least 3 hasm{\displaystyle m}rows, then it can only have2m−1{\displaystyle 2^{m}-1}columns, not more than that. This defines a(2m−1,2m−1−m){\displaystyle (2^{m}-1,2^{m}-1-m)}code, called Hamming code. It is easy to define Hamming codes for large alphabets of sizeq{\displaystyle q}. We need to define oneH{\displaystyle H}matrix with linearly independent columns. For any word of sizeq{\displaystyle q}there will be columns who are multiples of each other. So, to get linear independence all non zerom{\displaystyle m}-tuples with one as a top most non zero element will be chosen as columns. Then two columns will never be linearly dependent because three columns could be linearly dependent with the minimum distance of the code as 3. So, there are(qm−1)/(q−1){\displaystyle (q^{m}-1)/(q-1)}nonzero columns with one as top most non zero element. Therefore, a Hamming code is a[(qm−1)/(q−1),(qm−1)/(q−1)−m]{\displaystyle [(q^{m}-1)/(q-1),(q^{m}-1)/(q-1)-m]}code. Now, for cyclic codes, Letα{\displaystyle \alpha }be primitive element inGF(qm){\displaystyle GF(q^{m})}, and letβ=αq−1{\displaystyle \beta =\alpha ^{q-1}}. Thenβ(qm−1)/(q−1)=1{\displaystyle \beta ^{(q^{m}-1)/(q-1)}=1}and thusβ{\displaystyle \beta }is a zero of the polynomialx(qm−1)/(q−1)−1{\displaystyle x^{(q^{m}-1)/(q-1)}-1}and is a generator polynomial for the cyclic code of block lengthn=(qm−1)/(q−1){\displaystyle n=(q^{m}-1)/(q-1)}. But forq=2{\displaystyle q=2},α=β{\displaystyle \alpha =\beta }. And the received word is a polynomial of degreen−1{\displaystyle n-1}given as v(x)=a(x)g(x)+e(x){\displaystyle v(x)=a(x)g(x)+e(x)} where,e(x)=0{\displaystyle e(x)=0}orxi{\displaystyle x^{i}}wherei{\displaystyle i}represents the error locations. But we can also useαi{\displaystyle \alpha ^{i}}as an element ofGF(2m){\displaystyle GF(2^{m})}to index error location. Becauseg(α)=0{\displaystyle g(\alpha )=0}, we havev(α)=αi{\displaystyle v(\alpha )=\alpha ^{i}}and all powers ofα{\displaystyle \alpha }from0{\displaystyle 0}to2m−2{\displaystyle 2^{m}-2}are distinct. Therefore, we can easily determine error locationi{\displaystyle i}fromαi{\displaystyle \alpha ^{i}}unlessv(α)=0{\displaystyle v(\alpha )=0}which represents no error. So, a Hamming code is a single error correcting code overGF(2){\displaystyle GF(2)}withn=2m−1{\displaystyle n=2^{m}-1}andk=n−m{\displaystyle k=n-m}. FromHamming distanceconcept, a code with minimum distance2t+1{\displaystyle 2t+1}can correct anyt{\displaystyle t}errors. But in many channels error pattern is not very arbitrary, it occurs within very short segment of the message. Such kind of errors are calledburst errors. So, for correcting such errors we will get a more efficient code of higher rate because of the less constraints. Cyclic codes are used for correcting burst error. In fact, cyclic codes can also correct cyclic burst errors along with burst errors. Cyclic burst errors are defined as A cyclic burst of lengtht{\displaystyle t}is a vector whose nonzero components are amongt{\displaystyle t}(cyclically) consecutive components, the first and the last of which are nonzero. In polynomial form cyclic burst of lengtht{\displaystyle t}can be described ase(x)=xib(x)mod(xn−1){\displaystyle e(x)=x^{i}b(x)\mod (x^{n}-1)}withb(x){\displaystyle b(x)}as a polynomial of degreet−1{\displaystyle t-1}with nonzero coefficientb0{\displaystyle b_{0}}. Hereb(x){\displaystyle b(x)}defines the pattern andxi{\displaystyle x^{i}}defines the starting point of error. Length of the pattern is given by degb(x)+1{\displaystyle b(x)+1}. The syndrome polynomial is unique for each pattern and is given by s(x)=e(x)modg(x){\displaystyle s(x)=e(x)\mod g(x)} A linear block code that corrects all burst errors of lengtht{\displaystyle t}or less must have at least2t{\displaystyle 2t}check symbols. Proof: Because any linear code that can correct burst pattern of lengtht{\displaystyle t}or less cannot have a burst of length2t{\displaystyle 2t}or less as a codeword because if it did then a burst of lengtht{\displaystyle t}could change the codeword to burst pattern of lengtht{\displaystyle t}, which also could be obtained by making a burst error of lengtht{\displaystyle t}in all zero codeword. Now, any two vectors that are non zero in the first2t{\displaystyle 2t}components must be from different co-sets of an array to avoid their difference being a codeword of bursts of length2t{\displaystyle 2t}. Therefore, number of such co-sets are equal to number of such vectors which areq2t{\displaystyle q^{2t}}. Hence at leastq2t{\displaystyle q^{2t}}co-sets and hence at least2t{\displaystyle 2t}check symbol. This property is also known as Rieger bound and it is similar to theSingleton boundfor random error correcting. In 1959, Philip Fire[8]presented a construction of cyclic codes generated by a product of a binomial and a primitive polynomial. The binomial has the formxc+1{\displaystyle x^{c}+1}for some positive odd integerc{\displaystyle c}.[9]Fire codeis a cyclic burst error correcting code overGF(q){\displaystyle GF(q)}with the generator polynomial g(x)=(x2t−1−1)p(x){\displaystyle g(x)=(x^{2t-1}-1)p(x)} wherep(x){\displaystyle p(x)}is a prime polynomial with degreem{\displaystyle m}not smaller thant{\displaystyle t}andp(x){\displaystyle p(x)}does not dividex2t−1−1{\displaystyle x^{2t-1}-1}. Block length of the fire code is the smallest integern{\displaystyle n}such thatg(x){\displaystyle g(x)}dividesxn−1{\displaystyle x^{n}-1}. A fire code can correct all burst errors of length t or less if no two burstsb(x){\displaystyle b(x)}andxjb′(x){\displaystyle x^{j}b'(x)}appear in the same co-set. This can be proved by contradiction. Suppose there are two distinct nonzero burstsb(x){\displaystyle b(x)}andxjb′(x){\displaystyle x^{j}b'(x)}of lengtht{\displaystyle t}or less and are in the same co-set of the code. So, their difference is a codeword. As the difference is a multiple ofg(x){\displaystyle g(x)}it is also a multiple ofx2t−1−1{\displaystyle x^{2t-1}-1}. Therefore, b(x)=xjb′(x)mod(x2t−1−1){\displaystyle b(x)=x^{j}b'(x)\mod (x^{2t-1}-1)}. This shows thatj{\displaystyle j}is a multiple of2t−1{\displaystyle 2t-1}, So b(x)=xl(2t−1)b′(x){\displaystyle b(x)=x^{l(2t-1)}b'(x)} for somel{\displaystyle l}. Now, asl(2t−1){\displaystyle l(2t-1)}is less thant{\displaystyle t}andl{\displaystyle l}is less thanqm−1{\displaystyle q^{m}-1}so(xl(2t−1)−1)b(x){\displaystyle (x^{l(2t-1)}-1)b(x)}is a codeword. Therefore, (xl(2t−1)−1)b(x)=a(x)(x2t−1−1)p(x){\displaystyle (x^{l(2t-1)}-1)b(x)=a(x)(x^{2t-1}-1)p(x)}. Sinceb(x){\displaystyle b(x)}degree is less than degree ofp(x){\displaystyle p(x)},p(x){\displaystyle p(x)}cannot divideb(x){\displaystyle b(x)}. Ifl{\displaystyle l}is not zero, thenp(x){\displaystyle p(x)}also cannot dividexl(2t−1)−1{\displaystyle x^{l(2t-1)}-1}asl{\displaystyle l}is less thanqm−1{\displaystyle q^{m}-1}and by definition ofm{\displaystyle m},p(x){\displaystyle p(x)}dividesxl(2t−1)−1{\displaystyle x^{l(2t-1)}-1}for nol{\displaystyle l}smaller thanqm−1{\displaystyle q^{m}-1}. Thereforel{\displaystyle l}andj{\displaystyle j}equals to zero. That means both that both the bursts are same, contrary to assumption. Fire codes are the best single burst correcting codes with high rate and they are constructed analytically. They are of very high rate and whenm{\displaystyle m}andt{\displaystyle t}are equal, redundancy is least and is equal to3t−1{\displaystyle 3t-1}. By using multiple fire codes longer burst errors can also be corrected. For error detection cyclic codes are widely used and are calledt−1{\displaystyle t-1}cyclic redundancy codes. Applications ofFourier transformare widespread in signal processing. But their applications are not limited to the complex fields only; Fourier transforms also exist in the Galois fieldGF(q){\displaystyle GF(q)}. Cyclic codes using Fourier transform can be described in a setting closer to the signal processing. Fourier transform over finite fields The discrete Fourier transform of vectorv=v0,v1,....,vn−1{\displaystyle v=v_{0},v_{1},....,v_{n-1}}is given by a vectorV=V0,V1,.....,Vn−1{\displaystyle V=V_{0},V_{1},.....,V_{n-1}}where, Vk{\displaystyle V_{k}}=Σi=0n−1e−j2πn−1ikvi{\displaystyle \Sigma _{i=0}^{n-1}e^{-j2\pi n^{-1}ik}v_{i}}where, k=0,.....,n−1{\displaystyle k=0,.....,n-1} where exp(−j2π/n{\displaystyle -j2\pi /n}) is ann{\displaystyle n}th root of unity. Similarly in the finite fieldn{\displaystyle n}th root of unity is elementω{\displaystyle \omega }of ordern{\displaystyle n}. Therefore Ifv=(v0,v1,....,vn−1){\displaystyle v=(v_{0},v_{1},....,v_{n-1})}is a vector overGF(q){\displaystyle GF(q)}, andω{\displaystyle \omega }be an element ofGF(q){\displaystyle GF(q)}of ordern{\displaystyle n}, then Fourier transform of the vectorv{\displaystyle v}is the vectorV=(V0,V1,.....,Vn−1){\displaystyle V=(V_{0},V_{1},.....,V_{n-1})}and components are given by Vj{\displaystyle V_{j}}=Σi=0n−1ωijvi{\displaystyle \Sigma _{i=0}^{n-1}\omega ^{ij}v_{i}}where, k=0,.....,n−1{\displaystyle k=0,.....,n-1} Herei{\displaystyle i}istimeindex,j{\displaystyle j}isfrequencyandV{\displaystyle V}is thespectrum. One important difference between Fourier transform in complex field and Galois field is that complex fieldω{\displaystyle \omega }exists for every value ofn{\displaystyle n}while in Galois fieldω{\displaystyle \omega }exists only ifn{\displaystyle n}dividesq−1{\displaystyle q-1}. In case of extension fields, there will be a Fourier transform in the extension fieldGF(qm){\displaystyle GF(q^{m})}ifn{\displaystyle n}dividesqm−1{\displaystyle q^{m}-1}for somem{\displaystyle m}. In Galois field time domain vectorv{\displaystyle v}is over the fieldGF(q){\displaystyle GF(q)}but the spectrumV{\displaystyle V}may be over the extension fieldGF(qm){\displaystyle GF(q^{m})}. Any codeword of cyclic code of blocklengthn{\displaystyle n}can be represented by a polynomialc(x){\displaystyle c(x)}of degree at mostn−1{\displaystyle n-1}. Its encoder can be written asc(x)=a(x)g(x){\displaystyle c(x)=a(x)g(x)}. Therefore, in frequency domain encoder can be written asCj=AjGj{\displaystyle C_{j}=A_{j}G_{j}}. Herecodeword spectrumCj{\displaystyle C_{j}}has a value inGF(qm){\displaystyle GF(q^{m})}but all the components in the time domain are fromGF(q){\displaystyle GF(q)}. As the data spectrumAj{\displaystyle A_{j}}is arbitrary, the role ofGj{\displaystyle G_{j}}is to specify thosej{\displaystyle j}whereCj{\displaystyle C_{j}}will be zero. Thus, cyclic codes can also be defined as Given a set of spectral indices,A=(j1,....,jn−k){\displaystyle A=(j_{1},....,j_{n-k})},whose elements are called check frequencies, the cyclic codeC{\displaystyle C}is the set of words overGF(q){\displaystyle GF(q)}whose spectrum is zero in the components indexed byj1,...,jn−k{\displaystyle j_{1},...,j_{n-k}}.Any such spectrumC{\displaystyle C}will have components of the formAjGj{\displaystyle A_{j}G_{j}}. So, cyclic codes are vectors in the fieldGF(q){\displaystyle GF(q)}and the spectrum given by its inverse fourier transform is over the fieldGF(qm){\displaystyle GF(q^{m})}and are constrained to be zero at certain components. But every spectrum in the fieldGF(qm){\displaystyle GF(q^{m})}and zero at certain components may not have inverse transforms with components in the fieldGF(q){\displaystyle GF(q)}. Such spectrum can not be used as cyclic codes. Following are the few bounds on the spectrum of cyclic codes. Ifn{\displaystyle n}be a factor of(qm−1){\displaystyle (q^{m}-1)}for somem{\displaystyle m}. The only vector inGF(q)n{\displaystyle GF(q)^{n}}of weightd−1{\displaystyle d-1}or less that hasd−1{\displaystyle d-1}consecutive components of its spectrum equal to zero is all-zero vector. Ifn{\displaystyle n}be a factor of(qm−1){\displaystyle (q^{m}-1)}for somem{\displaystyle m}, andb{\displaystyle b}an integer that is coprime withn{\displaystyle n}. The only vectorv{\displaystyle v}inGF(q)n{\displaystyle GF(q)^{n}}of weightd−1{\displaystyle d-1}or less whose spectral componentsVj{\displaystyle V_{j}}equal zero forj=ℓ1+ℓ2b(modn){\displaystyle j=\ell _{1}+\ell _{2}b(\mod n)}, whereℓ1=0,....,d−s−1{\displaystyle \ell _{1}=0,....,d-s-1}andℓ2=0,....,s−1{\displaystyle \ell _{2}=0,....,s-1}, is the all zero vector. Ifn{\displaystyle n}be a factor ofqm−1{\displaystyle q^{m}-1}for somem{\displaystyle m}andGCD(n,b)=1{\displaystyle GCD(n,b)=1}. The only vector inGF(q)n{\displaystyle GF(q)^{n}}of weightd−1{\displaystyle d-1}or less whose spectral componentsVj{\displaystyle V_{j}}equal to zero forj=l1+l2b(modn){\displaystyle j=l_{1}+l_{2}b(\mod n)}, wherel1=0,...,d−s−2{\displaystyle l_{1}=0,...,d-s-2}andl2{\displaystyle l_{2}}takes at leasts+1{\displaystyle s+1}values in the range0,....,d−2{\displaystyle 0,....,d-2}, is the all-zero vector. When the primel{\displaystyle l}is a quadratic residue modulo the primep{\displaystyle p}there is aquadratic residue codewhich is a cyclic code of lengthp{\displaystyle p}, dimension(p+1)/2{\displaystyle (p+1)/2}and minimum weight at leastp{\displaystyle {\sqrt {p}}}overGF(l){\displaystyle GF(l)}. Aconstacyclic codeis a linear code with the property that for some constantλ{\displaystyle \lambda }if(c1,c2,…,cn){\displaystyle (c_{1},c_{2},\dots ,c_{n})}is a codeword, then so is(λcn,c1,…,cn−1){\displaystyle (\lambda c_{n},c_{1},\dots ,c_{n-1})}. Anegacyclic codeis a constacyclic code withλ=−1{\displaystyle \lambda =-1}.[10] Aquasi-cyclic code(QC code) has the property that for somes{\displaystyle s}dividingn{\displaystyle n}, any cyclic shift of a codeword bys{\displaystyle s}places is again a codeword. That is, for some constants{\displaystyle s}, if(c0,c1,…,cn−1){\displaystyle (c_{0},c_{1},\dots ,c_{n-1})}is a codeword, then so is(c−s,c1−s,…,cn−s−1){\displaystyle (c_{-s},c_{1-s},\dots ,c_{n-s-1})}, where all subscripts are reduced modn{\displaystyle n}.[11]Such a code is known as ans{\displaystyle s}-QC code. Adouble circulant codeis a quasi-cyclic code of even length withs=2{\displaystyle s=2}.[11] An(n,k){\displaystyle (n,k)}linear code is called ashortened cyclic codeif it can be obtained by deletingb{\displaystyle b}positions from an(n+b,k+b){\displaystyle (n+b,k+b)}cyclic code. Code of this form are not generally cyclic.[12] In shortened codes, information symbols are deleted to obtain a desired block length smaller than the original block length. While deleting the firstb{\displaystyle b}symbols is a common approach, in principle any set of information symbols can be deleted.[12]Any cyclic code can be converted to a quasi-cyclic code by dropping everyb{\displaystyle b}-th symbol, whereb{\displaystyle b}is a factor ofn{\displaystyle n}. If the dropped symbols are not check symbols, this cyclic code is also a shortened cyclic code. Quasi-twisted codes(QT codes) combine the properties of constacyclic and quasi-cyclic codes, with the shift occurring bys{\displaystyle s}places and with a multiplier ofλ{\displaystyle \lambda }. That is, for some constantsλ{\displaystyle \lambda }ands{\displaystyle s}, if(c0,c1,…,cn−1){\displaystyle (c_{0},c_{1},\dots ,c_{n-1})}is a codeword, then so is(λc−s,c1−s,…,cn−s−1){\displaystyle (\lambda c_{-s},c_{1-s},\dots ,c_{n-s-1})}, where all subscripts are reduced modn{\displaystyle n}.[13]Multi-twisted codesare further generalizations of QT codes, which join multiple QT codes end to end.[13][14] This article incorporates material from cyclic code onPlanetMath, which is licensed under theCreative Commons Attribution/Share-Alike License.
https://en.wikipedia.org/wiki/Cyclic_code
Incoding theory,folded Reed–Solomon codesare likeReed–Solomon codes, which are obtained by mappingm{\displaystyle m}Reed–Solomon codewords over a larger alphabet by careful bundling of codeword symbols. Folded Reed–Solomon codes are also a special case ofParvaresh–Vardy codes. Using optimal parameters one can decode with arateofR, and achieve a decoding radius of 1 −R. The term "folded Reed–Solomon codes" was coined in a paper by V.Y. Krachkovsky with an algorithm that presented Reed–Solomon codes with many random "phased burst" errors.[1]The list-decoding algorithm for folded RS codes corrects beyond the1−R{\displaystyle 1-{\sqrt {R}}}bound for Reed–Solomon codes achieved by theGuruswami–Sudanalgorithm for such phased burst errors. One of the ongoing challenges in Coding Theory is to have error correcting codes achieve an optimal trade-off between (Coding) Rate and Error-Correction Radius. Though this may not be possible to achieve practically (due to Noisy Channel Coding Theory issues), quasi optimal tradeoffs can be achieved theoretically. Prior to Folded Reed–Solomon codes being devised, the best Error-Correction Radius achieved was1−R{\displaystyle 1-{\sqrt {R}}}, byReed–Solomon codesfor all ratesR{\displaystyle R}. An improvement upon this1−R{\displaystyle 1-{\sqrt {R}}}bound was achieved by Parvaresh and Vardy for ratesR<116.{\displaystyle R<{\tfrac {1}{16}}.} ForR→0{\displaystyle R\to 0}the Parvaresh–Vardy algorithm can decode a fraction1−O(Rlog⁡(1/R)){\displaystyle 1-O(R\log(1/R))}of errors. Folded Reed–Solomon Codes improve on these previous constructions, and can be list decoded in polynomial time for a fraction(1−R−ε){\displaystyle (1-R-\varepsilon )}of errors for any constantε>0{\displaystyle \varepsilon >0}. Consider a Reed–Solomon[n=q−1,k]q{\displaystyle [n=q-1,k]_{q}}code of lengthn{\displaystyle n}anddimensionk{\displaystyle k}and a folding parameterm≥1{\displaystyle m\geq 1}. Assume thatm{\displaystyle m}dividesn{\displaystyle n}. Mapping for Reed–Solomon codes like this: whereγ∈Fq{\displaystyle \gamma \in \mathbb {F} _{q}}is aprimitive elementin Them{\displaystyle m}folded version of Reed Solomon codeC{\displaystyle C}, denotedFRSF,γ,m,k{\displaystyle FRS_{\mathbb {F} ,\gamma ,m,k}}is a code of block lengthN=n/m{\displaystyle N=n/m}overFm{\displaystyle \mathbb {F} ^{m}}.FRSF,γ,m,k{\displaystyle FRS_{\mathbb {F} ,\gamma ,m,k}}are just[q−1,k]{\displaystyle [q-1,k]}Reed Solomon codes withm{\displaystyle m}consecutive symbols from RS codewords grouped together. The above definition is made more clear by means of the diagram withm=3{\displaystyle m=3}, wherem{\displaystyle m}is the folding parameter. The message is denoted byf(X){\displaystyle f(X)}, which when encoded using Reed–Solomon encoding, consists of values off{\displaystyle f}atx0,x1,x2,…,xn−1{\displaystyle x_{0},x_{1},x_{2},\ldots ,x_{n-1}}, wherexi=γi{\displaystyle x_{i}=\gamma ^{i}}. Then bundling is performed in groups of 3 elements, to give a codeword of lengthn/3{\displaystyle n/3}over the alphabetFq3{\displaystyle \mathbb {F} _{q}^{3}}. Something to be observed here is that the folding operation demonstrated does not change the rateR{\displaystyle R}of the original Reed–Solomon code. To prove this, consider a linear[n,k,d]q{\displaystyle [n,k,d]_{q}}code, of lengthn{\displaystyle n},dimensionk{\displaystyle k}anddistanced{\displaystyle d}. Them{\displaystyle m}folding operation will make it a[nm,km,dm]qm{\displaystyle \left[{\tfrac {n}{m}},{\tfrac {k}{m}},{\tfrac {d}{m}}\right]_{q^{m}}}code. By this, therateR=kn{\displaystyle R={\tfrac {k}{n}}}will be the same. According to the asymptotic version of thesingleton bound, it is known that therelative distanceδ{\displaystyle \delta }, of a code must satisfyR⩽1−δ+o(1){\displaystyle R\leqslant 1-\delta +o(1)}whereR{\displaystyle R}is the rate of the code. As proved earlier, since the rateR{\displaystyle R}is maintained, the relative distanceδ⩽1−R{\displaystyle \delta \leqslant 1-R}also meets the Singleton bound. Folded Reed–Solomon codes are basically the same as Reed Solomon codes, just viewed over a larger alphabet. To show how this might help, consider a folded Reed–Solomon code withm=3{\displaystyle m=3}. Decoding a Reed–Solomon code and folded Reed–Solomon code for the same fraction of errorsρ{\displaystyle \rho }are tasks of almost the same computational intensity: one canunfoldthe received word of the folded Reed–Solomon code, treat it as a received word of the original Reed–Solomon code, and run the Reed–Solomon list decoding algorithm on it. Obviously, this list will contain all the folded Reed–Solomon codewords within distanceρ{\displaystyle \rho }of the received word, along with some extras, which we can expurgate. Also, decoding a folded Reed–Solomon code is an easier task. Suppose we want to correct a third of the errors. The decoding algorithm chosen must correct an error pattern that corrects every third symbol in the Reed–Solomon encoding. But after folding, this error pattern will corrupt all symbols overFq3{\displaystyle \mathbb {F} _{q}^{3}}and will eliminate the need for error correction. This propagation of errors is indicated by the blue color in the graphical description. This proves that for a fixed fraction of errorsρ,{\displaystyle \rho ,}the folding operation reduces the channel's flexibility to distribute errors, which in turn leads to a reduction in the number of error patterns that need to be corrected. We can relate Folded Reed Solomon codes withParvaresh Vardycodes which encodes a polynomialf{\displaystyle f}of degreek{\displaystyle k}with polynomialsf0=f,f1,…,fs−1(s⩾2){\displaystyle f_{0}=f,f_{1},\ldots ,f_{s-1}(s\geqslant 2)}wherefi(X)=fi−1(X)dmodE(X){\displaystyle f_{i}(X)=f_{i-1}(X)^{d}\mod E(X)}whereE(X){\displaystyle E(X)}is anirreducible polynomial. While choosing irreducible polynomialE(X)=Xq−γ{\displaystyle E(X)=X^{q}-\gamma }and parameterd{\displaystyle d}we should check if every polynomialf{\displaystyle f}of degree at mostk{\displaystyle k}satisfiesf(γX)=f(X)dmodE(X){\displaystyle f(\gamma X)=f(X)^{d}\mod E(X)}sincef(γX){\displaystyle f(\gamma X)}is just the shifted counterpart off(X){\displaystyle f(X)}whereγ{\displaystyle \gamma }is theprimitive elementinFq.{\displaystyle \mathbb {F} _{q}.}Thus folded RS code with bundling together code symbols is PV code of orders=m{\displaystyle s=m}for the set of evaluation points If we compare the folded RS code to a PV code of order 2 for the set of evaluation points we can see that in PV encoding off{\displaystyle f}, for every0≤i≤n/m−1{\displaystyle 0\leq i\leq n/m-1}and every0<j<m−1,f(γmi+j){\displaystyle 0<j<m-1,f(\gamma ^{mi+j})}appears atf(γmi+j){\displaystyle f(\gamma ^{mi+j})}andf1(γ−1γmi+j){\displaystyle f_{1}(\gamma ^{-1}\gamma ^{mi+j})}, unlike in the folded FRS encoding in which it appears only once. Thus, the PV and folded RS codes have same information but only the rate of FRS is bigger by a factor of2(m−1)/m{\displaystyle 2(m-1)/m}and hence thelist decodingradius trade-off is better for folded RS code by just using the list decodability of the PV codes. The plus point is in choosing FRS code in a way that they are compressed forms of suitable PV code with similar error correction performance with better rate than corresponding PV code. One can use this idea to construct a folded RS codes of rateR{\displaystyle R}that are list decodable up to radius approximately1−Rs/[s+1]{\displaystyle 1-R^{s/[s+1]}}fors≥1{\displaystyle s\geq 1}.[1] Alist decodingalgorithm which runs in quadratic time to decode FRS code up to radius1−R−ε{\displaystyle 1-R-\varepsilon }is presented by Guruswami. The algorithm essentially has three steps namely the interpolation step in whichWelch–Berlekamp-styleinterpolation is used to interpolate the non-zero polynomial after which all the polynomialsf∈Fq[X]{\displaystyle f\in \mathbb {F} _{q}[X]}with degreek−1{\displaystyle k-1}satisfying the equation derived in interpolation are found. In the third step the actual list of close-by codewords are known by pruning the solution subspace which takesqs{\displaystyle q^{s}}time. Guruswami presents anΩ(1/ε2){\displaystyle n^{\Omega (1/\varepsilon ^{2})}}time list decoding algorithm based on linear-algebra, which can decode folded Reed–Solomon code up to radius1−R−ε{\displaystyle 1-R-\varepsilon }with a list-size ofnO(1/ε2){\displaystyle {n^{O(1/\varepsilon ^{2})}}}. There are three steps in this algorithm: Interpolation Step, Root Finding Step and Prune Step. In the Interpolation step it will try to find the candidate message polynomialf(x){\displaystyle f(x)}by solving a linear system. In the Root Finding step, it will try to find the solution subspace by solving another linear system. The last step will try to prune the solution subspace gained in the second step. We will introduce each step in details in the following. It is aWelch–Berlekamp-styleinterpolation (because it can be viewed as the higher-dimensional generalization of the Welch–Berlekamp algorithm). Suppose we received a codewordy{\displaystyle y}of them{\displaystyle m}-folded Reed–Solomon code as shown below We interpolate the nonzero polynomial by using a carefully chosen degree parameterD{\displaystyle D}. So the interpolation requirements will be Then the number of monomials inQ(X,Y1,…,Ys){\displaystyle Q(X,Y_{1},\ldots ,Y_{s})}is Because the number of monomials inQ(X,Y1,…,Ys){\displaystyle Q(X,Y_{1},\ldots ,Y_{s})}is greater than the number of interpolation conditions. We have below lemma This lemma shows us that the interpolation step can be done in near-linear time. For now, we have talked about everything we need for the multivariate polynomialQ(X,Y1,…,Ys){\displaystyle Q(X,Y_{1},\ldots ,Y_{s})}. The remaining task is to focus on the message polynomialsf(X){\displaystyle f(X)}. Here "agree" means that all them{\displaystyle m}values in a column should match the corresponding values in codewordy{\displaystyle y}. This lemma shows us that any such polynomialQ(X,Y1,…,Ys){\displaystyle Q(X,Y_{1},\ldots ,Y_{s})}presents an algebraic condition that must be satisfied for those message polynomialsf(x){\displaystyle f(x)}that we are interested in list decoding. Combining Lemma 2 and parameterD{\displaystyle D}, we have Further we can get the decoding bound We notice that the fractional agreement is During this step, our task focus on how to find all polynomialsf∈Fq[X]{\displaystyle f\in {\mathbb {F} _{q}[X]}}with degree no more thank−1{\displaystyle k-1}and satisfy the equation we get from Step 1, namely Since the above equation forms a linear system equations overFq{\displaystyle \mathbb {F} _{q}}in the coefficientsf0,f1,…,fk−1{\displaystyle f_{0},f_{1},\ldots ,f_{k-1}}of the polynomial the solutions to the above equation is anaffine subspaceofFqk{\displaystyle \mathbb {F} _{q}^{k}}. This fact is the key point that gives rise to an efficient algorithm - we can solve the linear system. It is natural to ask how large is the dimension of the solution? Is there any upper bound on the dimension? Having an upper bound is very important in constructing an efficient list decoding algorithm because one can simply output all the codewords for any given decoding problem. Actually it indeed has an upper bound as below lemma argues. This lemma shows us the upper bound of the dimension for the solution space. Finally, based on the above analysis, we have below theorem Whens=m=1{\displaystyle s=m=1}, we notice that this reduces to a unique decoding algorithm with up to a fraction(1−R)/2{\displaystyle (1-R)/2}of errors. In other words, we can treat unique decoding algorithm as a specialty of list decoding algorithm. The quantity is aboutnO(1/ε){\displaystyle n^{O(1/\varepsilon )}}for the parameter choices that achieve a list decoding radius of1−R−ε{\displaystyle 1-R-\varepsilon }. Theorem 1 tells us exactly how large the error radius would be. Now we finally get the solution subspace. However, there is still one problem standing. The list size in the worst case isnΩ(1/ε){\displaystyle n^{\Omega (1/\varepsilon )}}. But the actual list of close-by codewords is only a small set within that subspace. So we need some process to prune the subspace to narrow it down. This prune process takesqs{\displaystyle q^{s}}time in the worst case. Unfortunately it is not known how to improve the running time because we do not know how to improve the bound of the list size for folded Reed-Solomon code. Things get better if we change the code by carefully choosing a subset of all possible degreek−1{\displaystyle k-1}polynomials as messages, the list size shows to be much smaller while only losing a little bit in the rate. We will talk about this briefly in next step. By converting the problem of decoding a folded Reed–Solomon code into two linear systems, one linear system that is used for the interpolation step and another linear system to find the candidate solution subspace, the complexity of the decoding problem is successfully reduced to quadratic. However, in the worst case, the bound of list size of the output is pretty bad. It was mentioned in Step 2 that if one carefully chooses only a subset of all possible degreek−1{\displaystyle k-1}polynomials as messages, the list size can be much reduced. Here we will expand our discussion. To achieve this goal, the idea is to limit the coefficient vector(f0,f1,…,fk−1){\displaystyle (f_{0},f_{1},\ldots ,f_{k-1})}to a special subsetν⊆Fqk{\displaystyle \nu \subseteq \mathbb {F} _{q}^{k}}, which satisfies below two conditions: This is to make sure that the rate will be at most reduced by factor of(1−ε){\displaystyle (1-\varepsilon )}. The bound for the list size at worst case isnΩ(1/ε){\displaystyle n^{\Omega (1/\varepsilon )}}, and it can be reduced to a relative small boundO(1/ε2){\displaystyle O(1/\varepsilon ^{2})}by using subspace-evasive subsets. During this step, as it has to check each element of the solution subspace that we get from Step 2, it takesqs{\displaystyle q^{s}}time in the worst case (s{\displaystyle s}is the dimension of the solution subspace). Dvir and Lovett improved the result based on the work of Guruswami, which can reduce the list size to a constant. Here is only presented the idea that is used to prune the solution subspace. For the details of the prune process, please refer to papers by Guruswami, Dvir and Lovett, which are listed in the reference. If we don't consider the Step 3, this algorithm can run in quadratic time. A summary for this algorithm is listed below.
https://en.wikipedia.org/wiki/Folded_Reed%E2%80%93Solomon_code
Incomputing,telecommunication,information theory, andcoding theory,forward error correction(FEC) orchannel coding[1][2][3]is a technique used forcontrolling errorsindata transmissionover unreliable or noisycommunication channels. The central idea is that the sender encodes the message in aredundantway, most often by using anerror correction code, orerror correcting code(ECC).[4][5]The redundancy allows the receiver not only todetect errorsthat may occur anywhere in the message, but often to correct a limited number of errors. Therefore areverse channelto request re-transmission may not be needed. The cost is a fixed, higher forward channel bandwidth. The American mathematicianRichard Hammingpioneered this field in the 1940s and invented the first error-correcting code in 1950: theHamming (7,4) code.[5] FEC can be applied in situations where re-transmissions are costly or impossible, such as one-way communication links or when transmitting to multiple receivers inmulticast. Long-latency connections also benefit; in the case of satellites orbiting distant planets, retransmission due to errors would create a delay of several hours. FEC is also widely used inmodemsand incellular networks. FEC processing in a receiver may be applied to a digital bit stream or in the demodulation of a digitally modulated carrier. For the latter, FEC is an integral part of the initialanalog-to-digital conversionin the receiver. TheViterbi decoderimplements asoft-decision algorithmto demodulate digital data from an analog signal corrupted by noise. Many FEC decoders can also generate abit-error rate(BER) signal which can be used as feedback to fine-tune the analog receiving electronics. FEC information is added tomass storage(magnetic, optical and solid state/flash based) devices to enable recovery of corrupted data, and is used asECCcomputer memoryon systems that require special provisions for reliability. The maximum proportion of errors or missing bits that can be corrected is determined by the design of the ECC, so different forward error correcting codes are suitable for different conditions. In general, a stronger code induces more redundancy that needs to be transmitted using the available bandwidth, which reduces the effective bit-rate while improving the received effectivesignal-to-noise ratio. Thenoisy-channel coding theoremofClaude Shannoncan be used to compute the maximum achievable communication bandwidth for a given maximum acceptable error probability. This establishes bounds on the theoretical maximum information transfer rate of a channel with some given base noise level. However, the proof is not constructive, and hence gives no insight of how to build a capacity achieving code. After years of research, some advanced FEC systems likepolar code[3]come very close to the theoretical maximum given by the Shannon channel capacity under the hypothesis of an infinite length frame. ECC is accomplished by addingredundancyto the transmitted information using an algorithm. A redundant bit may be a complicated function of many original information bits. The original information may or may not appear literally in the encoded output; codes that include the unmodified input in the output aresystematic, while those that do not arenon-systematic. A simplistic example of ECC is to transmit each data bit three times, which is known as a (3,1)repetition code. Through a noisy channel, a receiver might see eight versions of the output, see table below. This allows an error in any one of the three samples to be corrected by "majority vote", or "democratic voting". The correcting ability of this ECC is: Though simple to implement and widely used, thistriple modular redundancyis a relatively inefficient ECC. Better ECC codes typically examine the last several tens or even the last several hundreds of previously received bits to determine how to decode the current small handful of bits (typically in groups of two to eight bits). ECC could be said to work by "averaging noise"; since each data bit affects many transmitted symbols, the corruption of some symbols by noise usually allows the original user data to be extracted from the other, uncorrupted received symbols that also depend on the same user data. Most telecommunication systems use a fixedchannel codedesigned to tolerate the expected worst-casebit error rate, and then fail to work at all if the bit error rate is ever worse. However, some systems adapt to the given channel error conditions: some instances ofhybrid automatic repeat-requestuse a fixed ECC method as long as the ECC can handle the error rate, then switch toARQwhen the error rate gets too high;adaptive modulation and codinguses a variety of ECC rates, adding more error-correction bits per packet when there are higher error rates in the channel, or taking them out when they are not needed. The two main categories of ECC codes areblock codesandconvolutional codes. There are many types of block codes;Reed–Solomon codingis noteworthy for its widespread use incompact discs,DVDs, andhard disk drives. Other examples of classical block codes includeGolay,BCH,Multidimensional parity, andHamming codes. Hamming ECC is commonly used to correctNAND flashmemory errors.[6]This provides single-bit error correction and 2-bit error detection. Hamming codes are only suitable for more reliablesingle-level cell(SLC) NAND. Densermulti-level cell(MLC) NAND may use multi-bit correcting ECC such as BCH or Reed–Solomon.[7][8]NOR Flash typically does not use any error correction.[7] Classical block codes are usually decoded usinghard-decisionalgorithms,[9]which means that for every input and output signal a hard decision is made whether it corresponds to a one or a zero bit. In contrast, convolutional codes are typically decoded usingsoft-decisionalgorithms like the Viterbi, MAP orBCJRalgorithms, which process (discretized) analog signals, and which allow for much higher error-correction performance than hard-decision decoding. Nearly all classical block codes apply the algebraic properties offinite fields. Hence classical block codes are often referred to as algebraic codes. In contrast to classical block codes that often specify an error-detecting or error-correcting ability, many modern block codes such asLDPC codeslack such guarantees. Instead, modern codes are evaluated in terms of their bit error rates. Mostforward error correctioncodes correct only bit-flips, but not bit-insertions or bit-deletions. In this setting, theHamming distanceis the appropriate way to measure thebit error rate. A few forward error correction codes are designed to correct bit-insertions and bit-deletions, such as Marker Codes and Watermark Codes. TheLevenshtein distanceis a more appropriate way to measure the bit error rate when using such codes.[10] The fundamental principle of ECC is to add redundant bits in order to help the decoder to find out the true message that was encoded by the transmitter. The code-rate of a given ECC system is defined as the ratio between the number of information bits and the total number of bits (i.e., information plus redundancy bits) in a given communication package. The code-rate is hence a real number. A low code-rate close to zero implies a strong code that uses many redundant bits to achieve a good performance, while a large code-rate close to 1 implies a weak code. The redundant bits that protect the information have to be transferred using the same communication resources that they are trying to protect. This causes a fundamental tradeoff between reliability and data rate.[11]In one extreme, a strong code (with low code-rate) can induce an important increase in the receiver SNR (signal-to-noise-ratio) decreasing the bit error rate, at the cost of reducing the effective data rate. On the other extreme, not using any ECC (i.e., a code-rate equal to 1) uses the full channel for information transfer purposes, at the cost of leaving the bits without any additional protection. One interesting question is the following: how efficient in terms of information transfer can an ECC be that has a negligible decoding error rate? This question was answered by Claude Shannon with his second theorem, which says that the channel capacity is the maximum bit rate achievable by any ECC whose error rate tends to zero:[12]His proof relies on Gaussian random coding, which is not suitable to real-world applications. The upper bound given by Shannon's work inspired a long journey in designing ECCs that can come close to the ultimate performance boundary. Various codes today can attain almost the Shannon limit. However, capacity achieving ECCs are usually extremely complex to implement. The most popular ECCs have a trade-off between performance and computational complexity. Usually, their parameters give a range of possible code rates, which can be optimized depending on the scenario. Usually, this optimization is done in order to achieve a low decoding error probability while minimizing the impact to the data rate. Another criterion for optimizing the code rate is to balance low error rate and retransmissions number in order to the energy cost of the communication.[13] Classical (algebraic) block codes and convolutional codes are frequently combined inconcatenatedcoding schemes in which a short constraint-length Viterbi-decoded convolutional code does most of the work and a block code (usually Reed–Solomon) with larger symbol size and block length "mops up" any errors made by the convolutional decoder. Single pass decoding with this family of error correction codes can yield very low error rates, but for long range transmission conditions (like deep space) iterative decoding is recommended. Concatenated codes have been standard practice in satellite and deep space communications sinceVoyager 2first used the technique in its 1986 encounter withUranus. TheGalileocraft used iterative concatenated codes to compensate for the very high error rate conditions caused by having a failed antenna. Low-density parity-check(LDPC) codes are a class of highly efficient linear block codes made from many single parity check (SPC) codes. They can provide performance very close to thechannel capacity(the theoretical maximum) using an iterated soft-decision decoding approach, at linear time complexity in terms of their block length. Practical implementations rely heavily on decoding the constituent SPC codes in parallel. LDPC codes were first introduced byRobert G. Gallagerin his PhD thesis in 1960, but due to the computational effort in implementing encoder and decoder and the introduction ofReed–Solomoncodes, they were mostly ignored until the 1990s. LDPC codes are now used in many recent high-speed communication standards, such asDVB-S2(Digital Video Broadcasting – Satellite – Second Generation),WiMAX(IEEE 802.16estandard for microwave communications), High-Speed Wireless LAN (IEEE 802.11n),[14]10GBase-T Ethernet(802.3an) andG.hn/G.9960(ITU-T Standard for networking over power lines, phone lines and coaxial cable). Other LDPC codes are standardized for wireless communication standards within3GPPMBMS(seefountain codes). Turbo codingis an iterated soft-decoding scheme that combines two or more relatively simple convolutional codes and an interleaver to produce a block code that can perform to within a fraction of a decibel of theShannon limit. PredatingLDPC codesin terms of practical application, they now provide similar performance. One of the earliest commercial applications of turbo coding was theCDMA2000 1x(TIA IS-2000) digital cellular technology developed byQualcommand sold byVerizon Wireless,Sprint, and other carriers. It is also used for the evolution of CDMA2000 1x specifically for Internet access,1xEV-DO(TIA IS-856). Like 1x, EV-DO was developed byQualcomm, and is sold byVerizon Wireless,Sprint, and other carriers (Verizon's marketing name for 1xEV-DO isBroadband Access, Sprint's consumer and business marketing names for 1xEV-DO arePower VisionandMobile Broadband, respectively). Sometimes it is only necessary to decode single bits of the message, or to check whether a given signal is a codeword, and do so without looking at the entire signal. This can make sense in a streaming setting, where codewords are too large to be classically decoded fast enough and where only a few bits of the message are of interest for now. Also such codes have become an important tool incomputational complexity theory, e.g., for the design ofprobabilistically checkable proofs. Locally decodable codesare error-correcting codes for which single bits of the message can be probabilistically recovered by only looking at a small (say constant) number of positions of a codeword, even after the codeword has been corrupted at some constant fraction of positions.Locally testable codesare error-correcting codes for which it can be checked probabilistically whether a signal is close to a codeword by only looking at a small number of positions of the signal. Not all testing codes are locally decoding and testing of codes Not all locally decodable codes (LDCs) are locally testable codes (LTCs)[15]neither locally correctable codes (LCCs),[16]q-query LCCs are bounded exponentially[17][18]while LDCs can havesubexponentiallengths.[19][20] Interleaving is frequently used in digital communication and storage systems to improve the performance of forward error correcting codes. Manycommunication channelsare not memoryless: errors typically occur inburstsrather than independently. If the number of errors within acode wordexceeds the error-correcting code's capability, it fails to recover the original code word. Interleaving alleviates this problem by shuffling source symbols across several code words, thereby creating a moreuniform distributionof errors.[21]Therefore, interleaving is widely used forburst error-correction. The analysis of modern iterated codes, liketurbo codesandLDPC codes, typically assumes an independent distribution of errors.[22]Systems using LDPC codes therefore typically employ additional interleaving across the symbols within a code word.[23] For turbo codes, an interleaver is an integral component and its proper design is crucial for good performance.[21][24]The iterative decoding algorithm works best when there are not short cycles in thefactor graphthat represents the decoder; the interleaver is chosen to avoid short cycles. Interleaver designs include: In multi-carriercommunication systems, interleaving across carriers may be employed to provide frequencydiversity, e.g., to mitigatefrequency-selective fadingor narrowband interference.[28] Transmission without interleaving: Here, each group of the same letter represents a 4-bit one-bit error-correcting codeword. The codeword cccc is altered in one bit and can be corrected, but the codeword dddd is altered in three bits, so either it cannot be decoded at all or it might bedecoded incorrectly. With interleaving: In each of the codewords "aaaa", "eeee", "ffff", and "gggg", only one bit is altered, so one-bit error-correcting code will decode everything correctly. Transmission without interleaving: The term "AnExample" ends up mostly unintelligible and difficult to correct. With interleaving: No word is completely lost and the missing letters can be recovered with minimal guesswork. Use of interleaving techniques increases total delay. This is because the entire interleaved block must be received before the packets can be decoded.[29]Also interleavers hide the structure of errors; without an interleaver, more advanced decoding algorithms can take advantage of the error structure and achieve more reliable communication than a simpler decoder combined with an interleaver[citation needed]. An example of such an algorithm is based onneural network[30]structures. Simulating the behaviour of error-correcting codes (ECCs) in software is a common practice to design, validate and improve ECCs. The upcoming wireless 5G standard raises a new range of applications for the software ECCs: theCloud Radio Access Networks (C-RAN)in aSoftware-defined radio (SDR)context. The idea is to directly use software ECCs in the communications. For instance in the 5G, the software ECCs could be located in the cloud and the antennas connected to this computing resources: improving this way the flexibility of the communication network and eventually increasing the energy efficiency of the system. In this context, there are various available Open-source software listed below (non exhaustive).
https://en.wikipedia.org/wiki/Forward_error_correction
In thecomputer sciencesubfield ofalgorithmic information theory, aChaitin constant(Chaitin omega number)[1]orhalting probabilityis areal numberthat, informally speaking, represents theprobabilitythat a randomly constructed program will halt. These numbers are formed from a construction due toGregory Chaitin. Although there are infinitely many halting probabilities, one for each (universal, see below) method of encoding programs, it is common to use the letterΩto refer to them as if there were only one. BecauseΩdepends on the program encoding used, it is sometimes calledChaitin's constructionwhen not referring to any specific encoding. Each halting probability is anormalandtranscendentalreal number that is notcomputable, which means that there is noalgorithmto compute its digits. Each halting probability isMartin-Löf random, meaning there is not even any algorithm which can reliably guess its digits. The definition of a halting probability relies on the existence of a prefix-free universal computable function. Such a function, intuitively, represents a program in a programming language with the property that no valid program can be obtained as a proper extension of another valid program. Suppose thatFis apartial functionthat takes one argument, a finite binary string, and possibly returns a single binary string as output. The functionFis calledcomputableif there is aTuring machinethat computes it, in the sense that for any finite binary stringsxandy,F(x) =yif and only if the Turing machine halts withyon its tape when given the inputx. The functionFis calleduniversalif for every computable functionfof a single variable there is a stringwsuch that for allx,F(wx) =f(x); herewxrepresents theconcatenationof the two stringswandx. This means thatFcan be used to simulate any computable function of one variable. Informally,wrepresents a "script" for the computable functionf, andFrepresents an "interpreter" that parses the script as a prefix of its input and then executes it on the remainder of input. ThedomainofFis the set of all inputspon which it is defined. ForFthat are universal, such apcan generally be seen both as the concatenation of a program part and a data part, and as a single program for the functionF. The functionFis called prefix-free if there are no two elementsp,p′in its domain such thatp′is a proper extension ofp. This can be rephrased as: the domain ofFis aprefix-free code(instantaneous code) on the set of finite binary strings. A simple way to enforce prefix-free-ness is to use machines whose means of input is a binary stream from which bits can be read one at a time. There is no end-of-stream marker; the end of input is determined by when the universal machine decides to stop reading more bits, and the remaining bits are not considered part of the accepted string. Here, the difference between the two notions of program mentioned in the last paragraph becomes clear: one is easily recognized by some grammar, while the other requires arbitrary computation to recognize. The domain of any universal computable function is acomputably enumerable setbut never acomputable set. The domain is alwaysTuring equivalentto thehalting problem. LetPFbe the domain of a prefix-free universal computable functionF. The constantΩFis then defined as ΩF=∑p∈PF2−|p|,{\displaystyle \Omega _{F}=\sum _{p\in P_{F}}2^{-|p|},} where|p|denotes the length of a stringp. This is aninfinite sumwhich has one summand for everypin the domain ofF. The requirement that the domain be prefix-free, together withKraft's inequality, ensures that this sum converges to areal numberbetween 0 and 1. IfFis clear from context thenΩFmay be denoted simplyΩ, although different prefix-free universal computable functions lead to different values ofΩ. Knowing the firstNbits ofΩ, one could calculate thehalting problemfor all programs of a size up toN. Let the programpfor which the halting problem is to be solved beNbits long. Indovetailingfashion, all programs of all lengths are run, until enough have halted to jointly contribute enough probability to match these firstNbits. If the programphas not halted yet, then it never will, since its contribution to the halting probability would affect the firstNbits. Thus, the halting problem would be solved forp. Because many outstanding problems in number theory, such asGoldbach's conjecture, are equivalent to solving the halting problem for special programs (which would basically search for counter-examples and halt if one is found), knowing enough bits of Chaitin's constant would also imply knowing the answer to these problems. But as the halting problem is not generally solvable, calculating any but the first few bits of Chaitin's constant is not possible for a universal language. This reduces hard problems to impossible ones, much like trying to build anoracle machine for the halting problemwould be. TheCantor spaceis the collection of all infinite sequences of 0s and 1s. A halting probability can be interpreted as themeasureof a certain subset of Cantor space under the usualprobability measureon Cantor space. It is from this interpretation that halting probabilities take their name. The probability measure on Cantor space, sometimes called the fair-coin measure, is defined so that for any binary stringxthe set of sequences that begin withxhas measure2−|x|. This implies that for each natural numbern, the set of sequencesfin Cantor space such thatf(n)= 1 has measure⁠1/2⁠, and the set of sequences whosenth element is 0 also has measure⁠1/2⁠. LetFbe a prefix-free universal computable function. The domainPofFconsists of an infinite set of binary strings P={p1,p2,…}.{\displaystyle P=\{p_{1},p_{2},\ldots \}.} Each of these stringspidetermines a subsetSiof Cantor space; the setSicontains all sequences in cantor space that begin withpi. These sets are disjoint becausePis a prefix-free set. The sum ∑p∈P2−|p|{\displaystyle \sum _{p\in P}2^{-|p|}} represents the measure of the set ⋃i∈NSi.{\displaystyle \bigcup _{i\in \mathbb {N} }S_{i}.} In this way,ΩFrepresents the probability that a randomly selected infinite sequence of 0s and 1s begins with a bit string (of some finite length) that is in the domain ofF. It is for this reason thatΩFis called a halting probability. Each Chaitin constantΩhas the following properties: Not every set that is Turing equivalent to the halting problem is a halting probability. Afinerequivalence relation, Solovay equivalence, can be used to characterize the halting probabilities among the left-c.e. reals.[4]One can show that a real number in[0,1]is a Chaitin constant (i.e. the halting probability of some prefix-free universal computable function) if and only if it is left-c.e. and algorithmically random.[4]Ωis among the fewdefinablealgorithmically random numbers and is the best-known algorithmically random number, but it is not at all typical of all algorithmically random numbers.[5] A real number is called computable if there is an algorithm which, givenn, returns the firstndigits of the number. This is equivalent to the existence of a program that enumerates the digits of the real number. No halting probability is computable. The proof of this fact relies on an algorithm which, given the firstndigits ofΩ, solves Turing'shalting problemfor programs of length up ton. Since the halting problem isundecidable,Ωcannot be computed. The algorithm proceeds as follows. Given the firstndigits ofΩand ak≤n, the algorithm enumerates the domain ofFuntil enough elements of the domain have been found so that the probability they represent is within2−(k+1)ofΩ. After this point, no additional program of lengthkcan be in the domain, because each of these would add2−kto the measure, which is impossible. Thus the set of strings of lengthkin the domain is exactly the set of such strings already enumerated. A real number is random if the binary sequence representing the real number is analgorithmically random sequence. Calude, Hertling, Khoussainov, and Wang showed[6]that a recursively enumerable real number is an algorithmically random sequence if and only if it is a Chaitin'sΩnumber. For each specific consistent effectively representedaxiomatic systemfor thenatural numbers, such asPeano arithmetic, there exists a constantNsuch that no bit ofΩafter theNth can be proven to be 1 or 0 within that system. The constantNdepends on how theformal systemis effectively represented, and thus does not directly reflect the complexity of the axiomatic system. This incompleteness result is similar toGödel's incompleteness theoremin that it shows that no consistent formal theory for arithmetic can be complete. The firstnbits ofGregory Chaitin's constantΩare random or incompressible in the sense that they cannot be computed by a halting algorithm with fewer thann− O(1)bits. However, consider the short but never halting algorithm which systematically lists and runs all possible programs; whenever one of them halts its probability gets added to the output (initialized by zero). After finite time the firstnbits of the output will never change any more (it does not matter that this time itself is not computable by a halting program). So there is a short non-halting algorithm whose output converges (after finite time) onto the firstnbits ofΩ. In other words, theenumerablefirstnbits ofΩare highly compressible in the sense that they arelimit-computableby a very short algorithm; they are notrandomwith respect to the set of enumerating algorithms.Jürgen Schmidhuberconstructed a limit-computable "SuperΩ" which in a sense is much more random than the original limit-computableΩ, as one cannot significantly compress the SuperΩby any enumerating non-halting algorithm.[7] For an alternative "SuperΩ", theuniversality probabilityof aprefix-freeuniversal Turing machine(UTM) – namely, the probability that it remains universal even when every input of it (as abinary string) is prefixed by a random binary string – can be seen as the non-halting probability of a machine with oracle the third iteration of thehalting problem(i.e.,O(3)usingTuring jumpnotation).[8]
https://en.wikipedia.org/wiki/Chaitin%27s_constant
Incomputer scienceandinformation theory, acanonical Huffman codeis a particular type ofHuffman codewith unique properties which allow it to be described in a very compact manner. Rather than storing the structure of the code tree explicitly, canonical Huffman codes are ordered in such a way that it suffices to only store the lengths of the codewords, which reduces the overhead of the codebook. Data compressorsgenerally work in one of two ways. Either the decompressor can infer whatcodebookthe compressor has used from previous context, or the compressor must tell the decompressor what the codebook is. Since a canonical Huffman codebook can be stored especially efficiently, most compressors start by generating a "normal" Huffman codebook, and then convert it to canonical Huffman before using it. In order for asymbol codescheme such as theHuffman codeto be decompressed, the same model that the encoding algorithm used to compress the source data must be provided to the decoding algorithm so that it can use it to decompress the encoded data. In standard Huffman coding this model takes the form of a tree of variable-length codes, with the most frequent symbols located at the top of the structure and being represented by the fewest bits. However, this code tree introduces two critical inefficiencies into an implementation of the coding scheme. Firstly, each node of the tree must store either references to its child nodes or the symbol that it represents. This is expensive in memory usage and if there is a high proportion of unique symbols in the source data then the size of the code tree can account for a significant amount of the overall encoded data. Secondly, traversing the tree is computationally costly, since it requires the algorithm to jump randomly through the structure in memory as each bit in the encoded data is read in. Canonical Huffman codes address these two issues by generating the codes in a clear standardized format; all the codes for a given length are assigned their values sequentially. This means that instead of storing the structure of the code tree for decompression only the lengths of the codes are required, reducing the size of the encoded data. Additionally, because the codes are sequential, the decoding algorithm can be dramatically simplified so that it is computationally efficient. The normal Huffman codingalgorithmassigns a variable length code to every symbol in the alphabet. More frequently used symbols will be assigned a shorter code. For example, suppose we have the followingnon-canonical codebook: Here the letter A has been assigned 2bits, B has 1 bit, and C and D both have 3 bits. To make the code acanonicalHuffman code, the codes are renumbered. The bit lengths stay the same with the code book being sortedfirstby codeword length andsecondlybyalphabeticalvalueof the letter: Each of the existing codes are replaced with a new one of the same length, using the following algorithm: By following these three rules, thecanonicalversion of the code book produced will be: Another perspective on the canonical codewords is that they are the digits past theradix point(binary point) in a binary representation of a certain series. Specifically, suppose the lengths of the codewords arel1...ln. Then the canonical codeword for symboliis the firstlibinary digits past the radix point in the binary representation of ∑j=1i−12−lj.{\displaystyle \sum _{j=1}^{i-1}2^{-l_{j}}.} This perspective is particularly useful in light ofKraft's inequality, which says that the sum above will always be less than or equal to 1 (since the lengths come from a prefix free code). This shows that adding one in the algorithm above never overflows and creates a codeword that is longer than intended. The advantage of a canonical Huffman tree is that it can be encoded in fewer bits than an arbitrary tree. Let us take our original Huffman codebook: There are several ways we could encode this Huffman tree. For example, we could write eachsymbolfollowed by thenumber of bitsandcode: Since we are listing the symbols in sequential alphabetical order, we can omit the symbols themselves, listing just thenumber of bitsandcode: With ourcanonicalversion we have the knowledge that the symbols are in sequential alphabetical orderandthat a later code will always be higher in value than an earlier one. The only parts left to transmit are thebit-lengths(number of bits) for each symbol. Note that our canonical Huffman tree always has higher values for longer bit lengths and that any symbols of the same bit length (CandD) have higher code values for higher symbols: Since two-thirds of the constraints are known, only thenumber of bitsfor each symbol need be transmitted: With knowledge of the canonical Huffman algorithm, it is then possible to recreate the entire table (symbol and code values) from just the bit-lengths. Unused symbols are normally transmitted as having zero bit length. Another efficient way representing the codebook is to list all symbols in increasing order by their bit-lengths, and record the number of symbols for each bit-length. For the example mentioned above, the encoding becomes: This means that the first symbolBis of length 1, then theAof length 2, and remaining 2 symbols (C and D) of length 3. Since the symbols are sorted by bit-length, we can efficiently reconstruct the codebook. Apseudo codedescribing the reconstruction is introduced on the next section. This type of encoding is advantageous when only a few symbols in the alphabet are being compressed. For example, suppose the codebook contains only 4 lettersC,O,DandE, each of length 2. To represent the letterOusing the previous method, we need to either add a lot of zeros (Method1): or record which 4 letters we have used. Each way makes the description longer than the following (Method2): TheJPEG File Interchange Formatuses Method2 of encoding, because at most only 162 symbols out of the8-bitalphabet, which has size 256, will be in the codebook. Given a list of symbols sorted by bit-length, the followingpseudocodewill print a canonical Huffman code book: [1][2]
https://en.wikipedia.org/wiki/Canonical_Huffman_code
Incomputing,telecommunication,information theory, andcoding theory,forward error correction(FEC) orchannel coding[1][2][3]is a technique used forcontrolling errorsindata transmissionover unreliable or noisycommunication channels. The central idea is that the sender encodes the message in aredundantway, most often by using anerror correction code, orerror correcting code(ECC).[4][5]The redundancy allows the receiver not only todetect errorsthat may occur anywhere in the message, but often to correct a limited number of errors. Therefore areverse channelto request re-transmission may not be needed. The cost is a fixed, higher forward channel bandwidth. The American mathematicianRichard Hammingpioneered this field in the 1940s and invented the first error-correcting code in 1950: theHamming (7,4) code.[5] FEC can be applied in situations where re-transmissions are costly or impossible, such as one-way communication links or when transmitting to multiple receivers inmulticast. Long-latency connections also benefit; in the case of satellites orbiting distant planets, retransmission due to errors would create a delay of several hours. FEC is also widely used inmodemsand incellular networks. FEC processing in a receiver may be applied to a digital bit stream or in the demodulation of a digitally modulated carrier. For the latter, FEC is an integral part of the initialanalog-to-digital conversionin the receiver. TheViterbi decoderimplements asoft-decision algorithmto demodulate digital data from an analog signal corrupted by noise. Many FEC decoders can also generate abit-error rate(BER) signal which can be used as feedback to fine-tune the analog receiving electronics. FEC information is added tomass storage(magnetic, optical and solid state/flash based) devices to enable recovery of corrupted data, and is used asECCcomputer memoryon systems that require special provisions for reliability. The maximum proportion of errors or missing bits that can be corrected is determined by the design of the ECC, so different forward error correcting codes are suitable for different conditions. In general, a stronger code induces more redundancy that needs to be transmitted using the available bandwidth, which reduces the effective bit-rate while improving the received effectivesignal-to-noise ratio. Thenoisy-channel coding theoremofClaude Shannoncan be used to compute the maximum achievable communication bandwidth for a given maximum acceptable error probability. This establishes bounds on the theoretical maximum information transfer rate of a channel with some given base noise level. However, the proof is not constructive, and hence gives no insight of how to build a capacity achieving code. After years of research, some advanced FEC systems likepolar code[3]come very close to the theoretical maximum given by the Shannon channel capacity under the hypothesis of an infinite length frame. ECC is accomplished by addingredundancyto the transmitted information using an algorithm. A redundant bit may be a complicated function of many original information bits. The original information may or may not appear literally in the encoded output; codes that include the unmodified input in the output aresystematic, while those that do not arenon-systematic. A simplistic example of ECC is to transmit each data bit three times, which is known as a (3,1)repetition code. Through a noisy channel, a receiver might see eight versions of the output, see table below. This allows an error in any one of the three samples to be corrected by "majority vote", or "democratic voting". The correcting ability of this ECC is: Though simple to implement and widely used, thistriple modular redundancyis a relatively inefficient ECC. Better ECC codes typically examine the last several tens or even the last several hundreds of previously received bits to determine how to decode the current small handful of bits (typically in groups of two to eight bits). ECC could be said to work by "averaging noise"; since each data bit affects many transmitted symbols, the corruption of some symbols by noise usually allows the original user data to be extracted from the other, uncorrupted received symbols that also depend on the same user data. Most telecommunication systems use a fixedchannel codedesigned to tolerate the expected worst-casebit error rate, and then fail to work at all if the bit error rate is ever worse. However, some systems adapt to the given channel error conditions: some instances ofhybrid automatic repeat-requestuse a fixed ECC method as long as the ECC can handle the error rate, then switch toARQwhen the error rate gets too high;adaptive modulation and codinguses a variety of ECC rates, adding more error-correction bits per packet when there are higher error rates in the channel, or taking them out when they are not needed. The two main categories of ECC codes areblock codesandconvolutional codes. There are many types of block codes;Reed–Solomon codingis noteworthy for its widespread use incompact discs,DVDs, andhard disk drives. Other examples of classical block codes includeGolay,BCH,Multidimensional parity, andHamming codes. Hamming ECC is commonly used to correctNAND flashmemory errors.[6]This provides single-bit error correction and 2-bit error detection. Hamming codes are only suitable for more reliablesingle-level cell(SLC) NAND. Densermulti-level cell(MLC) NAND may use multi-bit correcting ECC such as BCH or Reed–Solomon.[7][8]NOR Flash typically does not use any error correction.[7] Classical block codes are usually decoded usinghard-decisionalgorithms,[9]which means that for every input and output signal a hard decision is made whether it corresponds to a one or a zero bit. In contrast, convolutional codes are typically decoded usingsoft-decisionalgorithms like the Viterbi, MAP orBCJRalgorithms, which process (discretized) analog signals, and which allow for much higher error-correction performance than hard-decision decoding. Nearly all classical block codes apply the algebraic properties offinite fields. Hence classical block codes are often referred to as algebraic codes. In contrast to classical block codes that often specify an error-detecting or error-correcting ability, many modern block codes such asLDPC codeslack such guarantees. Instead, modern codes are evaluated in terms of their bit error rates. Mostforward error correctioncodes correct only bit-flips, but not bit-insertions or bit-deletions. In this setting, theHamming distanceis the appropriate way to measure thebit error rate. A few forward error correction codes are designed to correct bit-insertions and bit-deletions, such as Marker Codes and Watermark Codes. TheLevenshtein distanceis a more appropriate way to measure the bit error rate when using such codes.[10] The fundamental principle of ECC is to add redundant bits in order to help the decoder to find out the true message that was encoded by the transmitter. The code-rate of a given ECC system is defined as the ratio between the number of information bits and the total number of bits (i.e., information plus redundancy bits) in a given communication package. The code-rate is hence a real number. A low code-rate close to zero implies a strong code that uses many redundant bits to achieve a good performance, while a large code-rate close to 1 implies a weak code. The redundant bits that protect the information have to be transferred using the same communication resources that they are trying to protect. This causes a fundamental tradeoff between reliability and data rate.[11]In one extreme, a strong code (with low code-rate) can induce an important increase in the receiver SNR (signal-to-noise-ratio) decreasing the bit error rate, at the cost of reducing the effective data rate. On the other extreme, not using any ECC (i.e., a code-rate equal to 1) uses the full channel for information transfer purposes, at the cost of leaving the bits without any additional protection. One interesting question is the following: how efficient in terms of information transfer can an ECC be that has a negligible decoding error rate? This question was answered by Claude Shannon with his second theorem, which says that the channel capacity is the maximum bit rate achievable by any ECC whose error rate tends to zero:[12]His proof relies on Gaussian random coding, which is not suitable to real-world applications. The upper bound given by Shannon's work inspired a long journey in designing ECCs that can come close to the ultimate performance boundary. Various codes today can attain almost the Shannon limit. However, capacity achieving ECCs are usually extremely complex to implement. The most popular ECCs have a trade-off between performance and computational complexity. Usually, their parameters give a range of possible code rates, which can be optimized depending on the scenario. Usually, this optimization is done in order to achieve a low decoding error probability while minimizing the impact to the data rate. Another criterion for optimizing the code rate is to balance low error rate and retransmissions number in order to the energy cost of the communication.[13] Classical (algebraic) block codes and convolutional codes are frequently combined inconcatenatedcoding schemes in which a short constraint-length Viterbi-decoded convolutional code does most of the work and a block code (usually Reed–Solomon) with larger symbol size and block length "mops up" any errors made by the convolutional decoder. Single pass decoding with this family of error correction codes can yield very low error rates, but for long range transmission conditions (like deep space) iterative decoding is recommended. Concatenated codes have been standard practice in satellite and deep space communications sinceVoyager 2first used the technique in its 1986 encounter withUranus. TheGalileocraft used iterative concatenated codes to compensate for the very high error rate conditions caused by having a failed antenna. Low-density parity-check(LDPC) codes are a class of highly efficient linear block codes made from many single parity check (SPC) codes. They can provide performance very close to thechannel capacity(the theoretical maximum) using an iterated soft-decision decoding approach, at linear time complexity in terms of their block length. Practical implementations rely heavily on decoding the constituent SPC codes in parallel. LDPC codes were first introduced byRobert G. Gallagerin his PhD thesis in 1960, but due to the computational effort in implementing encoder and decoder and the introduction ofReed–Solomoncodes, they were mostly ignored until the 1990s. LDPC codes are now used in many recent high-speed communication standards, such asDVB-S2(Digital Video Broadcasting – Satellite – Second Generation),WiMAX(IEEE 802.16estandard for microwave communications), High-Speed Wireless LAN (IEEE 802.11n),[14]10GBase-T Ethernet(802.3an) andG.hn/G.9960(ITU-T Standard for networking over power lines, phone lines and coaxial cable). Other LDPC codes are standardized for wireless communication standards within3GPPMBMS(seefountain codes). Turbo codingis an iterated soft-decoding scheme that combines two or more relatively simple convolutional codes and an interleaver to produce a block code that can perform to within a fraction of a decibel of theShannon limit. PredatingLDPC codesin terms of practical application, they now provide similar performance. One of the earliest commercial applications of turbo coding was theCDMA2000 1x(TIA IS-2000) digital cellular technology developed byQualcommand sold byVerizon Wireless,Sprint, and other carriers. It is also used for the evolution of CDMA2000 1x specifically for Internet access,1xEV-DO(TIA IS-856). Like 1x, EV-DO was developed byQualcomm, and is sold byVerizon Wireless,Sprint, and other carriers (Verizon's marketing name for 1xEV-DO isBroadband Access, Sprint's consumer and business marketing names for 1xEV-DO arePower VisionandMobile Broadband, respectively). Sometimes it is only necessary to decode single bits of the message, or to check whether a given signal is a codeword, and do so without looking at the entire signal. This can make sense in a streaming setting, where codewords are too large to be classically decoded fast enough and where only a few bits of the message are of interest for now. Also such codes have become an important tool incomputational complexity theory, e.g., for the design ofprobabilistically checkable proofs. Locally decodable codesare error-correcting codes for which single bits of the message can be probabilistically recovered by only looking at a small (say constant) number of positions of a codeword, even after the codeword has been corrupted at some constant fraction of positions.Locally testable codesare error-correcting codes for which it can be checked probabilistically whether a signal is close to a codeword by only looking at a small number of positions of the signal. Not all testing codes are locally decoding and testing of codes Not all locally decodable codes (LDCs) are locally testable codes (LTCs)[15]neither locally correctable codes (LCCs),[16]q-query LCCs are bounded exponentially[17][18]while LDCs can havesubexponentiallengths.[19][20] Interleaving is frequently used in digital communication and storage systems to improve the performance of forward error correcting codes. Manycommunication channelsare not memoryless: errors typically occur inburstsrather than independently. If the number of errors within acode wordexceeds the error-correcting code's capability, it fails to recover the original code word. Interleaving alleviates this problem by shuffling source symbols across several code words, thereby creating a moreuniform distributionof errors.[21]Therefore, interleaving is widely used forburst error-correction. The analysis of modern iterated codes, liketurbo codesandLDPC codes, typically assumes an independent distribution of errors.[22]Systems using LDPC codes therefore typically employ additional interleaving across the symbols within a code word.[23] For turbo codes, an interleaver is an integral component and its proper design is crucial for good performance.[21][24]The iterative decoding algorithm works best when there are not short cycles in thefactor graphthat represents the decoder; the interleaver is chosen to avoid short cycles. Interleaver designs include: In multi-carriercommunication systems, interleaving across carriers may be employed to provide frequencydiversity, e.g., to mitigatefrequency-selective fadingor narrowband interference.[28] Transmission without interleaving: Here, each group of the same letter represents a 4-bit one-bit error-correcting codeword. The codeword cccc is altered in one bit and can be corrected, but the codeword dddd is altered in three bits, so either it cannot be decoded at all or it might bedecoded incorrectly. With interleaving: In each of the codewords "aaaa", "eeee", "ffff", and "gggg", only one bit is altered, so one-bit error-correcting code will decode everything correctly. Transmission without interleaving: The term "AnExample" ends up mostly unintelligible and difficult to correct. With interleaving: No word is completely lost and the missing letters can be recovered with minimal guesswork. Use of interleaving techniques increases total delay. This is because the entire interleaved block must be received before the packets can be decoded.[29]Also interleavers hide the structure of errors; without an interleaver, more advanced decoding algorithms can take advantage of the error structure and achieve more reliable communication than a simpler decoder combined with an interleaver[citation needed]. An example of such an algorithm is based onneural network[30]structures. Simulating the behaviour of error-correcting codes (ECCs) in software is a common practice to design, validate and improve ECCs. The upcoming wireless 5G standard raises a new range of applications for the software ECCs: theCloud Radio Access Networks (C-RAN)in aSoftware-defined radio (SDR)context. The idea is to directly use software ECCs in the communications. For instance in the 5G, the software ECCs could be located in the cloud and the antennas connected to this computing resources: improving this way the flexibility of the communication network and eventually increasing the energy efficiency of the system. In this context, there are various available Open-source software listed below (non exhaustive).
https://en.wikipedia.org/wiki/Channel_coding
Ininformation theory, theerror exponentof achannel codeorsource codeover the block length of the code is the rate at which the error probability decays exponentially with the block length of the code. Formally, it is defined as the limiting ratio of the negative logarithm of the error probability to the block length of the code for large block lengths. For example, if the probability of errorPerror{\displaystyle P_{\mathrm {error} }}of adecoderdrops ase−nα{\displaystyle e^{-n\alpha }}, wheren{\displaystyle n}is the block length, the error exponent isα{\displaystyle \alpha }. In this example,−ln⁡Perrorn{\displaystyle {\frac {-\ln P_{\mathrm {error} }}{n}}}approachesα{\displaystyle \alpha }for largen{\displaystyle n}. Many of theinformation-theoretictheorems are of asymptotic nature, for example, thechannel coding theoremstates that for anyrateless than the channel capacity, the probability of the error of the channel code can be made to go to zero as the block length goes to infinity. In practical situations, there are limitations to the delay of the communication and the block length must be finite. Therefore, it is important to study how the probability of error drops as the block length go to infinity. Thechannel coding theoremstates that for any ε > 0 and for anyrateless than the channel capacity, there is an encoding and decoding scheme that can be used to ensure that the probability of block error is less than ε > 0 for sufficiently long message blockX. Also, for anyrategreater than the channel capacity, the probability of block error at the receiver goes to one as the block length goes to infinity. Assuming a channel coding setup as follows: the channel can transmit any ofM=2nR{\displaystyle M=2^{nR}\;}messages, by transmitting the corresponding codeword (which is of lengthn). Each component in the codebook is drawni.i.d.according to some probability distribution withprobability mass functionQ. At the decoding end, maximum likelihood decoding is done. LetXin{\displaystyle X_{i}^{n}}be thei{\displaystyle i}th random codeword in the codebook, wherei{\displaystyle i}goes from1{\displaystyle 1}toM{\displaystyle M}. Suppose the first message is selected, so codewordX1n{\displaystyle X_{1}^{n}}is transmitted. Given thaty1n{\displaystyle y_{1}^{n}}is received, the probability that the codeword is incorrectly detected asX2n{\displaystyle X_{2}^{n}}is: The function1(p(y1n∣x2n)>p(y1n∣x1n)){\displaystyle 1(p(y_{1}^{n}\mid x_{2}^{n})>p(y_{1}^{n}\mid x_{1}^{n}))}has upper bound fors>0{\displaystyle s>0\;}Thus, Since there are a total ofMmessages, and the entries in the codebook are i.i.d., the probability thatX1n{\displaystyle X_{1}^{n}}is confused with any other message isM{\displaystyle M}times the above expression. Using the union bound, the probability of confusingX1n{\displaystyle X_{1}^{n}}with any message is bounded by: for any0<ρ<1{\displaystyle 0<\rho <1}. Averaging over all combinations ofx1n,y1n{\displaystyle x_{1}^{n},y_{1}^{n}}: Choosings=1−sρ{\displaystyle s=1-s\rho }and combining the two sums overx1n{\displaystyle x_{1}^{n}}in the above formula: Using the independence nature of the elements of the codeword, and the discrete memoryless nature of the channel: Using the fact that each element of codeword is identically distributed and thus stationary: ReplacingMby 2nRand defining probability of error becomes Qandρ{\displaystyle \rho }should be chosen so that the bound is tighest. Thus, the error exponent can be defined as Thesource codingtheorem states that for anyε>0{\displaystyle \varepsilon >0}and any discrete-time i.i.d. source such asX{\displaystyle X}and for anyrateless than theentropyof the source, there is large enoughn{\displaystyle n}and an encoder that takesn{\displaystyle n}i.i.d. repetition of the source,X1:n{\displaystyle X^{1:n}}, and maps it ton.(H(X)+ε){\displaystyle n.(H(X)+\varepsilon )}binary bits such that the source symbolsX1:n{\displaystyle X^{1:n}}are recoverable from the binary bits with probability at least1−ε{\displaystyle 1-\varepsilon }. LetM=enR{\displaystyle M=e^{nR}\,\!}be the total number of possible messages. Next map each of the possible source output sequences to one of the messages randomly using a uniform distribution and independently from everything else. When a source is generated the corresponding messageM=m{\displaystyle M=m\,}is then transmitted to the destination. The message gets decoded to one of the possible source strings. In order to minimize the probability of error the decoder will decode to the source sequenceX1n{\displaystyle X_{1}^{n}}that maximizesP(X1n∣Am){\displaystyle P(X_{1}^{n}\mid A_{m})}, whereAm{\displaystyle A_{m}\,}denotes the event that messagem{\displaystyle m}was transmitted. This rule is equivalent to finding the source sequenceX1n{\displaystyle X_{1}^{n}}among the set of source sequences that map to messagem{\displaystyle m}that maximizesP(X1n){\displaystyle P(X_{1}^{n})}. This reduction follows from the fact that the messages were assigned randomly and independently of everything else. Thus, as an example of when an error occurs, supposed that the source sequenceX1n(1){\displaystyle X_{1}^{n}(1)}was mapped to message1{\displaystyle 1}as was the source sequenceX1n(2){\displaystyle X_{1}^{n}(2)}. IfX1n(1){\displaystyle X_{1}^{n}(1)\,}was generated at the source, butP(X1n(2))>P(X1n(1)){\displaystyle P(X_{1}^{n}(2))>P(X_{1}^{n}(1))}then an error occurs. LetSi{\displaystyle S_{i}\,}denote the event that the source sequenceX1n(i){\displaystyle X_{1}^{n}(i)}was generated at the source, so thatP(Si)=P(X1n(i)).{\displaystyle P(S_{i})=P(X_{1}^{n}(i))\,.}Then the probability of error can be broken down asP(E)=∑iP(E∣Si)P(Si).{\displaystyle P(E)=\sum _{i}P(E\mid S_{i})P(S_{i})\,.}Thus, attention can be focused on finding an upper bound to theP(E∣Si){\displaystyle P(E\mid S_{i})\,}. LetAi′{\displaystyle A_{i'}\,}denote the event that the source sequenceX1n(i′){\displaystyle X_{1}^{n}(i')}was mapped to the same message as the source sequenceX1n(i){\displaystyle X_{1}^{n}(i)}and thatP(X1n(i′))≥P(X1n(i)){\displaystyle P(X_{1}^{n}(i'))\geq P(X_{1}^{n}(i))}. Thus, lettingXi,i′{\displaystyle X_{i,i'}\,}denote the event that the two source sequencesi{\displaystyle i\,}andi′{\displaystyle i'\,}map to the same message, we have that and using the fact thatP(Xi,i′)=1M{\displaystyle P(X_{i,i'})={\frac {1}{M}}\,}and is independent of everything else have that A simple upper bound for the term on the left can be established as for some arbitrary real numbers>0.{\displaystyle s>0\,.}This upper bound can be verified by noting thatP(P(X1n(i′))>P(X1n(i))){\displaystyle P(P(X_{1}^{n}(i'))>P(X_{1}^{n}(i)))\,}either equals1{\displaystyle 1\,}or0{\displaystyle 0\,}because the probabilities of a given input sequence are completely deterministic. Thus, ifP(X1n(i′))≥P(X1n(i)),{\displaystyle P(X_{1}^{n}(i'))\geq P(X_{1}^{n}(i))\,,}thenP(X1n(i′))P(X1n(i))≥1{\displaystyle {\frac {P(X_{1}^{n}(i'))}{P(X_{1}^{n}(i))}}\geq 1\,}so that the inequality holds in that case. The inequality holds in the other case as well because for all possible source strings. Thus, combining everything and introducing someρ∈[0,1]{\displaystyle \rho \in [0,1]\,}, have that Where the inequalities follow from a variation on the Union Bound. Finally applying this upper bound to the summation forP(E){\displaystyle P(E)\,}have that: Where the sum can now be taken over alli′{\displaystyle i'\,}because that will only increase the bound. Ultimately yielding that Now for simplicity let1−sρ=s{\displaystyle 1-s\rho =s\,}so thats=11+ρ.{\displaystyle s={\frac {1}{1+\rho }}\,.}Substituting this new value ofs{\displaystyle s\,}into the above bound on the probability of error and using the fact thati′{\displaystyle i'\,}is just a dummy variable in the sum gives the following as an upper bound on the probability of error: The term in the exponent should be maximized overρ{\displaystyle \rho \,}in order to achieve the highest upper bound on the probability of error. LettingE0(ρ)=ln⁡(∑xiP(xi)11+ρ)(1+ρ),{\displaystyle E_{0}(\rho )=\ln \left(\sum _{x_{i}}P(x_{i})^{\frac {1}{1+\rho }}\right)(1+\rho )\,,}see that the error exponent for the source coding case is: R. Gallager,Information Theory and Reliable Communication, Wiley 1968
https://en.wikipedia.org/wiki/Error_exponent
Ininformation theory, thenoisy-channel coding theorem(sometimesShannon's theoremorShannon's limit), establishes that for any given degree of noise contamination of a communication channel, it is possible (in theory) to communicate discrete data (digitalinformation) nearly error-free up to a computable maximum rate through the channel. This result was presented byClaude Shannonin 1948 and was based in part on earlier work and ideas ofHarry NyquistandRalph Hartley. TheShannon limitorShannon capacityof a communication channel refers to the maximumrateof error-free data that can theoretically be transferred over the channel if the link is subject to random data transmission errors, for a particular noise level. It was first described by Shannon (1948), and shortly after published in a book by Shannon andWarren WeaverentitledThe Mathematical Theory of Communication(1949). This founded the modern discipline ofinformation theory. Stated byClaude Shannonin 1948, the theorem describes the maximum possible efficiency oferror-correcting methodsversus levels of noise interference and data corruption. Shannon's theorem has wide-ranging applications in both communications anddata storage. This theorem is of foundational importance to the modern field ofinformation theory. Shannon only gave an outline of the proof. The first rigorous proof for the discrete case is given in (Feinstein 1954). The Shannon theorem states that given a noisy channel withchannel capacityCand information transmitted at a rateR, then ifR<C{\displaystyle R<C}there existcodesthat allow theprobability of errorat the receiver to be made arbitrarily small. This means that, theoretically, it is possible to transmit information nearly without error at any rate below a limiting rate,C. The converse is also important. IfR>C{\displaystyle R>C}, an arbitrarily small probability of error is not achievable. All codes will have a probability of error greater than a certain positive minimal level, and this level increases as the rate increases. So, information cannot be guaranteed to be transmitted reliably across a channel at rates beyond the channel capacity. The theorem does not address the rare situation in which rate and capacity are equal. The channel capacityC{\displaystyle C}can be calculated from the physical properties of a channel; for a band-limited channel with Gaussian noise, using theShannon–Hartley theorem. Simple schemes such as "send the message 3 times and use a best 2 out of 3 voting scheme if the copies differ" are inefficient error-correction methods, unable to asymptotically guarantee that a block of data can be communicated free of error. Advanced techniques such asReed–Solomon codesand, more recently,low-density parity-check(LDPC) codes andturbo codes, come much closer to reaching the theoretical Shannon limit, but at a cost of high computational complexity. Using these highly efficient codes and with the computing power in today'sdigital signal processors, it is now possible to reach very close to the Shannon limit. In fact, it was shown that LDPC codes can reach within 0.0045 dB of the Shannon limit (for binaryadditive white Gaussian noise(AWGN) channels, with very long block lengths).[1] The basic mathematical model for a communication system is the following: AmessageWis transmitted through a noisy channel by using encoding and decoding functions. AnencodermapsWinto a pre-defined sequence of channel symbols of lengthn. In its most basic model, the channel distorts each of these symbols independently of the others. The output of the channel –the received sequence– is fed into adecoderwhich maps the sequence into an estimate of the message. In this setting, the probability of error is defined as: Theorem(Shannon, 1948): (MacKay (2003), p. 162; cf Gallager (1968), ch.5; Cover and Thomas (1991), p. 198; Shannon (1948) thm. 11) As with the several other major results in information theory, the proof of the noisy channel coding theorem includes an achievability result and a matching converse result. These two components serve to bound, in this case, the set of possible rates at which one can communicate over a noisy channel, and matching serves to show that these bounds are tight bounds. The following outlines are only one set of many different styles available for study in information theory texts. This particular proof of achievability follows the style of proofs that make use of theasymptotic equipartition property(AEP). Another style can be found in information theory texts usingerror exponents. Both types of proofs make use of a random coding argument where the codebook used across a channel is randomly constructed - this serves to make the analysis simpler while still proving the existence of a code satisfying a desired low probability of error at any data rate below thechannel capacity. By an AEP-related argument, given a channel, lengthn{\displaystyle n}strings of source symbolsX1n{\displaystyle X_{1}^{n}}, and lengthn{\displaystyle n}strings of channel outputsY1n{\displaystyle Y_{1}^{n}}, we can define ajointly typical setby the following: We say that two sequencesX1n{\displaystyle {X_{1}^{n}}}andY1n{\displaystyle Y_{1}^{n}}arejointly typicalif they lie in the jointly typical set defined above. Steps The probability of error of this scheme is divided into two parts: Define:Ei={(X1n(i),Y1n)∈Aε(n)},i=1,2,…,2nR{\displaystyle E_{i}=\{(X_{1}^{n}(i),Y_{1}^{n})\in A_{\varepsilon }^{(n)}\},i=1,2,\dots ,2^{nR}} as the event that message i is jointly typical with the sequence received when message 1 is sent. We can observe that asn{\displaystyle n}goes to infinity, ifR<I(X;Y){\displaystyle R<I(X;Y)}for the channel, the probability of error will go to 0. Finally, given that the average codebook is shown to be "good," we know that there exists a codebook whose performance is better than the average, and so satisfies our need for arbitrarily low error probability communicating across the noisy channel. Suppose a code of2nR{\displaystyle 2^{nR}}codewords. Let W be drawn uniformly over this set as an index. LetXn{\displaystyle X^{n}}andYn{\displaystyle Y^{n}}be the transmitted codewords and received codewords, respectively. The result of these steps is thatPe(n)≥1−1nR−CR{\displaystyle P_{e}^{(n)}\geq 1-{\frac {1}{nR}}-{\frac {C}{R}}}. As the block lengthn{\displaystyle n}goes to infinity, we obtainPe(n){\displaystyle P_{e}^{(n)}}is bounded away from 0 if R is greater than C - we can get arbitrarily low rates of error only if R is less than C. A strong converse theorem, proven by Wolfowitz in 1957,[3]states that, for some finite positive constantA{\displaystyle A}. While the weak converse states that the error probability is bounded away from zero asn{\displaystyle n}goes to infinity, the strong converse states that the error goes to 1. Thus,C{\displaystyle C}is a sharp threshold between perfectly reliable and completely unreliable communication. We assume that the channel is memoryless, but its transition probabilities change with time, in a fashion known at the transmitter as well as the receiver. Then the channel capacity is given by The maximum is attained at the capacity achieving distributions for each respective channel. That is,C=liminf1n∑i=1nCi{\displaystyle C=\lim \inf {\frac {1}{n}}\sum _{i=1}^{n}C_{i}}whereCi{\displaystyle C_{i}}is the capacity of the ithchannel. The proof runs through in almost the same way as that of channel coding theorem. Achievability follows from random coding with each symbol chosen randomly from the capacity achieving distribution for that particular channel. Typicality arguments use the definition of typical sets for non-stationary sources defined in theasymptotic equipartition propertyarticle. The technicality oflim infcomes into play when1n∑i=1nCi{\displaystyle {\frac {1}{n}}\sum _{i=1}^{n}C_{i}}does not converge.
https://en.wikipedia.org/wiki/Noisy-channel_coding_theorem
Golomb codingis alossless data compressionmethod using a family ofdata compressioncodes invented bySolomon W. Golombin the 1960s. Alphabets following ageometric distributionwill have a Golomb code as an optimalprefix code,[1]making Golomb coding highly suitable for situations in which the occurrence of small values in the input stream is significantly more likely than large values. Rice coding(invented byRobert F. Rice) denotes using a subset of the family of Golomb codes to produce a simpler (but possibly suboptimal) prefix code. Rice used this set of codes in anadaptive codingscheme; "Rice coding" can refer either to that adaptive scheme or to using that subset of Golomb codes. Whereas a Golomb code has a tunable parameter that can be any positive integer value, Rice codes are those in which the tunable parameter is a power of two. This makes Rice codes convenient for use on a computer, since multiplication and division by 2 can be implemented more efficiently inbinary arithmetic. Rice was motivated to propose this simpler subset due to the fact that geometric distributions are often varying with time, not precisely known, or both, so selecting the seemingly optimal code might not be very advantageous. Rice coding is used as theentropy encodingstage in a number of losslessimage compressionandaudio data compressionmethods. Golomb coding uses a tunable parameterMto divide an input valuexinto two parts:q, the result of a division byM, andr, the remainder. The quotient is sent inunary coding, followed by the remainder intruncated binary encoding. WhenM=1{\displaystyle M=1}, Golomb coding is equivalent to unary coding. Golomb–Rice codes can be thought of as codes that indicate a number by the position of thebin(q), and theoffsetwithin thebin(r). The example figure shows the positionqand offsetrfor the encoding of integerxusing Golomb–Rice parameterM= 3, with source probabilities following a geometric distribution withp(0) = 0.2. Formally, the two parts are given by the following expression, wherexis the nonnegative integer being encoded: and Bothqandrwill be encoded using variable numbers of bits:qby a unary code, andrbybbits for Rice code, or a choice betweenbandb+1bits for Golomb code (i.e.Mis not a power of 2), withb=⌊log2⁡(M)⌋{\displaystyle b=\lfloor \log _{2}(M)\rfloor }. Ifr<2b+1−M{\displaystyle r<2^{b+1}-M}, then usebbits to encoder; otherwise, useb+1 bits to encoder. Clearly,b=log2⁡(M){\displaystyle b=\log _{2}(M)}ifMis a power of 2 and we can encode all values ofrwithbbits. The integerxtreated by Golomb was the run length of aBernoulli process, which has ageometric distributionstarting at 0. The best choice of parameterMis a function of the corresponding Bernoulli process, which is parameterized byp=P(x=0){\displaystyle p=P(x=0)}the probability of success in a givenBernoulli trial.Mis either the median of the distribution or the median ±1. It can be determined by these inequalities: which are solved by For the example withp(0) = 0.2: The Golomb code for this distribution is equivalent to theHuffman codefor the same probabilities, if it were possible to compute the Huffman code for the infinite set of source values. Golomb's scheme was designed to encode sequences of non-negative numbers. However, it is easily extended to accept sequences containing negative numbers using anoverlap and interleavescheme, in which all values are reassigned to some positive number in a unique and reversible way. The sequence begins: 0, −1, 1, −2, 2, −3, 3, −4, 4, ... Then-th negative value (i.e.,⁠−n{\displaystyle -n}⁠) is mapped to thenthodd number (⁠2n−1{\displaystyle 2n-1}⁠), and themthpositive value is mapped to them-th even number (⁠2m{\displaystyle 2m}⁠). This may be expressed mathematically as follows: a positive valuexis mapped to (x′=2|x|=2x,x≥0{\displaystyle x'=2|x|=2x,\ x\geq 0}), and a negative valueyis mapped to (y′=2|y|−1=−2y−1,y<0{\displaystyle y'=2|y|-1=-2y-1,\ y<0}). Such a code may be used for simplicity, even if suboptimal. Truly optimal codes for two-sided geometric distributions include multiple variants of the Golomb code, depending on the distribution parameters, including this one.[2] Below is the Rice–Golomb encoding, where the remainder code uses simple truncated binary encoding, also named "Rice coding" (other varying-length binary encodings, like arithmetic or Huffman encodings, are possible for the remainder codes, if the statistic distribution of remainder codes is not flat, and notably when not all possible remainders after the division are used). In this algorithm, if theMparameter is a power of 2, it becomes equivalent to the simpler Rice encoding: Decoding: SetM= 10. Thusb=⌊log2⁡(10)⌋=3{\displaystyle b=\lfloor \log _{2}(10)\rfloor =3}. The cutoff is2b+1−M=16−10=6{\displaystyle 2^{b+1}-M=16-10=6}. For example, with a Rice–Golomb encoding using parameterM= 10, the decimal number 42 would first be split intoq= 4 andr= 2, and would be encoded as qcode(q),rcode(r) = qcode(4),rcode(2) = 11110,010 (you don't need to encode the separating comma in the output stream, because the 0 at the end of theqcode is enough to say whenqends andrbegins; both the qcode and rcode are self-delimited). Given an alphabet of two symbols, or a set of two events,PandQ, with probabilitiespand (1 −p) respectively, wherep≥ 1/2, Golomb coding can be used to encode runs of zero or moreP′s separated by singleQ′s. In this application, the best setting of the parameterMis the nearest integer to−1log2⁡p{\displaystyle -{\frac {1}{\log _{2}p}}}. Whenp= 1/2,M= 1, and the Golomb code corresponds to unary (n≥ 0P′s followed by aQis encoded asnones followed by a zero). If a simpler code is desired, one can assign Golomb–Rice parameterb(i.e., Golomb parameterM=2b{\displaystyle M=2^{b}}) to the integer nearest to−log2⁡(−log2⁡p){\displaystyle -\log _{2}(-\log _{2}p)}; although not always the best parameter, it is usually the best Rice parameter and its compression performance is quite close to the optimal Golomb code. (Rice himself proposed using various codes for the same data to figure out which was best. A laterJPLresearcher proposed various methods of optimizing or estimating the code parameter.[3]) Consider using a Rice code with a binary portion havingbbits to run-length encode sequences wherePhas a probabilityp. IfP[bit is part ofk-run]{\displaystyle \mathbb {P} [{\text{bit is part of }}k{\text{-run}}]}is the probability that a bit will be part of ank-bit run (k−1{\displaystyle k-1}Ps and oneQ) and(compression ratio ofk-run){\displaystyle ({\text{compression ratio of }}k{\text{-run}})}is the compression ratio of that run, then the expected compression ratio is Compression is often expressed in terms of1−E[compression ratio]{\displaystyle 1-\mathbb {E} [{\text{compression ratio}}]}, the proportion compressed. Forp≈1{\displaystyle p\approx 1}, the run-length coding approach results in compression ratios close toentropy. For example, using Rice codeb=6{\displaystyle b=6}forp=0.99{\displaystyle p=0.99}yields91.89%compression, while the entropy limit is91.92%. When a probability distribution for integers is not known, the optimal parameter for a Golomb–Rice encoder cannot be determined. Thus, in many applications, a two-pass approach is used: first, the block of data is scanned to estimate a probability density function (PDF) for the data. The Golomb–Rice parameter is then determined from that estimated PDF. A simpler variation of that approach is to assume that the PDF belongs to a parametrized family, estimate the PDF parameters from the data, and then compute the optimal Golomb–Rice parameter. That is the approach used in most of the applications discussed below. An alternative approach to efficiently encode integer data whose PDF is not known, or is varying, is to use a backwards-adaptive encoder. The RLGR encoder[1]achieves that using a very simple algorithm that adjusts the Golomb–Rice parameter up or down, depending on the last encoded symbol. A decoder can follow the same rule to track the variation of the encoding parameters, so no side information needs to be transmitted, just the encoded data. Assuming a generalized Gaussian PDF, which covers a wide range of statistics seen in data such as prediction errors or transform coefficients in multimedia codecs, the RLGR encoding algorithm can perform very well in such applications. Numerous signal codecs use a Rice code forpredictionresidues. In predictive algorithms, such residues tend to fall into a two-sidedgeometric distribution, with small residues being more frequent than large residues, and the Rice code closely approximates the Huffman code for such a distribution without the overhead of having to transmit the Huffman table. One signal that does not match a geometric distribution is asine wave, because the differential residues create a sinusoidal signal whose values are not creating a geometric distribution (the highest and lowest residue values have similar high frequency of occurrences, only the median positive and negative residues occur less often). Several losslessaudio codecs, such asShorten,[4]FLAC,[5]Apple Lossless, andMPEG-4 ALS, use a Rice code after thelinear prediction step(called "adaptive FIR filter" in Apple Lossless). Rice coding is also used in theFELICSlossless image codec. The Golomb–Rice coder is used in the entropy coding stage ofRice algorithmbasedlossless image codecs. One such experiment yields the compression ratio graph shown. TheJPEG-LSscheme uses Rice–Golomb to encode the prediction residuals. The adaptive version of Golomb–Rice coding mentioned above, the RLGR encoder[2],is used for encoding screen content in virtual machines in theRemoteFXcomponent of the Microsoft Remote Desktop Protocol.
https://en.wikipedia.org/wiki/Golomb_code
TheKruskal count[1][2](also known asKruskal's principle,[3][4][5][6][7]Dynkin–Kruskal count,[8]Dynkin's counting trick,[9]Dynkin's card trick,[10][11][12][13]coupling card trick[14][15][16]orshift coupling[10][11][12][13]) is aprobabilisticconcept originally demonstrated by the Russian mathematicianEvgenii Borisovich Dynkinin the 1950s or 1960s[when?]discussingcouplingeffects[14][15][9][16]and rediscovered as acard trickby the American mathematicianMartin David Kruskalin the early 1970s[17][nb 1]as a side-product while working on another problem.[18]It was published by Kruskal's friend[19]Martin Gardner[20][1]and magicianKarl Fulvesin 1975.[21]This is related to a similar trick published by magician Alexander F. Kraus in 1957 asSum total[22][23][24][25]and later calledKraus principle.[2][7][25][18] Besides uses as a card trick, the underlying phenomenon has applications incryptography,code breaking,software tamper protection,code self-synchronization,control-flow resynchronization, design ofvariable-length codesandvariable-length instruction sets,web navigation, object alignment, and others. The trick is performed with cards, but is more a magical-looking effect than a conventional magic trick. The magician has no access to the cards, which are manipulated by members of the audience. Thussleight of handis not possible. Rather the effect is based on the mathematical fact that the output of aMarkov chain, under certain conditions, is typically independent of the input.[26][27][28][29][6]A simplified version using the hands of a clock performed byDavid Copperfieldis as follows.[30][31]A volunteer picks a number from one to twelve and does not reveal it to the magician. The volunteer is instructed to start from 12 on the clock and move clockwise by a number of spaces equal to the number of letters that the chosen number has when spelled out. This is then repeated, moving by the number of letters in the new number. The output after three or more moves does not depend on the initially chosen number and therefore the magician can predict it.
https://en.wikipedia.org/wiki/Kruskal_count
Incomputer science, aninstruction set architecture(ISA) is anabstract modelthat generally defines howsoftwarecontrols theCPUin a computer or a family of computers.[1]A device or program that executes instructions described by that ISA, such as a central processing unit (CPU), is called animplementationof that ISA. In general, an ISA defines the supportedinstructions,data types,registers, the hardware support for managingmain memory,[clarification needed]fundamental features (such as thememory consistency,addressing modes,virtual memory), and theinput/outputmodel of implementations of the ISA. An ISA specifies the behavior ofmachine coderunning on implementations of that ISA in a fashion that does not depend on the characteristics of that implementation, providingbinary compatibilitybetween implementations. This enables multiple implementations of an ISA that differ in characteristics such asperformance, physical size, and monetary cost (among other things), but that are capable of running the same machine code, so that a lower-performance, lower-cost machine can be replaced with a higher-cost, higher-performance machine without having to replace software. It also enables the evolution of themicroarchitecturesof the implementations of that ISA, so that a newer, higher-performance implementation of an ISA can run software that runs on previous generations of implementations. If anoperating systemmaintains a standard and compatibleapplication binary interface(ABI) for a particular ISA, machine code will run on future implementations of that ISA and operating system. However, if an ISA supports running multiple operating systems, it does not guarantee that machine code for one operating system will run on another operating system, unless the first operating system supports running machine code built for the other operating system. An ISA can be extended by adding instructions or other capabilities, or adding support for larger addresses and data values; an implementation of the extended ISA will still be able to executemachine codefor versions of the ISA without those extensions. Machine code using those extensions will only run on implementations that support those extensions. The binary compatibility that they provide makes ISAs one of the most fundamental abstractions incomputing. An instruction set architecture is distinguished from amicroarchitecture, which is the set ofprocessor designtechniques used, in a particular processor, to implement the instruction set. Processors with different microarchitectures can share a common instruction set. For example, theIntelPentiumand theAMDAthlonimplement nearly identical versions of thex86 instruction set, but they have radically different internal designs. The concept of anarchitecture, distinct from the design of a specific machine, was developed byFred Brooksat IBM during the design phase ofSystem/360. Prior to NPL [System/360], the company's computer designers had been free to honor cost objectives not only by selecting technologies but also by fashioning functional and architectural refinements. The SPREAD compatibility objective, in contrast, postulated a single architecture for a series of five processors spanning a wide range of cost and performance. None of the five engineering design teams could count on being able to bring about adjustments in architectural specifications as a way of easing difficulties in achieving cost and performance objectives.[2]: p.137 Somevirtual machinesthat supportbytecodeas their ISA such asSmalltalk, theJava virtual machine, andMicrosoft'sCommon Language Runtime, implement this by translating the bytecode for commonly used code paths into native machine code. In addition, these virtual machines execute less frequently used code paths by interpretation (see:Just-in-time compilation).Transmetaimplemented the x86 instruction set atopVLIWprocessors in this fashion. An ISA may be classified in a number of different ways. A common classification is by architecturalcomplexity. Acomplex instruction set computer(CISC) has many specialized instructions, some of which may only be rarely used in practical programs. Areduced instruction set computer(RISC) simplifies the processor by efficiently implementing only the instructions that are frequently used in programs, while the less common operations are implemented as subroutines, having their resulting additional processor execution time offset by infrequent use.[3] Other types includevery long instruction word(VLIW) architectures, and the closely relatedlong instruction word(LIW)[citation needed]andexplicitly parallel instruction computing(EPIC) architectures. These architectures seek to exploitinstruction-level parallelismwith less hardware than RISC and CISC by making thecompilerresponsible for instruction issue and scheduling.[4] Architectures with even less complexity have been studied, such as theminimal instruction set computer(MISC) andone-instruction set computer(OISC). These are theoretically important types, but have not been commercialized.[5][6] Machine languageis built up from discretestatementsorinstructions. On the processing architecture, a given instruction may specify: More complex operations are built up by combining these simple instructions, which are executed sequentially, or as otherwise directed bycontrol flowinstructions. Examples of operations common to many instruction sets include: Processors may include "complex" instructions in their instruction set. A single "complex" instruction does something that may take many instructions on other computers. Such instructions aretypifiedby instructions that take multiple steps, control multiple functional units, or otherwise appear on a larger scale than the bulk of simple instructions implemented by the given processor. Some examples of "complex" instructions include: Complex instructions are more common in CISC instruction sets than in RISC instruction sets, but RISC instruction sets may include them as well. RISC instruction sets generally do not include ALU operations with memory operands, or instructions to move large blocks of memory, but most RISC instruction sets includeSIMDorvectorinstructions that perform the same arithmetic operation on multiple pieces of data at the same time. SIMD instructions have the ability of manipulating large vectors and matrices in minimal time. SIMD instructions allow easyparallelizationof algorithms commonly involved in sound, image, and video processing. Various SIMD implementations have been brought to market under trade names such asMMX,3DNow!, andAltiVec. On traditional architectures, an instruction includes anopcodethat specifies the operation to perform, such asadd contents of memory to register—and zero or moreoperandspecifiers, which may specifyregisters, memory locations, or literal data. The operand specifiers may haveaddressing modesdetermining their meaning or may be in fixed fields. Invery long instruction word(VLIW) architectures, which include manymicrocodearchitectures, multiple simultaneous opcodes and operands are specified in a single instruction. Some exotic instruction sets do not have an opcode field, such astransport triggered architectures(TTA), only operand(s). Moststack machineshave "0-operand" instruction sets in which arithmetic and logical operations lack any operand specifier fields; only instructions that push operands onto the evaluation stack or that pop operands from the stack into variables have operand specifiers. The instruction set carries out most ALU actions with postfix (reverse Polish notation) operations that work only on the expressionstack, not on data registers or arbitrary main memory cells. This can be very convenient for compiling high-level languages, because most arithmetic expressions can be easily translated into postfix notation.[8] Conditional instructions often have a predicate field—a few bits that encode the specific condition to cause an operation to be performed rather than not performed. For example, a conditional branch instruction will transfer control if the condition is true, so that execution proceeds to a different part of the program, and not transfer control if the condition is false, so that execution continues sequentially. Some instruction sets also have conditional moves, so that the move will be executed, and the data stored in the target location, if the condition is true, and not executed, and the target location not modified, if the condition is false. Similarly, IBMz/Architecturehas a conditional store instruction. A few instruction sets include a predicate field in every instruction. Having predicates for non-branch instructions is calledpredication. Instruction sets may be categorized by the maximum number of operandsexplicitlyspecified in instructions. (In the examples that follow,a,b, andcare (direct or calculated) addresses referring to memory cells, whilereg1and so on refer to machine registers.) Due to the large number of bits needed to encode the three registers of a 3-operand instruction, RISC architectures that have 16-bit instructions are invariably 2-operand designs, such as the Atmel AVR,TI MSP430, and some versions ofARM Thumb. RISC architectures that have 32-bit instructions are usually 3-operand designs, such as theARM,AVR32,MIPS,Power ISA, andSPARCarchitectures. Each instruction specifies some number of operands (registers, memory locations, or immediate values)explicitly. Some instructions give one or both operands implicitly, such as by being stored on top of thestackor in an implicit register. If some of the operands are given implicitly, fewer operands need be specified in the instruction. When a "destination operand" explicitly specifies the destination, an additional operand must be supplied. Consequently, the number of operands encoded in an instruction may differ from the mathematically necessary number of arguments for a logical or arithmetic operation (thearity). Operands are either encoded in the "opcode" representation of the instruction, or else are given as values or addresses following the opcode. Register pressuremeasures the availability of free registers at any point in time during the program execution. Register pressure is high when a large number of the available registers are in use; thus, the higher the register pressure, the more often the register contents must bespilledinto memory. Increasing the number of registers in an architecture decreases register pressure but increases the cost.[12] While embedded instruction sets such asThumbsuffer from extremely high register pressure because they have small register sets, general-purpose RISC ISAs likeMIPSandAlphaenjoy low register pressure. CISC ISAs like x86-64 offer low register pressure despite having smaller register sets. This is due to the many addressing modes and optimizations (such as sub-register addressing, memory operands in ALU instructions, absolute addressing, PC-relative addressing, and register-to-register spills) that CISC ISAs offer.[13] The size or length of an instruction varies widely, from as little as four bits in somemicrocontrollersto many hundreds of bits in someVLIWsystems. Processors used inpersonal computers,mainframes, andsupercomputershave minimum instruction sizes between 8 and 64 bits. The longest possible instruction on x86 is 15 bytes (120 bits).[14]Within an instruction set, different instructions may have different lengths. In some architectures, notably mostreduced instruction set computers(RISC),instructions are a fixed length, typically corresponding with that architecture'sword size. In other architectures, instructions havevariable length, typically integral multiples of abyteor ahalfword. Some, such as theARMwithThumb-extensionhavemixedvariable encoding, that is two fixed, usually 32-bit and 16-bit encodings, where instructions cannot be mixed freely but must be switched between on a branch (or exception boundary in ARMv8). Fixed-length instructions are less complicated to handle than variable-length instructions for several reasons (not having to check whether an instruction straddles a cache line or virtual memory page boundary,[11]for instance), and are therefore somewhat easier to optimize for speed. In early 1960s computers, main memory was expensive and very limited, even on mainframes. Minimizing the size of a program to make sure it would fit in the limited memory was often central. Thus the size of the instructions needed to perform a particular task, thecode density, was an important characteristic of any instruction set. It remained important on the initially-tiny memories of minicomputers and then microprocessors. Density remains important today, for smartphone applications, applications downloaded into browsers over slow Internet connections, and in ROMs for embedded applications. A more general advantage of increased density is improved effectiveness of caches and instruction prefetch. Computers with high code density often have complex instructions for procedure entry, parameterized returns, loops, etc. (therefore retroactively namedComplex Instruction Set Computers,CISC). However, more typical, or frequent, "CISC" instructions merely combine a basic ALU operation, such as "add", with the access of one or more operands in memory (usingaddressing modessuch as direct, indirect, indexed, etc.). Certain architectures may allow two or three operands (including the result) directly in memory or may be able to perform functions such as automatic pointer increment, etc. Software-implemented instruction sets may have even more complex and powerful instructions. Reduced instruction-set computers,RISC, were first widely implemented during a period of rapidly growing memory subsystems. They sacrifice code density to simplify implementation circuitry, and try to increase performance via higher clock frequencies and more registers. A single RISC instruction typically performs only a single operation, such as an "add" of registers or a "load" from a memory location into a register. A RISC instruction set normally has a fixedinstruction length, whereas a typical CISC instruction set has instructions of widely varying length. However, as RISC computers normally require more and often longer instructions to implement a given task, they inherently make less optimal use of bus bandwidth and cache memories. Certain embedded RISC ISAs likeThumbandAVR32typically exhibit very high density owing to a technique called code compression. This technique packs two 16-bit instructions into one 32-bit word, which is then unpacked at the decode stage and executed as two instructions.[15] Minimal instruction set computers(MISC) are commonly a form ofstack machine, where there are few separate instructions (8–32), so that multiple instructions can be fit into a single machine word. These types of cores often take little silicon to implement, so they can be easily realized in anFPGAor in amulti-coreform. The code density of MISC is similar to the code density of RISC; the increased instruction density is offset by requiring more of the primitive instructions to do a task.[16][failed verification] There has been research intoexecutable compressionas a mechanism for improving code density. The mathematics ofKolmogorov complexitydescribes the challenges and limits of this. In practice, code density is also dependent on thecompiler. Mostoptimizing compilershave options that control whether to optimize code generation for execution speed or for code density. For instanceGCChas the option-Osto optimize for small machine code size, and-O3to optimize for execution speed at the cost of larger machine code. The instructions constituting a program are rarely specified using their internal, numeric form (machine code); they may be specified by programmers using anassembly languageor, more commonly, may be generated fromhigh-level programming languagesbycompilers.[17] The design of instruction sets is a complex issue. There were two stages in history for the microprocessor. The first was the CISC (Complex Instruction Set Computer), which had many different instructions. In the 1970s, however, places like IBM did research and found that many instructions in the set could be eliminated. The result was the RISC (Reduced Instruction Set Computer), an architecture that uses a smaller set of instructions. A simpler instruction set may offer the potential for higher speeds, reduced processor size, and reduced power consumption. However, a more complex set may optimize common operations, improve memory andcacheefficiency, or simplify programming. Some instruction set designers reserve one or more opcodes for some kind ofsystem callorsoftware interrupt. For example,MOS Technology 6502uses 00H,Zilog Z80uses the eight codes C7,CF,D7,DF,E7,EF,F7,FFH[18]whileMotorola 68000use codes in the range A000..AFFFH. Fast virtual machines are much easier to implement if an instruction set meets thePopek and Goldberg virtualization requirements.[clarification needed] TheNOP slideused in immunity-aware programming is much easier to implement if the "unprogrammed" state of the memory is interpreted as aNOP.[dubious–discuss] On systems with multiple processors,non-blocking synchronizationalgorithms are much easier to implement[citation needed]if the instruction set includes support for something such as "fetch-and-add", "load-link/store-conditional" (LL/SC), or "atomiccompare-and-swap". A given instruction set can be implemented in a variety of ways. All ways of implementing a particular instruction set provide the sameprogramming model, and all implementations of that instruction set are able to run the same executables. The various ways of implementing an instruction set give different tradeoffs between cost, performance, power consumption, size, etc. When designing themicroarchitectureof a processor, engineers use blocks of "hard-wired" electronic circuitry (often designed separately) such as adders, multiplexers, counters, registers, ALUs, etc. Some kind ofregister transfer languageis then often used to describe the decoding and sequencing of each instruction of an ISA using this physical microarchitecture. There are two basic ways to build acontrol unitto implement this description (although many designs use middle ways or compromises): Some microcoded CPU designs with a writable control store use it to allow the instruction set to be changed (for example, theRekursivprocessor and theImsysCjip).[19] CPUs designed forreconfigurable computingmay usefield-programmable gate arrays(FPGAs). An ISA can also beemulatedin software by aninterpreter. Naturally, due to the interpretation overhead, this is slower than directly running programs on the emulated hardware, unless the hardware running the emulator is an order of magnitude faster. Today, it is common practice for vendors of new ISAs or microarchitectures to make software emulators available to software developers before the hardware implementation is ready. Often the details of the implementation have a strong influence on the particular instructions selected for the instruction set. For example, many implementations of theinstruction pipelineonly allow a single memory load or memory store per instruction, leading to aload–store architecture(RISC). For another example, some early ways of implementing theinstruction pipelineled to adelay slot. The demands of high-speed digital signal processing have pushed in the opposite direction—forcing instructions to be implemented in a particular way. For example, to perform digital filters fast enough, the MAC instruction in a typicaldigital signal processor(DSP) must use a kind ofHarvard architecturethat can fetch an instruction and two data words simultaneously, and it requires a single-cyclemultiply–accumulatemultiplier.
https://en.wikipedia.org/wiki/Variable-length_instruction_set
Inmathematics, ameasure-preserving dynamical systemis an object of study in the abstract formulation ofdynamical systems, andergodic theoryin particular. Measure-preserving systems obey thePoincaré recurrence theorem, and are a special case ofconservative systems. They provide the formal, mathematical basis for a broad range of physical systems, and, in particular, many systems fromclassical mechanics(in particular, mostnon-dissipativesystems) as well as systems inthermodynamic equilibrium. A measure-preserving dynamical system is defined as aprobability spaceand ameasure-preservingtransformation on it. In more detail, it is a system with the following structure: One may ask why the measure preserving transformation is defined in terms of the inverseμ(T−1(A))=μ(A){\displaystyle \mu (T^{-1}(A))=\mu (A)}instead of the forward transformationμ(T(A))=μ(A){\displaystyle \mu (T(A))=\mu (A)}. This can be understood intuitively. Consider the typical measure on the unit interval[0,1]{\displaystyle [0,1]}, and a mapTx=2xmod1={2xifx<1/22x−1ifx>1/2{\displaystyle Tx=2x\mod 1={\begin{cases}2x{\text{ if }}x<1/2\\2x-1{\text{ if }}x>1/2\\\end{cases}}}. This is theBernoulli map. Now, distribute an even layer of paint on the unit interval[0,1]{\displaystyle [0,1]}, and then map the paint forward. The paint on the[0,1/2]{\displaystyle [0,1/2]}half is spread thinly over all of[0,1]{\displaystyle [0,1]}, and the paint on the[1/2,1]{\displaystyle [1/2,1]}half as well. The two layers of thin paint, layered together, recreates the exact same paint thickness. More generally, the paint that would arrive at subsetA⊂[0,1]{\displaystyle A\subset [0,1]}comes from the subsetT−1(A){\displaystyle T^{-1}(A)}. For the paint thickness to remain unchanged (measure-preserving), the mass of incoming paint should be the same:μ(A)=μ(T−1(A)){\displaystyle \mu (A)=\mu (T^{-1}(A))}. Consider a mappingT{\displaystyle {\mathcal {T}}}ofpower sets: Consider now the special case of mapsT{\displaystyle {\mathcal {T}}}which preserve intersections, unions and complements (so that it is a map ofBorel sets) and also sendsX{\displaystyle X}toX{\displaystyle X}(because we want it to beconservative). Every such conservative, Borel-preserving map can be specified by somesurjectivemapT:X→X{\displaystyle T:X\to X}by writingT(A)=T−1(A){\displaystyle {\mathcal {T}}(A)=T^{-1}(A)}. Of course, one could also defineT(A)=T(A){\displaystyle {\mathcal {T}}(A)=T(A)}, but this is not enough to specify all such possible mapsT{\displaystyle {\mathcal {T}}}. That is, conservative, Borel-preserving mapsT{\displaystyle {\mathcal {T}}}cannot, in general, be written in the formT(A)=T(A);{\displaystyle {\mathcal {T}}(A)=T(A);}. μ(T−1(A)){\displaystyle \mu (T^{-1}(A))}has the form of apushforward, whereasμ(T(A)){\displaystyle \mu (T(A))}is generically called apullback. Almost all properties and behaviors of dynamical systems are defined in terms of the pushforward. For example, thetransfer operatoris defined in terms of the pushforward of the transformation mapT{\displaystyle T}; the measureμ{\displaystyle \mu }can now be understood as aninvariant measure; it is just theFrobenius–Perron eigenvectorof the transfer operator (recall, the FP eigenvector is the largest eigenvector of a matrix; in this case it is the eigenvector which has the eigenvalue one: the invariant measure.) There are two classification problems of interest. One, discussed below, fixes(X,B,μ){\displaystyle (X,{\mathcal {B}},\mu )}and asks about the isomorphism classes of a transformation mapT{\displaystyle T}. The other, discussed intransfer operator, fixes(X,B){\displaystyle (X,{\mathcal {B}})}andT{\displaystyle T}, and asks about mapsμ{\displaystyle \mu }that are measure-like. Measure-like, in that they preserve the Borel properties, but are no longer invariant; they are in general dissipative and so give insights intodissipative systemsand the route to equilibrium. In terms of physics, the measure-preserving dynamical system(X,B,μ,T){\displaystyle (X,{\mathcal {B}},\mu ,T)}often describes a physical system that is in equilibrium, for example,thermodynamic equilibrium. One might ask: how did it get that way? Often, the answer is by stirring,mixing,turbulence,thermalizationor other such processes. If a transformation mapT{\displaystyle T}describes this stirring, mixing, etc. then the system(X,B,μ,T){\displaystyle (X,{\mathcal {B}},\mu ,T)}is all that is left, after all of the transient modes have decayed away. The transient modes are precisely those eigenvectors of the transfer operator that have eigenvalue less than one; the invariant measureμ{\displaystyle \mu }is the one mode that does not decay away. The rate of decay of the transient modes are given by (the logarithm of) their eigenvalues; the eigenvalue one corresponds to infinite half-life. Themicrocanonical ensemblefrom physics provides an informal example. Consider, for example, a fluid, gas or plasma in a box of width, length and heightw×l×h,{\displaystyle w\times l\times h,}consisting ofN{\displaystyle N}atoms. A single atom in that box might be anywhere, having arbitrary velocity; it would be represented by a single point inw×l×h×R3.{\displaystyle w\times l\times h\times \mathbb {R} ^{3}.}A given collection ofN{\displaystyle N}atoms would then be asingle pointsomewhere in the space(w×l×h)N×R3N.{\displaystyle (w\times l\times h)^{N}\times \mathbb {R} ^{3N}.}The "ensemble" is the collection of all such points, that is, the collection of all such possible boxes (of which there are an uncountably-infinite number). This ensemble of all-possible-boxes is the spaceX{\displaystyle X}above. In the case of anideal gas, the measureμ{\displaystyle \mu }is given by theMaxwell–Boltzmann distribution. It is aproduct measure, in that ifpi(x,y,z,vx,vy,vz)d3xd3p{\displaystyle p_{i}(x,y,z,v_{x},v_{y},v_{z})\,d^{3}x\,d^{3}p}is the probability of atomi{\displaystyle i}having position and velocityx,y,z,vx,vy,vz{\displaystyle x,y,z,v_{x},v_{y},v_{z}}, then, forN{\displaystyle N}atoms, the probability is the product ofN{\displaystyle N}of these. This measure is understood to apply to the ensemble. So, for example, one of the possible boxes in the ensemble has all of the atoms on one side of the box. One can compute the likelihood of this, in the Maxwell–Boltzmann measure. It will be enormously tiny, of orderO(2−3N).{\displaystyle {\mathcal {O}}\left(2^{-3N}\right).}Of all possible boxes in the ensemble, this is a ridiculously small fraction. The only reason that this is an "informal example" is because writing down the transition functionT{\displaystyle T}is difficult, and, even if written down, it is hard to perform practical computations with it. Difficulties are compounded if there are interactions between the particles themselves, like avan der Waals interactionor some other interaction suitable for a liquid or a plasma; in such cases, the invariant measure is no longer the Maxwell–Boltzmann distribution. The art of physics is finding reasonable approximations. This system does exhibit one key idea from the classification of measure-preserving dynamical systems: two ensembles, having different temperatures, are inequivalent. The entropy for a given canonical ensemble depends on its temperature; as physical systems, it is "obvious" that when the temperatures differ, so do the systems. This holds in general: systems with different entropy are not isomorphic. Unlike the informal example above, the examples below are sufficiently well-defined and tractable that explicit, formal computations can be performed. The definition of a measure-preserving dynamical system can be generalized to the case in whichTis not a single transformation that is iterated to give the dynamics of the system, but instead is amonoid(or even agroup, in which case we have theaction of a groupupon the given probability space) of transformationsTs:X→Xparametrized bys∈Z(orR, orN∪ {0}, or [0, +∞)), where each transformationTssatisfies the same requirements asTabove.[1]In particular, the transformations obey the rules: The earlier, simpler case fits into this framework by definingTs=Tsfors∈N. The concept of ahomomorphismand anisomorphismmay be defined. Consider two dynamical systems(X,A,μ,T){\displaystyle (X,{\mathcal {A}},\mu ,T)}and(Y,B,ν,S){\displaystyle (Y,{\mathcal {B}},\nu ,S)}. Then a mapping is ahomomorphism of dynamical systemsif it satisfies the following three properties: The system(Y,B,ν,S){\displaystyle (Y,{\mathcal {B}},\nu ,S)}is then called afactorof(X,A,μ,T){\displaystyle (X,{\mathcal {A}},\mu ,T)}. The mapφ{\displaystyle \varphi \;}is anisomorphism of dynamical systemsif, in addition, there exists another mapping that is also a homomorphism, which satisfies Hence, one may form acategoryof dynamical systems and their homomorphisms. A pointx∈Xis called ageneric pointif theorbitof the point isdistributed uniformlyaccording to the measure. Consider a dynamical system(X,B,T,μ){\displaystyle (X,{\mathcal {B}},T,\mu )}, and letQ= {Q1, ...,Qk} be apartitionofXintokmeasurable pair-wise disjoint sets. Given a pointx∈X, clearlyxbelongs to only one of theQi. Similarly, the iterated pointTnxcan belong to only one of the parts as well. Thesymbolic nameofx, with regards to the partitionQ, is the sequence of integers {an} such that The set of symbolic names with respect to a partition is called thesymbolic dynamicsof the dynamical system. A partitionQis called ageneratororgenerating partitionif μ-almost every pointxhas a unique symbolic name. Given a partition Q = {Q1, ...,Qk} and a dynamical system(X,B,T,μ){\displaystyle (X,{\mathcal {B}},T,\mu )}, define theT-pullback ofQas Further, given twopartitionsQ= {Q1, ...,Qk} andR= {R1, ...,Rm}, define theirrefinementas With these two constructs, therefinement of an iterated pullbackis defined as which plays crucial role in the construction of the measure-theoretic entropy of a dynamical system. Theentropyof a partitionQ{\displaystyle {\mathcal {Q}}}is defined as[2][3] The measure-theoretic entropy of a dynamical system(X,B,T,μ){\displaystyle (X,{\mathcal {B}},T,\mu )}with respect to a partitionQ= {Q1, ...,Qk} is then defined as Finally, theKolmogorov–Sinai metricormeasure-theoretic entropyof a dynamical system(X,B,T,μ){\displaystyle (X,{\mathcal {B}},T,\mu )}is defined as where thesupremumis taken over all finite measurable partitions. A theorem ofYakov Sinaiin 1959 shows that the supremum is actually obtained on partitions that are generators. Thus, for example, the entropy of theBernoulli processis log 2, sincealmost everyreal numberhas a uniquebinary expansion. That is, one may partition theunit intervalinto the intervals [0, 1/2) and [1/2, 1]. Every real numberxis either less than 1/2 or not; and likewise so is the fractional part of 2nx. If the spaceXis compact and endowed with a topology, or is a metric space, then thetopological entropymay also be defined. IfT{\displaystyle T}is an ergodic, piecewise expanding, and Markov onX⊂R{\displaystyle X\subset \mathbb {R} }, andμ{\displaystyle \mu }is absolutely continuous with respect to the Lebesgue measure, then we have the Rokhlin formula[4](section 4.3 and section 12.3[5]):hμ(T)=∫ln⁡|dT/dx|μ(dx){\displaystyle h_{\mu }(T)=\int \ln |dT/dx|\mu (dx)}This allows calculation of entropy of many interval maps, such as thelogistic map. Ergodic means thatT−1(A)=A{\displaystyle T^{-1}(A)=A}impliesA{\displaystyle A}has full measure or zero measure. Piecewise expanding and Markov means that there is a partition ofX{\displaystyle X}into finitely many open intervals, such that for someϵ>0{\displaystyle \epsilon >0},|T′|≥1+ϵ{\displaystyle |T'|\geq 1+\epsilon }on each open interval. Markov means that for eachIi{\displaystyle I_{i}}from those open intervals, eitherT(Ii)∩Ii=∅{\displaystyle T(I_{i})\cap I_{i}=\emptyset }orT(Ii)∩Ii=Ii{\displaystyle T(I_{i})\cap I_{i}=I_{i}}. One of the primary activities in the study of measure-preserving systems is their classification according to their properties. That is, let(X,B,μ){\displaystyle (X,{\mathcal {B}},\mu )}be a measure space, and letU{\displaystyle U}be the set of all measure preserving systems(X,B,μ,T){\displaystyle (X,{\mathcal {B}},\mu ,T)}. An isomorphismS∼T{\displaystyle S\sim T}of two transformationsS,T{\displaystyle S,T}defines anequivalence relationR⊂U×U.{\displaystyle {\mathcal {R}}\subset U\times U.}The goal is then to describe the relationR{\displaystyle {\mathcal {R}}}. A number of classification theorems have been obtained; but quite interestingly, a number of anti-classification theorems have been found as well. The anti-classification theorems state that there are more than a countable number of isomorphism classes, and that a countable amount of information is not sufficient to classify isomorphisms.[6][7] The first anti-classification theorem, due to Hjorth, states that ifU{\displaystyle U}is endowed with theweak topology, then the setR{\displaystyle {\mathcal {R}}}is not aBorel set.[8]There are a variety of other anti-classification results. For example, replacing isomorphism withKakutani equivalence, it can be shown that there are uncountably many non-Kakutani equivalent ergodic measure-preserving transformations of each entropy type.[9] These stand in contrast to the classification theorems. These include: Krieger finite generator theorem[14](Krieger 1970)—Given a dynamical system on a Lebesgue space of measure 1, whereT{\textstyle T}is invertible, measure preserving, and ergodic. IfhT≤ln⁡k{\displaystyle h_{T}\leq \ln k}for some integerk{\displaystyle k}, then the system has a size-k{\displaystyle k}generator. If the entropy is exactly equal toln⁡k{\displaystyle \ln k}, then such a generator exists iff the system is isomorphic to the Bernoulli shift onk{\displaystyle k}symbols with equal measures.
https://en.wikipedia.org/wiki/Metric_entropy
Themathematical theory of informationis based onprobability theoryandstatistics, and measures information with severalquantities of information. The choice of logarithmic base in the following formulae determines theunitofinformation entropythat is used. The most common unit of information is thebit, or more correctly theshannon,[2]based on thebinary logarithm. Althoughbitis more frequently used in place ofshannon, its name is not distinguished from thebitas used in data processing to refer to a binary value or stream regardless of its entropy (information content). Other units include thenat, based on thenatural logarithm, and thehartley, based on the base 10 orcommon logarithm. In what follows, an expression of the formplog⁡p{\displaystyle p\log p\,}is considered by convention to be equal to zero wheneverp{\displaystyle p}is zero. This is justified becauselimp→0+plog⁡p=0{\displaystyle \lim _{p\rightarrow 0+}p\log p=0}for any logarithmic base.[3] Shannon derived a measure of information content called theself-informationor"surprisal"of a messagem{\displaystyle m}: wherep(m)=Pr(M=m){\displaystyle p(m)=\mathrm {Pr} (M=m)}is the probability that messagem{\displaystyle m}is chosen from all possible choices in the message spaceM{\displaystyle M}. The base of the logarithm only affects a scaling factor and, consequently, the units in which the measured information content is expressed. If the logarithm is base 2, the measure of information is expressed in units ofshannonsor more often simply "bits" (abitin other contexts is rather defined as a "binary digit", whoseaverage information contentis at most 1 shannon). Information from a source is gained by a recipient only if the recipient did not already have that information to begin with. Messages that convey information over a certain (P=1) event (or one which isknownwith certainty, for instance, through a back-channel) provide no information, as the above equation indicates. Infrequently occurring messages contain more information than more frequently occurring messages. It can also be shown that a compound message of two (or more) unrelated messages would have a quantity of information that is the sum of the measures of information of each message individually. That can be derived using this definition by considering a compound messagem&n{\displaystyle m\&n}providing information regarding the values of two random variables M and N using a message which is the concatenation of the elementary messagesmandn, each of whose information content are given byI⁡(m){\displaystyle \operatorname {I} (m)}andI⁡(n){\displaystyle \operatorname {I} (n)}respectively. If the messagesmandneach depend only on M and N, and the processes M and N areindependent, then sinceP(m&n)=P(m)P(n){\displaystyle P(m\&n)=P(m)P(n)}(the definition of statistical independence) it is clear from the above definition thatI⁡(m&n)=I⁡(m)+I⁡(n){\displaystyle \operatorname {I} (m\&n)=\operatorname {I} (m)+\operatorname {I} (n)}. An example: The weather forecast broadcast is: "Tonight's forecast: Dark. Continued darkness until widely scattered light in the morning." This message contains almost no information. However, a forecast of a snowstorm would certainly contain information since such does not happen every evening. There would be an even greater amount of information in an accurate forecast of snow for a warm location, such asMiami. The amount of information in a forecast of snow for a location where it never snows (impossible event) is the highest (infinity). Theentropyof a discrete message spaceM{\displaystyle M}is a measure of the amount ofuncertaintyone has about which message will be chosen. It is defined as theaverageself-information of a messagem{\displaystyle m}from that message space: where An important property of entropy is that it is maximized when all the messages in the message space are equiprobable (e.g.p(m)=1/|M|{\displaystyle p(m)=1/|M|}). In this caseH(M)=log⁡|M|{\displaystyle \mathrm {H} (M)=\log |M|}. Sometimes the functionH{\displaystyle \mathrm {H} }is expressed in terms of the probabilities of the distribution: An important special case of this is thebinary entropy function: Thejoint entropyof two discrete random variablesX{\displaystyle X}andY{\displaystyle Y}is defined as the entropy of thejoint distributionofX{\displaystyle X}andY{\displaystyle Y}: IfX{\displaystyle X}andY{\displaystyle Y}areindependent, then the joint entropy is simply the sum of their individual entropies. (Note: The joint entropy should not be confused with thecross entropy, despite similar notations.) Given a particular value of a random variableY{\displaystyle Y}, the conditional entropy ofX{\displaystyle X}givenY=y{\displaystyle Y=y}is defined as: wherep(x|y)=p(x,y)p(y){\displaystyle p(x|y)={\frac {p(x,y)}{p(y)}}}is theconditional probabilityofx{\displaystyle x}giveny{\displaystyle y}. Theconditional entropyofX{\displaystyle X}givenY{\displaystyle Y}, also called theequivocationofX{\displaystyle X}aboutY{\displaystyle Y}is then given by: This uses theconditional expectationfrom probability theory. A basic property of the conditional entropy is that: TheKullback–Leibler divergence(orinformation divergence,information gain, orrelative entropy) is a way of comparing two distributions, a "true"probability distributionp{\displaystyle p}, and an arbitrary probability distributionq{\displaystyle q}. If we compress data in a manner that assumesq{\displaystyle q}is the distribution underlying some data, when, in reality,p{\displaystyle p}is the correct distribution, Kullback–Leibler divergence is the number of average additional bits per datum necessary for compression, or, mathematically, It is in some sense the "distance" fromq{\displaystyle q}top{\displaystyle p}, although it is not a truemetricdue to its not being symmetric. It turns out that one of the most useful and important measures of information is themutual information, ortransinformation. This is a measure of how much information can be obtained about one random variable by observing another. The mutual information ofX{\displaystyle X}relative toY{\displaystyle Y}(which represents conceptually the average amount of information aboutX{\displaystyle X}that can be gained by observingY{\displaystyle Y}) is given by: A basic property of the mutual information is that: That is, knowingY{\displaystyle Y}, we can save an average ofI⁡(X;Y){\displaystyle \operatorname {I} (X;Y)}bits in encodingX{\displaystyle X}compared to not knowingY{\displaystyle Y}. Mutual information issymmetric: Mutual information can be expressed as the averageKullback–Leibler divergence(information gain) of theposterior probability distributionofX{\displaystyle X}given the value ofY{\displaystyle Y}to theprior distributiononX{\displaystyle X}: In other words, this is a measure of how much, on the average, the probability distribution onX{\displaystyle X}will change if we are given the value ofY{\displaystyle Y}. This is often recalculated as the divergence from the product of the marginal distributions to the actual joint distribution: Mutual information is closely related to thelog-likelihood ratio testin the context of contingency tables and themultinomial distributionand toPearson's χ2test: mutual information can be considered a statistic for assessing independence between a pair of variables, and has a well-specified asymptotic distribution. The basic measures of discrete entropy have been extended by analogy tocontinuousspaces by replacing sums with integrals andprobability mass functionswithprobability density functions. Although, in both cases, mutual information expresses the number of bits of information common to the two sources in question, the analogy doesnotimply identical properties; for example, differential entropy may be negative. The differential analogies of entropy, joint entropy, conditional entropy, and mutual information are defined as follows: wheref(x,y){\displaystyle f(x,y)}is the joint density function,f(x){\displaystyle f(x)}andf(y){\displaystyle f(y)}are the marginal distributions, andf(x|y){\displaystyle f(x|y)}is the conditional distribution.
https://en.wikipedia.org/wiki/Quantities_of_information
Brevity codesare used inamateur radio, maritime, aviation, police, and military communications. They are designed to convey complex information with a few words or codes. Some areclassifiedfrom the public.
https://en.wikipedia.org/wiki/Brevity_code
Ten-codes, officially known asten signals, arebrevity codesused to represent common phrases in voice communication, particularly by US public safety officials and incitizens band(CB) radio transmissions. The police version of ten-codes is officially known as theAPCO Project 14 Aural Brevity Code.[1] The codes, developed during 1937–1940 and expanded in 1974 by theAssociation of Public-Safety Communications Officials-International(APCO), allow brevity and standardization of message traffic. They have historically been widely used by law enforcement officers inNorth America, but in 2006, due to the lack of standardization, the U.S. federal government recommended they be discontinued in favor of everyday language.[2] APCO first proposed Morse code brevity codes in the June 1935 issue of The APCO Bulletin, which were adapted from the procedure symbols of the U.S. Navy, though these procedures were for communications in Morse code, not voice.[3] In August 1935, the APCO Bulletin published a recommendation that the organization issue a handbook that described standard operating procedures, including:[4] The development of theAPCO Ten Signalsbegan in 1937[5]to reduce use of speech on the radio at a time when police radio channels were limited. Credit for inventing the codes goes to Charles "Charlie" Hopper, communications director for theIllinois State Police, District 10 inPesotum, Illinois. Hopper had been involved in radio for years and realized there was a need to abbreviate transmissions onState Policebands.[6]Experienced radio operators knew the first syllable of a transmission was frequently not understood because of quirks in early electronics technology. Radios in the 1930s were based onvacuum tubespowered by a small motor-generator called adynamotor. The dynamotor took from 1/10 to 1/4 of a second to "spin up" to full power. Police officers were trained to push the microphone button, then pause briefly before speaking; however, sometimes they would forget to wait. Preceding each code with "ten-" gave the radio transmitter time to reach full power. An APCO Bulletin of January 1940 lists codes assigned as part of standardisation.[7] In 1954, APCO published an article describing a proposed simplification of the code, based on an analysis conducted by the San Diego Police Department.[8]In the September 1955 issue of the APCO Bulletin, a revision of the Ten-Signals was proposed,[9]and it was later adopted. The Ten Signals were included in APCO Project Two (1967), "Public Safety Standard Operating Procedures Manual", published as study cards in APCO Project 4 (1973), "Ten Signal Cards", and then revised in APCO Project 14 (1974).[10][11][12][13] Ten-codes, especially "10-4" (meaning "understood") first reached public recognition in the mid- to late-1950s through the television seriesHighway Patrol, withBroderick Crawford.[citation needed] Ten-codes were adapted for use byCB radioenthusiasts.C. W. McCall's hit song "Convoy" (1975), depicting conversation among CB-communicatingtruckers, put phrases like "10-4" and "what's your twenty?" (10-20 for "where are you?") into common use in American English.[citation needed] The movieConvoy(1978), loosely based on McCall's song, further entrenched ten-codes in casual conversation, as did the movieSmokey and the Bandit. The New Zealandreality televisionshowTen 7 Aotearoa(formerlyPolice Ten 7) takes its name from the New Zealand Police ten-code 10-7, which means "Unit has arrived at job".[14][15] Often when an officer retires, a call to dispatch is made. The officer gives a 10-7 code (Out of service) and then a 10-42 code (ending tour of duty).[16][17] (c. 1971) (plain language to replace Ten Codes)[25] Traffic TheNew Zealand Policeuse a variety of radio communication codes including its own version of 10-codes seen below.[27] While ten-codes were intended to be a terse, concise, and standardized system, the proliferation of different meanings can render them useless in situations when officers from different agencies and jurisdictions need to communicate. In the fall of 2005, responding to inter-organizational communication problems during the rescue operations afterHurricane Katrina, the United StatesFederal Emergency Management Agency(FEMA) discouraged the use of ten-codes and other codes due to their wide variation in meaning.[28][29]TheDepartment of Homeland Security's SAFECOM program, established in response to communication problems experienced during theSeptember 11 attacksalso advises local agencies on how and why to transition to plain language,[30]and their use is expressly forbidden in the nationally standardizedIncident Command System, as is the use of other codes.[31] APCO International stated in 2012 that plain speech communications over public safety radio systems is preferred over the traditional 10-Codes and dispatch signals.[32]Nineteen states had changed to plain English by the end of 2009.[33]As of 2011[update], ten-codes remained in common use in many areas, but were increasingly being phased out in favor of plain language.[2] About 1979, APCO created the Phrase Word Brevity Code as a direct replacement for the Ten-code.[26] In 1980, theNational Incident Management Systempublished a document, ICS Clear Text Guide, which was another attempt to create a replacement for Ten-codes. The list of code words was republished in the 1990 Montana Mutual Aid and Common Frequencies document.[34] Brevity codes other than the APCO 10-code are frequently used, and include several types:
https://en.wikipedia.org/wiki/Ten-code
Acrossword(orcrossword puzzle) is aword gameconsisting of a grid of black and white squares, into which solvers enter words or phrases ("entries") crossing each other horizontally ("across") and vertically ("down") according to a set of clues. Each white square is typically filled with one letter, while the black squares are used to separate entries. The first white square in each entry is typically numbered to correspond to its clue. Crosswords commonly appear innewspapersandmagazines. The earliest crosswords that resemble their modern form were popularized by theNew York Worldin the 1910s. Many variants of crosswords are popular around the world, includingcryptic crosswordsand many language-specific variants. Crossword construction in modern times usually involves the use of software. Constructors choose a theme (except for themeless puzzles), place the theme answers in a grid which is usually symmetric, fill in the rest of the grid, and then write clues. A person who constructs or solves crosswords is called a "cruciverbalist".[1]The word "cruciverbalist" appears to have been coined in the 1970s from the Latin rootscrucis, meaning 'cross', andverbum, meaning 'word'.[2] Crossword grids such as those appearing in most North American newspapers andmagazinesconsist mainly of solid regions of uninterrupted white squares, separated more sparsely by shaded squares. Every letter is "checked" (i.e., is part of both an "across" word and a "down" word) and usually each answer must contain at least three letters. In such puzzles shaded squares are typically limited to about one-sixth of the total. Crossword grids elsewhere, such as in Britain,South Africa,Indiaand Australia, have alattice-like structure, with a higher percentage of shaded squares (around 25%), leaving about half the letters in an answer unchecked. For example, if the top row has an answer running all the way across, there will often be no across answers in the second row. Another tradition in puzzle design (in North America, India, and Britain particularly) is that the grid should have 180-degreerotational symmetry, so that its pattern appears the same if the paper is turned upside down. Most puzzle designs also require that all white cells be orthogonally contiguous (that is, connected in one mass through shared sides, to form a singlepolyomino). Substantial variants from the usual forms exist. Two of the common ones are barred crosswords, which use bold lines between squares (instead of shaded squares) to separate answers, and circular designs, with answers entered either radially or in concentric circles. "Free form" crosswords ("criss-cross" puzzles), which have simple, asymmetric designs, are often seen on school worksheets, children's menus, and other entertainment for children. Grids forming shapes other than squares are also occasionally used. Puzzlesare often one of several standard sizes. For example, many weekday newspaper puzzles (such as the AmericanNew York Timescrossword puzzle) are 15×15 squares, while weekend puzzles may be 21×21, 23×23, or 25×25. TheNew York Timespuzzles also set a common pattern for American crosswords by increasing in difficulty throughout the week: their Monday puzzles are the easiest and the puzzles get harder each day until Saturday. Their larger Sunday puzzle is about the same level of difficulty as a weekday-size Thursday puzzle.[3]This has led U.S. solvers to use the day of the week as a shorthand when describing how hard a puzzle is: e.g. an easy puzzle may be referred to as a "Monday" or a "Tuesday", a medium-difficulty puzzle as a "Wednesday", and a truly difficult puzzle as a "Saturday". Typically clues appear outside the grid, divided into an across list and a down list; the first cell of each entry contains a number referenced by the clue lists. For example, the answer to a clue labeled "17 Down" is entered with the first letter in the cell numbered "17", proceeding down from there. Numbers are almost never repeated; numbered cells are numbered consecutively, usually from left to right across each row, starting with the top row and proceeding downward. Some Japanese crosswords are numbered from top to bottom down each column, starting with the leftmost column and proceeding right. American-style crossword clues, calledstraightorquick cluesby those more familiar with cryptic puzzles, are often simple definitions of the answers. Often, a straight clue is not in itself sufficient to distinguish between several possible answers, either because multiple synonymous answers may fit or because the clue itself is a homonym (e.g., "Lead" as in to be ahead in a contest or "Lead" as in the element), so the solver must make use ofchecksto establish the correct answer with certainty. For example, the answer to the clue "PC key" for a three-letter answer could beESC,ALT,TAB,DEL, orINS, so until acheckis filled in, giving at least one of the letters, the correct answer cannot be determined. In most American-style crosswords,[4]the majority of the clues in the puzzle are straight clues,[5]with the remainder being one of the other types described below. Crossword clues are generally consistent with the solutions. For instance, clues and their solutions should always agree in tense, number, and degree.[6]If a clue is in the past tense, so is the answer: thus "Traveled on horseback" would be a valid clue for the solutionRODE, but not forRIDE. Similarly, "Family members" would be a valid clue forAUNTSbut notUNCLE, while "More joyful" could clueHAPPIERbut notHAPPIEST. Capitalization of answer letters is conventionally ignored; crossword puzzles are typically filled in, and their answer sheets published, inall caps. This ensures aproper namecan have its initialcapitalletter checked with a non-capitalizable letter in the intersecting clue. Some clue examples: The constraints of the American-style grid (in which every letter is checked) often require a fair number of answers not to be dictionary words. As a result, the following ways to clue abbreviations and other non-words, although they can be found in "straight" British crosswords, are much more common in American ones: Many American crossword puzzles feature a "theme" consisting of a number of long entries (generally three to five in a standard 15×15-square "weekday-size" puzzle) that share some relationship, type of pun, or other element in common. As an example, theNew York Timescrossword of April 26, 2005 by Sarah Keller, edited byWill Shortz, featured five themed entries ending in the different parts of a tree:SQUARE ROOT,TABLE LEAF,WARDROBE TRUNK,BRAIN STEM, andBANK BRANCH. The above is an example of a category theme, where the theme elements are all members of the same set. Other types of themes include: The themed crossword puzzle was invented in 1958 byHarold T. Bers, an advertising executive and frequent contributor toThe New York Timescrossword.[10][11][12][13] TheSimon & SchusterCrossword Puzzle Series has published many unusually themed crosswords. "Rosetta Stone", by Sam Bellotto Jr., incorporates aCaesar ciphercryptogram as the theme; the key to breaking the cipher is the answer to 1Across. Another unusual theme requires the solver to use the answer to a clue as another clue. The answer tothatclue is the real solution. Many puzzles feature clues involving wordplay which are to be taken metaphorically or in some sense other than their literal meaning, requiring some form oflateral thinking. Depending on the puzzle creator or the editor, this might be represented either with a question mark at the end of the clue or with a modifier such as "maybe" or "perhaps". In more difficult puzzles, the indicator may be omitted, increasing ambiguity between a literal meaning and a wordplay meaning. Examples: Any type of puzzle may containcross-references, where the answer to one clue forms part of another clue, in which it is referred to by number and direction. E.g., a puzzle might have 1-across clued as "Central character in The Lord of the Rings" =FRODO, with 17-down clued as "Precious object for 1-Across" =RING. When an answer is composed of multiple or hyphenated words, some crosswords (especially in Britain) indicate the structure of the answer. For example, "(3,5)" after a clue indicates that the answer is composed of a three-letter word followed by a five-letter word. Most American-style crosswords do not provide this information. Some crossword designers have started including a metapuzzle, or "meta" for short, a second puzzle within the completed puzzle.[14]After the player has correctly solved the crossword puzzle in the usual fashion, the solution forms the basis of a second puzzle. The designer usually includes a hint to the metapuzzle. For instance, the puzzleEight Isn't Enoughby Matt Gaffney gives the clue "This week's contest answer is a three-word phrase whose second word is 'or'."[15]The crossword solution includes the entries "BROUGHT TO NAUGHT", "MIGHT MAKES RIGHT", "CAUGHT A STRAIGHT", and "HEIGHT AND WEIGHT", which are all three-word phrases with two words ending in -ght. The solution to the meta is a similar phrase in which the middle word is "or": "FIGHT OR FLIGHT". Since September 2015, theWall Street JournalFriday crossword has featured a crossword contest metapuzzle, with the prize of a WSJ mug going to a reader randomly chosen from among those submitting the correct answer.[16][17] Some puzzle grids contain more than one correct answer for the same set of clues. These are called Schrödinger or quantum puzzles, alluding to theSchrödinger's Catthought experimentinquantum physics.[18]Schrödinger puzzles have frequently been published in venues includingFireball CrosswordsandThe American Values Club Crosswords, and at least ten have appeared inThe New York Timessince the late 1980s.[19] The dailyNew York Timespuzzle for November 5, 1996, byJeremiah Farrell, had a clue for 39 across that read "Lead story in tomorrow's newspaper, with 43 Across (!)."[20]The answer for 43 across was ELECTED; depending on the outcome of that day'sPresidential Election, the answer for 39 across would have been correct with eitherCLINTONorBOBDOLE, as would each of the corresponding down answers.[21]On September 1, 2016, the dailyNew York Timespuzzle by Ben Tausig had four squares which led to correct answers reading both across and down if solvers entered either "M" or "F".[22]The puzzle's theme,GENDERFLUID, was revealed at 37 across in the center of the puzzle: "Having a variable identity, as suggested by four squares in this puzzle."[23] In cryptic crosswords, the clues are puzzles in themselves. A typical clue contains both a definition at the beginning or end of the clue and wordplay, which provides a way to manufacture the word indicated by the definition, and which may not parse logically. Cryptics usually give the length of their answers in parentheses after the clue, which is especially useful with multi-word answers. Certain signs indicate different forms of wordplay. Solving cryptics is harder to learn than standard crosswords, as learning to interpret the different types of cryptic clues can take some practice. InGreat Britainand throughout much of theCommonwealth, cryptics of varying degrees of difficulty are featured in many newspapers.[24][25] The first crosswords with strictly cryptic clues appeared in the 1920s, pioneered by Edward Powys Mathers. He established the principle of cryptic crossword clues.[26]Cryptic crossword clues consist typically of a definition and some type of word play. Cryptic crossword clues need to be viewed two ways. One is a surface reading and one a hidden meaning.[27]The surface reading is the basic reading of the clue to look for key words and how those words are constructed in the clue. The second way is the hidden meaning. This can be a double definition, an anagram, homophone, or words backwards. There are eight main types of clues in cryptic crosswords.[27] There are several types of wordplay used in cryptics. One is straightforward definition substitution using parts of a word. For example, in one puzzle by Mel Taub, the answerIMPORTANTis given the clue "To bring worker into the country may prove significant". The explanation is that toimportmeans "to bring into the country", the "worker" is a workerant, and "significant" meansimportant. Here, "significant" is the straight definition (appearing here at the end of the clue), "to bring worker into the country" is the wordplay definition, and "may prove" serves to link the two. Note that in a cryptic clue, there is almost always only one answer that fits both the definition and the wordplay, so that when one sees the answer, one knows that it is the right answer—although it can sometimes be a challenge to figure outwhyit is the right answer. A good cryptic clue should provide a fair and exact definition of the answer, while at the same time being deliberately misleading. Another type of wordplay used in cryptics is the use ofhomophones. For example, the clue "A few, we hear, add up (3)" is the clue forSUM. The straight definition is "add up", meaning "totalize". The solver must guess that "we hear" indicates ahomophone, and so a homophone of a synonym of "A few" ("some") is the answer. Other words relating to sound or hearing can be used to signal the presence of a homophone clue (e.g., "aloud", "audibly", "in conversation", etc.). The double meaning is commonly used as another form of wordplay. For example, "Cat's tongue (7)" is solved byPERSIAN, since this is a type of cat, as well as a tongue, or language. This is the only type of cryptic clue without wordplay—both parts of the clue are a straight definition. Cryptics often includeanagrams, as well. For example, in "Slipped a disc – it's cruel (8)" an anagram is indicated by "slipped", with the definition to aim for being "cruel". Ignoring all punctuation, "a disc – it's" produces "SADISTIC".Colin Dexteradvised that "Usually the indicator will be an adjective (drunk, fancy, unusual, and so on); an adverb (badly, excitedly, unexpectedly); a past participle (altered, broken, jumbled) or indeed any phrase giving a similar meaning."[28] Embedded words are another common trick in cryptics. The clue "Bigotry aside, I'd take him (9)" is solved byAPARTHEID. The straight definition is "bigotry", and the wordplay explains itself, indicated by the word "take" (since one word "takes" another): "aside" means APART and I'd is simply ID, so APART and ID "take" HE (which is, in cryptic crossword usage, a perfectly good synonym for "him"). The answer could be elucidated as APART(HE)ID. Another common clue type is the "hidden clue" or "container", where the answer is hidden in the text of the clue itself. For example, "Made a dug-out, buried, and passed away (4)" is solved byDEAD. The answer is written in the clue: "maDE A Dug-out". "Buried" indicates that the answer is embedded within the clue. There are numerous other forms of wordplay found in cryptic clues. Backwards words can be indicated by words like "climbing", "retreating", or "ascending" (depending on whether it is an across clue or a down clue) or by directional indicators such as "going North" (meaning upwards) or "West" (right-to-left); letters can be replaced or removed with indicators such as "nothing rather than excellence" (meaning replace E in a word with O); the letterIcan be indicated by "me" or "one;" the letterOcan be indicated by "nought", "nothing", "zero", or "a ring" (since it visually resembles one); the letterXmight be clued as "a cross", or "ten" (as in theRoman numeral), or "an illiterate's signature", or "sounds like your old flame" (homophone for "ex"). "Senselessness" is solved by "e", because "e" is what remains after removing (less) "ness" from "sense". With the different types of wordplay and definition possibilities, the composer of a cryptic puzzle is presented with many different possible ways to clue a given answer. Most desirable are clues that are clean but deceptive, with a smoothsurface reading(that is, the resulting clue looks as natural a phrase as possible). TheUsenetnewsgrouprec.puzzles.crosswordshas a number of clueing competitions where contestants all submit clues for the same word and a judge picks the best one. In principle, each cryptic clue is usually sufficient to define its answer uniquely, so it should be possible to answer each clue without use of the grid. In practice, the use of checks is an important aid to the solver. These are common crossword variants that vary more from a regular crossword than just an unusual grid shape or unusual clues; these crossword variants may be based on different solving principles and require a different solving skill set. Cipher crosswords were invented in Germany in the 19th century. Published under various trade names (including Code Breakers, Code Crackers, and Kaidoku), and not to be confused with cryptic crosswords (ciphertext puzzles are commonly known ascryptograms), a cipher crossword replaces the clues for each entry with clues for each white cell of the grid—an integer from 1 to 26 inclusive is printed in the corner of each. The objective, as any other crossword, is to determine the proper letter for each cell; in a cipher crossword, the 26 numbers serve as acipherfor those letters: cells that share matching numbers are filled with matching letters, and no two numbers stand for the same letter. All resultant entries must be valid words. Usually, at least one number's letter is given at the outset. English-language cipher crosswords are nearly alwayspangrammatic(all letters of the alphabet appear in the solution). As these puzzles are closer to codes than quizzes, they require a different skillset; many basic cryptographic techniques, such as determining likely vowels, are key to solving these. Given their pangrammaticity, a frequent start point is locating where 'Q' and 'U' must appear. In a diagramless crossword, often called a diagramless for short or, in the UK, a skeleton crossword or carte blanche, the grid offers overall dimensions, but the locations of most of the clue numbers and shaded squares are unspecified. A solver must deduce not only the answers to individual clues, but how to fit together partially built-up clumps of answers into larger clumps with properly set shaded squares. Some of these puzzles follow the traditional symmetry rule, others have left-right mirror symmetry, and others have greater levels of symmetry or outlines suggesting other shapes. If the symmetry of the grid is given, the solver can use it to his/her advantage. A fill-in crossword (also known as crusadex or cruzadex) features a grid and the full list of words to be entered in that grid, but does not give explicit clues for where each word goes. The challenge is figuring out how to integrate the list of words together within the grid so that all intersections of words are valid. Fill-in crosswords may often have longer word length than regular crosswords to make the crossword easier to solve, and symmetry is often disregarded. Fitting together several long words is easier than fitting together several short words because there are fewer possibilities for how the long words intersect together. These types of crosswords are also used to demonstrateartificial intelligenceabilities, such as finding solutions to the puzzle based on a set of determinedconstraints.[29] A cross-figure or crossnumber is the numerical analogy of a crossword, in which the solutions to the clues are numbers instead of words. Clues are usuallyarithmeticalexpressions, but can also begeneral knowledgeclues to which the answer is a number or year. There are also numerical fill-in crosswords. An acrostic is a type of word puzzle, in eponymousacrosticform, that typically consists of two parts. The first is a set of lettered clues, each of which has numbered blanks representing the letters of the answer. The second part is a long series of numbered blanks and spaces, representing a quotation or other text, into which the answers for the clues fit. In most forms of the puzzle, the first letters of each correct clue answer, read in order from clue A on down the list, will spell out the author of the quote and the title of the work it is taken from; this can be used as an additional solving aid. The arroword is a variant of a crossword that does not have as many black squares as a true crossword, but has arrows inside the grid, with clues preceding the arrows. It has been called the most popular word puzzle in manyEuropean countries, and is often called the Scandinavian crossword, as it is believed to have originated in Sweden.[30] The phrase "cross word puzzle" was first written in 1862 byOur Young Folksin the United States. Crossword-like puzzles, for example Double Diamond Puzzles, appeared in the magazineSt. Nicholas, published since 1873.[31]Another crossword puzzle appeared on September 14, 1890, in the Italian magazineIl Secolo Illustrato della Domenica. It was designed by Giuseppe Airoldi and titled "Per passare il tempo" ("To pass the time"). Airoldi's puzzle was a four-by-four grid with no shaded squares; it included horizontal and vertical clues.[32] Crosswords in England during the 19th century were of an elementary kind, apparently derived from theword square, a group of words arranged so the letters read alike vertically and horizontally, and printed in children's puzzle books and various periodicals. On December 21, 1913,Arthur Wynne, ajournalistborn inLiverpool, England, published a "word-cross" puzzle in theNew York Worldthat embodied most of the features of the modern genre. This puzzle is frequently cited as the first crossword puzzle, and Wynne as the inventor. An illustrator later reversed the "word-cross" name to "cross-word".[33][34][35] Crossword puzzles became a regular weekly feature in theNew York World, and spread to other newspapers; thePittsburgh Press, for example, was publishing them at least as early as 1916[36]andThe Boston Globeby 1917.[37] By the 1920s, the crossword phenomenon was starting to attract notice. In October 1922, newspapers published a comic strip byClare Briggsentitled "Movie of a Man Doing the Cross-Word Puzzle", with an enthusiast muttering "87 across 'Northern Sea Bird'!!??!?!!? Hm-m-m starts with an 'M', second letter is 'U' ... I'll look up all the words starting with an 'M-U ...' mus-musi-mur-murd—Hot Dog! Here 'tis!Murre!"[38]In 1923 a humorous squib inThe Boston Globehas a wife ordering her husband to run out and "rescue the papers ... the part I want is blowing down the street." "What is it you're so keen about?" "The Cross-Word Puzzle. Hurry, please, that's a good boy."[39]InThe New Yorker'sinaugural issue, from 1925, the "Jottings About Town" section observed, "Judging from the number of solvers in the subway and 'L' trains, the crossword puzzle bids fair to become a fad with New Yorkers."[40]In 1922, theNew York Public Libraryreported that "The latest craze to strike libraries is the crossword puzzle", and complained that when "the puzzle 'fans' swarm to the dictionaries and encyclopedias so as to drive away readers and students who need these books in their daily work, can there be any doubt of the Library's duty to protect its legitimate readers?"[41] The first book of crossword puzzles was published bySimon & Schusterin 1924, after a suggestion from co-founderRichard Simon'saunt. The publisher was initially skeptical that the book would succeed, and only printed a small run at first. The book was promoted with an included pencil, and "This odd-looking book with a pencil attached to it"[42]was an instant hit, leading crossword puzzles to become a craze of 1924. To help promote its books, Simon & Schuster also founded the Amateur Cross Word Puzzle League of America, which began the process of developing standards for puzzle design.[35][43] Not all of the attention drawn to the crossword puzzle fad was positive: A 1924 editorial inThe New York Timescomplained of the "sinful waste in the utterly futile finding of words the letters of which will fit into a prearranged pattern, more or less complex. This is not a game at all, and it hardly can be called a sport ... [solvers] get nothing out of it except a primitive form of mental exercise, and success or failure in any given attempt is equally irrelevant to mental development."[44]A clergyman called the working of crossword puzzles "the mark of a childish mentality" and said, "There is no use for persons to pretend that working one of the puzzles carries any intellectual value with it."[45]However, another wrote a completeBible Cross-Word Puzzle Book. Also in 1925,Timemagazine noted that nine Manhattan dailies and fourteen other big newspapers were carrying crosswords, and quoted opposing views as to whether "This crossword craze will positively end by June!" or "The crossword puzzle is here to stay!"[46]In 1925,The New York Timesnoted, with approval, a scathing critique of crosswords byThe New Republic; but concluded that "Fortunately, the question of whether the puzzles are beneficial or harmful is in no urgent need of an answer. The craze evidently is dying out fast and in a few months it will be forgotten."[47]and in 1929 declared, "The cross-word puzzle, it seems, has gone the way of all fads."[48]In 1930, a correspondent noted that "Together withThe Timesof London, yours is the only journal of prominence that has never succumbed to the lure of the cross-word puzzle" and said that "The craze—the fad—stage has passed, but there are still people numbering it to the millions who look for their daily cross-word puzzle as regularly as for the weather predictions."[49] The term "crossword" first appeared in theOxford English Dictionaryin 1933.[50] The New York Timesfinally began to publish a crossword puzzle on 15 February 1942, spurred on by the idea that the puzzle could be a welcome distraction from the harsh news ofWorld War II.The New York Times'sfirst puzzle editor wasMargaret Petherbridge Farrar, who was editor from 1942 to 1969.[35]She was succeeded byWill Weng, who was succeeded byEugene T. Maleska. Since 1993, they have been edited byWill Shortz, theTimes'fourth crossword editor. Simon & Schustercontinues to publish theCrossword Puzzle Book Seriesbooks that it began in 1924, currently under the editorship of John M. Samson. The original series ended in 2007 after 258 volumes. Since 2008, these books are now in the Mega series, appearing three times per year and each featuring 300 puzzles. Thecryptic crosswordvariation originated in Britain in the mid-1920s.Edward Powys Mathersset the first crossword to use entirely cryptic clues, originally just for the enjoyment of his friends, one of whom, without permission, submitted it to the SaturdayWestminster Gazette. The editors approached Mathers for more puzzles, and published eleven more of these novel cryptic crosswords. Upon the demise of the SaturdayWestminster, Mathers began setting puzzles forThe Observer, beginning a series of 670 cryptic crosswords, which ended only with Mathers' death in 1939.[51]Mathers set his puzzles under the pen name ofTorquemada, after the firstGrand Inquisitorof theSpanish Inquisition. His successors asThe Observercryptic crossword setter followed his example.Derrick Somerset Macnutt, who took over at Mather's death, chose the pen name "Ximenes," an Anglicization of the surname ofFrancisco Jiménez de Cisneros, a Grand Inquisitor in Castile. The currentObservercryptic compiler,Jonathan Crowthersets under the name "Azed," a reversal ofDeza, another Grand Inquisitor. Cryptic crosswords are popular in Britain, some British Commonwealth nations, and in a few other countries. Many British newspapers publish both standard and cryptic crosswords. The cryptic crossword was imported to the US in 1968 by composer and lyricistStephen Sondheimin theNew Yorkmagazine, but never became widespread. From 1977 to 2006,The Atlanticregularly featured a cryptic crossword "Puzzler" by the husband and wife team ofEmily Cox and Henry Rathvon. From 2006 to 2009,The Atlanticpuzzler appeared only online. In 2010, Cox and Rathvon's efforts began to appear monthly inThe Wall Street Journal.[52]The pair retired at the end of 2023, but the WSJ continues to offer a cryptic crossword each month. In theUnited Kingdom, theSunday Expresswas the first newspaper to publish a crossword on November 2, 1924, a Wynne puzzle adapted for the UK. The first crossword in Britain, according to Tony Augarde in hisOxford Guide to Word Games(1984), was inPearson's Magazinefor February 1922. The 2006 documentaryWordplay, about enthusiasts ofThe New York Times'spuzzle, increased public interest in crosswords. It highlighted attendees of Will Shortz'sAmerican Crossword Puzzle Tournamentand other notable crossword enthusiasts, including former US presidentBill Clintonand comedianJon Stewart.[35]Other crossword tournaments in the United States includeLollapuzzoolain New York City and Boswords in Boston.[53] In 1944, Allied security officers were disturbed by the appearance, in a series of crosswords inThe Daily Telegraph, of words that were secret code names for military operations planned as part ofOperation Overlord. Some cryptologists forBletchley Parkwere selected after doing well in a crossword-solving competition.[54] According toGuinness World Records, May 15, 2007, the most prolific crossword compiler isRoger SquiresofIronbridge,Shropshire, UK. On May 14, 2007, he published his 66,666th crossword,[55]equivalent to 2 million clues. He is one of only four setters to have provided cryptic puzzles toThe Times,The Daily Telegraph,The Guardian, theFinancial TimesandThe Independent. He also holds the record for the longest word ever used in a published crossword—the 58-letter Welsh townLlanfairpwllgwyngyllgogerychwyrndrobwllllantysiliogogogochclued as an anagram. Enthusiasts have compiled a number of record-setting achievements inNew York Timesand other venues.[56] Women editors such asMargaret Farrarwere influential in the first few decades of puzzle-making, and women constructors such asBernice GordonandElizabeth Gorskihave each contributed hundreds of puzzles toThe New York Times.[61]However, in recent years the number of women constructors has declined. During the years thatWill WengandEugene Maleskaedited theNew York Times crossword(1969–1993), women constructors accounted for 35% of puzzles,[62][63]while during the editorship ofWill Shortz(1993–present), this percentage has gone down, with women constructors (including collaborations) accounting for only 15% of puzzles in both 2014 and 2015, 17% of puzzles published in 2016, 13%—the lowest in the "Shortz Era"—in 2017, and 16% in 2018.[64][65]Several reasons have been given for the decline in women constructors. One explanation is that the gender imbalance in crossword construction is similar to that in related fields, such asjournalism, and that morefreelancemale constructors than females submit puzzles on spec toThe New York Timesand other outlets.[66]Another explanation is that computer-assisted construction and the increased influence of computational approaches in generating word lists may be making crossword construction more likeSTEM fields in which women are underrepresented for a number of factors.[62]However, it has also been argued that this explanation risks propagating myths about gender and technology.[67]Some have argued that the relative absence of women constructors and editors has had an influence on the content of the puzzles themselves, and that clues and entries can be insensitive regarding language related to gender and race.[68][69]Margaret Irvinesuggested that lack of confidence was a barrier.[70]Several approaches have been suggested to develop more women in the field, including mentoring novice women constructors and encouraging women constructors to publish their puzzles independently.[71][67] Crossword venues other thanNew York Timeshave recently published higher percentages of women than that puzzle. In the spring of 2018, Patti Varol and Amy Reynaldo organized and edited a pack of 18 puzzles constructed by women called "Women of Letters".[72]Inspired by this, Laura Braunstein and Tracy Bennett launchedThe Inkubator, a "twice-monthly subscription service that will publish crosswords constructed by cis women, trans women, and woman-aligned constructors."[73]The Inkubatorraised over $30,000 in its initial Kickstarter campaign,[74]and began publishing puzzles on January 17, 2019. A book of 100 puzzles,Inkubator Crosswords: 100 Audacious Puzzles by Women and Nonbinary Creators,was published in 2022.[75]On February 8, 2023, they announced to subscribers that 2023 would be their final year as a subscription service.[76] Owing to the large number of words ending with a vowel, Italian crossword-makers have perhaps the most difficult task. The right margin and the bottom can be particularly difficult to put together. From such a perspective, Swedish crossword-makers have a far easier task. Especially in the large picture crosswords, both conjugation of verbs and declension of adjectives and nouns are allowed. A Swedish clue like"kan sättas i munnen" = "sked"("can be put in the mouth" = "spoon") can be grammatically changed;"denkan sättas i munnen" = "skeden"("itcan be put in the mouth" = "the spoon"), as the definite form of a noun includes declension. From their origin in New York, crosswords have spread to many countries and languages. In languages other than English, the status of diacritics varies according to the orthography of the particular language, thus: French-language crosswords are smaller than English-language ones, and not necessarily square: there are usually 8–13 rows and columns, totaling 81–130 squares. They need not be symmetric and two-letter words are allowed, unlike in most English-language puzzles. Compilers strive to minimize use of shaded squares. A black-square usage of 10% is typical;Georges Pereccompiled many 9×9 grids forLe Pointwith four or even three black squares.[79]Rather than numbering the individual clues, the rows and columns are numbered as on achessboard. All clues for a given row or column are listed, against its number, as separate sentences. InItaly, crosswords are usually oblong and larger than French ones, 13×21 being a common size. As in France, they usually are not symmetrical; two-letter words are allowed; and the number of shaded squares is minimized. Nouns (including surnames) and the infinitive or past participle of verbs are allowed, as are abbreviations; in larger crosswords, it is customary to put at the center of the grid phrases made of two to four words, or forenames and surnames. A variant of Italian crosswords does not use shaded squares: words are delimited by thickening the grid. Another variant starts with a blank grid: the solver must insert both the answers and the shaded squares, and across and down clues are either ordered by row and column or not ordered at all. ModernHebrewis normally written with only the consonants; vowels are either understood, or entered as diacritical marks. This can lead to ambiguities in the entry of some words, and compilers generally specify that answers are to be entered inktiv male(with some vowels) orktiv haser(without vowels). Further, since Hebrew is written from right to left, but Roman numerals are used and written from left to right, there can be an ambiguity in the description of lengths of entries, particularly for multi-word phrases. Different compilers and publications use differing conventions for both of these issues. In theJapanese languagecrossword; because of the writing system, one syllable (typicallykatakana) is entered into each white cell of the grid rather than one letter, resulting in the typical solving grid seeming small in comparison to those of other languages. Any secondYōoncharacter is treated as a full syllable and is rarely written with a smaller character. Even cipher crosswords have a Japanese equivalent, although pangrammaticity does not apply. Crosswords withkanjito fill in are also produced, but in far smaller number as it takes far more effort to construct one. Despite Japanese having three writing forms -hiragana,katakana, andkanji- they are rarely mixed in a single crossword puzzle. The design of Japanese crossword grids often follows two additional rules: that shaded cells may not share a side (i.e. they may not be orthogonally contiguous) and that the corner squares must be white. A. N. Prahlada Rao, based inBangalore, has composed/ constructed some 35,000 crossword puzzles in the languageKannada, including 7,500 crosswords based on films made in Kannada, with a total of 10,00,000 (ten lakhs, or one million) clues.[80][81]His name was recorded in the Limca Book Of Records in 2015 for creating the highest number of crosswords in any Indian Regional Language. He continued to hold this title through 2016 and 2017.[82]In 2008, a five volume set of his puzzles was released, followed by 7 more volumes in 2017.[83]Bengaliis also well known for its crossword puzzles. Crosswords are published regularly in mostBengalidailies and periodicals. The grid system is similar to the British style and two-letter words are usually not allowed. InPoland, crosswords typically use British-style grids, but some do not have shaded cells. Shaded cells are often replaced by boxes with clues—such crosswords are called Swedish puzzles or Swedish-style crosswords. In a vast majority of Polish crosswords, nouns are the only allowed words. Swedish crosswords are mainly in the illustrated (photos or drawings), in-line clue style typical of the "Swedish-style grid". The "Swedish-style" grid (picture crosswords) uses no clue numbers. Instead, clues are contained in the cells which do not contain answers, with arrows indicating where and in what direction to fill in answers. Arrows can be omitted from clue cells, in which case the convention is for the answer to go horizontally to the right of the clue cell, or – if the clue cell is split vertically and contains two clues – for the answer to go horizontally to the right for the top clue and vertically below for the bottom clue. This style of grid is also used in several countries other than Sweden, often in magazines, but also in daily newspapers. The grid often has one or more photos replacing a block of squares as a clue to one or several answers; for example, the name of a pop star, or some kind of rhyme or phrase that can be associated with the photo. These puzzles usually have no symmetry in the grid but instead often have a common theme (literature, music, nature, geography, events of a special year, etc.) This tradition prospered already in the mid-1900s, in family magazines and sections of newspapers. Then the specialised magazines took off. Around the turn of the millennium, approximately half a dozen Swedish magazine publishers produced specialised crossword magazines, totaling more than twenty titles, often published on a monthly basis. The oldest extant crossword magazine published in Swedish isKrysset[84](fromBonnier), founded in 1957. Additionally, nearly all newspapers publish crosswords of some kind, and at weekends often devote specialised sections in the paper to crosswords and similar type of pastime material. Both major evening dailies (AftonbladetandExpressen) publish a weekly crossword supplement, namedKryss & QuizandKorsord[85]respectively. Both are available as paid supplements on Mondays and Tuesdays, as part of the ongoing competition between the two newspapers. In typical themed American-style crosswords, the theme is created first, as a set of symmetric long across answers will be needed around which the grid can be created.[86][87]Since the grid will typically have 180-degree rotational symmetry, the answers will need to be also: thus a typical 15×15 square American puzzle might have two 15-letter entries and two 13-letter entries that could be arranged appropriately in the grid (e.g., one 15-letter entry in the third row, and the other symmetrically in the 13th row; one 13-letter entry starting in the first square of the 6th row and the other ending in the last square of the 10th row).[87][88]The theme must not only be funny or interesting, but also internally consistent. In the April 26, 2005 by Sarah Keller mentioned above, the five themed entries contained in the different parts of a tree: SQUAREROOT, TABLELEAF, WARDROBETRUNK, BRAINSTEM, and BANKBRANCH. In this puzzle, CHARTER OAK wouldnotbe an appropriate entry, as all the other entries contain different parts of a tree, not the name of a kind of tree. Similarly, FAMILY TREE would not be appropriate unless it were used as arevealerfor the theme (frequently clued with a phrase along the lines "... and a hint to ..."). Given the existing entries, SEED MONEY would also be unacceptable, as all the other theme entriesendin the part of a tree as opposed to beginning with it, though the puzzle could certainly be changed to have a mix of words in different positions.[86] Once a consistent, appropriate theme has been chosen, a grid is designed around that theme, following a set of basic principles: Crossword puzzle payments for standard 15×15 puzzles from the major outlets range from $50 (Games) to $500 (The New York Times) while payments for 21×21 puzzles range from $250 (Newsday) to $1,500 (The New York Times).[95] The compensation structure of crosswords generally entails authors selling all rights to their puzzles upon publication, and as a result receiving no royalties from republication of their work in books or other forms. Software that aids increatingcrossword puzzles has been written since at least 1976;[96]one popular example was Crossword Magic for theApple IIin the 1980s.[97]The earliest software relied on people to input a list of fill words and clues, and automatically maps the answers onto a suitable grid. This is asearch problemin computer science because there are many possible arrangements to be checked against the rules of construction. Any given set of answers might have zero, one, or multiple legal arrangements. Modern open source libraries exist that attempt to efficiently generate legal arrangements from a given set of answers.[98] In the late 1990s, the transition began from mostly hand-created arrangements to computer-assisted, which creators generally say has allowed authors to produce more interesting and creative puzzles, reducingcrosswordese.[99] Modern software includes large databases of clues and answers, allowing the computer to randomly select words for the puzzle, potentially with guidance from the user as to the theme or a specific set of words to pick with greater probability. Many serious users add words to the database as an expression of personal creativity or for use in a desired theme. Software can also be used to assist the user in finding words for a specific spot in an arrangement by quickly searching through the dictionary for all words that fit.[99] In 1998 in Jakarta, publisher Elex Media Komputindo (Gramedia Group) published a crossword software entitled "Teka-Teki Silang Komputer" (Computerized Crossword Puzzle [Eng]) in diskette form. It is the first Crossword Puzzle software published in Indonesia. Created by Sukmono Bayu Adhi, the software is archived in the National Library of the Republic of Indonesia (Salemba Library, Jakarta).[100] Originally Petherbridge called the two dimensions of the crossword puzzle "Horizontal" and "Vertical". Among various numbering schemes, the standard became that in which only the start squares of each word were numbered, from left to right and top to bottom. "1 Horizontal" and "1 Vertical" and the like were names for the clues, the cross words, or the grid locations, interchangeably. Later in theTimesthese terms commonly became "across" and "down" and notations for clues could either use the words or the letters "A" and "D", with or without hyphens. Media related toCrosswordsat Wikimedia Commons
https://en.wikipedia.org/wiki/Cipher_crossword
Apasswordis a word, phrase or string of characters used to gain access to a resource, such as an object, area or information. Passwordmay also refer to:
https://en.wikipedia.org/wiki/Password_(disambiguation)
Asafewordis a code word or signal used to communicate personal states or limits regarding physical, emotional, or moral boundaries. Safewordmay also refer to:
https://en.wikipedia.org/wiki/Safeword_(disambiguation)
Inmathematics, anabsorbing element(orannihilating element) is a special type of element of asetwith respect to abinary operationon that set. The result of combining an absorbing element with any element of the set is the absorbing element itself. Insemigrouptheory, the absorbing element is called azero element[1][2]because there is no risk of confusion withother notions of zero, with the notable exception: under additive notationzeromay, quite naturally, denote the neutral element of a monoid. In this article "zero element" and "absorbing element" are synonymous. Formally, let(S, •)be a setSwith a closed binary operation • on it (known as amagma). Azero element(or anabsorbing/annihilating element) is an elementzsuch that for allsinS,z•s=s•z=z. This notion can be refined to the notions ofleft zero, where one requires only thatz•s=z, andright zero, wheres•z=z.[2] Absorbing elements are particularly interesting forsemigroups, especially the multiplicative semigroup of asemiring. In the case of a semiring with 0, the definition of an absorbing element is sometimes relaxed so that it is not required to absorb 0; otherwise, 0 would be the only absorbing element.[3]
https://en.wikipedia.org/wiki/Absorbing_element
In mathematics, theadditive inverseof anelementx, denoted−x,[1]is the element that whenaddedtox, yields theadditive identity,0 (zero).[2]In the most familiar cases, this is thenumber0, but it can also refer to a more generalizedzero element. Inelementary mathematics, the additive inverse is often referred to as theoppositenumber,[3][4]or itsnegative.[5]Theunary operationofarithmetic negation[6]is closely related tosubtraction[7]and is important insolving algebraic equations.[8]Not allsetswhere addition is defined have an additive inverse, such as thenatural numbers.[9] When working withintegers,rational numbers,real numbers, andcomplex numbers, the additive inverse of any number can be found by multiplying it by−1.[8] The concept can also be extended to algebraic expressions, which is often used when balancingequations. The additive inverse is closely related tosubtraction, which can be viewed as an addition using the inverse: Conversely, the additive inverse can be thought of as subtraction from zero: This connection lead to the minus sign being used for both opposite magnitudes and subtraction as far back as the 17th century. While this notation is standard today, it was met with opposition at the time, as some mathematicians felt it could be unclear and lead to errors.[10] Given an algebraic structure defined under addition(S,+){\displaystyle (S,+)}with an additive identitye∈S{\displaystyle e\in S}, an elementx∈S{\displaystyle x\in S}has an additive inversey{\displaystyle y}if and only ify∈S{\displaystyle y\in S},x+y=e{\displaystyle x+y=e}, andy+x=e{\displaystyle y+x=e}.[9] Addition is typically only used to refer to acommutativeoperation, but it is not necessarilyassociative. When it is associative, so(a+b)+c=a+(b+c){\displaystyle (a+b)+c=a+(b+c)}, the left and right inverses, if they exist, will agree, and the additive inverse will be unique. In non-associative cases, the left and right inverses may disagree, and in these cases, the inverse is not considered to exist. The definition requiresclosure, that the additive elementy{\displaystyle y}be found inS{\displaystyle S}. This is why despite addition being defined over the natural numbers, it does not an additive inverse for its members. The associated inverses would benegative numbers, which is why the integers do have an additive inverse.
https://en.wikipedia.org/wiki/Additive_inverse
Inmathematics, and in particular,algebra, ageneralized inverse(or,g-inverse) of an elementxis an elementythat has some properties of aninverse elementbut not necessarily all of them. The purpose of constructing a generalized inverse of a matrix is to obtain a matrix that can serve as an inverse in some sense for a wider class of matrices thaninvertible matrices. Generalized inverses can be defined in anymathematical structurethat involvesassociativemultiplication, that is, in asemigroup. This article describes generalized inverses of amatrixA{\displaystyle A}. A matrixAg∈Rn×m{\displaystyle A^{\mathrm {g} }\in \mathbb {R} ^{n\times m}}is a generalized inverse of a matrixA∈Rm×n{\displaystyle A\in \mathbb {R} ^{m\times n}}ifAAgA=A.{\displaystyle AA^{\mathrm {g} }A=A.}[1][2][3]A generalized inverse exists for an arbitrary matrix, and when a matrix has aregular inverse, this inverse is its unique generalized inverse.[1] Consider thelinear system whereA{\displaystyle A}is anm×n{\displaystyle m\times n}matrix andy∈C(A),{\displaystyle y\in {\mathcal {C}}(A),}thecolumn spaceofA{\displaystyle A}. Ifm=n{\displaystyle m=n}andA{\displaystyle A}isnonsingularthenx=A−1y{\displaystyle x=A^{-1}y}will be the solution of the system. Note that, ifA{\displaystyle A}is nonsingular, then Now supposeA{\displaystyle A}is rectangular (m≠n{\displaystyle m\neq n}), or square and singular. Then we need a right candidateG{\displaystyle G}of ordern×m{\displaystyle n\times m}such that for ally∈C(A),{\displaystyle y\in {\mathcal {C}}(A),} That is,x=Gy{\displaystyle x=Gy}is a solution of the linear systemAx=y{\displaystyle Ax=y}. Equivalently, we need a matrixG{\displaystyle G}of ordern×m{\displaystyle n\times m}such that Hence we can define thegeneralized inverseas follows: Given anm×n{\displaystyle m\times n}matrixA{\displaystyle A}, ann×m{\displaystyle n\times m}matrixG{\displaystyle G}is said to be a generalized inverse ofA{\displaystyle A}ifAGA=A.{\displaystyle AGA=A.}‍[1][2][3]The matrixA−1{\displaystyle A^{-1}}has been termed aregular inverseofA{\displaystyle A}by some authors.[5] Important types of generalized inverse include: Some generalized inverses are defined and classified based on the Penrose conditions: where∗{\displaystyle {}^{*}}denotes conjugate transpose. IfAg{\displaystyle A^{\mathrm {g} }}satisfies the first condition, then it is ageneralized inverseofA{\displaystyle A}. If it satisfies the first two conditions, then it is areflexive generalized inverseofA{\displaystyle A}. If it satisfies all four conditions, then it is thepseudoinverseofA{\displaystyle A}, which is denoted byA+{\displaystyle A^{+}}and also known as theMoore–Penrose inverse, after the pioneering works byE. H. MooreandRoger Penrose.[2][7][8][9][10][11]It is convenient to define anI{\displaystyle I}-inverseofA{\displaystyle A}as an inverse that satisfies the subsetI⊂{1,2,3,4}{\displaystyle I\subset \{1,2,3,4\}}of the Penrose conditions listed above. Relations, such asA(1,4)AA(1,3)=A+{\displaystyle A^{(1,4)}AA^{(1,3)}=A^{+}}, can be established between these different classes ofI{\displaystyle I}-inverses.[1] WhenA{\displaystyle A}is non-singular, any generalized inverseAg=A−1{\displaystyle A^{\mathrm {g} }=A^{-1}}and is therefore unique. For a singularA{\displaystyle A}, some generalised inverses, such as the Drazin inverse and the Moore–Penrose inverse, are unique, while others are not necessarily uniquely defined. Let Sincedet(A)=0{\displaystyle \det(A)=0},A{\displaystyle A}is singular and has no regular inverse. However,A{\displaystyle A}andG{\displaystyle G}satisfy Penrose conditions (1) and (2), but not (3) or (4). Hence,G{\displaystyle G}is a reflexive generalized inverse ofA{\displaystyle A}. Let SinceA{\displaystyle A}is not square,A{\displaystyle A}has no regular inverse. However,AR−1{\displaystyle A_{\mathrm {R} }^{-1}}is a right inverse ofA{\displaystyle A}. The matrixA{\displaystyle A}has no left inverse. The elementbis a generalized inverse of an elementaif and only ifa⋅b⋅a=a{\displaystyle a\cdot b\cdot a=a}, in any semigroup (orring, since themultiplicationfunction in any ring is a semigroup). The generalized inverses of the element 3 in the ringZ/12Z{\displaystyle \mathbb {Z} /12\mathbb {Z} }are 3, 7, and 11, since in the ringZ/12Z{\displaystyle \mathbb {Z} /12\mathbb {Z} }: The generalized inverses of the element 4 in the ringZ/12Z{\displaystyle \mathbb {Z} /12\mathbb {Z} }are 1, 4, 7, and 10, since in the ringZ/12Z{\displaystyle \mathbb {Z} /12\mathbb {Z} }: If an elementain a semigroup (or ring) has an inverse, the inverse must be the only generalized inverse of this element, like the elements 1, 5, 7, and 11 in the ringZ/12Z{\displaystyle \mathbb {Z} /12\mathbb {Z} }. In the ringZ/12Z{\displaystyle \mathbb {Z} /12\mathbb {Z} }any element is a generalized inverse of 0; however 2 has no generalized inverse, since there is nobinZ/12Z{\displaystyle \mathbb {Z} /12\mathbb {Z} }such that2⋅b⋅2=2{\displaystyle 2\cdot b\cdot 2=2}. The following characterizations are easy to verify: Any generalized inverse can be used to determine whether asystem of linear equationshas any solutions, and if so to give all of them. If any solutions exist for then×mlinear system with vectorx{\displaystyle x}of unknowns and vectorb{\displaystyle b}of constants, all solutions are given by parametric on the arbitrary vectorw{\displaystyle w}, whereAg{\displaystyle A^{\mathrm {g} }}is any generalized inverse ofA{\displaystyle A}. Solutions exist if and only ifAgb{\displaystyle A^{\mathrm {g} }b}is a solution, that is, if and only ifAAgb=b{\displaystyle AA^{\mathrm {g} }b=b}. IfAhas full column rank, the bracketed expression in this equation is the zero matrix and so the solution is unique.[12] The generalized inverses of matrices can be characterized as follows. LetA∈Rm×n{\displaystyle A\in \mathbb {R} ^{m\times n}}, and A=U[Σ1000]VT{\displaystyle A=U{\begin{bmatrix}\Sigma _{1}&0\\0&0\end{bmatrix}}V^{\operatorname {T} }} be itssingular-value decomposition. Then for any generalized inverseAg{\displaystyle A^{g}}, there exist[1]matricesX{\displaystyle X},Y{\displaystyle Y}, andZ{\displaystyle Z}such that Ag=V[Σ1−1XYZ]UT.{\displaystyle A^{g}=V{\begin{bmatrix}\Sigma _{1}^{-1}&X\\Y&Z\end{bmatrix}}U^{\operatorname {T} }.} Conversely, any choice ofX{\displaystyle X},Y{\displaystyle Y}, andZ{\displaystyle Z}for matrix of this form is a generalized inverse ofA{\displaystyle A}.[1]The{1,2}{\displaystyle \{1,2\}}-inverses are exactly those for whichZ=YΣ1X{\displaystyle Z=Y\Sigma _{1}X}, the{1,3}{\displaystyle \{1,3\}}-inverses are exactly those for whichX=0{\displaystyle X=0}, and the{1,4}{\displaystyle \{1,4\}}-inverses are exactly those for whichY=0{\displaystyle Y=0}. In particular, the pseudoinverse is given byX=Y=Z=0{\displaystyle X=Y=Z=0}: A+=V[Σ1−1000]UT.{\displaystyle A^{+}=V{\begin{bmatrix}\Sigma _{1}^{-1}&0\\0&0\end{bmatrix}}U^{\operatorname {T} }.} In practical applications it is necessary to identify the class of matrix transformations that must be preserved by a generalized inverse. For example, the Moore–Penrose inverse,A+,{\displaystyle A^{+},}satisfies the following definition of consistency with respect to transformations involving unitary matricesUandV: The Drazin inverse,AD{\displaystyle A^{\mathrm {D} }}satisfies the following definition of consistency with respect to similarity transformations involving a nonsingular matrixS: The unit-consistent (UC) inverse,[13]AU,{\displaystyle A^{\mathrm {U} },}satisfies the following definition of consistency with respect to transformations involving nonsingular diagonal matricesDandE: The fact that the Moore–Penrose inverse provides consistency with respect to rotations (which are orthonormal transformations) explains its widespread use in physics and other applications in which Euclidean distances must be preserved. The UC inverse, by contrast, is applicable when system behavior is expected to be invariant with respect to the choice of units on different state variables, e.g., miles versus kilometers.
https://en.wikipedia.org/wiki/Generalized_inverse
Inmathematics, anidentityis anequalityrelating onemathematical expressionAto another mathematical expressionB, such thatAandB(which might contain somevariables) produce the same value for all values of the variables within a certaindomain of discourse.[1][2]In other words,A=Bis an identity ifAandBdefine the samefunctions, and an identity is an equality between functions that are differently defined. For example,(a+b)2=a2+2ab+b2{\displaystyle (a+b)^{2}=a^{2}+2ab+b^{2}}andcos2⁡θ+sin2⁡θ=1{\displaystyle \cos ^{2}\theta +\sin ^{2}\theta =1}are identities.[3]Identities are sometimes indicated by thetriple barsymbol≡instead of=, theequals sign.[4]Formally, an identity is auniversally quantifiedequality. Certain identities, such asa+0=a{\displaystyle a+0=a}anda+(−a)=0{\displaystyle a+(-a)=0}, form the basis ofalgebra,[5]while other identities, such as(a+b)2=a2+2ab+b2{\displaystyle (a+b)^{2}=a^{2}+2ab+b^{2}}anda2−b2=(a+b)(a−b){\displaystyle a^{2}-b^{2}=(a+b)(a-b)}, can be useful in simplifying algebraic expressions and expanding them.[6] Geometrically,trigonometric identitiesare identities involving certain functions of one or moreangles.[7]They are distinct fromtriangle identities, which are identities involving both angles and side lengths of atriangle. Only the former are covered in this article. These identities are useful whenever expressions involving trigonometric functions need to be simplified. Another important application is theintegrationof non-trigonometric functions: a common technique which involves first using thesubstitution rule with a trigonometric function, and then simplifying the resulting integral with a trigonometric identity. One of the most prominent examples of trigonometric identities involves the equationsin2⁡θ+cos2⁡θ=1,{\displaystyle \sin ^{2}\theta +\cos ^{2}\theta =1,}which is true for allrealvalues ofθ{\displaystyle \theta }. On the other hand, the equation is only true for certain values ofθ{\displaystyle \theta }, not all. For example, this equation is true whenθ=0,{\displaystyle \theta =0,}but false whenθ=2{\displaystyle \theta =2}. Another group of trigonometric identities concerns the so-called addition/subtraction formulas (e.g. the double-angle identitysin⁡(2θ)=2sin⁡θcos⁡θ{\displaystyle \sin(2\theta )=2\sin \theta \cos \theta }, the addition formula fortan⁡(x+y){\displaystyle \tan(x+y)}), which can be used to break down expressions of larger angles into those with smaller constituents. The following identities hold for allintegerexponents, provided that the base is non-zero: Unlike addition and multiplication, exponentiation is notcommutative. For example,2 + 3 = 3 + 2 = 5and2 · 3 = 3 · 2 = 6, but23= 8whereas32= 9. Also unlike addition and multiplication, exponentiation is notassociativeeither. For example,(2 + 3) + 4 = 2 + (3 + 4) = 9and(2 · 3) · 4 = 2 · (3 · 4) = 24, but 23to the 4 is 84(or 4,096) whereas 2 to the 34is 281(or 2,417,851,639,229,258,349,412,352). When no parentheses are written, by convention the order is top-down, not bottom-up: Several important formulas, sometimes calledlogarithmic identitiesorlog laws, relatelogarithmsto one another:[a] The logarithm of a product is the sum of the logarithms of the numbers being multiplied; the logarithm of the ratio of two numbers is the difference of the logarithms. The logarithm of thepth power of a number isptimes the logarithm of the number itself; the logarithm of apth root is the logarithm of the number divided byp. The following table lists these identities with examples. Each of the identities can be derived after substitution of the logarithm definitionsx=blogb⁡x,{\displaystyle x=b^{\log _{b}x},}and/ory=blogb⁡y,{\displaystyle y=b^{\log _{b}y},}in the left hand sides. The logarithm logb(x) can be computed from the logarithms ofxandbwith respect to an arbitrary basekusing the following formula: Typicalscientific calculatorscalculate the logarithms to bases 10 ande.[8]Logarithms with respect to any basebcan be determined using either of these two logarithms by the previous formula: Given a numberxand its logarithm logb(x) to an unknown baseb, the base is given by: The hyperbolic functions satisfy many identities, all of them similar in form to thetrigonometric identities. In fact,Osborn's rule[9]states that one can convert any trigonometric identity into a hyperbolic identity by expanding it completely in terms of integer powers of sines and cosines, changing sine to sinh and cosine to cosh, and switching the sign of every term which contains a product of anevennumber of hyperbolic sines.[10] TheGudermannian functiongives a direct relationship between the trigonometric functions and the hyperbolic ones that does not involvecomplex numbers. Formally, an identity is a trueuniversally quantifiedformulaof the form∀x1,…,xn:s=t,{\displaystyle \forall x_{1},\ldots ,x_{n}:s=t,}wheresandtaretermswith no otherfree variablesthanx1,…,xn.{\displaystyle x_{1},\ldots ,x_{n}.}The quantifier prefix∀x1,…,xn{\displaystyle \forall x_{1},\ldots ,x_{n}}is often left implicit, when it is stated that the formula is an identity. For example, theaxiomsof amonoidare often given as the formulas or, shortly, So, these formulas are identities in every monoid. As for any equality, the formulas without quantifier are often calledequations. In other words, an identity is an equation that is true for all values of the variables.[11][12]
https://en.wikipedia.org/wiki/Identity_(mathematics)
Inmathematics, anidentity function, also called anidentity relation,identity maporidentity transformation, is afunctionthat always returns the value that was used as itsargument, unchanged. That is, whenfis the identity function, theequalityf(x) =xis true for all values ofxto whichfcan be applied. Formally, ifXis aset, the identity functionfonXis defined to be a function withXas itsdomainandcodomain, satisfying In other words, the function valuef(x)in the codomainXis always the same as the input elementxin the domainX. The identity function onXis clearly aninjective functionas well as asurjective function(its codomain is also itsrange), so it isbijective.[2] The identity functionfonXis often denoted byidX. Inset theory, where a function is defined as a particular kind ofbinary relation, the identity function is given by theidentity relation, ordiagonalofX.[3] Iff:X→Yis any function, thenf∘ idX=f= idY∘f, where "∘" denotesfunction composition.[4]In particular,idXis theidentity elementof themonoidof all functions fromXtoX(under function composition). Since the identity element of a monoid isunique,[5]one can alternately define the identity function onMto be this identity element. Such a definition generalizes to the concept of anidentity morphismincategory theory, where theendomorphismsofMneed not be functions.
https://en.wikipedia.org/wiki/Identity_function
Inmathematics, the concept of aninverse elementgeneralises the concepts ofopposite(−x) andreciprocal(1/x) of numbers. Given anoperationdenoted here∗, and anidentity elementdenotede, ifx∗y=e, one says thatxis aleft inverseofy, and thatyis aright inverseofx. (An identity element is an element such thatx*e=xande*y=yfor allxandyfor which the left-hand sides are defined.[1]) When the operation∗isassociative, if an elementxhas both a left inverse and a right inverse, then these two inverses are equal and unique; they are called theinverse elementor simply theinverse. Often an adjective is added for specifying the operation, such as inadditive inverse,multiplicative inverse, andfunctional inverse. In this case (associative operation), aninvertible elementis an element that has an inverse. In aring, aninvertible element, also called aunit, is an element that is invertible under multiplication (this is not ambiguous, as every element is invertible under addition). Inverses are commonly used ingroups—where every element is invertible, andrings—where invertible elements are also calledunits. They are also commonly used for operations that are not defined for all possible operands, such asinverse matricesandinverse functions. This has been generalized tocategory theory, where, by definition, anisomorphismis an invertiblemorphism. The word 'inverse' is derived fromLatin:inversusthat means 'turned upside down', 'overturned'. This may take its origin from the case offractions, where the (multiplicative) inverse is obtained by exchanging the numerator and the denominator (the inverse ofxy{\displaystyle {\tfrac {x}{y}}}isyx{\displaystyle {\tfrac {y}{x}}}). The concepts ofinverse elementandinvertible elementare commonly defined forbinary operationsthat are everywhere defined (that is, the operation is defined for any two elements of itsdomain). However, these concepts are also commonly used withpartial operations, that is operations that are not defined everywhere. Common examples arematrix multiplication,function compositionand composition ofmorphismsin acategory. It follows that the common definitions ofassociativityandidentity elementmust be extended to partial operations; this is the object of the first subsections. In this section,Xis aset(possibly aproper class) on which a partial operation (possibly total) is defined, which is denoted with∗.{\displaystyle *.} A partial operation isassociativeif for everyx,y,zinXfor which one of the members of the equality is defined; the equality means that the other member of the equality must also be defined. Examples of non-total associative operations aremultiplication of matricesof arbitrary size, andfunction composition. Let∗{\displaystyle *}be a possiblypartialassociative operation on a setX. Anidentity element, or simply anidentityis an elementesuch that for everyxandyfor which the left-hand sides of the equalities are defined. Ifeandfare two identity elements such thate∗f{\displaystyle e*f}is defined, thene=f.{\displaystyle e=f.}(This results immediately from the definition, bye=e∗f=f.{\displaystyle e=e*f=f.}) It follows that a total operation has at most one identity element, and ifeandfare different identities, thene∗f{\displaystyle e*f}is not defined. For example, in the case ofmatrix multiplication, there is onen×nidentity matrixfor every positive integern, and two identity matrices of different size cannot be multiplied together. Similarly,identity functionsare identity elements forfunction composition, and the composition of the identity functions of two different sets are not defined. Ifx∗y=e,{\displaystyle x*y=e,}whereeis an identity element, one says thatxis aleft inverseofy, andyis aright inverseofx. Left and right inverses do not always exist, even when the operation is total and associative. For example, addition is a total associative operation onnonnegative integers, which has0asadditive identity, and0is the only element that has anadditive inverse. This lack of inverses is the main motivation for extending thenatural numbersinto the integers. An element can have several left inverses and several right inverses, even when the operation is total and associative. For example, consider thefunctionsfrom the integers to the integers. Thedoubling functionx↦2x{\displaystyle x\mapsto 2x}has infinitely many left inverses underfunction composition, which are the functions that divide by two the even numbers, and give any value to odd numbers. Similarly, every function that mapsnto either2n{\displaystyle 2n}or2n+1{\displaystyle 2n+1}is a right inverse of the functionn↦⌊n2⌋,{\textstyle n\mapsto \left\lfloor {\frac {n}{2}}\right\rfloor ,}thefloor functionthat mapsnton2{\textstyle {\frac {n}{2}}}orn−12,{\textstyle {\frac {n-1}{2}},}depending whethernis even or odd. More generally, a function has a left inverse forfunction compositionif and only if it isinjective, and it has a right inverse if and only if it issurjective. Incategory theory, right inverses are also calledsections, and left inverses are calledretractions. An element isinvertibleunder an operation if it has a left inverse and a right inverse. In the common case where the operation is associative, the left and right inverse of an element are equal and unique. Indeed, iflandrare respectively a left inverse and a right inverse ofx, then The inverseof an invertible element is its unique left or right inverse. If the operation is denoted as an addition, the inverse, oradditive inverse, of an elementxis denoted−x.{\displaystyle -x.}Otherwise, the inverse ofxis generally denotedx−1,{\displaystyle x^{-1},}or, in the case of acommutativemultiplication1x.{\textstyle {\frac {1}{x}}.}When there may be a confusion between several operations, the symbol of the operation may be added before the exponent, such as inx∗−1.{\displaystyle x^{*-1}.}The notationf∘−1{\displaystyle f^{\circ -1}}is not commonly used forfunction composition, since1f{\textstyle {\frac {1}{f}}}can be used for themultiplicative inverse. Ifxandyare invertible, andx∗y{\displaystyle x*y}is defined, thenx∗y{\displaystyle x*y}is invertible, and its inverse isy−1x−1.{\displaystyle y^{-1}x^{-1}.} An invertiblehomomorphismis called anisomorphism. Incategory theory, an invertiblemorphismis also called anisomorphism. Agroupis asetwith anassociative operationthat has an identity element, and for which every element has an inverse. Thus, the inverse is afunctionfrom the group to itself that may also be considered as an operation ofarityone. It is also aninvolution, since the inverse of the inverse of an element is the element itself. A group mayacton a set astransformationsof this set. In this case, the inverseg−1{\displaystyle g^{-1}}of a group elementg{\displaystyle g}defines a transformation that is the inverse of the transformation defined byg,{\displaystyle g,}that is, the transformation that "undoes" the transformation defined byg.{\displaystyle g.} For example, theRubik's cube grouprepresents the finite sequences of elementary moves. The inverse of such a sequence is obtained by applying the inverse of each move in the reverse order. Amonoidis a set with anassociative operationthat has anidentity element. Theinvertible elementsin a monoid form agroupunder monoid operation. Aringis a monoid for ring multiplication. In this case, the invertible elements are also calledunitsand form thegroup of unitsof the ring. If a monoid is notcommutative, there may exist non-invertible elements that have a left inverse or a right inverse (not both, as, otherwise, the element would be invertible). For example, the set of thefunctionsfrom a set to itself is a monoid underfunction composition. In this monoid, the invertible elements are thebijective functions; the elements that have left inverses are theinjective functions, and those that have right inverses are thesurjective functions. Given a monoid, one may want extend it by adding inverse to some elements. This is generally impossible for non-commutative monoids, but, in a commutative monoid, it is possible to add inverses to the elements that have thecancellation property(an elementxhas the cancellation property ifxy=xz{\displaystyle xy=xz}impliesy=z,{\displaystyle y=z,}andyx=zx{\displaystyle yx=zx}impliesy=z{\displaystyle y=z}).This extension of a monoid is allowed byGrothendieck groupconstruction. This is the method that is commonly used for constructingintegersfromnatural numbers,rational numbersfromintegersand, more generally, thefield of fractionsof anintegral domain, andlocalizationsofcommutative rings. Aringis analgebraic structurewith two operations,additionandmultiplication, which are denoted as the usual operations on numbers. Under addition, a ring is anabelian group, which means that addition iscommutativeandassociative; it has an identity, called theadditive identity, and denoted0; and every elementxhas an inverse, called itsadditive inverseand denoted−x. Because of commutativity, the concepts of left and right inverses are meaningless since they do not differ from inverses. Under multiplication, a ring is amonoid; this means that multiplication is associative and has an identity called themultiplicative identityand denoted1. Aninvertible elementfor multiplication is called aunit. The inverse ormultiplicative inverse(for avoiding confusion with additive inverses) of a unitxis denotedx−1,{\displaystyle x^{-1},}or, when the multiplication is commutative,1x.{\textstyle {\frac {1}{x}}.} The additive identity0is never a unit, except when the ring is thezero ring, which has0as its unique element. If0is the only non-unit, the ring is afieldif the multiplication is commutative, or adivision ringotherwise. In anoncommutative ring(that is, a ring whose multiplication is not commutative), a non-invertible element may have one or several left or right inverses. This is, for example, the case of thelinear functionsfrom aninfinite-dimensional vector spaceto itself. Acommutative ring(that is, a ring whose multiplication is commutative) may be extended by adding inverses to elements that are notzero divisors(that is, their product with a nonzero element cannot be0). This is the process oflocalization, which produces, in particular, the field ofrational numbersfrom the ring of integers, and, more generally, thefield of fractionsof anintegral domain. Localization is also used with zero divisors, but, in this case the original ring is not asubringof the localisation; instead, it is mapped non-injectively to the localization. Matrix multiplicationis commonly defined formatricesover afield, and straightforwardly extended to matrices overrings,rngsandsemirings. However,in this section, only matrices over acommutative ringare considered, because of the use of the concept ofrankanddeterminant. IfAis am×nmatrix (that is, a matrix withmrows andncolumns), andBis ap×qmatrix, the productABis defined ifn=p, and only in this case. Anidentity matrix, that is, an identity element for matrix multiplication is asquare matrix(same number for rows and columns) whose entries of themain diagonalare all equal to1, and all other entries are0. Aninvertible matrixis an invertible element under matrix multiplication. A matrix over a commutative ringRis invertible if and only if its determinant is aunitinR(that is, is invertible inR. In this case, itsinverse matrixcan be computed withCramer's rule. IfRis a field, the determinant is invertible if and only if it is not zero. As the case of fields is more common, one see often invertible matrices defined as matrices with a nonzero determinant, but this is incorrect over rings. In the case ofinteger matrices(that is, matrices with integer entries), an invertible matrix is a matrix that has an inverse that is also an integer matrix. Such a matrix is called aunimodular matrixfor distinguishing it from matrices that are invertible over thereal numbers. A square integer matrix is unimodular if and only if its determinant is1or−1, since these two numbers are the only units in the ring of integers. A matrix has a left inverse if and only if its rank equals its number of columns. This left inverse is not unique except for square matrices where the left inverse equal the inverse matrix. Similarly, a right inverse exists if and only if the rank equals the number of rows; it is not unique in the case of a rectangular matrix, and equals the inverse matrix in the case of a square matrix. Compositionis apartial operationthat generalizes tohomomorphismsofalgebraic structuresandmorphismsofcategoriesinto operations that are also calledcomposition, and share many properties with function composition. In all the case, composition isassociative. Iff:X→Y{\displaystyle f\colon X\to Y}andg:Y′→Z,{\displaystyle g\colon Y'\to Z,}the compositiong∘f{\displaystyle g\circ f}is defined if and only ifY′=Y{\displaystyle Y'=Y}or, in the function and homomorphism cases,Y⊂Y′.{\displaystyle Y\subset Y'.}In the function and homomorphism cases, this means that thecodomainoff{\displaystyle f}equals or is included in thedomainofg. In the morphism case, this means that thecodomainoff{\displaystyle f}equals thedomainofg. There is anidentityidX:X→X{\displaystyle \operatorname {id} _{X}\colon X\to X}for every objectX(set, algebraic structure orobject), which is called also anidentity functionin the function case. A function is invertible if and only if it is abijection. An invertible homomorphism or morphism is called anisomorphism. An homomorphism of algebraic structures is an isomorphism if and only if it is a bijection. The inverse of a bijection is called aninverse function. In the other cases, one talks ofinverse isomorphisms. A function has a left inverse or a right inverse if and only it isinjectiveorsurjective, respectively. An homomorphism of algebraic structures that has a left inverse or a right inverse is respectively injective or surjective, but the converse is not true in some algebraic structures. For example, the converse is true forvector spacesbut not formodulesover a ring: a homomorphism of modules that has a left inverse of a right inverse is called respectively asplit epimorphismor asplit monomorphism. This terminology is also used for morphisms in any category. LetS{\displaystyle S}be a unitalmagma, that is, asetwith abinary operation∗{\displaystyle *}and anidentity elemente∈S{\displaystyle e\in S}. If, fora,b∈S{\displaystyle a,b\in S}, we havea∗b=e{\displaystyle a*b=e}, thena{\displaystyle a}is called aleft inverseofb{\displaystyle b}andb{\displaystyle b}is called aright inverseofa{\displaystyle a}. If an elementx{\displaystyle x}is both a left inverse and a right inverse ofy{\displaystyle y}, thenx{\displaystyle x}is called atwo-sided inverse, or simply aninverse, ofy{\displaystyle y}. An element with a two-sided inverse inS{\displaystyle S}is calledinvertibleinS{\displaystyle S}. An element with an inverse element only on one side isleft invertibleorright invertible. Elements of a unital magma(S,∗){\displaystyle (S,*)}may have multiple left, right or two-sided inverses. For example, in the magma given by the Cayley table the elements 2 and 3 each have two two-sided inverses. A unital magma in which all elements are invertible need not be aloop. For example, in the magma(S,∗){\displaystyle (S,*)}given by theCayley table every element has a unique two-sided inverse (namely itself), but(S,∗){\displaystyle (S,*)}is not a loop because the Cayley table is not aLatin square. Similarly, a loop need not have two-sided inverses. For example, in the loop given by the Cayley table the only element with a two-sided inverse is the identity element 1. If the operation∗{\displaystyle *}isassociativethen if an element has both a left inverse and a right inverse, they are equal. In other words, in amonoid(an associative unital magma) every element has at most one inverse (as defined in this section). In a monoid, the set of invertible elements is agroup, called thegroup of unitsofS{\displaystyle S}, and denoted byU(S){\displaystyle U(S)}orH1. The definition in the previous section generalizes the notion of inverse in group relative to the notion of identity. It's also possible, albeit less obvious, to generalize the notion of an inverse by dropping the identity element but keeping associativity; that is, in asemigroup. In a semigroupSan elementxis called(von Neumann) regularif there exists some elementzinSsuch thatxzx=x;zis sometimes called apseudoinverse. An elementyis called (simply) aninverseofxifxyx=xandy=yxy. Every regular element has at least one inverse: ifx=xzxthen it is easy to verify thaty=zxzis an inverse ofxas defined in this section. Another easy to prove fact: ifyis an inverse ofxthene=xyandf=yxareidempotents, that isee=eandff=f. Thus, every pair of (mutually) inverse elements gives rise to two idempotents, andex=xf=x,ye=fy=y, andeacts as a left identity onx, whilefacts a right identity, and the left/right roles are reversed fory. This simple observation can be generalized usingGreen's relations: every idempotentein an arbitrary semigroup is a left identity forReand right identity forLe.[2]An intuitive description of this fact is that every pair of mutually inverse elements produces a local left identity, and respectively, a local right identity. In a monoid, the notion of inverse as defined in the previous section is strictly narrower than the definition given in this section. Only elements in the Green classH1have an inverse from the unital magma perspective, whereas for any idempotente, the elements ofHehave an inverse as defined in this section. Under this more general definition, inverses need not be unique (or exist) in an arbitrary semigroup or monoid. If all elements are regular, then the semigroup (or monoid) is called regular, and every element has at least one inverse. If every element has exactly one inverse as defined in this section, then the semigroup is called aninverse semigroup. Finally, an inverse semigroup with only one idempotent is a group. An inverse semigroup may have anabsorbing element0 because 000 = 0, whereas a group may not. Outside semigroup theory, a unique inverse as defined in this section is sometimes called aquasi-inverse. This is generally justified because in most applications (for example, all examples in this article) associativity holds, which makes this notion a generalization of the left/right inverse relative to an identity (seeGeneralized inverse). A natural generalization of the inverse semigroup is to define an (arbitrary) unary operation ° such that (a°)° =afor allainS; this endowsSwith a type ⟨2,1⟩ algebra. A semigroup endowed with such an operation is called aU-semigroup. Although it may seem thata° will be the inverse ofa, this is not necessarily the case. In order to obtain interesting notion(s), the unary operation must somehow interact with the semigroup operation. Two classes ofU-semigroups have been studied:[3] Clearly a group is both anI-semigroup and a *-semigroup. A class of semigroups important in semigroup theory arecompletely regular semigroups; these areI-semigroups in which one additionally hasaa° =a°a; in other words every element has commuting pseudoinversea°. There are few concrete examples of such semigroups however; most arecompletely simple semigroups. In contrast, a subclass of *-semigroups, the*-regular semigroups(in the sense of Drazin), yield one of best known examples of a (unique) pseudoinverse, theMoore–Penrose inverse. In this case however the involutiona* is not the pseudoinverse. Rather, the pseudoinverse ofxis the unique elementysuch thatxyx=x,yxy=y, (xy)* =xy, (yx)* =yx. Since *-regular semigroups generalize inverse semigroups, the unique element defined this way in a *-regular semigroup is called thegeneralized inverseorMoore–Penrose inverse. All examples in this section involve associative operators. The lower and upper adjoints in a (monotone)Galois connection,LandGare quasi-inverses of each other; that is,LGL=LandGLG=Gand one uniquely determines the other. They are not left or right inverses of each other however. Asquare matrixM{\displaystyle M}with entries in afieldK{\displaystyle K}is invertible (in the set of all square matrices of the same size, undermatrix multiplication) if and only if itsdeterminantis different from zero. If the determinant ofM{\displaystyle M}is zero, it is impossible for it to have a one-sided inverse; therefore a left inverse or right inverse implies the existence of the other one. Seeinvertible matrixfor more. More generally, a square matrix over acommutative ringR{\displaystyle R}is invertibleif and only ifits determinant is invertible inR{\displaystyle R}. Non-square matrices offull rankhave several one-sided inverses:[4] The left inverse can be used to determine the least norm solution ofAx=b{\displaystyle Ax=b}, which is also theleast squaresformula forregressionand is given byx=(ATA)−1ATb.{\displaystyle x=\left(A^{\text{T}}A\right)^{-1}A^{\text{T}}b.} Norank deficientmatrix has any (even one-sided) inverse. However, the Moore–Penrose inverse exists for all matrices, and coincides with the left or right (or true) inverse when it exists. As an example of matrix inverses, consider: So, asm<n, we have a right inverse,Aright−1=AT(AAT)−1.{\displaystyle A_{\text{right}}^{-1}=A^{\text{T}}\left(AA^{\text{T}}\right)^{-1}.}By components it is computed as The left inverse doesn't exist, because which is asingular matrix, and cannot be inverted.
https://en.wikipedia.org/wiki/Inverse_element
Inmathematics, and more specifically inabstract algebra, apseudo-ringis one of the following variants of aring: None of these definitions are equivalent, so it is best[editorializing]to avoid the term "pseudo-ring" or to clarify which meaning is intended. Thisalgebra-related article is astub. You can help Wikipedia byexpanding it.
https://en.wikipedia.org/wiki/Pseudo-ring#Properties_weaker_than_having_an_identity
Unitalmay refer to:
https://en.wikipedia.org/wiki/Unital_(disambiguation)
Inmathematics,anticommutativityis a specific property of some non-commutativemathematicaloperations. Swapping the position oftwo argumentsof an antisymmetric operation yields a result which is theinverseof the result with unswapped arguments. The notioninverserefers to agroup structureon the operation'scodomain, possibly with another operation.Subtractionis an anticommutative operation because commuting the operands ofa−bgivesb−a= −(a−b);for example,2 − 10 = −(10 − 2) = −8.Another prominent example of an anticommutative operation is theLie bracket. Inmathematical physics, wheresymmetryis of central importance, or even just inmultilinear algebrathese operations are mostly (multilinear with respect to somevector structuresand then) calledantisymmetric operations, and when they are not already ofaritygreater than two, extended in anassociativesetting to cover more than twoarguments. IfA,B{\displaystyle A,B}are twoabelian groups, abilinear mapf:A2→B{\displaystyle f\colon A^{2}\to B}isanticommutativeif for allx,y∈A{\displaystyle x,y\in A}we have More generally, amultilinear mapg:An→B{\displaystyle g:A^{n}\to B}is anticommutative if for allx1,…xn∈A{\displaystyle x_{1},\dots x_{n}\in A}we have wheresgn(σ){\displaystyle {\text{sgn}}(\sigma )}is thesignof thepermutationσ{\displaystyle \sigma }. If the abelian groupB{\displaystyle B}has no 2-torsion, implying that ifx=−x{\displaystyle x=-x}thenx=0{\displaystyle x=0}, then any anticommutative bilinear mapf:A2→B{\displaystyle f\colon A^{2}\to B}satisfies More generally, bytransposingtwo elements, any anticommutative multilinear mapg:An→B{\displaystyle g\colon A^{n}\to B}satisfies if any of thexi{\displaystyle x_{i}}are equal; such a map is said to bealternating. Conversely, using multilinearity, any alternating map is anticommutative. In the binary case this works as follows: iff:A2→B{\displaystyle f\colon A^{2}\to B}is alternating then by bilinearity we have and the proof in the multilinear case is the same but in only two of the inputs. Examples of anticommutative binary operations include:
https://en.wikipedia.org/wiki/Anticommutative_property
Inquantum mechanics, thecanonical commutation relationis the fundamental relation betweencanonical conjugatequantities (quantities which are related by definition such that one is theFourier transformof another). For example,[x^,p^x]=iℏI{\displaystyle [{\hat {x}},{\hat {p}}_{x}]=i\hbar \mathbb {I} } between the position operatorxand momentum operatorpxin thexdirection of a point particle in one dimension, where[x,px] =xpx−pxxis thecommutatorofxandpx,iis theimaginary unit, andℏis thereduced Planck constanth/2π, andI{\displaystyle \mathbb {I} }is the unit operator. In general, position and momentum are vectors of operators and their commutation relation between different components of position and momentum can be expressed as[x^i,p^j]=iℏδij,{\displaystyle [{\hat {x}}_{i},{\hat {p}}_{j}]=i\hbar \delta _{ij},}whereδij{\displaystyle \delta _{ij}}is theKronecker delta. This relation is attributed toWerner Heisenberg,Max BornandPascual Jordan(1925),[1][2]who called it a "quantum condition" serving as a postulate of the theory; it was noted byE. Kennard(1927)[3]to imply theHeisenberguncertainty principle. TheStone–von Neumann theoremgives a uniqueness result for operators satisfying (an exponentiated form of) the canonical commutation relation. By contrast, inclassical physics, all observables commute and thecommutatorwould be zero. However, an analogous relation exists, which is obtained by replacing the commutator with thePoisson bracketmultiplied byiℏ{\displaystyle i\hbar },{x,p}=1.{\displaystyle \{x,p\}=1\,.} This observation ledDiracto propose that the quantum counterpartsf^{\displaystyle {\hat {f}}},g^{\displaystyle {\hat {g}}}of classical observablesf,gsatisfy[f^,g^]=iℏ{f,g}^.{\displaystyle [{\hat {f}},{\hat {g}}]=i\hbar {\widehat {\{f,g\}}}\,.} In 1946,Hip Groenewolddemonstrated that ageneral systematic correspondencebetween quantum commutators and Poisson brackets could not hold consistently.[4][5] However, he further appreciated that such a systematic correspondence does, in fact, exist between the quantum commutator and adeformationof the Poisson bracket, today called theMoyal bracket, and, in general, quantum operators and classical observables and distributions inphase space. He thus finally elucidated the consistent correspondence mechanism, theWigner–Weyl transform, that underlies an alternate equivalent mathematical representation of quantum mechanics known asdeformation quantization.[4][6] According to thecorrespondence principle, in certain limits the quantum equations of states must approachHamilton's equations of motion. The latter state the following relation between the generalized coordinateq(e.g. position) and the generalized momentump:{q˙=∂H∂p={q,H};p˙=−∂H∂q={p,H}.{\displaystyle {\begin{cases}{\dot {q}}={\frac {\partial H}{\partial p}}=\{q,H\};\\{\dot {p}}=-{\frac {\partial H}{\partial q}}=\{p,H\}.\end{cases}}} In quantum mechanics the HamiltonianH^{\displaystyle {\hat {H}}}, (generalized) coordinateQ^{\displaystyle {\hat {Q}}}and (generalized) momentumP^{\displaystyle {\hat {P}}}are all linear operators. The time derivative of a quantum state is represented by the operator−iH^/ℏ{\displaystyle -i{\hat {H}}/\hbar }(by theSchrödinger equation). Equivalently, since in the Schrödinger picture the operators are not explicitly time-dependent, the operators can be seen to be evolving in time (for a contrary perspective where the operators are time dependent, seeHeisenberg picture) according to their commutation relation with the Hamiltonian:dQ^dt=iℏ[H^,Q^]{\displaystyle {\frac {d{\hat {Q}}}{dt}}={\frac {i}{\hbar }}[{\hat {H}},{\hat {Q}}]}dP^dt=iℏ[H^,P^].{\displaystyle {\frac {d{\hat {P}}}{dt}}={\frac {i}{\hbar }}[{\hat {H}},{\hat {P}}]\,\,.} In order for that to reconcile in the classical limit with Hamilton's equations of motion,[H^,Q^]{\displaystyle [{\hat {H}},{\hat {Q}}]}must depend entirely on the appearance ofP^{\displaystyle {\hat {P}}}in the Hamiltonian and[H^,P^]{\displaystyle [{\hat {H}},{\hat {P}}]}must depend entirely on the appearance ofQ^{\displaystyle {\hat {Q}}}in the Hamiltonian. Further, since the Hamiltonian operator depends on the (generalized) coordinate and momentum operators, it can be viewed as a functional, and we may write (usingfunctional derivatives):[H^,Q^]=δH^δP^⋅[P^,Q^]{\displaystyle [{\hat {H}},{\hat {Q}}]={\frac {\delta {\hat {H}}}{\delta {\hat {P}}}}\cdot [{\hat {P}},{\hat {Q}}]}[H^,P^]=δH^δQ^⋅[Q^,P^].{\displaystyle [{\hat {H}},{\hat {P}}]={\frac {\delta {\hat {H}}}{\delta {\hat {Q}}}}\cdot [{\hat {Q}},{\hat {P}}]\,.} In order to obtain the classical limit we must then have[Q^,P^]=iℏI.{\displaystyle [{\hat {Q}},{\hat {P}}]=i\hbar ~I.} ThegroupH3(R){\displaystyle H_{3}(\mathbb {R} )}generated byexponentiationof the 3-dimensionalLie algebradetermined by the commutation relation[x^,p^]=iℏ{\displaystyle [{\hat {x}},{\hat {p}}]=i\hbar }is called theHeisenberg group. This group can be realized as the group of3×3{\displaystyle 3\times 3}upper triangular matrices with ones on the diagonal.[7] According to the standardmathematical formulation of quantum mechanics, quantum observables such asx^{\displaystyle {\hat {x}}}andp^{\displaystyle {\hat {p}}}should be represented asself-adjoint operatorson someHilbert space. It is relatively easy to see that twooperatorssatisfying the above canonical commutation relations cannot both bebounded. Certainly, ifx^{\displaystyle {\hat {x}}}andp^{\displaystyle {\hat {p}}}weretrace classoperators, the relationTr⁡(AB)=Tr⁡(BA){\displaystyle \operatorname {Tr} (AB)=\operatorname {Tr} (BA)}gives a nonzero number on the right and zero on the left. Alternately, ifx^{\displaystyle {\hat {x}}}andp^{\displaystyle {\hat {p}}}were bounded operators, note that[x^n,p^]=iℏnx^n−1{\displaystyle [{\hat {x}}^{n},{\hat {p}}]=i\hbar n{\hat {x}}^{n-1}}, hence the operator norms would satisfy2‖p^‖‖x^n−1‖‖x^‖≥nℏ‖x^n−1‖,{\displaystyle 2\left\|{\hat {p}}\right\|\left\|{\hat {x}}^{n-1}\right\|\left\|{\hat {x}}\right\|\geq n\hbar \left\|{\hat {x}}^{n-1}\right\|,}so that, for anyn,2‖p^‖‖x^‖≥nℏ{\displaystyle 2\left\|{\hat {p}}\right\|\left\|{\hat {x}}\right\|\geq n\hbar }However,ncan be arbitrarily large, so at least one operator cannot be bounded, and the dimension of the underlying Hilbert space cannot be finite. If the operators satisfy the Weyl relations (an exponentiated version of the canonical commutation relations, described below) then as a consequence of theStone–von Neumann theorem,bothoperators must be unbounded. Still, these canonical commutation relations can be rendered somewhat "tamer" by writing them in terms of the (bounded)unitary operatorsexp⁡(itx^){\displaystyle \exp(it{\hat {x}})}andexp⁡(isp^){\displaystyle \exp(is{\hat {p}})}. The resulting braiding relations for these operators are the so-calledWeyl relationsexp⁡(itx^)exp⁡(isp^)=exp⁡(−istℏ)exp⁡(isp^)exp⁡(itx^).{\displaystyle \exp(it{\hat {x}})\exp(is{\hat {p}})=\exp(-ist\hbar )\exp(is{\hat {p}})\exp(it{\hat {x}}).}These relations may be thought of as an exponentiated version of the canonical commutation relations; they reflect that translations in position and translations in momentum do not commute. One can easily reformulate the Weyl relations in terms of therepresentations of the Heisenberg group. The uniqueness of the canonical commutation relations—in the form of the Weyl relations—is then guaranteed by theStone–von Neumann theorem. For technical reasons, the Weyl relations are not strictly equivalent to the canonical commutation relation[x^,p^]=iℏ{\displaystyle [{\hat {x}},{\hat {p}}]=i\hbar }. Ifx^{\displaystyle {\hat {x}}}andp^{\displaystyle {\hat {p}}}were bounded operators, then a special case of theBaker–Campbell–Hausdorff formulawould allow one to "exponentiate" the canonical commutation relations to the Weyl relations.[8]Since, as we have noted, any operators satisfying the canonical commutation relations must be unbounded, the Baker–Campbell–Hausdorff formula does not apply without additional domain assumptions. Indeed, counterexamples exist satisfying the canonical commutation relations but not the Weyl relations.[9](These same operators give acounterexampleto the naive form of the uncertainty principle.) These technical issues are the reason that theStone–von Neumann theoremis formulated in terms of the Weyl relations. A discrete version of the Weyl relations, in which the parameterssandtrange overZ/n{\displaystyle \mathbb {Z} /n}, can be realized on a finite-dimensional Hilbert space by means of theclock and shift matrices. It can be shown that[F(x→),pi]=iℏ∂F(x→)∂xi;[xi,F(p→)]=iℏ∂F(p→)∂pi.{\displaystyle [F({\vec {x}}),p_{i}]=i\hbar {\frac {\partial F({\vec {x}})}{\partial x_{i}}};\qquad [x_{i},F({\vec {p}})]=i\hbar {\frac {\partial F({\vec {p}})}{\partial p_{i}}}.} UsingCn+1k=Cnk+Cnk−1{\displaystyle C_{n+1}^{k}=C_{n}^{k}+C_{n}^{k-1}}, it can be shown that bymathematical induction[x^n,p^m]=∑k=1min(m,n)−(−iℏ)kn!m!k!(n−k)!(m−k)!x^n−kp^m−k=∑k=1min(m,n)(iℏ)kn!m!k!(n−k)!(m−k)!p^m−kx^n−k,{\displaystyle \left[{\hat {x}}^{n},{\hat {p}}^{m}\right]=\sum _{k=1}^{\min \left(m,n\right)}{{\frac {-\left(-i\hbar \right)^{k}n!m!}{k!\left(n-k\right)!\left(m-k\right)!}}{\hat {x}}^{n-k}{\hat {p}}^{m-k}}=\sum _{k=1}^{\min \left(m,n\right)}{{\frac {\left(i\hbar \right)^{k}n!m!}{k!\left(n-k\right)!\left(m-k\right)!}}{\hat {p}}^{m-k}{\hat {x}}^{n-k}},}generally known as McCoy's formula.[10] In addition, the simple formula[x,p]=iℏI,{\displaystyle [x,p]=i\hbar \,\mathbb {I} ~,}valid for thequantizationof the simplest classical system, can be generalized to the case of an arbitraryLagrangianL{\displaystyle {\mathcal {L}}}.[11]We identifycanonical coordinates(such asxin the example above, or a fieldΦ(x)in the case ofquantum field theory) andcanonical momentaπx(in the example above it isp, or more generally, some functions involving thederivativesof the canonical coordinates with respect to time):πi=def∂L∂(∂xi/∂t).{\displaystyle \pi _{i}\ {\stackrel {\mathrm {def} }{=}}\ {\frac {\partial {\mathcal {L}}}{\partial (\partial x_{i}/\partial t)}}.} This definition of the canonical momentum ensures that one of theEuler–Lagrange equationshas the form∂∂tπi=∂L∂xi.{\displaystyle {\frac {\partial }{\partial t}}\pi _{i}={\frac {\partial {\mathcal {L}}}{\partial x_{i}}}.} The canonical commutation relations then amount to[xi,πj]=iℏδij{\displaystyle [x_{i},\pi _{j}]=i\hbar \delta _{ij}\,}whereδijis theKronecker delta. Canonical quantization is applied, by definition, oncanonical coordinates. However, in the presence of anelectromagnetic field, the canonical momentumpis notgauge invariant. The correct gauge-invariant momentum (or "kinetic momentum") is whereqis the particle'selectric charge,Ais thevector potential, andcis thespeed of light. Although the quantitypkinis the "physical momentum", in that it is the quantity to be identified with momentum in laboratory experiments, itdoes notsatisfy the canonical commutation relations; only the canonical momentum does that. This can be seen as follows. The non-relativisticHamiltonianfor a quantized charged particle of massmin a classical electromagnetic field is (in cgs units)H=12m(p−qAc)2+qϕ{\displaystyle H={\frac {1}{2m}}\left(p-{\frac {qA}{c}}\right)^{2}+q\phi }whereAis the three-vector potential andφis thescalar potential. This form of the Hamiltonian, as well as theSchrödinger equationHψ=iħ∂ψ/∂t, theMaxwell equationsand theLorentz force laware invariant under the gauge transformationA→A′=A+∇Λ{\displaystyle A\to A'=A+\nabla \Lambda }ϕ→ϕ′=ϕ−1c∂Λ∂t{\displaystyle \phi \to \phi '=\phi -{\frac {1}{c}}{\frac {\partial \Lambda }{\partial t}}}ψ→ψ′=Uψ{\displaystyle \psi \to \psi '=U\psi }H→H′=UHU†,{\displaystyle H\to H'=UHU^{\dagger },}whereU=exp⁡(iqΛℏc){\displaystyle U=\exp \left({\frac {iq\Lambda }{\hbar c}}\right)}andΛ = Λ(x,t)is the gauge function. Theangular momentum operatorisL=r×p{\displaystyle L=r\times p\,\!}and obeys the canonical quantization relations[Li,Lj]=iℏϵijkLk{\displaystyle [L_{i},L_{j}]=i\hbar {\epsilon _{ijk}}L_{k}}defining theLie algebraforso(3), whereϵijk{\displaystyle \epsilon _{ijk}}is theLevi-Civita symbol. Under gauge transformations, the angular momentum transforms as⟨ψ|L|ψ⟩→⟨ψ′|L′|ψ′⟩=⟨ψ|L|ψ⟩+qℏc⟨ψ|r×∇Λ|ψ⟩.{\displaystyle \langle \psi \vert L\vert \psi \rangle \to \langle \psi ^{\prime }\vert L^{\prime }\vert \psi ^{\prime }\rangle =\langle \psi \vert L\vert \psi \rangle +{\frac {q}{\hbar c}}\langle \psi \vert r\times \nabla \Lambda \vert \psi \rangle \,.} The gauge-invariant angular momentum (or "kinetic angular momentum") is given byK=r×(p−qAc),{\displaystyle K=r\times \left(p-{\frac {qA}{c}}\right),}which has the commutation relations[Ki,Kj]=iℏϵijk(Kk+qℏcxk(x⋅B)){\displaystyle [K_{i},K_{j}]=i\hbar {\epsilon _{ij}}^{\,k}\left(K_{k}+{\frac {q\hbar }{c}}x_{k}\left(x\cdot B\right)\right)}whereB=∇×A{\displaystyle B=\nabla \times A}is themagnetic field. The inequivalence of these two formulations shows up in theZeeman effectand theAharonov–Bohm effect. All such nontrivial commutation relations for pairs of operators lead to correspondinguncertainty relations,[12]involving positive semi-definite expectation contributions by their respective commutators and anticommutators. In general, for twoHermitian operatorsAandB, consider expectation values in a system in the stateψ, the variances around the corresponding expectation values being(ΔA)2≡ ⟨(A− ⟨A⟩)2⟩, etc. ThenΔAΔB≥12|⟨[A,B]⟩|2+|⟨{A−⟨A⟩,B−⟨B⟩}⟩|2,{\displaystyle \Delta A\,\Delta B\geq {\frac {1}{2}}{\sqrt {\left|\left\langle \left[{A},{B}\right]\right\rangle \right|^{2}+\left|\left\langle \left\{A-\langle A\rangle ,B-\langle B\rangle \right\}\right\rangle \right|^{2}}},}where[A,B] ≡A B−B Ais thecommutatorofAandB, and{A,B} ≡A B+B Ais theanticommutator. This follows through use of theCauchy–Schwarz inequality, since|⟨A2⟩| |⟨B2⟩| ≥ |⟨A B⟩|2, andA B= ([A,B] + {A,B})/2; and similarly for the shifted operatorsA− ⟨A⟩andB− ⟨B⟩. (Cf.uncertainty principle derivations.) Substituting forAandB(and taking care with the analysis) yield Heisenberg's familiar uncertainty relation forxandp, as usual. For the angular momentum operatorsLx=y pz−z py, etc., one has that[Lx,Ly]=iℏϵxyzLz,{\displaystyle [{L_{x}},{L_{y}}]=i\hbar \epsilon _{xyz}{L_{z}},}whereϵxyz{\displaystyle \epsilon _{xyz}}is theLevi-Civita symboland simply reverses the sign of the answer under pairwise interchange of the indices. An analogous relation holds for thespinoperators. Here, forLxandLy,[12]in angular momentum multipletsψ= |ℓ,m⟩, one has, for the transverse components of theCasimir invariantLx2+Ly2+Lz2, thez-symmetric relations as well as⟨Lx⟩ = ⟨Ly⟩ = 0. Consequently, the above inequality applied to this commutation relation specifiesΔLxΔLy≥12ℏ2|⟨Lz⟩|2,{\displaystyle \Delta L_{x}\,\Delta L_{y}\geq {\frac {1}{2}}{\sqrt {\hbar ^{2}|\langle L_{z}\rangle |^{2}}}~,}hence|⟨Lx2⟩⟨Ly2⟩|≥ℏ22|m|{\displaystyle {\sqrt {|\langle L_{x}^{2}\rangle \langle L_{y}^{2}\rangle |}}\geq {\frac {\hbar ^{2}}{2}}\vert m\vert }and thereforeℓ(ℓ+1)−m2≥|m|,{\displaystyle \ell (\ell +1)-m^{2}\geq |m|~,}so, then, it yields useful constraints such as a lower bound on theCasimir invariant:ℓ(ℓ+ 1) ≥ |m| (|m| + 1), and henceℓ≥ |m|, among others.
https://en.wikipedia.org/wiki/Canonical_commutation_relation
Inmathematics, especiallygroup theory, thecentralizer(also calledcommutant[1][2]) of asubsetSin agroupGis the setCG⁡(S){\displaystyle \operatorname {C} _{G}(S)}of elements ofGthatcommutewith every element ofS, or equivalently, the set of elementsg∈G{\displaystyle g\in G}such thatconjugationbyg{\displaystyle g}leaves each element ofSfixed. ThenormalizerofSinGis thesetof elementsNG(S){\displaystyle \mathrm {N} _{G}(S)}ofGthat satisfy the weaker condition of leaving the setS⊆G{\displaystyle S\subseteq G}fixed under conjugation. The centralizer and normalizer ofSaresubgroupsofG. Many techniques in group theory are based on studying the centralizers and normalizers of suitable subsetsS. Suitably formulated, the definitions also apply tosemigroups. Inring theory, thecentralizer of a subset of aringis defined with respect to the multiplication of the ring (a semigroup operation). The centralizer of a subset of a ringRis asubringofR. This article also deals with centralizers and normalizers in aLie algebra. Theidealizerin a semigroup or ring is another construction that is in the same vein as the centralizer and normalizer. Thecentralizerof a subsetS{\displaystyle S}of group (or semigroup)Gis defined as[3] where only the first definition applies to semigroups. If there is no ambiguity about the group in question, theGcan be suppressed from the notation. WhenS={a}{\displaystyle S=\{a\}}is asingletonset, we write CG(a) instead of CG({a}). Another less common notation for the centralizer is Z(a), which parallels the notation for thecenter. With this latter notation, one must be careful to avoid confusion between thecenterof a groupG, Z(G), and thecentralizerof anelementginG, Z(g). ThenormalizerofSin the group (or semigroup)Gis defined as where again only the first definition applies to semigroups. If the setS{\displaystyle S}is a subgroup ofG{\displaystyle G}, then the normalizerNG(S){\displaystyle N_{G}(S)}is the largest subgroupG′⊆G{\displaystyle G'\subseteq G}whereS{\displaystyle S}is anormal subgroupofG′{\displaystyle G'}. The definitions ofcentralizerandnormalizerare similar but not identical. Ifgis in the centralizer ofS{\displaystyle S}andsis inS{\displaystyle S}, then it must be thatgs=sg, but ifgis in the normalizer, thengs=tgfor sometinS{\displaystyle S}, withtpossibly different froms. That is, elements of the centralizer ofS{\displaystyle S}must commute pointwise withS{\displaystyle S}, but elements of the normalizer ofSneed only commute withS as a set. The same notational conventions mentioned above for centralizers also apply to normalizers. The normalizer should not be confused with thenormal closure. ClearlyCG(S)⊆NG(S){\displaystyle C_{G}(S)\subseteq N_{G}(S)}and both are subgroups ofG{\displaystyle G}. IfRis a ring or analgebra over a field, andS{\displaystyle S}is a subset ofR, then the centralizer ofS{\displaystyle S}is exactly as defined for groups, withRin the place ofG. IfL{\displaystyle {\mathfrak {L}}}is aLie algebra(orLie ring) with Lie product [x,y], then the centralizer of a subsetS{\displaystyle S}ofL{\displaystyle {\mathfrak {L}}}is defined to be[4] The definition of centralizers for Lie rings is linked to the definition for rings in the following way. IfRis an associative ring, thenRcan be given thebracket product[x,y] =xy−yx. Of course thenxy=yxif and only if[x,y] = 0. If we denote the setRwith the bracket product as LR, then clearly thering centralizerofS{\displaystyle S}inRis equal to theLie ring centralizerofS{\displaystyle S}in LR. The normalizer of a subsetS{\displaystyle S}of a Lie algebra (or Lie ring)L{\displaystyle {\mathfrak {L}}}is given by[4] While this is the standard usage of the term "normalizer" in Lie algebra, this construction is actually theidealizerof the setS{\displaystyle S}inL{\displaystyle {\mathfrak {L}}}. IfS{\displaystyle S}is an additive subgroup ofL{\displaystyle {\mathfrak {L}}}, thenNL(S){\displaystyle \mathrm {N} _{\mathfrak {L}}(S)}is the largest Lie subring (or Lie subalgebra, as the case may be) in whichS{\displaystyle S}is a Lieideal.[5] Consider the group Take a subsetH{\displaystyle H}of the groupG{\displaystyle G}: Note that[1,2,3]{\displaystyle [1,2,3]}is the identity permutation inG{\displaystyle G}and retains the order of each element and[1,3,2]{\displaystyle [1,3,2]}is the permutation that fixes the first element and swaps the second and third element. The normalizer ofH{\displaystyle H}with respect to the groupG{\displaystyle G}are all elements ofG{\displaystyle G}that yield the setH{\displaystyle H}(potentially permuted) when the element conjugatesH{\displaystyle H}. Working out the example for each element ofG{\displaystyle G}: Therefore, the normalizerNG(H){\displaystyle N_{G}(H)}ofH{\displaystyle H}inG{\displaystyle G}is{[1,2,3],[1,3,2]}{\displaystyle \{[1,2,3],[1,3,2]\}}since both these group elements preserve the setH{\displaystyle H}under conjugation. The centralizer of the groupG{\displaystyle G}is the set of elements that leave each element ofH{\displaystyle H}unchanged by conjugation; that is, the set of elements that commutes with every element inH{\displaystyle H}. It's clear in this example that the only such element in S3isH{\displaystyle H}itself ([1, 2, 3], [1, 3, 2]). LetS′{\displaystyle S'}denote the centralizer ofS{\displaystyle S}in the semigroupA{\displaystyle A}; i.e.S′={x∈A∣sx=xsfor everys∈S}.{\displaystyle S'=\{x\in A\mid sx=xs{\text{ for every }}s\in S\}.}ThenS′{\displaystyle S'}forms asubsemigroupandS′=S‴=S′′′′′{\displaystyle S'=S'''=S'''''}; i.e. a commutant is its ownbicommutant. Source:[6] Source:[4]
https://en.wikipedia.org/wiki/Centralizer