Dataset Viewer
text
stringlengths 16
172k
| source
stringlengths 32
122
|
---|---|
Innumber theory,Fermat's little theoremstates that ifpis aprime number, then for anyintegera, the numberap−ais an integer multiple ofp. In the notation ofmodular arithmetic, this is expressed asap≡a(modp).{\displaystyle a^{p}\equiv a{\pmod {p}}.}
For example, ifa= 2andp= 7, then27= 128, and128 − 2 = 126 = 7 × 18is an integer multiple of7.
Ifais not divisible byp, that is, ifaiscoprimetop, then Fermat's little theorem is equivalent to the statement thatap− 1− 1is an integer multiple ofp, or in symbols:[1][2]ap−1≡1(modp).{\displaystyle a^{p-1}\equiv 1{\pmod {p}}.}
For example, ifa= 2andp= 7, then26= 64, and64 − 1 = 63 = 7 × 9is a multiple of7.
Fermat's little theorem is the basis for theFermat primality testand is one of the fundamental results ofelementary number theory. The theorem is named afterPierre de Fermat, who stated it in 1640. It is called the "little theorem" to distinguish it fromFermat's Last Theorem.[3]
Pierre de Fermat first stated the theorem in a letter dated October 18, 1640, to his friend and confidantFrénicle de Bessy. His formulation is equivalent to the following:[3]
Ifpis a prime andais any integer not divisible byp, thenap− 1− 1is divisible byp.
Fermat's original statement was
Tout nombre premier mesure infailliblement une des puissances−1{\displaystyle -1}de quelque progression que ce soit, et l'exposant de la dite puissance est sous-multiple du nombre premier donné−1{\displaystyle -1}; et, après qu'on a trouvé la première puissance qui satisfait à la question, toutes celles dont les exposants sont multiples de l'exposant de la première satisfont tout de même à la question.
This may be translated, with explanations and formulas added in brackets for easier understanding, as:
Every prime number [p] divides necessarily one of the powers minus one of any [geometric]progression[a,a2,a3, …] [that is, there existstsuch thatpdividesat− 1], and the exponent of this power [t] divides the given prime minus one [dividesp− 1]. After one has found the first power [t] that satisfies the question, all those whose exponents are multiples of the exponent of the first one satisfy similarly the question [that is, all multiples of the firstthave the same property].
Fermat did not consider the case whereais a multiple ofpnor prove his assertion, only stating:[4]
Et cette proposition est généralement vraie en toutes progressions et en tous nombres premiers; de quoi je vous envoierois la démonstration, si je n'appréhendois d'être trop long.
(And this proposition is generally true for all series [sic] and for all prime numbers; I would send you a demonstration of it, if I did not fear going on for too long.)[5]
Eulerprovided the first published proof in 1736, in a paper titled "Theorematum Quorundam ad Numeros Primos Spectantium Demonstratio" (in English: "Demonstration of Certain Theorems Concerning Prime Numbers") in theProceedingsof the St. Petersburg Academy,[6][7]butLeibnizhad given virtually the same proof in an unpublished manuscript from sometime before 1683.[3]
The term "Fermat's little theorem" was probably first used in print in 1913 inZahlentheoriebyKurt Hensel:[8]
Für jede endliche Gruppe besteht nun ein Fundamentalsatz, welcher der kleine Fermatsche Satz genannt zu werden pflegt, weil ein ganz spezieller Teil desselben zuerst von Fermat bewiesen worden ist.
(There is a fundamental theorem holding in every finite group, usually called Fermat's little theorem because Fermat was the first to have proved a very special part of it.)
An early use in English occurs inA.A. Albert'sModern Higher Algebra(1937), which refers to "the so-called 'little' Fermat theorem" on page 206.[9]
Some mathematicians independently made the related hypothesis (sometimes incorrectly called the Chinese hypothesis) that2p≡ 2 (modp)if and only ifpis prime. Indeed, the "if" part is true, and it is a special case of Fermat's little theorem. However, the "only if" part is false: For example,2341≡ 2 (mod 341), but 341 = 11 × 31 is apseudoprimeto base 2. Seebelow.
Several proofs of Fermat's little theorem are known. It is frequently proved as acorollaryofEuler's theorem.
Euler's theoremis a generalization of Fermat's little theorem: For anymodulusnand any integeracoprime ton, one has
aφ(n)≡1(modn),{\displaystyle a^{\varphi (n)}\equiv 1{\pmod {n}},}
whereφ(n)denotesEuler's totient function(which counts the integers from 1 tonthat are coprime ton). Fermat's little theorem is indeed a special case, because ifnis a prime number, thenφ(n) =n− 1.
A corollary of Euler's theorem is: For every positive integern, if the integeraiscoprimewithn, thenx≡y(modφ(n))impliesax≡ay(modn),{\displaystyle x\equiv y{\pmod {\varphi (n)}}\quad {\text{implies}}\quad a^{x}\equiv a^{y}{\pmod {n}},}for any integersxandy.
This follows from Euler's theorem, since, ifx≡y(modφ(n)){\displaystyle x\equiv y{\pmod {\varphi (n)}}}, thenx=y+kφ(n)for some integerk, and one hasax=ay+φ(n)k=ay(aφ(n))k≡ay1k≡ay(modn).{\displaystyle a^{x}=a^{y+\varphi (n)k}=a^{y}(a^{\varphi (n)})^{k}\equiv a^{y}1^{k}\equiv a^{y}{\pmod {n}}.}
Ifnis prime, this is also a corollary of Fermat's little theorem. This is widely used inmodular arithmetic, because this allows reducingmodular exponentiationwith large exponents to exponents smaller thann.
Euler's theorem is used withnnot prime inpublic-key cryptography, specifically in theRSA cryptosystem, typically in the following way:[10]ify=xe(modn),{\displaystyle y=x^{e}{\pmod {n}},}retrievingxfrom the values ofy,eandnis easy if one knowsφ(n).[11]In fact, theextended Euclidean algorithmallows computing themodular inverseofemoduloφ(n), that is, the integerfsuch thatef≡1(modφ(n)).{\displaystyle ef\equiv 1{\pmod {\varphi (n)}}.}It follows thatx≡xef≡(xe)f≡yf(modn).{\displaystyle x\equiv x^{ef}\equiv (x^{e})^{f}\equiv y^{f}{\pmod {n}}.}
On the other hand, ifn=pqis the product of two distinct prime numbers, thenφ(n) = (p− 1)(q− 1). In this case, findingffromnandeis as difficult as computingφ(n)(this has not been proven, but no algorithm is known for computingfwithout knowingφ(n)). Knowing onlyn, the computation ofφ(n)has essentially the same difficulty as the factorization ofn, sinceφ(n) = (p− 1)(q− 1), and conversely, the factorspandqare the (integer) solutions of the equationx2− (n−φ(n) + 1)x+n= 0.
The basic idea of RSA cryptosystem is thus: If a messagexis encrypted asy=xe(modn), using public values ofnande, then, with the current knowledge, it cannot be decrypted without finding the (secret) factorspandqofn.
Fermat's little theorem is also related to theCarmichael functionandCarmichael's theorem, as well as toLagrange's theorem in group theory.
Theconverseof Fermat's little theorem fails forCarmichael numbers. However, a slightly weaker variant of the converse isLehmer's theorem:
If there exists an integerasuch thatap−1≡1(modp){\displaystyle a^{p-1}\equiv 1{\pmod {p}}}and for all primesqdividingp− 1one hasa(p−1)/q≢1(modp),{\displaystyle a^{(p-1)/q}\not \equiv 1{\pmod {p}},}thenpis prime.
This theorem forms the basis for theLucas primality test, an importantprimality test, and Pratt'sprimality certificate.
Ifaandpare coprime numbers such thatap−1− 1is divisible byp, thenpneed not be prime. If it is not, thenpis called a(Fermat) pseudoprimeto basea. The first pseudoprime to base 2 was found in 1820 byPierre Frédéric Sarrus: 341 = 11 × 31.[12][13]
A numberpthat is a Fermat pseudoprime to baseafor every numberacoprime topis called aCarmichael number. Alternately, any numberpsatisfying the equalitygcd(p,∑a=1p−1ap−1)=1{\displaystyle \gcd \left(p,\sum _{a=1}^{p-1}a^{p-1}\right)=1}is either a prime or a Carmichael number.
TheMiller–Rabin primality testuses the following extension of Fermat's little theorem:[14]
Ifpis anoddprime andp− 1 = 2sdwiths > 0anddodd > 0, then for everyacoprime top, eitherad≡ 1 (modp)or there existsrsuch that0 ≤r<sanda2rd≡ −1 (modp).
This result may be deduced from Fermat's little theorem by the fact that, ifpis an odd prime, then the integers modulopform afinite field, in which 1 modulophas exactly two square roots, 1 and −1 modulop.
Note thatad≡ 1 (modp)holds trivially fora≡ 1 (modp), because the congruence relation iscompatible with exponentiation. Andad=a20d≡ −1 (modp)holds trivially fora≡ −1 (modp)sincedis odd, for the same reason. That is why one usually chooses a randomain the interval1 <a<p− 1.
The Miller–Rabin test uses this property in the following way: given an odd integerpfor which primality has to be tested, writep− 1 = 2sdwiths > 0anddodd > 0, and choose a randomasuch that1 <a<p− 1; then computeb=admodp; ifbis not 1 nor −1, then square it repeatedly modulopuntil you get −1 or have squareds− 1times. Ifb≠ 1and −1 has not been obtained by squaring, thenpis acompositeandais awitnessfor the compositeness ofp. Otherwise,pis astrongprobable primeto base a; that is, it may be prime or not. Ifpis composite, the probability that the test declares it a strong probable prime anyway is at most1⁄4, in which casepis astrong pseudoprime, andais astrong liar. Therefore afterknon-conclusive random tests, the probability thatpis composite is at most 4−k, and may thus be made as low as desired by increasingk.
In summary, the test either proves that a number is composite or asserts that it is prime with a probability of error that may be chosen as low as desired. The test is very simple to implement and computationally more efficient than all known deterministic tests. Therefore, it is generally used before starting a proof of primality.
|
https://en.wikipedia.org/wiki/Fermat%27s_little_theorem
|
Inmathematics, apermutationof asetcan mean one of two different things:
An example of the first meaning is the six permutations (orderings) of the set {1, 2, 3}: written astuples, they are (1, 2, 3), (1, 3, 2), (2, 1, 3), (2, 3, 1), (3, 1, 2), and (3, 2, 1).Anagramsof a word whose letters are all different are also permutations: the letters are already ordered in the original word, and the anagram reorders them. The study of permutations offinite setsis an important topic incombinatoricsandgroup theory.
Permutations are used in almost every branch of mathematics and in many other fields of science. Incomputer science, they are used for analyzingsorting algorithms; inquantum physics, for describing states of particles; and inbiology, for describingRNAsequences.
The number of permutations ofndistinct objects isnfactorial, usually written asn!, which means the product of all positive integers less than or equal ton.
According to the second meaning, a permutation of asetSis defined as abijectionfromSto itself.[2][3]That is, it is afunctionfromStoSfor which every element occurs exactly once as animagevalue. Such a functionσ:S→S{\displaystyle \sigma :S\to S}is equivalent to the rearrangement of the elements ofSin which each elementiis replaced by the correspondingσ(i){\displaystyle \sigma (i)}. For example, the permutation (3, 1, 2) corresponds to the functionσ{\displaystyle \sigma }defined asσ(1)=3,σ(2)=1,σ(3)=2.{\displaystyle \sigma (1)=3,\quad \sigma (2)=1,\quad \sigma (3)=2.}The collection of all permutations of a set form agroupcalled thesymmetric groupof the set. Thegroup operationis thecomposition of functions(performing one rearrangement after the other), which results in another function (rearrangement). The properties of permutations do not depend on the nature of the elements being permuted, only on their number, so one often considers the standard setS={1,2,…,n}{\displaystyle S=\{1,2,\ldots ,n\}}.
In elementary combinatorics, thek-permutations, orpartial permutations, are the ordered arrangements ofkdistinct elements selected from a set. Whenkis equal to the size of the set, these are the permutations in the previous sense.
Permutation-like objects calledhexagramswere used in China in theI Ching(Pinyin: Yi Jing) as early as 1000 BC.
In Greece,Plutarchwrote thatXenocratesof Chalcedon (396–314 BC) discovered the number of different syllables possible in the Greek language. This would have been the first attempt on record to solve a difficult problem in permutations and combinations.[4]
Al-Khalil(717–786), anArab mathematicianandcryptographer, wrote theBook of Cryptographic Messages. It contains the first use of permutations and combinations, to list all possibleArabicwords with and without vowels.[5]
The rule to determine the number of permutations ofnobjects was known in Indian culture around 1150 AD. TheLilavatiby the Indian mathematicianBhāskara IIcontains a passage that translates as follows:
The product of multiplication of the arithmetical series beginning and increasing by unity and continued to the number of places, will be the variations of number with specific figures.[6]
In 1677,Fabian Stedmandescribed factorials when explaining the number of permutations of bells inchange ringing. Starting from two bells: "first,twomust be admitted to be varied in two ways", which he illustrates by showing 1 2 and 2 1.[7]He then explains that with three bells there are "three times two figures to be produced out of three" which again is illustrated. His explanation involves "cast away 3, and 1.2 will remain; cast away 2, and 1.3 will remain; cast away 1, and 2.3 will remain".[8]He then moves on to four bells and repeats the casting away argument showing that there will be four different sets of three. Effectively, this is a recursive process. He continues with five bells using the "casting away" method and tabulates the resulting 120 combinations.[9]At this point he gives up and remarks:
Now the nature of these methods is such, that the changes on one number comprehends the changes on all lesser numbers, ... insomuch that a compleat Peal of changes on one number seemeth to be formed by uniting of the compleat Peals on all lesser numbers into one entire body;[10]
Stedman widens the consideration of permutations; he goes on to consider the number of permutations of the letters of the alphabet and of horses from a stable of 20.[11]
A first case in which seemingly unrelated mathematical questions were studied with the help of permutations occurred around 1770, whenJoseph Louis Lagrange, in the study of polynomial equations, observed that properties of the permutations of therootsof an equation are related to the possibilities to solve it. This line of work ultimately resulted, through the work ofÉvariste Galois, inGalois theory, which gives a complete description of what is possible and impossible with respect to solving polynomial equations (in one unknown) by radicals. In modern mathematics, there are many similar situations in which understanding a problem requires studying certain permutations related to it.
The study of permutations as substitutions on n elements led to the notion of group as algebraic structure, through the works ofCauchy(1815 memoir).
Permutations played an important role in thecryptanalysis of the Enigma machine, a cipher device used byNazi GermanyduringWorld War II. In particular, one important property of permutations, namely, that two permutations are conjugate exactly when they have the same cycle type, was used by cryptologistMarian Rejewskito break the German Enigma cipher in turn of years 1932-1933.[12][13]
In mathematics texts it is customary to denote permutations using lowercase Greek letters. Commonly, eitherα,β,γ{\displaystyle \alpha ,\beta ,\gamma }orσ,τ,ρ,π{\displaystyle \sigma ,\tau ,\rho ,\pi }are used.[14]
A permutation can be defined as abijection(an invertible mapping, a one-to-one and onto function) from a setSto itself:
σ:S⟶∼S.{\displaystyle \sigma :S\ {\stackrel {\sim }{\longrightarrow }}\ S.}
Theidentity permutationis defined byσ(x)=x{\displaystyle \sigma (x)=x}for all elementsx∈S{\displaystyle x\in S}, and can be denoted by the number1{\displaystyle 1},[a]byid=idS{\displaystyle {\text{id}}={\text{id}}_{S}}, or by a single 1-cycle (x).[15][16]The set of all permutations of a set withnelements forms thesymmetric groupSn{\displaystyle S_{n}}, where thegroup operationiscomposition of functions. Thus for two permutationsσ{\displaystyle \sigma }andτ{\displaystyle \tau }in the groupSn{\displaystyle S_{n}}, their productπ=στ{\displaystyle \pi =\sigma \tau }is defined by:
π(i)=σ(τ(i)).{\displaystyle \pi (i)=\sigma (\tau (i)).}
Composition is usually written without a dot or other sign. In general, composition of two permutations is notcommutative:τσ≠στ.{\displaystyle \tau \sigma \neq \sigma \tau .}
As a bijection from a set to itself, a permutation is a function thatperformsa rearrangement of a set, termed anactive permutationorsubstitution. An older viewpoint sees a permutation as an ordered arrangement or list of all the elements ofS, called apassive permutation.[17]According to this definition, all permutations in§ One-line notationare passive. This meaning is subtly distinct from how passive (i.e.alias) is used inActive and passive transformationand elsewhere,[18][19]which would consider all permutations open to passive interpretation (regardless of whether they are in one-line notation, two-line notation, etc.).
A permutationσ{\displaystyle \sigma }can be decomposed into one or more disjointcycleswhich are theorbitsof the cyclic group⟨σ⟩={1,σ,σ2,…}{\displaystyle \langle \sigma \rangle =\{1,\sigma ,\sigma ^{2},\ldots \}}actingon the setS. A cycle is found by repeatedly applying the permutation to an element:x,σ(x),σ(σ(x)),…,σk−1(x){\displaystyle x,\sigma (x),\sigma (\sigma (x)),\ldots ,\sigma ^{k-1}(x)}, where we assumeσk(x)=x{\displaystyle \sigma ^{k}(x)=x}. A cycle consisting ofkelements is called ak-cycle. (See§ Cycle notationbelow.)
Afixed pointof a permutationσ{\displaystyle \sigma }is an elementxwhich is taken to itself, that isσ(x)=x{\displaystyle \sigma (x)=x}, forming a 1-cycle(x){\displaystyle (\,x\,)}. A permutation with no fixed points is called aderangement. A permutation exchanging two elements (a single 2-cycle) and leaving the others fixed is called atransposition.
Several notations are widely used to represent permutations conveniently.Cycle notationis a popular choice, as it is compact and shows the permutation's structure clearly. This article will use cycle notation unless otherwise specified.
Cauchy'stwo-line notation[20][21]lists the elements ofSin the first row, and the image of each element below it in the second row. For example, the permutation ofS= {1, 2, 3, 4, 5, 6} given by the function
σ(1)=2,σ(2)=6,σ(3)=5,σ(4)=4,σ(5)=3,σ(6)=1{\displaystyle \sigma (1)=2,\ \ \sigma (2)=6,\ \ \sigma (3)=5,\ \ \sigma (4)=4,\ \ \sigma (5)=3,\ \ \sigma (6)=1}
can be written as
The elements ofSmay appear in any order in the first row, so this permutation could also be written:
If there is a "natural" order for the elements ofS,[b]sayx1,x2,…,xn{\displaystyle x_{1},x_{2},\ldots ,x_{n}}, then one uses this for the first row of the two-line notation:
Under this assumption, one may omit the first row and write the permutation inone-line notationas
that is, as an ordered arrangement of the elements ofS.[22][23]Care must be taken to distinguish one-line notation from the cycle notation described below: a common usage is to omit parentheses or other enclosing marks for one-line notation, while using parentheses for cycle notation. The one-line notation is also called thewordrepresentation.[24]
The example above would then be:
σ=(123456265431)=265431.{\displaystyle \sigma ={\begin{pmatrix}1&2&3&4&5&6\\2&6&5&4&3&1\end{pmatrix}}=265431.}
(It is typical to use commas to separate these entries only if some have two or more digits.)
This compact form is common in elementarycombinatoricsandcomputer science. It is especially useful in applications where the permutations are to be compared aslarger or smallerusinglexicographic order.
Cycle notation describes the effect of repeatedly applying the permutation on the elements of the setS, with an orbit being called acycle. The permutation is written as a list of cycles; since distinct cycles involvedisjointsets of elements, this is referred to as "decomposition into disjoint cycles".
To write down the permutationσ{\displaystyle \sigma }in cycle notation, one proceeds as follows:
Also, it is common to omit 1-cycles, since these can be inferred: for any elementxinSnot appearing in any cycle, one implicitly assumesσ(x)=x{\displaystyle \sigma (x)=x}.[25]
Following the convention of omitting 1-cycles, one may interpret an individual cycle as a permutation which fixes all the elements not in the cycle (acyclic permutationhaving only one cycle of length greater than 1). Then the list of disjoint cycles can be seen as the composition of these cyclic permutations. For example, the one-line permutationσ=265431{\displaystyle \sigma =265431}can be written in cycle notation as:
σ=(126)(35)(4)=(126)(35).{\displaystyle \sigma =(126)(35)(4)=(126)(35).}
This may be seen as the compositionσ=κ1κ2{\displaystyle \sigma =\kappa _{1}\kappa _{2}}of cyclic permutations:
κ1=(126)=(126)(3)(4)(5),κ2=(35)=(35)(1)(2)(6).{\displaystyle \kappa _{1}=(126)=(126)(3)(4)(5),\quad \kappa _{2}=(35)=(35)(1)(2)(6).}
While permutations in general do not commute, disjoint cycles do; for example:
σ=(126)(35)=(35)(126).{\displaystyle \sigma =(126)(35)=(35)(126).}
Also, each cycle can be rewritten from a different starting point; for example,
σ=(126)(35)=(261)(53).{\displaystyle \sigma =(126)(35)=(261)(53).}
Thus one may write the disjoint cycles of a given permutation in many different ways.
A convenient feature of cycle notation is that inverting the permutation is given by reversing the order of the elements in each cycle. For example,
σ−1=(A2(126)(35))−1=(621)(53).{\displaystyle \sigma ^{-1}=\left({\vphantom {A^{2}}}(126)(35)\right)^{-1}=(621)(53).}
In some combinatorial contexts it is useful to fix a certain order for the elements in the cycles and of the (disjoint) cycles themselves.Miklós Bónacalls the following ordering choices thecanonical cycle notation:
For example,(513)(6)(827)(94){\displaystyle (513)(6)(827)(94)}is a permutation ofS={1,2,…,9}{\displaystyle S=\{1,2,\ldots ,9\}}in canonical cycle notation.[26]
Richard Stanleycalls this the "standard representation" of a permutation,[27]and Martin Aigner uses "standard form".[24]Sergey Kitaevalso uses the "standard form" terminology, but reverses both choices; that is, each cycle lists its minimal element first, and the cycles are sorted in decreasing order of their minimal elements.[28]
There are two ways to denote the composition of two permutations. In the most common notation,σ⋅τ{\displaystyle \sigma \cdot \tau }is the function that maps any elementxtoσ(τ(x)){\displaystyle \sigma (\tau (x))}. The rightmost permutation is applied to the argument first,[29]because the argument is written to the right of the function.
Adifferentrule for multiplying permutations comes from writing the argument to the left of the function, so that the leftmost permutation acts first.[30][31][32]In this notation, the permutation is often written as an exponent, soσacting onxis writtenxσ; then the product is defined byxσ⋅τ=(xσ)τ{\displaystyle x^{\sigma \cdot \tau }=(x^{\sigma })^{\tau }}. This article uses the first definition, where the rightmost permutation is applied first.
Thefunction compositionoperation satisfies the axioms of agroup. It isassociative, meaning(ρσ)τ=ρ(στ){\displaystyle (\rho \sigma )\tau =\rho (\sigma \tau )}, and products of more than two permutations are usually written without parentheses. The composition operation also has anidentity element(the identity permutationid{\displaystyle {\text{id}}}), and each permutationσ{\displaystyle \sigma }has an inverseσ−1{\displaystyle \sigma ^{-1}}(itsinverse function) withσ−1σ=σσ−1=id{\displaystyle \sigma ^{-1}\sigma =\sigma \sigma ^{-1}={\text{id}}}.
The concept of a permutation as an ordered arrangement admits several generalizations that have been calledpermutations, especially in older literature.
In older literature and elementary textbooks, ak-permutation ofn(sometimes called apartial permutation,sequence without repetition,variation, orarrangement) means an ordered arrangement (list) of ak-element subset of ann-set.[c][33][34]The number of suchk-permutations (k-arrangements) ofn{\displaystyle n}is denoted variously by such symbols asPkn{\displaystyle P_{k}^{n}},nPk{\displaystyle _{n}P_{k}},nPk{\displaystyle ^{n}\!P_{k}},Pn,k{\displaystyle P_{n,k}},P(n,k){\displaystyle P(n,k)}, orAnk{\displaystyle A_{n}^{k}},[35]computed by the formula:[36]
which is 0 whenk>n, and otherwise is equal to
The product is well defined without the assumption thatn{\displaystyle n}is a non-negative integer, and is of importance outside combinatorics as well; it is known as thePochhammer symbol(n)k{\displaystyle (n)_{k}}or as thek{\displaystyle k}-th falling factorial powernk_{\displaystyle n^{\underline {k}}}:
P(n,k)=nPk=(n)k=nk_.{\displaystyle P(n,k)={_{n}}P_{k}=(n)_{k}=n^{\underline {k}}.}
This usage of the termpermutationis closely associated with the termcombinationto mean a subset. Ak-combinationof a setSis ak-element subset ofS: the elements of a combination are not ordered. Ordering thek-combinations ofSin all possible ways produces thek-permutations ofS. The number ofk-combinations of ann-set,C(n,k), is therefore related to the number ofk-permutations ofnby:
These numbers are also known asbinomial coefficients, usually denoted(nk){\displaystyle {\tbinom {n}{k}}}:
C(n,k)=nCk=(nk).{\displaystyle C(n,k)={_{n}}C_{k}={\binom {n}{k}}.}
Ordered arrangements ofkelements of a setS, where repetition is allowed, are calledk-tuples. They have sometimes been referred to aspermutations with repetition, although they are not permutations in the usual sense. They are also calledwordsorstringsover the alphabetS. If the setShasnelements, the number ofk-tuples overSisnk.{\displaystyle n^{k}.}
IfMis a finitemultiset, then amultiset permutationis an ordered arrangement of elements ofMin which each element appears a number of times equal exactly to its multiplicity inM. Ananagramof a word having some repeated letters is an example of a multiset permutation.[d]If the multiplicities of the elements ofM(taken in some order) arem1{\displaystyle m_{1}},m2{\displaystyle m_{2}}, ...,ml{\displaystyle m_{l}}and their sum (that is, the size ofM) isn, then the number of multiset permutations ofMis given by themultinomial coefficient,[37]
For example, the number of distinct anagrams of the word MISSISSIPPI is:[38]
Ak-permutationof a multisetMis a sequence ofkelements ofMin which each element appearsa number of times less than or equal toits multiplicity inM(an element'srepetition number).
Permutations, when considered as arrangements, are sometimes referred to aslinearly orderedarrangements. If, however, the objects are arranged in a circular manner this distinguished ordering is weakened: there is no "first element" in the arrangement, as any element can be considered as the start. An arrangement of distinct objects in a circular manner is called acircular permutation.[39][e]These can be formally defined asequivalence classesof ordinary permutations of these objects, for theequivalence relationgenerated by moving the final element of the linear arrangement to its front.
Two circular permutations are equivalent if one can be rotated into the other. The following four circular permutations on four letters are considered to be the same.
The circular arrangements are to be read counter-clockwise, so the following two are not equivalent since no rotation can bring one to the other.
There are (n– 1)! circular permutations of a set withnelements.
The number of permutations ofndistinct objects isn!.
The number ofn-permutations withkdisjoint cycles is the signlessStirling number of the first kind, denotedc(n,k){\displaystyle c(n,k)}or[nk]{\displaystyle [{\begin{smallmatrix}n\\k\end{smallmatrix}}]}.[40]
The cycles (including the fixed points) of a permutationσ{\displaystyle \sigma }of a set withnelements partition that set; so the lengths of these cycles form aninteger partitionofn, which is called thecycle type(or sometimescycle structureorcycle shape) ofσ{\displaystyle \sigma }. There is a "1" in the cycle type for every fixed point ofσ{\displaystyle \sigma }, a "2" for every transposition, and so on. The cycle type ofβ=(125)(34)(68)(7){\displaystyle \beta =(1\,2\,5\,)(\,3\,4\,)(6\,8\,)(\,7\,)}is(3,2,2,1).{\displaystyle (3,2,2,1).}
This may also be written in a more compact form as[112231].
More precisely, the general form is[1α12α2⋯nαn]{\displaystyle [1^{\alpha _{1}}2^{\alpha _{2}}\dotsm n^{\alpha _{n}}]}, whereα1,…,αn{\displaystyle \alpha _{1},\ldots ,\alpha _{n}}are the numbers of cycles of respective length. The number of permutations of a given cycle type is[41]
The number of cycle types of a set withnelements equals the value of thepartition functionp(n){\displaystyle p(n)}.
Polya'scycle indexpolynomial is agenerating functionwhich counts permutations by their cycle type.
In general, composing permutations written in cycle notation follows no easily described pattern – the cycles of the composition can be different from those being composed. However the cycle type is preserved in the special case ofconjugatinga permutationσ{\displaystyle \sigma }by another permutationπ{\displaystyle \pi }, which means forming the productπσπ−1{\displaystyle \pi \sigma \pi ^{-1}}. Here,πσπ−1{\displaystyle \pi \sigma \pi ^{-1}}is theconjugateofσ{\displaystyle \sigma }byπ{\displaystyle \pi }and its cycle notation can be obtained by taking the cycle notation forσ{\displaystyle \sigma }and applyingπ{\displaystyle \pi }to all the entries in it.[42]It follows that two permutations are conjugate exactly when they have the same cycle type.
The order of a permutationσ{\displaystyle \sigma }is the smallest positive integermso thatσm=id{\displaystyle \sigma ^{m}=\mathrm {id} }. It is theleast common multipleof the lengths of its cycles. For example, the order ofσ=(152)(34){\displaystyle \sigma =(152)(34)}islcm(3,2)=6{\displaystyle {\text{lcm}}(3,2)=6}.
Every permutation of a finite set can be expressed as the product of transpositions.[43]Although many such expressions for a given permutation may exist, either they all contain an even number of transpositions or they all contain an odd number of transpositions. Thus all permutations can be classified aseven or odddepending on this number.
This result can be extended so as to assign asign, writtensgnσ{\displaystyle \operatorname {sgn} \sigma }, to each permutation.sgnσ=+1{\displaystyle \operatorname {sgn} \sigma =+1}ifσ{\displaystyle \sigma }is even andsgnσ=−1{\displaystyle \operatorname {sgn} \sigma =-1}ifσ{\displaystyle \sigma }is odd. Then for two permutationsσ{\displaystyle \sigma }andπ{\displaystyle \pi }
It follows thatsgn(σσ−1)=+1.{\displaystyle \operatorname {sgn} \left(\sigma \sigma ^{-1}\right)=+1.}
The sign of a permutation is equal to the determinant of its permutation matrix (below).
Apermutation matrixis ann×nmatrixthat has exactly one entry 1 in each column and in each row, and all other entries are 0. There are several ways to assign a permutation matrix to a permutation of {1, 2, ...,n}. One natural approach is to defineLσ{\displaystyle L_{\sigma }}to be thelinear transformationofRn{\displaystyle \mathbb {R} ^{n}}which permutes thestandard basis{e1,…,en}{\displaystyle \{\mathbf {e} _{1},\ldots ,\mathbf {e} _{n}\}}byLσ(ej)=eσ(j){\displaystyle L_{\sigma }(\mathbf {e} _{j})=\mathbf {e} _{\sigma (j)}}, and defineMσ{\displaystyle M_{\sigma }}to be its matrix. That is,Mσ{\displaystyle M_{\sigma }}has itsjthcolumn equal to the n × 1 column vectoreσ(j){\displaystyle \mathbf {e} _{\sigma (j)}}: its (i,j) entry is to 1 ifi=σ(j), and 0 otherwise. Since composition of linear mappings is described by matrix multiplication, it follows that this construction is compatible with composition of permutations:
MσMτ=Mστ{\displaystyle M_{\sigma }M_{\tau }=M_{\sigma \tau }}.
For example, the one-line permutationsσ=213,τ=231{\displaystyle \sigma =213,\ \tau =231}have productστ=132{\displaystyle \sigma \tau =132}, and the corresponding matrices are:MσMτ=(010100001)(001100010)=(100001010)=Mστ.{\displaystyle M_{\sigma }M_{\tau }={\begin{pmatrix}0&1&0\\1&0&0\\0&0&1\end{pmatrix}}{\begin{pmatrix}0&0&1\\1&0&0\\0&1&0\end{pmatrix}}={\begin{pmatrix}1&0&0\\0&0&1\\0&1&0\end{pmatrix}}=M_{\sigma \tau }.}
It is also common in the literature to find the inverse convention, where a permutationσis associated to the matrixPσ=(Mσ)−1=(Mσ)T{\displaystyle P_{\sigma }=(M_{\sigma })^{-1}=(M_{\sigma })^{T}}whose (i,j) entry is 1 ifj=σ(i) and is 0 otherwise. In this convention, permutation matrices multiply in the opposite order from permutations, that is,PσPτ=Pτσ{\displaystyle P_{\sigma }P_{\tau }=P_{\tau \sigma }}. In this correspondence, permutation matrices act on the right side of the standard1×n{\displaystyle 1\times n}row vectors(ei)T{\displaystyle ({\bf {e}}_{i})^{T}}:(ei)TPσ=(eσ(i))T{\displaystyle ({\bf {e}}_{i})^{T}P_{\sigma }=({\bf {e}}_{\sigma (i)})^{T}}.
TheCayley tableon the right shows these matrices for permutations of 3 elements.
In some applications, the elements of the set being permuted will be compared with each other. This requires that the setShas atotal orderso that any two elements can be compared. The set {1, 2, ...,n} with the usual ≤ relation is the most frequently used set in these applications.
A number of properties of a permutation are directly related to the total ordering ofS,considering the permutation written in one-line notation as a sequenceσ=σ(1)σ(2)⋯σ(n){\displaystyle \sigma =\sigma (1)\sigma (2)\cdots \sigma (n)}.
Anascentof a permutationσofnis any positioni<nwhere the following value is bigger than the current one. That is,iis an ascent ifσ(i)<σ(i+1){\displaystyle \sigma (i)<\sigma (i{+}1)}. For example, the permutation 3452167 has ascents (at positions) 1, 2, 5, and 6.
Similarly, adescentis a positioni<nwithσ(i)>σ(i+1){\displaystyle \sigma (i)>\sigma (i{+}1)}, so everyiwith1≤i<n{\displaystyle 1\leq i<n}is either an ascent or a descent.
Anascending runof a permutation is a nonempty increasing contiguous subsequence that cannot be extended at either end; it corresponds to a maximal sequence of successive ascents (the latter may be empty: between two successive descents there is still an ascending run of length 1). By contrast anincreasing subsequenceof a permutation is not necessarily contiguous: it is an increasing sequence obtained by omitting some of the values of the one-line notation.
For example, the permutation 2453167 has the ascending runs 245, 3, and 167, while it has an increasing subsequence 2367.
If a permutation hask− 1 descents, then it must be the union ofkascending runs.[44]
The number of permutations ofnwithkascents is (by definition) theEulerian number⟨nk⟩{\displaystyle \textstyle \left\langle {n \atop k}\right\rangle }; this is also the number of permutations ofnwithkdescents. Some authors however define the Eulerian number⟨nk⟩{\displaystyle \textstyle \left\langle {n \atop k}\right\rangle }as the number of permutations withkascending runs, which corresponds tok− 1descents.[45]
An exceedance of a permutationσ1σ2...σnis an indexjsuch thatσj>j. If the inequality is not strict (that is,σj≥j), thenjis called aweak exceedance. The number ofn-permutations withkexceedances coincides with the number ofn-permutations withkdescents.[46]
Arecordorleft-to-right maximumof a permutationσis an elementisuch thatσ(j) <σ(i) for allj < i.
Foata'sfundamental bijectiontransforms a permutationσwith a given canonical cycle form into the permutationf(σ)=σ^{\displaystyle f(\sigma )={\hat {\sigma }}}whose one-line notation has the same sequence of elements with parentheses removed.[27][47]For example:σ=(513)(6)(827)(94)=(123456789375916824),{\displaystyle \sigma =(513)(6)(827)(94)={\begin{pmatrix}1&2&3&4&5&6&7&8&9\\3&7&5&9&1&6&8&2&4\end{pmatrix}},}
σ^=513682794=(123456789513682794).{\displaystyle {\hat {\sigma }}=513682794={\begin{pmatrix}1&2&3&4&5&6&7&8&9\\5&1&3&6&8&2&7&9&4\end{pmatrix}}.}
Here the first element in each canonical cycle ofσbecomes a record (left-to-right maximum) ofσ^{\displaystyle {\hat {\sigma }}}. Givenσ^{\displaystyle {\hat {\sigma }}}, one may find its records and insert parentheses to construct the inverse transformationσ=f−1(σ^){\displaystyle \sigma =f^{-1}({\hat {\sigma }})}. Underlining the records in the above example:σ^=5_136_8_279_4{\displaystyle {\hat {\sigma }}={\underline {5}}\,1\,3\,{\underline {6}}\,{\underline {8}}\,2\,7\,{\underline {9}}\,4}, which allows the reconstruction of the cycles ofσ.
The following table showsσ^{\displaystyle {\hat {\sigma }}}andσfor the six permutations ofS= {1, 2, 3}, with the bold text on each side showing the notation used in the bijection: one-line notation forσ^{\displaystyle {\hat {\sigma }}}and canonical cycle notation forσ.
σ^=f(σ)σ=f−1(σ^)123=(1)(2)(3)123=(1)(2)(3)132=(1)(32)132=(1)(32)213=(21)(3)213=(21)(3)231=(312)321=(2)(31)312=(321)231=(312)321=(2)(31)312=(321){\displaystyle {\begin{array}{l|l}{\hat {\sigma }}=f(\sigma )&\sigma =f^{-1}({\hat {\sigma }})\\\hline \mathbf {123} =(\,1\,)(\,2\,)(\,3\,)&123=\mathbf {(\,1\,)(\,2\,)(\,3\,)} \\\mathbf {132} =(\,1\,)(\,3\,2\,)&132=\mathbf {(\,1\,)(\,3\,2\,)} \\\mathbf {213} =(\,2\,1\,)(\,3\,)&213=\mathbf {(\,2\,1\,)(\,3\,)} \\\mathbf {231} =(\,3\,1\,2\,)&321=\mathbf {(\,2\,)(\,3\,1\,)} \\\mathbf {312} =(\,3\,2\,1\,)&231=\mathbf {(\,3\,1\,2\,)} \\\mathbf {321} =(\,2\,)(\,3\,1\,)&312=\mathbf {(\,3\,2\,1\,)} \end{array}}}As a first corollary, the number ofn-permutations with exactlykrecords is equal to the number ofn-permutations with exactlykcycles: this last number is the signlessStirling number of the first kind,c(n,k){\displaystyle c(n,k)}. Furthermore, Foata's mapping takes ann-permutation withkweak exceedances to ann-permutation withk− 1ascents.[47]For example, (2)(31) = 321 hask =2 weak exceedances (at index 1 and 2), whereasf(321) = 231hask− 1 = 1ascent (at index 1; that is, from 2 to 3).
Aninversionof a permutationσis a pair(i,j)of positions where the entries of a permutation are in the opposite order:i<j{\displaystyle i<j}andσ(i)>σ(j){\displaystyle \sigma (i)>\sigma (j)}.[49]Thus a descent is an inversion at two adjacent positions. For example,σ= 23154has (i,j) = (1, 3), (2, 3), and (4, 5), where (σ(i),σ(j)) = (2, 1), (3, 1), and (5, 4).
Sometimes an inversion is defined as the pair of values (σ(i),σ(j)); this makes no difference for thenumberof inversions, and the reverse pair (σ(j),σ(i)) is an inversion in the above sense for the inverse permutationσ−1.
The number of inversions is an important measure for the degree to which the entries of a permutation are out of order; it is the same forσand forσ−1. To bring a permutation withkinversions into order (that is, transform it into the identity permutation), by successively applying (right-multiplication by)adjacent transpositions, is always possible and requires a sequence ofksuch operations. Moreover, any reasonable choice for the adjacent transpositions will work: it suffices to choose at each step a transposition ofiandi+ 1whereiis a descent of the permutation as modified so far (so that the transposition will remove this particular descent, although it might create other descents). This is so because applying such a transposition reduces the number of inversions by 1; as long as this number is not zero, the permutation is not the identity, so it has at least one descent.Bubble sortandinsertion sortcan be interpreted as particular instances of this procedure to put a sequence into order. Incidentally this procedure proves that any permutationσcan be written as a product of adjacent transpositions; for this one may simply reverse any sequence of such transpositions that transformsσinto the identity. In fact, by enumerating all sequences of adjacent transpositions that would transformσinto the identity, one obtains (after reversal) acompletelist of all expressions of minimal length writingσas a product of adjacent transpositions.
The number of permutations ofnwithkinversions is expressed by aMahonian number.[50]This is the coefficient ofqk{\displaystyle q^{k}}in the expansion of the product
[n]q!=∏m=1n∑i=0m−1qi=1(1+q)(1+q+q2)⋯(1+q+q2+⋯+qn−1),{\displaystyle [n]_{q}!=\prod _{m=1}^{n}\sum _{i=0}^{m-1}q^{i}=1\left(1+q\right)\left(1+q+q^{2}\right)\cdots \left(1+q+q^{2}+\cdots +q^{n-1}\right),}
The notation[n]q!{\displaystyle [n]_{q}!}denotes theq-factorial. This expansion commonly appears in the study ofnecklaces.
Letσ∈Sn,i,j∈{1,2,…,n}{\displaystyle \sigma \in S_{n},i,j\in \{1,2,\dots ,n\}}such thati<j{\displaystyle i<j}andσ(i)>σ(j){\displaystyle \sigma (i)>\sigma (j)}.
In this case, say the weight of the inversion(i,j){\displaystyle (i,j)}isσ(i)−σ(j){\displaystyle \sigma (i)-\sigma (j)}.
Kobayashi (2011) proved the enumeration formula∑i<j,σ(i)>σ(j)(σ(i)−σ(j))=|{τ∈Sn∣τ≤σ,τis bigrassmannian}{\displaystyle \sum _{i<j,\sigma (i)>\sigma (j)}(\sigma (i)-\sigma (j))=|\{\tau \in S_{n}\mid \tau \leq \sigma ,\tau {\text{ is bigrassmannian}}\}}
where≤{\displaystyle \leq }denotesBruhat orderin thesymmetric groups. This graded partial order often appears in the context ofCoxeter groups.
One way to represent permutations ofnthings is by an integerNwith 0 ≤N<n!, provided convenient methods are given to convert between the number and the representation of a permutation as an ordered arrangement (sequence). This gives the most compact representation of arbitrary permutations, and in computing is particularly attractive whennis small enough thatNcan be held in a machine word; for 32-bit words this meansn≤ 12, and for 64-bit words this meansn≤ 20. The conversion can be done via the intermediate form of a sequence of numbersdn,dn−1, ...,d2,d1, wherediis a non-negative integer less thani(one may omitd1, as it is always 0, but its presence makes the subsequent conversion to a permutation easier to describe). The first step then is to simply expressNin thefactorial number system, which is just a particularmixed radixrepresentation, where, for numbers less thann!, the bases (place values or multiplication factors) for successive digits are(n− 1)!,(n− 2)!, ..., 2!, 1!. The second step interprets this sequence as aLehmer codeor (almost equivalently) as an inversion table.
In theLehmer codefor a permutationσ, the numberdnrepresents the choice made for the first termσ1, the numberdn−1represents the choice made for the second termσ2among the remainingn− 1elements of the set, and so forth. More precisely, eachdn+1−igives the number ofremainingelements strictly less than the termσi. Since those remaining elements are bound to turn up as some later termσj, the digitdn+1−icounts theinversions(i,j) involvingias smaller index (the number of valuesjfor whichi<jandσi>σj). Theinversion tableforσis quite similar, but heredn+1−kcounts the number of inversions (i,j) wherek=σjoccurs as the smaller of the two values appearing in inverted order.[51]
Both encodings can be visualized by annbynRothe diagram[52](named afterHeinrich August Rothe) in which dots at (i,σi) mark the entries of the permutation, and a cross at (i,σj) marks the inversion (i,j); by the definition of inversions a cross appears in any square that comes both before the dot (j,σj) in its column, and before the dot (i,σi) in its row. The Lehmer code lists the numbers of crosses in successive rows, while the inversion table lists the numbers of crosses in successive columns; it is just the Lehmer code for the inverse permutation, and vice versa.
To effectively convert a Lehmer codedn,dn−1, ...,d2,d1into a permutation of an ordered setS, one can start with a list of the elements ofSin increasing order, and foriincreasing from 1 tonsetσito the element in the list that is preceded bydn+1−iother ones, and remove that element from the list. To convert an inversion tabledn,dn−1, ...,d2,d1into the corresponding permutation, one can traverse the numbers fromd1todnwhile inserting the elements ofSfrom largest to smallest into an initially empty sequence; at the step using the numberdfrom the inversion table, the element fromSinserted into the sequence at the point where it is preceded bydelements already present. Alternatively one could process the numbers from the inversion table and the elements ofSboth in the opposite order, starting with a row ofnempty slots, and at each step place the element fromSinto the empty slot that is preceded bydother empty slots.
Converting successive natural numbers to the factorial number system produces those sequences inlexicographic order(as is the case with any mixed radix number system), and further converting them to permutations preserves the lexicographic ordering, provided the Lehmer code interpretation is used (using inversion tables, one gets a different ordering, where one starts by comparing permutations by theplaceof their entries 1 rather than by the value of their first entries). The sum of the numbers in the factorial number system representation gives the number of inversions of the permutation, and the parity of that sum gives thesignatureof the permutation. Moreover, the positions of the zeroes in the inversion table give the values of left-to-right maxima of the permutation (in the example 6, 8, 9) while the positions of the zeroes in the Lehmer code are the positions of the right-to-left minima (in the example positions the 4, 8, 9 of the values 1, 2, 5); this allows computing the distribution of such extrema among all permutations. A permutation with Lehmer codedn,dn−1, ...,d2,d1has an ascentn−iif and only ifdi≥di+1.
In computing it may be required to generate permutations of a given sequence of values. The methods best adapted to do this depend on whether one wants some randomly chosen permutations, or all permutations, and in the latter case if a specific ordering is required. Another question is whether possible equality among entries in the given sequence is to be taken into account; if so, one should only generate distinct multiset permutations of the sequence.
An obvious way to generate permutations ofnis to generate values for theLehmer code(possibly using thefactorial number systemrepresentation of integers up ton!), and convert those into the corresponding permutations. However, the latter step, while straightforward, is hard to implement efficiently, because it requiresnoperations each of selection from a sequence and deletion from it, at an arbitrary position; of the obvious representations of the sequence as anarrayor alinked list, both require (for different reasons) aboutn2/4 operations to perform the conversion. Withnlikely to be rather small (especially if generation of all permutations is needed) that is not too much of a problem, but it turns out that both for random and for systematic generation there are simple alternatives that do considerably better. For this reason it does not seem useful, although certainly possible, to employ a special data structure that would allow performing the conversion from Lehmer code to permutation inO(nlogn)time.
For generatingrandom permutationsof a given sequence ofnvalues, it makes no difference whether one applies a randomly selected permutation ofnto the sequence, or chooses a random element from the set of distinct (multiset) permutations of the sequence. This is because, even though in case of repeated values there can be many distinct permutations ofnthat result in the same permuted sequence, the number of such permutations is the same for each possible result. Unlike for systematic generation, which becomes unfeasible for largendue to the growth of the numbern!, there is no reason to assume thatnwill be small for random generation.
The basic idea to generate a random permutation is to generate at random one of then! sequences of integersd1,d2,...,dnsatisfying0 ≤di<i(sinced1is always zero it may be omitted) and to convert it to a permutation through abijectivecorrespondence. For the latter correspondence one could interpret the (reverse) sequence as a Lehmer code, and this gives a generation method first published in 1938 byRonald FisherandFrank Yates.[53]While at the time computer implementation was not an issue, this method suffers from the difficulty sketched above to convert from Lehmer code to permutation efficiently. This can be remedied by using a different bijective correspondence: after usingdito select an element amongiremaining elements of the sequence (for decreasing values ofi), rather than removing the element and compacting the sequence by shifting down further elements one place, oneswapsthe element with the final remaining element. Thus the elements remaining for selection form a consecutive range at each point in time, even though they may not occur in the same order as they did in the original sequence. The mapping from sequence of integers to permutations is somewhat complicated, but it can be seen to produce each permutation in exactly one way, by an immediateinduction. When the selected element happens to be the final remaining element, the swap operation can be omitted. This does not occur sufficiently often to warrant testing for the condition, but the final element must be included among the candidates of the selection, to guarantee that all permutations can be generated.
The resulting algorithm for generating a random permutation ofa[0],a[1], ...,a[n− 1]can be described as follows inpseudocode:
This can be combined with the initialization of the arraya[i] =ias follows
Ifdi+1=i, the first assignment will copy an uninitialized value, but the second will overwrite it with the correct valuei.
However, Fisher-Yates is not the fastest algorithm for generating a permutation, because Fisher-Yates is essentially a sequential algorithm and "divide and conquer" procedures can achieve the same result in parallel.[54]
There are many ways to systematically generate all permutations of a given sequence.[55]One classic, simple, and flexible algorithm is based upon finding the next permutation inlexicographic ordering, if it exists. It can handle repeated values, for which case it generates each distinct multiset permutation once. Even for ordinary permutations it is significantly more efficient than generating values for the Lehmer code in lexicographic order (possibly using thefactorial number system) and converting those to permutations. It begins by sorting the sequence in (weakly)increasingorder (which gives its lexicographically minimal permutation), and then repeats advancing to the next permutation as long as one is found. The method goes back toNarayana Panditain 14th century India, and has been rediscovered frequently.[56]
The following algorithm generates the next permutation lexicographically after a given permutation. It changes the given permutation in-place.
For example, given the sequence [1, 2, 3, 4] (which is in increasing order), and given that the index iszero-based, the steps are as follows:
Following this algorithm, the next lexicographic permutation will be [1, 3, 2, 4], and the 24th permutation will be [4, 3, 2, 1] at which pointa[k] <a[k+ 1] does not exist, indicating that this is the last permutation.
This method uses about 3 comparisons and 1.5 swaps per permutation, amortized over the whole sequence, not counting the initial sort.[57]
An alternative to the above algorithm, theSteinhaus–Johnson–Trotter algorithm, generates an ordering on all the permutations of a given sequence with the property that any two consecutive permutations in its output differ by swapping two adjacent values. This ordering on the permutations was known to 17th-century English bell ringers, among whom it was known as "plain changes". One advantage of this method is that the small amount of change from one permutation to the next allows the method to be implemented in constant time per permutation. The same can also easily generate the subset of even permutations, again in constant time per permutation, by skipping every other output permutation.[56]
An alternative to Steinhaus–Johnson–Trotter isHeap's algorithm,[58]said byRobert Sedgewickin 1977 to be the fastest algorithm of generating permutations in applications.[55]
The following figure shows the output of all three aforementioned algorithms for generating all permutations of lengthn=4{\displaystyle n=4}, and of six additional algorithms described in the literature.
Explicit sequence of swaps (transpositions, 2-cycles(pq){\displaystyle (pq)}), is described here, each swap applied (on the left) to the previous chain providing a new permutation, such that all the permutations can be retrieved, each only once.[64]This counting/generating procedure has an additional structure (call it nested), as it is given in steps: after completely retrievingSk−1{\displaystyle S_{k-1}}, continue retrievingSk∖Sk−1{\displaystyle S_{k}\backslash S_{k-1}}by cosetsSk−1τi{\displaystyle S_{k-1}\tau _{i}}ofSk−1{\displaystyle S_{k-1}}inSk{\displaystyle S_{k}}, by appropriately choosing the coset representativesτi{\displaystyle \tau _{i}}to be described below. Since eachSm{\displaystyle S_{m}}is sequentially generated, there is alast elementλm∈Sm{\displaystyle \lambda _{m}\in S_{m}}. So, after generatingSk−1{\displaystyle S_{k-1}}by swaps, the next permutation inSk∖Sk−1{\displaystyle S_{k}\backslash S_{k-1}}has to beτ1=(p1k)λk−1{\displaystyle \tau _{1}=(p_{1}k)\lambda _{k-1}}for some1≤p1<k{\displaystyle 1\leq p_{1}<k}. Then all swaps that generatedSk−1{\displaystyle S_{k-1}}are repeated, generating the whole cosetSk−1τ1{\displaystyle S_{k-1}\tau _{1}}, reaching the last permutation in that cosetλk−1τ1{\displaystyle \lambda _{k-1}\tau _{1}}; the next swap has to move the permutation to representative of another cosetτ2=(p2k)λk−1τ1{\displaystyle \tau _{2}=(p_{2}k)\lambda _{k-1}\tau _{1}}.
Continuing the same way, one gets coset representativesτj=(pjk)λk−1⋯λk−1(pik)λk−1⋯λk−1(p1k)λk−1{\displaystyle \tau _{j}=(p_{j}k)\lambda _{k-1}\cdots \lambda _{k-1}(p_{i}k)\lambda _{k-1}\cdots \lambda _{k-1}(p_{1}k)\lambda _{k-1}}for the cosets ofSk−1{\displaystyle S_{k-1}}inSk{\displaystyle S_{k}}; the ordered set(p1,…,pk−1){\displaystyle (p_{1},\ldots ,p_{k-1})}(0≤pi<k{\displaystyle 0\leq p_{i}<k}) is called the set of coset beginnings. Two of these representatives are in the same coset if and only ifτj(τi)−1=(pjk)λk−1(pj−1k)λk−1⋯λk−1(pi+1k)=ϰij∈Sk−1{\displaystyle \tau _{j}(\tau _{i})^{-1}=(p_{j}k)\lambda _{k-1}(p_{j-1}k)\lambda _{k-1}\cdots \lambda _{k-1}(p_{i+1}k)=\varkappa _{ij}\in S_{k-1}}, that is,ϰij(k)=k{\displaystyle \varkappa _{ij}(k)=k}. Concluding, permutationsτi∈Sk−Sk−1{\displaystyle \tau _{i}\in S_{k}-S_{k-1}}are all representatives of distinct cosets if and only if for anyk>j>i≥1{\displaystyle k>j>i\geq 1},(λk−1)j−ipi≠pj{\displaystyle (\lambda _{k-1})^{j-i}p_{i}\neq p_{j}}(no repeat condition). In particular, for all generated permutations to be distinct it is not necessary for thepi{\displaystyle p_{i}}values to be distinct. In the process, one gets thatλk=λk−1(pk−1k)λk−1(pk−2k)λk−1⋯λk−1(p1k)λk−1{\displaystyle \lambda _{k}=\lambda _{k-1}(p_{k-1}k)\lambda _{k-1}(p_{k-2}k)\lambda _{k-1}\cdots \lambda _{k-1}(p_{1}k)\lambda _{k-1}}and this provides the recursion procedure.
EXAMPLES: obviously, forλ2{\displaystyle \lambda _{2}}one hasλ2=(12){\displaystyle \lambda _{2}=(12)}; to buildλ3{\displaystyle \lambda _{3}}there are only two possibilities for the coset beginnings satisfying the no repeat condition; the choicep1=p2=1{\displaystyle p_{1}=p_{2}=1}leads toλ3=λ2(13)λ2(13)λ2=(13){\displaystyle \lambda _{3}=\lambda _{2}(13)\lambda _{2}(13)\lambda _{2}=(13)}. To continue generatingS4{\displaystyle S_{4}}one needs appropriate coset beginnings (satisfying the no repeat condition): there is a convenient choice:p1=1,p2=2,p3=3{\displaystyle p_{1}=1,p_{2}=2,p_{3}=3}, leading toλ4=(13)(1234)(13)=(1432){\displaystyle \lambda _{4}=(13)(1234)(13)=(1432)}. Then, to buildλ5{\displaystyle \lambda _{5}}a convenient choice for the coset beginnings (satisfying the no repeat condition) isp1=p2=p3=p4=1{\displaystyle p_{1}=p_{2}=p_{3}=p_{4}=1}, leading toλ5=(15){\displaystyle \lambda _{5}=(15)}.
From examples above one can inductively go to higherk{\displaystyle k}in a similar way, choosing coset beginnings ofSk{\displaystyle S_{k}}inSk+1{\displaystyle S_{k+1}}, as follows: fork{\displaystyle k}even choosing all coset beginnings equal to 1 and fork{\displaystyle k}odd choosing coset beginnings equal to(1,2,…,k){\displaystyle (1,2,\dots ,k)}. With such choices the "last" permutation isλk=(1k){\displaystyle \lambda _{k}=(1k)}fork{\displaystyle k}odd andλk=(1k−)(12⋯k)(1k−){\displaystyle \lambda _{k}=(1k_{-})(12\cdots k)(1k_{-})}fork{\displaystyle k}even (k−=k−1{\displaystyle k_{-}=k-1}). Using these explicit formulae one can easily compute the permutation of certain index in the counting/generation steps with minimum computation. For this, writing the index in factorial base is useful. For example, the permutation for index699=5(5!)+4(4!)+1(2!)+1(1!){\displaystyle 699=5(5!)+4(4!)+1(2!)+1(1!)}is:σ=λ2(13)λ2(15)λ4(15)λ4(15)λ4(15)λ4(56)λ5(46)λ5(36)λ5(26)λ5(16)λ5={\displaystyle \sigma =\lambda _{2}(13)\lambda _{2}(15)\lambda _{4}(15)\lambda _{4}(15)\lambda _{4}(15)\lambda _{4}(56)\lambda _{5}(46)\lambda _{5}(36)\lambda _{5}(26)\lambda _{5}(16)\lambda _{5}=}λ2(13)λ2((15)λ4)4(λ5)−1λ6=(23)(14325)−1(15)(15)(123456)(15)={\displaystyle \lambda _{2}(13)\lambda _{2}((15)\lambda _{4})^{4}(\lambda _{5})^{-1}\lambda _{6}=(23)(14325)^{-1}(15)(15)(123456)(15)=}(23)(15234)(123456)(15){\displaystyle (23)(15234)(123456)(15)}, yelding finally,σ=(1653)(24){\displaystyle \sigma =(1653)(24)}.
Because multiplying by swap permutation takes short computing time and every new generated permutation requires only one such swap multiplication, this generation procedure is quite efficient. Moreover as there is a simple formula, having the last permutation in eachSk{\displaystyle S_{k}}can save even more time to go directly to a permutation with certain index in fewer steps than expected as it can be done in blocks of subgroups rather than swap by swap.
Permutations are used in theinterleavercomponent of theerror detection and correctionalgorithms, such asturbo codes, for example3GPP Long Term Evolutionmobile telecommunication standard uses these ideas (see 3GPP technical specification 36.212[65]).
Such applications raise the question of fast generation of permutations satisfying certain desirable properties. One of the methods is based on thepermutation polynomials. Also as a base for optimal hashing in Unique Permutation Hashing.[66]
|
https://en.wikipedia.org/wiki/Permutation
|
Inmathematics,Stirling numbersarise in a variety ofanalyticandcombinatorialproblems. They are named afterJames Stirling, who introduced them in a purely algebraic setting in his bookMethodus differentialis(1730).[1]They were rediscovered and given a combinatorial meaning by Masanobu Saka in his 1782Sanpō-Gakkai(The Sea of Learning on Mathematics).[2][3]
Two different sets of numbers bear this name: theStirling numbers of the first kindand theStirling numbers of the second kind. Additionally,Lah numbersare sometimes referred to as Stirling numbers of the third kind. Each kind is detailed in its respective article, this one serving as a description of relations between them.
A common property of all three kinds is that they describe coefficients relating three different sequences of polynomials that frequently arise in combinatorics. Moreover, all three can be defined as the number of partitions ofnelements intoknon-empty subsets, where each subset is endowed with a certain kind of order (no order, cyclical, or linear).
Several different notations for Stirling numbers are in use. Ordinary (signed)Stirling numbers of the first kindare commonly denoted:
Unsigned Stirling numbers of the first kind, which count the number ofpermutationsofnelements withkdisjointcycles, are denoted:
Stirling numbers of the second kind, which count the number of ways to partition a set ofnelements intoknonempty subsets:[4]
Abramowitz and Stegunuse an uppercaseS{\displaystyle S}and ablackletterS{\displaystyle {\mathfrak {S}}}, respectively, for the first and second kinds of Stirling number. The notation of brackets and braces, in analogy tobinomial coefficients, was introduced in 1935 byJovan Karamataand promoted later byDonald Knuth, though the bracket notation conflicts with a common notation forGaussian coefficients.[5]The mathematical motivation for this type of notation, as well as additional Stirling number formulae, may be found on the page forStirling numbers and exponential generating functions.
Another infrequent notation iss1(n,k){\displaystyle s_{1}(n,k)}ands2(n,k){\displaystyle s_{2}(n,k)}.
Stirling numbers express coefficients in expansions offalling and rising factorials(also known as the Pochhammer symbol) as polynomials.
That is, thefalling factorial, defined as(x)n=x(x−1)⋯(x−n+1),{\displaystyle \ (x)_{n}=x(x-1)\ \cdots (x-n+1)\ ,}is a polynomial inxof degreenwhose expansion is
with (signed) Stirling numbers of the first kind as coefficients.
Note that(x)0≡1,{\displaystyle \ (x)_{0}\equiv 1\ ,}by convention, because it is anempty product. The notationsxn_{\displaystyle \ x^{\underline {n}}\ }for the falling factorial andxn¯{\displaystyle \ x^{\overline {n}}\ }for the rising factorial are also often used.[6](Confusingly, the Pochhammer symbol that many use forfallingfactorials is used inspecial functionsforrisingfactorials.)
Similarly, therising factorial, defined asx(n)=x(x+1)⋯(x+n−1),{\displaystyle \ x^{(n)}\ =\ x(x+1)\ \cdots (x+n-1)\ ,}is a polynomial inxof degreenwhose expansion is
with unsigned Stirling numbers of the first kind as coefficients.
One of these expansions can be derived from the other by observing thatx(n)=(−1)n(−x)n.{\displaystyle \ x^{(n)}=(-1)^{n}(-x)_{n}~.}
Stirling numbers of the second kind express the reverse relations:
and
Considering the set ofpolynomialsin the (indeterminate) variablexas a vector space,
each of the three sequences
is abasis.
That is, every polynomial inxcan be written as a suma0x(0)+a1x(1)+⋯+anx(n){\displaystyle a_{0}x^{(0)}+a_{1}x^{(1)}+\dots +a_{n}x^{(n)}}for some unique coefficientsai{\displaystyle a_{i}}(similarly for the other two bases).
The above relations then express thechange of basisbetween them, as summarized in the followingcommutative diagram:
The coefficients for the two bottom changes are described by theLah numbersbelow.
Since coefficients in any basis are unique, one can define Stirling numbers this way, as the coefficients expressing polynomials of one basis in terms of another, that is, the unique numbers relatingxn{\displaystyle x^{n}}with falling and rising factorials as above.
Falling factorials define, up to scaling, the same polynomials asbinomial coefficients:(xk)=(x)k/k!{\textstyle {\binom {x}{k}}=(x)_{k}/k!}. The changes between the standard basisx0,x1,x2,…{\displaystyle \textstyle x^{0},x^{1},x^{2},\dots }and the basis(x0),(x1),(x2),…{\textstyle {\binom {x}{0}},{\binom {x}{1}},{\binom {x}{2}},\dots }are thus described by similar formulas:
Expressing a polynomial in the basis of falling factorials is useful for calculating sums of the polynomial evaluated at consecutive integers.
Indeed, the sum of falling factorials with fixedkcan expressed as another falling factorial (fork≠−1{\displaystyle k\neq -1})
This can be proved byinduction.
For example, the sum of fourth powers of integers up ton(this time withnincluded), is:
Here the Stirling numbers can be computed from their definition as the number of partitions of 4 elements intoknon-empty unlabeled subsets.
In contrast, the sum∑i=0nik{\textstyle \sum _{i=0}^{n}i^{k}}in the standard basis is given byFaulhaber's formula, which in general is more complicated.
The Stirling numbers of the first and second kinds can be considered inverses of one another:
and
whereδnk{\displaystyle \delta _{nk}}is theKronecker delta. These two relationships may be understood to be matrix inverse relationships. That is, letsbe thelower triangular matrixof Stirling numbers of the first kind, whose matrix elementssnk=s(n,k).{\displaystyle s_{nk}=s(n,k).\,}Theinverseof this matrix isS, thelower triangular matrixof Stirling numbers of the second kind, whose entries areSnk=S(n,k).{\displaystyle S_{nk}=S(n,k).}Symbolically, this is written
AlthoughsandSare infinite, so calculating a product entry involves an infinite sum, the matrix multiplications work because these matrices are lower triangular, so only a finite number of terms in the sum are nonzero.
The Lah numbersL(n,k)=(n−1k−1)n!k!{\displaystyle L(n,k)={n-1 \choose k-1}{\frac {n!}{k!}}}are sometimes called Stirling numbers of the third kind.[7]By convention,L(0,0)=1{\displaystyle L(0,0)=1}andL(n,k)=0{\displaystyle L(n,k)=0}ifn<k{\displaystyle n<k}ork=0<n{\displaystyle k=0<n}.
These numbers are coefficients expressing falling factorials in terms of rising factorials and vice versa:
As above, this means they express the change of basis between the bases(x)0,(x)1,(x)2,⋯{\displaystyle (x)_{0},(x)_{1},(x)_{2},\cdots }andx(0),x(1),x(2),⋯{\displaystyle x^{(0)},x^{(1)},x^{(2)},\cdots }, completing the diagram.
In particular, one formula is the inverse of the other, thus:
Similarly, composing the change of basis fromx(n){\displaystyle x^{(n)}}toxn{\displaystyle x^{n}}with the change of basis fromxn{\displaystyle x^{n}}to(x)n{\displaystyle (x)_{n}}gives the change of basis directly fromx(n){\displaystyle x^{(n)}}to(x)n{\displaystyle (x)_{n}}:
and similarly for other compositions. In terms of matrices, ifL{\displaystyle L}denotes the matrix with entriesLnk=L(n,k){\displaystyle L_{nk}=L(n,k)}andL−{\displaystyle L^{-}}denotes the matrix with entriesLnk−=(−1)n−kL(n,k){\displaystyle L_{nk}^{-}=(-1)^{n-k}L(n,k)}, then one is the inverse of the other:L−=L−1{\displaystyle L^{-}=L^{-1}}.
Composing the matrix of unsigned Stirling numbers of the first kind with the matrix of Stirling numbers of the second kind gives the Lah numbers:L=|s|⋅S{\displaystyle L=|s|\cdot S}.
Enumeratively,{nk},[nk],L(n,k){\textstyle \left\{{\!n\! \atop \!k\!}\right\},\left[{n \atop k}\right],L(n,k)}can be defined as the number of partitions ofnelements intoknon-empty unlabeled subsets, where each subset is endowed with no order, acyclic order, or a linear order, respectively. In particular, this implies the inequalities:
For any pair of sequences,{fn}{\displaystyle \{f_{n}\}}and{gn}{\displaystyle \{g_{n}\}}, related by a finite sum Stirling number formula given by
for all integersn≥0{\displaystyle n\geq 0}, we have a correspondinginversion formulaforfn{\displaystyle f_{n}}given by
The lower indices could be any integer between0{\textstyle 0}andn{\textstyle n}.
These inversion relations between the two sequences translate into functional equations between the sequenceexponential generating functionsgiven by theStirling (generating function) transformas
and
ForD=d/dx{\displaystyle D=d/dx}, thedifferential operatorsxnDn{\displaystyle x^{n}D^{n}}and(xD)n{\displaystyle (xD)^{n}}are related by the following formulas for all integersn≥0{\displaystyle n\geq 0}:[8]
Another pair of "inversion" relations involving theStirling numbersrelate theforward differencesand the ordinarynth{\displaystyle n^{th}}derivativesof a function,f(x){\displaystyle f(x)}, which is analytic for allx{\displaystyle x}by the formulas[9]
See the specific articles for details.
Abramowitz and Stegun give the following symmetric formulae that relate the Stirling numbers of the first and second kind.[10]
and
The Stirling numbers can be extended to negative integral values, but not all authors do so in the same way.[11][12][13]Regardless of the approach taken, it is worth noting that Stirling numbers of first and second kind are connected by the relations:
whennandkare nonnegative integers. So we have the following table for[−n−k]{\displaystyle \left[{-n \atop -k}\right]}:
Donald Knuth[13]defined the more general Stirling numbers by extending arecurrence relationto all integers. In this approach,[nk]{\textstyle \left[{n \atop k}\right]}and{nk}{\textstyle \left\{{\!n\! \atop \!k\!}\right\}}are zero ifnis negative andkis nonnegative, or ifnis nonnegative andkis negative, and so we have, foranyintegersnandk,
On the other hand, for positive integersnandk, David Branson[12]defined[−n−k],{\textstyle \left[{-n \atop -k}\right]\!,}{−n−k},{\textstyle \left\{{\!-n\! \atop \!-k\!}\right\}\!,}[−nk],{\textstyle \left[{-n \atop k}\right]\!,}and{−nk}{\textstyle \left\{{\!-n\! \atop \!k\!}\right\}}(but not[n−k]{\textstyle \left[{n \atop -k}\right]}or{n−k}{\textstyle \left\{{\!n\! \atop \!-k\!}\right\}}). In this approach, one has the following extension of therecurrence relationof the Stirling numbers of the first kind:
For example,[−5k]=1120(5−102k+103k−54k+15k).{\textstyle \left[{-5 \atop k}\right]={\frac {1}{120}}{\Bigl (}5-{\frac {10}{2^{k}}}+{\frac {10}{3^{k}}}-{\frac {5}{4^{k}}}+{\frac {1}{5^{k}}}{\Bigr )}.}This leads to the following table of values of[nk]{\textstyle \left[{n \atop k}\right]}for negative integraln.
In this case∑n=1∞[−n−k]=Bk{\textstyle \sum _{n=1}^{\infty }\left[{-n \atop -k}\right]=B_{k}}whereBk{\displaystyle B_{k}}is aBell number, and so one may define the negative Bell numbers by∑n=1∞[−nk]=:B−k{\textstyle \sum _{n=1}^{\infty }\left[{-n \atop k}\right]=:B_{-k}}.
For example, this produces∑n=1∞[−n1]=B−1=1e∑j=1∞1j⋅j!=1e∫01et−1tdt=0.4848291…{\textstyle \sum _{n=1}^{\infty }\left[{-n \atop 1}\right]=B_{-1}={\frac {1}{e}}\sum _{j=1}^{\infty }{\frac {1}{j\cdot j!}}={\frac {1}{e}}\int _{0}^{1}{\frac {e^{t}-1}{t}}dt=0.4848291\dots }, generallyB−k=1e∑j=1∞1jkj!{\textstyle B_{-k}={\frac {1}{e}}\sum _{j=1}^{\infty }{\frac {1}{j^{k}j!}}}.
|
https://en.wikipedia.org/wiki/Stirling_numbers
|
Inmathematics,Stirling's approximation(orStirling's formula) is anasymptoticapproximation forfactorials. It is a good approximation, leading to accurate results even for small values ofn{\displaystyle n}. It is named afterJames Stirling, though a related but less precise result was first stated byAbraham de Moivre.[1][2][3]
One way of stating the approximation involves thelogarithmof the factorial:ln(n!)=nlnn−n+O(lnn),{\displaystyle \ln(n!)=n\ln n-n+O(\ln n),}where thebig O notationmeans that, for all sufficiently large values ofn{\displaystyle n}, the difference betweenln(n!){\displaystyle \ln(n!)}andnlnn−n{\displaystyle n\ln n-n}will be at most proportional to the logarithm ofn{\displaystyle n}. In computer science applications such as theworst-case lower bound for comparison sorting, it is convenient to instead use thebinary logarithm, giving the equivalent formlog2(n!)=nlog2n−nlog2e+O(log2n).{\displaystyle \log _{2}(n!)=n\log _{2}n-n\log _{2}e+O(\log _{2}n).}The error term in either base can be expressed more precisely as12log2(2πn)+O(1n){\displaystyle {\tfrac {1}{2}}\log _{2}(2\pi n)+O({\tfrac {1}{n}})}, corresponding to an approximate formula for the factorial itself,n!∼2πn(ne)n.{\displaystyle n!\sim {\sqrt {2\pi n}}\left({\frac {n}{e}}\right)^{n}.}Here the sign∼{\displaystyle \sim }means that the two quantities are asymptotic, that is, their ratio tends to 1 asn{\displaystyle n}tends to infinity.
Roughly speaking, the simplest version of Stirling's formula can be quickly obtained by approximating the sumln(n!)=∑j=1nlnj{\displaystyle \ln(n!)=\sum _{j=1}^{n}\ln j}with anintegral:∑j=1nlnj≈∫1nlnxdx=nlnn−n+1.{\displaystyle \sum _{j=1}^{n}\ln j\approx \int _{1}^{n}\ln x\,{\rm {d}}x=n\ln n-n+1.}
The full formula, together with precise estimates of its error, can be derived as follows. Instead of approximatingn!{\displaystyle n!}, one considers itsnatural logarithm, as this is aslowly varying function:ln(n!)=ln1+ln2+⋯+lnn.{\displaystyle \ln(n!)=\ln 1+\ln 2+\cdots +\ln n.}
The right-hand side of this equation minus12(ln1+lnn)=12lnn{\displaystyle {\tfrac {1}{2}}(\ln 1+\ln n)={\tfrac {1}{2}}\ln n}is the approximation by thetrapezoid ruleof the integralln(n!)−12lnn≈∫1nlnxdx=nlnn−n+1,{\displaystyle \ln(n!)-{\tfrac {1}{2}}\ln n\approx \int _{1}^{n}\ln x\,{\rm {d}}x=n\ln n-n+1,}
and the error in this approximation is given by theEuler–Maclaurin formula:ln(n!)−12lnn=12ln1+ln2+ln3+⋯+ln(n−1)+12lnn=nlnn−n+1+∑k=2m(−1)kBkk(k−1)(1nk−1−1)+Rm,n,{\displaystyle {\begin{aligned}\ln(n!)-{\tfrac {1}{2}}\ln n&={\tfrac {1}{2}}\ln 1+\ln 2+\ln 3+\cdots +\ln(n-1)+{\tfrac {1}{2}}\ln n\\&=n\ln n-n+1+\sum _{k=2}^{m}{\frac {(-1)^{k}B_{k}}{k(k-1)}}\left({\frac {1}{n^{k-1}}}-1\right)+R_{m,n},\end{aligned}}}
whereBk{\displaystyle B_{k}}is aBernoulli number, andRm,nis the remainder term in the Euler–Maclaurin formula. Take limits to find thatlimn→∞(ln(n!)−nlnn+n−12lnn)=1−∑k=2m(−1)kBkk(k−1)+limn→∞Rm,n.{\displaystyle \lim _{n\to \infty }\left(\ln(n!)-n\ln n+n-{\tfrac {1}{2}}\ln n\right)=1-\sum _{k=2}^{m}{\frac {(-1)^{k}B_{k}}{k(k-1)}}+\lim _{n\to \infty }R_{m,n}.}
Denote this limit asy{\displaystyle y}. Because the remainderRm,nin the Euler–Maclaurin formula satisfiesRm,n=limn→∞Rm,n+O(1nm),{\displaystyle R_{m,n}=\lim _{n\to \infty }R_{m,n}+O\left({\frac {1}{n^{m}}}\right),}
wherebig-O notationis used, combining the equations above yields the approximation formula in its logarithmic form:ln(n!)=nln(ne)+12lnn+y+∑k=2m(−1)kBkk(k−1)nk−1+O(1nm).{\displaystyle \ln(n!)=n\ln \left({\frac {n}{e}}\right)+{\tfrac {1}{2}}\ln n+y+\sum _{k=2}^{m}{\frac {(-1)^{k}B_{k}}{k(k-1)n^{k-1}}}+O\left({\frac {1}{n^{m}}}\right).}
Taking the exponential of both sides and choosing any positive integerm{\displaystyle m}, one obtains a formula involving an unknown quantityey{\displaystyle e^{y}}. Form= 1, the formula isn!=eyn(ne)n(1+O(1n)).{\displaystyle n!=e^{y}{\sqrt {n}}\left({\frac {n}{e}}\right)^{n}\left(1+O\left({\frac {1}{n}}\right)\right).}
The quantityey{\displaystyle e^{y}}can be found by taking the limit on both sides asn{\displaystyle n}tends to infinity and usingWallis' product, which shows thatey=2π{\displaystyle e^{y}={\sqrt {2\pi }}}. Therefore, one obtains Stirling's formula:n!=2πn(ne)n(1+O(1n)).{\displaystyle n!={\sqrt {2\pi n}}\left({\frac {n}{e}}\right)^{n}\left(1+O\left({\frac {1}{n}}\right)\right).}
An alternative formula forn!{\displaystyle n!}using thegamma functionisn!=∫0∞xne−xdx.{\displaystyle n!=\int _{0}^{\infty }x^{n}e^{-x}\,{\rm {d}}x.}(as can be seen by repeated integration by parts). Rewriting and changing variablesx=ny, one obtainsn!=∫0∞enlnx−xdx=enlnnn∫0∞en(lny−y)dy.{\displaystyle n!=\int _{0}^{\infty }e^{n\ln x-x}\,{\rm {d}}x=e^{n\ln n}n\int _{0}^{\infty }e^{n(\ln y-y)}\,{\rm {d}}y.}ApplyingLaplace's methodone has∫0∞en(lny−y)dy∼2πne−n,{\displaystyle \int _{0}^{\infty }e^{n(\ln y-y)}\,{\rm {d}}y\sim {\sqrt {\frac {2\pi }{n}}}e^{-n},}which recovers Stirling's formula:n!∼enlnnn2πne−n=2πn(ne)n.{\displaystyle n!\sim e^{n\ln n}n{\sqrt {\frac {2\pi }{n}}}e^{-n}={\sqrt {2\pi n}}\left({\frac {n}{e}}\right)^{n}.}
In fact, further corrections can also be obtained using Laplace's method. From previous result, we know thatΓ(x)∼xxe−x{\displaystyle \Gamma (x)\sim x^{x}e^{-x}}, so we "peel off" this dominant term, then perform two changes of variables, to obtain:x−xexΓ(x)=∫Rex(1+t−et)dt{\displaystyle x^{-x}e^{x}\Gamma (x)=\int _{\mathbb {R} }e^{x(1+t-e^{t})}dt}To verify this:∫Rex(1+t−et)dt=t↦lntex∫0∞tx−1e−xtdt=t↦t/xx−xex∫0∞e−ttx−1dt=x−xexΓ(x){\displaystyle \int _{\mathbb {R} }e^{x(1+t-e^{t})}dt{\overset {t\mapsto \ln t}{=}}e^{x}\int _{0}^{\infty }t^{x-1}e^{-xt}dt{\overset {t\mapsto t/x}{=}}x^{-x}e^{x}\int _{0}^{\infty }e^{-t}t^{x-1}dt=x^{-x}e^{x}\Gamma (x)}.
Now the functiont↦1+t−et{\displaystyle t\mapsto 1+t-e^{t}}is unimodal, with maximum value zero. Locally around zero, it looks like−t2/2{\displaystyle -t^{2}/2}, which is why we are able to perform Laplace's method. In order to extend Laplace's method to higher orders, we perform another change of variables by1+t−et=−τ2/2{\displaystyle 1+t-e^{t}=-\tau ^{2}/2}. This equation cannot be solved in closed form, but it can be solved by serial expansion, which gives ust=τ−τ2/6+τ3/36+a4τ4+O(τ5){\displaystyle t=\tau -\tau ^{2}/6+\tau ^{3}/36+a_{4}\tau ^{4}+O(\tau ^{5})}. Now plug back to the equation to obtainx−xexΓ(x)=∫Re−xτ2/2(1−τ/3+τ2/12+4a4τ3+O(τ4))dτ=2π(x−1/2+x−3/2/12)+O(x−5/2){\displaystyle x^{-x}e^{x}\Gamma (x)=\int _{\mathbb {R} }e^{-x\tau ^{2}/2}(1-\tau /3+\tau ^{2}/12+4a_{4}\tau ^{3}+O(\tau ^{4}))d\tau ={\sqrt {2\pi }}(x^{-1/2}+x^{-3/2}/12)+O(x^{-5/2})}notice how we don't need to actually finda4{\displaystyle a_{4}}, since it is cancelled out by the integral. Higher orders can be achieved by computing more terms int=τ+⋯{\displaystyle t=\tau +\cdots }, which can be obtained programmatically.[note 1]
Thus we get Stirling's formula to two orders:n!=2πn(ne)n(1+112n+O(1n2)).{\displaystyle n!={\sqrt {2\pi n}}\left({\frac {n}{e}}\right)^{n}\left(1+{\frac {1}{12n}}+O\left({\frac {1}{n^{2}}}\right)\right).}
A complex-analysis version of this method[4]is to consider1n!{\displaystyle {\frac {1}{n!}}}as aTaylor coefficientof the exponential functionez=∑n=0∞znn!{\displaystyle e^{z}=\sum _{n=0}^{\infty }{\frac {z^{n}}{n!}}}, computed byCauchy's integral formulaas1n!=12πi∮|z|=rezzn+1dz.{\displaystyle {\frac {1}{n!}}={\frac {1}{2\pi i}}\oint \limits _{|z|=r}{\frac {e^{z}}{z^{n+1}}}\,\mathrm {d} z.}
This line integral can then be approximated using thesaddle-point methodwith an appropriate choice of contour radiusr=rn{\displaystyle r=r_{n}}. The dominant portion of the integral near the saddle point is then approximated by a real integral and Laplace's method, while the remaining portion of the integral can be bounded above to give an error term.
An alternative version uses the fact that thePoisson distributionconverges to anormal distributionby theCentral Limit Theorem.[5]
Since the Poisson distribution with parameterλ{\displaystyle \lambda }converges to a normal distribution with meanλ{\displaystyle \lambda }and varianceλ{\displaystyle \lambda }, theirdensity functionswill be approximately the same:
exp(−μ)μxx!≈12πμexp(−12(x−μμ)){\displaystyle {\frac {\exp(-\mu )\mu ^{x}}{x!}}\approx {\frac {1}{\sqrt {2\pi \mu }}}\exp(-{\frac {1}{2}}({\frac {x-\mu }{\sqrt {\mu }}}))}
Evaluating this expression at the mean, at which the approximation is particularly accurate, simplifies this expression to:
exp(−μ)μμμ!≈12πμ{\displaystyle {\frac {\exp(-\mu )\mu ^{\mu }}{\mu !}}\approx {\frac {1}{\sqrt {2\pi \mu }}}}
Taking logs then results in:
−μ+μlnμ−lnμ!≈−12ln2πμ{\displaystyle -\mu +\mu \ln \mu -\ln \mu !\approx -{\frac {1}{2}}\ln 2\pi \mu }
which can easily be rearranged to give:
lnμ!≈μlnμ−μ+12ln2πμ{\displaystyle \ln \mu !\approx \mu \ln \mu -\mu +{\frac {1}{2}}\ln 2\pi \mu }
Evaluating atμ=n{\displaystyle \mu =n}gives the usual, more precise form of Stirling's approximation.
Stirling's formula is in fact the first approximation to the following series (now called theStirling series):[6]n!∼2πn(ne)n(1+112n+1288n2−13951840n3−5712488320n4+⋯).{\displaystyle n!\sim {\sqrt {2\pi n}}\left({\frac {n}{e}}\right)^{n}\left(1+{\frac {1}{12n}}+{\frac {1}{288n^{2}}}-{\frac {139}{51840n^{3}}}-{\frac {571}{2488320n^{4}}}+\cdots \right).}
An explicit formula for the coefficients in this series was given by G. Nemes.[7]Further terms are listed in theOn-Line Encyclopedia of Integer SequencesasA001163andA001164. The first graph in this section shows therelative errorvs.n{\displaystyle n}, for 1 through all 5 terms listed above. (Bender and Orszag[8]p. 218) gives the asymptotic formula for the coefficients:A2j+1∼(−1)j2(2j)!/(2π)2(j+1){\displaystyle A_{2j+1}\sim (-1)^{j}2(2j)!/(2\pi )^{2(j+1)}}which shows that it grows superexponentially, and that by theratio testtheradius of convergenceis zero.
Asn→ ∞, the error in the truncated series is asymptotically equal to the first omitted term. This is an example of anasymptotic expansion. It is not aconvergent series; for anyparticularvalue ofn{\displaystyle n}there are only so many terms of the series that improve accuracy, after which accuracy worsens. This is shown in the next graph, which shows the relative error versus the number of terms in the series, for larger numbers of terms. More precisely, letS(n,t)be the Stirling series tot{\displaystyle t}terms evaluated atn{\displaystyle n}. The graphs show|ln(S(n,t)n!)|,{\displaystyle \left|\ln \left({\frac {S(n,t)}{n!}}\right)\right|,}which, when small, is essentially the relative error.
Writing Stirling's series in the formln(n!)∼nlnn−n+12ln(2πn)+112n−1360n3+11260n5−11680n7+⋯,{\displaystyle \ln(n!)\sim n\ln n-n+{\tfrac {1}{2}}\ln(2\pi n)+{\frac {1}{12n}}-{\frac {1}{360n^{3}}}+{\frac {1}{1260n^{5}}}-{\frac {1}{1680n^{7}}}+\cdots ,}it is known that the error in truncating the series is always of the opposite sign and at most the same magnitude as the first omitted term.[citation needed]
Other bounds, due to Robbins,[9]valid for all positive integersn{\displaystyle n}are2πn(ne)ne112n+1<n!<2πn(ne)ne112n.{\displaystyle {\sqrt {2\pi n}}\left({\frac {n}{e}}\right)^{n}e^{\frac {1}{12n+1}}<n!<{\sqrt {2\pi n}}\left({\frac {n}{e}}\right)^{n}e^{\frac {1}{12n}}.}This upper bound corresponds to stopping the above series forln(n!){\displaystyle \ln(n!)}after the1n{\displaystyle {\frac {1}{n}}}term. The lower bound is weaker than that obtained by stopping the series after the1n3{\displaystyle {\frac {1}{n^{3}}}}term. A looser version of this bound is thatn!ennn+12∈(2π,e]{\displaystyle {\frac {n!e^{n}}{n^{n+{\frac {1}{2}}}}}\in ({\sqrt {2\pi }},e]}for alln≥1{\displaystyle n\geq 1}.
For all positive integers,n!=Γ(n+1),{\displaystyle n!=\Gamma (n+1),}whereΓdenotes thegamma function.
However, the gamma function, unlike the factorial, is more broadly defined for all complex numbers other than non-positive integers; nevertheless, Stirling's formula may still be applied. IfRe(z) > 0, thenlnΓ(z)=zlnz−z+12ln2πz+∫0∞2arctan(tz)e2πt−1dt.{\displaystyle \ln \Gamma (z)=z\ln z-z+{\tfrac {1}{2}}\ln {\frac {2\pi }{z}}+\int _{0}^{\infty }{\frac {2\arctan \left({\frac {t}{z}}\right)}{e^{2\pi t}-1}}\,{\rm {d}}t.}
Repeated integration by parts giveslnΓ(z)∼zlnz−z+12ln2πz+∑n=1N−1B2n2n(2n−1)z2n−1=zlnz−z+12ln2πz+112z−1360z3+11260z5+…,{\displaystyle {\begin{aligned}\ln \Gamma (z)\sim z\ln z-z+{\tfrac {1}{2}}\ln {\frac {2\pi }{z}}+\sum _{n=1}^{N-1}{\frac {B_{2n}}{2n(2n-1)z^{2n-1}}}\\=z\ln z-z+{\tfrac {1}{2}}\ln {\frac {2\pi }{z}}+{\frac {1}{12z}}-{\frac {1}{360z^{3}}}+{\frac {1}{1260z^{5}}}+\dots ,\end{aligned}}}
whereBn{\displaystyle B_{n}}is then{\displaystyle n}thBernoulli number(note that the limit of the sum asN→∞{\displaystyle N\to \infty }is not convergent, so this formula is just anasymptotic expansion). The formula is valid forz{\displaystyle z}large enough in absolute value, when|arg(z)| < π −ε, whereεis positive, with an error term ofO(z−2N+ 1). The corresponding approximation may now be written:Γ(z)=2πz(ze)z(1+O(1z)).{\displaystyle \Gamma (z)={\sqrt {\frac {2\pi }{z}}}\,{\left({\frac {z}{e}}\right)}^{z}\left(1+O\left({\frac {1}{z}}\right)\right).}
where the expansion is identical to that of Stirling's series above forn!{\displaystyle n!}, except thatn{\displaystyle n}is replaced withz− 1.[10]
A further application of this asymptotic expansion is for complex argumentzwith constantRe(z). See for example the Stirling formula applied inIm(z) =tof theRiemann–Siegel theta functionon the straight line1/4+it.
Thomas Bayesshowed, in a letter toJohn Cantonpublished by theRoyal Societyin 1763, that Stirling's formula did not give aconvergent series.[11]Obtaining a convergent version of Stirling's formula entails evaluatingBinet's formula:∫0∞2arctan(tx)e2πt−1dt=lnΓ(x)−xlnx+x−12ln2πx.{\displaystyle \int _{0}^{\infty }{\frac {2\arctan \left({\frac {t}{x}}\right)}{e^{2\pi t}-1}}\,{\rm {d}}t=\ln \Gamma (x)-x\ln x+x-{\tfrac {1}{2}}\ln {\frac {2\pi }{x}}.}
One way to do this is by means of a convergent series of invertedrising factorials. Ifzn¯=z(z+1)⋯(z+n−1),{\displaystyle z^{\bar {n}}=z(z+1)\cdots (z+n-1),}then∫0∞2arctan(tx)e2πt−1dt=∑n=1∞cn(x+1)n¯,{\displaystyle \int _{0}^{\infty }{\frac {2\arctan \left({\frac {t}{x}}\right)}{e^{2\pi t}-1}}\,{\rm {d}}t=\sum _{n=1}^{\infty }{\frac {c_{n}}{(x+1)^{\bar {n}}}},}wherecn=1n∫01xn¯(x−12)dx=12n∑k=1nk|s(n,k)|(k+1)(k+2),{\displaystyle c_{n}={\frac {1}{n}}\int _{0}^{1}x^{\bar {n}}\left(x-{\tfrac {1}{2}}\right)\,{\rm {d}}x={\frac {1}{2n}}\sum _{k=1}^{n}{\frac {k|s(n,k)|}{(k+1)(k+2)}},}wheres(n,k)denotes theStirling numbers of the first kind. From this one obtains a version of Stirling's serieslnΓ(x)=xlnx−x+12ln2πx+112(x+1)+112(x+1)(x+2)++59360(x+1)(x+2)(x+3)+2960(x+1)(x+2)(x+3)(x+4)+⋯,{\displaystyle {\begin{aligned}\ln \Gamma (x)&=x\ln x-x+{\tfrac {1}{2}}\ln {\frac {2\pi }{x}}+{\frac {1}{12(x+1)}}+{\frac {1}{12(x+1)(x+2)}}+\\&\quad +{\frac {59}{360(x+1)(x+2)(x+3)}}+{\frac {29}{60(x+1)(x+2)(x+3)(x+4)}}+\cdots ,\end{aligned}}}which converges whenRe(x) > 0.
Stirling's formula may also be given in convergent form as[12]Γ(x)=2πxx−12e−x+μ(x){\displaystyle \Gamma (x)={\sqrt {2\pi }}x^{x-{\frac {1}{2}}}e^{-x+\mu (x)}}whereμ(x)=∑n=0∞((x+n+12)ln(1+1x+n)−1).{\displaystyle \mu \left(x\right)=\sum _{n=0}^{\infty }\left(\left(x+n+{\frac {1}{2}}\right)\ln \left(1+{\frac {1}{x+n}}\right)-1\right).}
The approximationΓ(z)≈2πz(zezsinh1z+1810z6)z{\displaystyle \Gamma (z)\approx {\sqrt {\frac {2\pi }{z}}}\left({\frac {z}{e}}{\sqrt {z\sinh {\frac {1}{z}}+{\frac {1}{810z^{6}}}}}\right)^{z}}and its equivalent form2lnΓ(z)≈ln(2π)−lnz+z(2lnz+ln(zsinh1z+1810z6)−2){\displaystyle 2\ln \Gamma (z)\approx \ln(2\pi )-\ln z+z\left(2\ln z+\ln \left(z\sinh {\frac {1}{z}}+{\frac {1}{810z^{6}}}\right)-2\right)}can be obtained by rearranging Stirling's extended formula and observing a coincidence between the resultantpower seriesand theTaylor seriesexpansion of thehyperbolic sinefunction. This approximation is good to more than 8 decimal digits forzwith a real part greater than 8. Robert H. Windschitl suggested it in 2002 for computing the gamma function with fair accuracy on calculators with limited program or register memory.[13]
Gergő Nemes proposed in 2007 an approximation which gives the same number of exact digits as the Windschitl approximation but is much simpler:[14]Γ(z)≈2πz(1e(z+112z−110z))z,{\displaystyle \Gamma (z)\approx {\sqrt {\frac {2\pi }{z}}}\left({\frac {1}{e}}\left(z+{\frac {1}{12z-{\frac {1}{10z}}}}\right)\right)^{z},}or equivalently,lnΓ(z)≈12(ln(2π)−lnz)+z(ln(z+112z−110z)−1).{\displaystyle \ln \Gamma (z)\approx {\tfrac {1}{2}}\left(\ln(2\pi )-\ln z\right)+z\left(\ln \left(z+{\frac {1}{12z-{\frac {1}{10z}}}}\right)-1\right).}
An alternative approximation for the gamma function stated bySrinivasa RamanujaninRamanujan's lost notebook[15]isΓ(1+x)≈π(xe)x(8x3+4x2+x+130)16{\displaystyle \Gamma (1+x)\approx {\sqrt {\pi }}\left({\frac {x}{e}}\right)^{x}\left(8x^{3}+4x^{2}+x+{\frac {1}{30}}\right)^{\frac {1}{6}}}forx≥ 0. The equivalent approximation forlnn!has an asymptotic error of1/1400n3and is given bylnn!≈nlnn−n+16ln(8n3+4n2+n+130)+12lnπ.{\displaystyle \ln n!\approx n\ln n-n+{\tfrac {1}{6}}\ln(8n^{3}+4n^{2}+n+{\tfrac {1}{30}})+{\tfrac {1}{2}}\ln \pi .}
The approximation may be made precise by giving paired upper and lower bounds; one such inequality is[16][17][18][19]π(xe)x(8x3+4x2+x+1100)1/6<Γ(1+x)<π(xe)x(8x3+4x2+x+130)1/6.{\displaystyle {\sqrt {\pi }}\left({\frac {x}{e}}\right)^{x}\left(8x^{3}+4x^{2}+x+{\frac {1}{100}}\right)^{1/6}<\Gamma (1+x)<{\sqrt {\pi }}\left({\frac {x}{e}}\right)^{x}\left(8x^{3}+4x^{2}+x+{\frac {1}{30}}\right)^{1/6}.}
The formula was first discovered byAbraham de Moivre[2]in the formn!∼[constant]⋅nn+12e−n.{\displaystyle n!\sim [{\rm {constant}}]\cdot n^{n+{\frac {1}{2}}}e^{-n}.}
De Moivre gave an approximate rational-number expression for the natural logarithm of the constant. Stirling's contribution consisted of showing that the constant is precisely2π{\displaystyle {\sqrt {2\pi }}}.[3]
|
https://en.wikipedia.org/wiki/Stirling_approximation
|
Incryptography, theInternational Data Encryption Algorithm(IDEA), originally calledImproved Proposed Encryption Standard(IPES), is asymmetric-keyblock cipherdesigned byJames MasseyofETH ZurichandXuejia Laiand was first described in 1991. The algorithm was intended as a replacement for theData Encryption Standard(DES). IDEA is a minor revision of an earliercipher, the Proposed Encryption Standard (PES).
The cipher was designed under a research contract with the Hasler Foundation, which became part of Ascom-Tech AG. The cipher was patented in a number of countries but was freely available for non-commercial use. The name "IDEA" is also atrademark. The lastpatentsexpired in 2012, and IDEA is now patent-free and thus completely free for all uses.[2]
IDEA was used inPretty Good Privacy(PGP) v2.0 and was incorporated after the original cipher used in v1.0,BassOmatic, was found to be insecure.[3]IDEA is an optional algorithm in theOpenPGPstandard.
IDEA operates on 64-bitblocksusing a 128-bitkeyand consists of a series of 8 identical transformations (around, see the illustration) and an output transformation (thehalf-round). The processes for encryption and decryption are similar. IDEA derives much of its security by interleaving operations from differentgroups—modularaddition and multiplication, and bitwiseeXclusive OR (XOR)— which are algebraically "incompatible" in some sense. In more detail, these operators, which all deal with 16-bit quantities, are:
After the 8 rounds comes a final “half-round”, the output transformation illustrated below (the swap of the middle two values cancels out the swap at the end of the last round, so that there is no net swap):
The overall structure of IDEA follows theLai–Massey scheme. XOR is used for both subtraction and addition. IDEA uses a key-dependent half-round function. To work with 16-bit words (meaning 4 inputs instead of 2 for the 64-bit block size), IDEA uses the Lai–Massey scheme twice in parallel, with the two parallel round functions being interwoven with each other. To ensure sufficient diffusion, two of the sub-blocks are swapped after each round.
Each round uses 6 16-bit sub-keys, while the half-round uses 4, a total of 52 for 8.5 rounds. The first 8 sub-keys are extracted directly from the key, with K1 from the first round being the lower 16 bits; further groups of 8 keys are created by rotating the main key left 25 bits between each group of 8. This means that it is rotated less than once per round, on average, for a total of 6 rotations.
Decryption works like encryption, but the order of the round keys is inverted, and the subkeys for the odd rounds are inversed. For instance, the values of subkeys K1–K4 are replaced by the inverse of K49–K52 for the respective group operation, K5 and K6 of each group should be replaced by K47 and K48 for decryption.
The designers analysed IDEA to measure its strength againstdifferential cryptanalysisand concluded that it is immune under certain assumptions. No successfullinearor algebraic weaknesses have been reported. As of 2007[update], the best attack applied to all keys could break IDEA reduced to 6 rounds (the full IDEA cipher uses 8.5 rounds).[4]Note that a "break" is any attack that requires less than 2128operations; the 6-round attack requires 264known plaintexts and 2126.8operations.
Bruce Schneierthought highly of IDEA in 1996, writing: "In my opinion, it is the best and most secure block algorithm available to the public at this time." (Applied Cryptography, 2nd ed.) However, by 1999 he was no longer recommending IDEA due to the availability of faster algorithms, some progress in itscryptanalysis, and the issue of patents.[5]
In 2011 full 8.5-round IDEA was broken using a meet-in-the-middle attack.[6]Independently in 2012, full 8.5-round IDEA was broken using a narrow-bicliques attack, with a reduction of cryptographic strength of about 2 bits, similar to the effect of the previous bicliques attack onAES; however, this attack does not threaten the security of IDEA in practice.[7]
The very simple key schedule makes IDEA subject to a class ofweak keys; some keys containing a large number of 0 bits produceweak encryption.[8]These are of little concern in practice, being sufficiently rare that they are unnecessary to avoid explicitly when generating keys randomly. A simple fix was proposed: XORing each subkey with a 16-bit constant, such as 0x0DAE.[8][9]
Larger classes of weak keys were found in 2002.[10]
This is still of negligible probability to be a concern to a randomly chosen key, and some of the problems are fixed by the constant XOR proposed earlier, but the paper is not certain if all of them are. A more comprehensive redesign of the IDEA key schedule may be desirable.[10]
A patent application for IDEA was first filed inSwitzerland(CH A 1690/90) on May 18, 1990, then an international patent application was filed under thePatent Cooperation Treatyon May 16, 1991. Patents were eventually granted inAustria,France,Germany,Italy, theNetherlands,Spain,Sweden,Switzerland, theUnited Kingdom, (European Patent Register entry forEuropean patent no. 0482154, filed May 16, 1991, issued June 22, 1994 and expired May 16, 2011), theUnited States(U.S. patent 5,214,703, issued May 25, 1993 and expired January 7, 2012) andJapan(JP 3225440, expired May 16, 2011).[11]
MediaCrypt AG is now offering a successor to IDEA and focuses on its new cipher (official release in May 2005)IDEA NXT, which was previously called FOX.
|
https://en.wikipedia.org/wiki/IDEA_(cipher)
|
TheGlobal System for Mobile Communications(GSM) is a family of standards to describe the protocols for second-generation (2G) digitalcellular networks,[2]as used by mobile devices such asmobile phonesandmobile broadband modems. GSM is also atrade markowned by theGSM Association.[3]"GSM" may also refer to the voice codec initially used in GSM.[4]
2G networks developed as a replacement for first generation (1G) analog cellular networks. The original GSM standard, which was developed by theEuropean Telecommunications Standards Institute(ETSI), originally described a digital, circuit-switched network optimized forfull duplexvoicetelephony, employingtime division multiple access(TDMA) between stations. This expanded over time to includedata communications, first bycircuit-switched transport, then bypacketdata transport via its upgraded standards,GPRSand thenEDGE. GSM exists in various versions based on thefrequency bands used.
GSM was first implemented inFinlandin December 1991.[5]It became the global standard for mobile cellular communications, with over 2 billion GSM subscribers globally in 2006, far above its competing standard,CDMA.[6]Its share reached over 90% market share by the mid-2010s, and operating in over 219 countries and territories.[2]The specifications and maintenance of GSM passed over to the3GPPbody in 2000,[7]which at the time developed third-generation (3G)UMTSstandards, followed by the fourth-generation (4G) LTE Advanced and the fifth-generation5Gstandards, which do not form part of the GSM standard. Beginning in the late 2010s, various carriers worldwidestarted to shut down their GSM networks; nevertheless, as a result of the network's widespread use, the acronym "GSM" is still used as a generic term for the plethora ofGmobile phone technologies evolved from it or mobile phones itself.
In 1983, work began to develop a European standard for digital cellular voice telecommunications when theEuropean Conference of Postal and Telecommunications Administrations(CEPT) set up theGroupe Spécial Mobile(GSM) committee and later provided a permanent technical-support group based inParis. Five years later, in 1987, 15 representatives from 13 European countries signed amemorandum of understandinginCopenhagento develop and deploy a common cellular telephone system across Europe, and EU rules were passed to make GSM a mandatory standard.[8]The decision to develop a continental standard eventually resulted in a unified, open, standard-based network which was larger than that in the United States.[9][10][11][12]
In February 1987 Europe produced the first agreed GSM Technical Specification. Ministers fromthe four big EU countries[clarification needed]cemented their political support for GSM with the Bonn Declaration on Global Information Networks in May and the GSMMoUwas tabled for signature in September. The MoU drew in mobile operators from across Europe to pledge to invest in new GSM networks to an ambitious common date.
In this short 38-week period the whole of Europe (countries and industries) had been brought behind GSM in a rare unity and speed guided by four public officials: Armin Silberhorn (Germany), Stephen Temple (UK),Philippe Dupuis(France), and Renzo Failli (Italy).[13]In 1989 the Groupe Spécial Mobile committee was transferred from CEPT to theEuropean Telecommunications Standards Institute(ETSI).[10][11][12]The IEEE/RSE awarded toThomas HaugandPhilippe Dupuisthe 2018James Clerk Maxwell medalfor their "leadership in the development of the first international mobile communications standard with subsequent evolution into worldwide smartphone data communication".[14]The GSM (2G) has evolved into 3G, 4G and 5G.
In parallelFranceandGermanysigned a joint development agreement in 1984 and were joined byItalyand theUKin 1986. In 1986, theEuropean Commissionproposed reserving the 900 MHz spectrum band for GSM. It was long believed that the formerFinnishprime ministerHarri Holkerimade the world's first GSM call on 1 July 1991, callingKaarina Suonio(deputy mayor of the city ofTampere) using a network built byNokia and SiemensandoperatedbyRadiolinja.[15]In 2021 a former Nokia engineerPekka Lonkarevealed toHelsingin Sanomatmaking a test call just a couple of hours earlier. "World's first GSM call was actually made by me. I called Marjo Jousinen, in Salo.", Lonka informed.[16]The following year saw the sending of the firstshort messaging service(SMS or "text message") message, andVodafone UKand Telecom Finland signed the first internationalroamingagreement.
Work began in 1991 to expand the GSM standard to the 1800 MHz frequency band and the first 1800 MHz network became operational in the UK by 1993, called the DCS 1800. Also that year,Telstrabecame the first network operator to deploy a GSM network outside Europe and the first practical hand-held GSMmobile phonebecame available.
In 1995 fax, data and SMS messaging services were launched commercially, the first 1900 MHz GSM network became operational in the United States and GSM subscribers worldwide exceeded 10 million. In the same year, theGSM Associationformed. Pre-paid GSM SIM cards were launched in 1996 and worldwide GSM subscribers passed 100 million in 1998.[11]
In 2000 the first commercialGeneral Packet Radio Service(GPRS) services were launched and the first GPRS-compatible handsets became available for sale. In 2001, the first UMTS (W-CDMA) network was launched, a 3G technology that is not part of GSM. Worldwide GSM subscribers exceeded 500 million. In 2002, the firstMultimedia Messaging Service(MMS) was introduced and the first GSM network in the 800 MHz frequency band became operational.Enhanced Data rates for GSM Evolution(EDGE) services first became operational in a network in 2003, and the number of worldwide GSM subscribers exceeded 1 billion in 2004.[11]
By 2005 GSM networks accounted for more than 75% of the worldwide cellular network market, serving 1.5 billion subscribers. In 2005, the firstHSDPA-capable network also became operational. The firstHSUPAnetwork launched in 2007. (High Speed Packet Access(HSPA) and its uplink and downlink versions are 3G technologies, not part of GSM.) Worldwide GSM subscribers exceeded three billion in 2008.[11]
TheGSM Associationestimated in 2011 that technologies defined in the GSM standard served 80% of the mobile market, encompassing more than 5 billion people across more than 212 countries and territories, making GSM the most ubiquitous of the many standards for cellular networks.[17]
GSM is a second-generation (2G) standard employing time-division multiple-access (TDMA) spectrum-sharing, issued by the European Telecommunications Standards Institute (ETSI). The GSM standard does not include the 3GUniversal Mobile Telecommunications System(UMTS),code-division multiple access(CDMA) technology, nor the 4G LTEorthogonal frequency-division multiple access(OFDMA) technology standards issued by the 3GPP.[18]
GSM, for the first time, set a common standard for Europe for wireless networks. It was also adopted by many countries outside Europe. This allowed subscribers to use other GSM networks that have roaming agreements with each other. The common standard reduced research and development costs, since hardware and software could be sold with only minor adaptations for the local market.[19]
TelstrainAustraliashut down its 2G GSM network on 1 December 2016, the first mobile network operator to decommission a GSM network.[20]The second mobile provider to shut down its GSM network (on 1 January 2017) wasAT&T Mobilityfrom theUnited States.[21]OptusinAustraliacompleted the shut down of its 2G GSM network on 1 August 2017, part of the Optus GSM network coveringWestern Australiaand theNorthern Territoryhad earlier in the year been shut down in April 2017.[22]Singaporeshut down 2G services entirely in April 2017.[23]
The network is structured into several discrete sections:
GSM utilizes acellular network, meaning thatcell phonesconnect to it by searching for cells in the immediate vicinity. There are five different cell sizes in a GSM network:
The coverage area of each cell varies according to the implementation environment. Macro cells can be regarded as cells where thebase-stationantennais installed on a mast or a building above average rooftop level. Micro cells are cells whose antenna height is under average rooftop level; they are typically deployed in urban areas. Picocells are small cells whose coverage diameter is a few dozen meters; they are mainly used indoors. Femtocells are cells designed for use in residential orsmall-businessenvironments and connect to atelecommunications service provider's network via abroadband-internetconnection. Umbrella cells are used to cover shadowed regions of smaller cells and to fill in gaps in coverage between those cells.
Cell horizontal radius varies – depending on antenna height,antenna gain, andpropagationconditions – from a couple of hundred meters to several tens of kilometers. The longest distance the GSM specification supports in practical use is 35 kilometres (22 mi). There are also several implementations of the concept of an extended cell,[24]where the cell radius could be double or even more, depending on the antenna system, the type of terrain, and thetiming advance.
GSM supports indoor coverage – achievable by using an indoor picocell base station, or anindoor repeaterwith distributed indoor antennas fed through power splitters – to deliver the radio signals from an antenna outdoors to the separate indoor distributed antenna system. Picocells are typically deployed when significant call capacity is needed indoors, as in shopping centers or airports. However, this is not a prerequisite, since indoor coverage is also provided by in-building penetration of radio signals from any nearby cell.
GSM networks operate in a number of differentcarrier frequencyranges (separated intoGSM frequency rangesfor 2G andUMTS frequency bandsfor 3G), with most2GGSM networks operating in the 900 MHz or 1800 MHz bands. Where these bands were already allocated, the 850 MHz and 1900 MHz bands were used instead (for example in Canada and the United States). In rare cases the 400 and 450 MHz frequency bands are assigned in some countries because they were previously used for first-generation systems.
For comparison, most3Gnetworks in Europe operate in the 2100 MHz frequency band. For more information on worldwide GSM frequency usage, seeGSM frequency bands.
Regardless of the frequency selected by an operator, it is divided intotimeslotsfor individual phones. This allows eight full-rate or sixteen half-rate speech channels perradio frequency. These eight radio timeslots (orburstperiods) are grouped into aTDMAframe. Half-rate channels use alternate frames in the same timeslot. The channel data rate for all8 channelsis270.833 kbit/s,and the frame duration is4.615 ms.[25]TDMA noise is interference that can be heard on speakers near a GSM phone using TDMA, audible as a buzzing sound.[26]
The transmission power in the handset is limited to a maximum of 2 watts inGSM 850/900and1 wattinGSM 1800/1900.
GSM has used a variety of voicecodecsto squeeze 3.1 kHz audio into between 7 and 13 kbit/s. Originally, two codecs, named after the types of data channel they were allocated, were used, calledHalf Rate(6.5 kbit/s) andFull Rate(13 kbit/s). These used a system based onlinear predictive coding(LPC). In addition to being efficient withbitrates, these codecs also made it easier to identify more important parts of the audio, allowing the air interface layer to prioritize and better protect these parts of the signal. GSM was further enhanced in 1997[27]with theenhanced full rate(EFR) codec, a 12.2 kbit/s codec that uses a full-rate channel. Finally, with the development ofUMTS, EFR was refactored into a variable-rate codec calledAMR-Narrowband, which is high quality and robust against interference when used on full-rate channels, or less robust but still relatively high quality when used in good radio conditions on half-rate channel.
One of the key features of GSM is theSubscriber Identity Module, commonly known as aSIM card. The SIM is a detachablesmart card[3]containing a user's subscription information and phone book. This allows users to retain their information after switching handsets. Alternatively, users can change networks or network identities without switching handsets - simply by changing the SIM.
Sometimesmobile network operatorsrestrict handsets that they sell for exclusive use in their own network. This is calledSIM lockingand is implemented by a software feature of the phone. A subscriber may usually contact the provider to remove the lock for a fee, utilize private services to remove the lock, or use software and websites to unlock the handset themselves. It is possible to hack past a phone locked by a network operator.
In some countries and regions (e.g.BrazilandGermany) all phones are sold unlocked due to the abundance of dual-SIM handsets and operators.[28]
GSM was intended to be a secure wireless system. It has considered the user authentication using apre-shared keyandchallenge–response, and over-the-air encryption. However, GSM is vulnerable to different types of attack, each of them aimed at a different part of the network.[29]
Research findings indicate that GSM faces susceptibility to hacking byscript kiddies, a term referring to inexperienced individuals utilizing readily available hardware and software. The vulnerability arises from the accessibility of tools such as a DVB-T TV tuner, posing a threat to both mobile and network users. Despite the term "script kiddies" implying a lack of sophisticated skills, the consequences of their attacks on GSM can be severe, impacting the functionality ofcellular networks. Given that GSM continues to be the main source of cellular technology in numerous countries, its susceptibility to potential threats from malicious attacks is one that needs to be addressed.[30]
The development ofUMTSintroduced an optionalUniversal Subscriber Identity Module(USIM), that uses a longer authentication key to give greater security, as well as mutually authenticating the network and the user, whereas GSM only authenticates the user to the network (and not vice versa). The security model therefore offers confidentiality and authentication, but limited authorization capabilities, and nonon-repudiation.
GSM uses several cryptographic algorithms for security. TheA5/1,A5/2, andA5/3stream ciphersare used for ensuring over-the-air voice privacy. A5/1 was developed first and is a stronger algorithm used within Europe and the United States; A5/2 is weaker and used in other countries. Serious weaknesses have been found in both algorithms: it is possible to break A5/2 in real-time with aciphertext-only attack, and in January 2007, The Hacker's Choice started the A5/1 cracking project with plans to useFPGAsthat allow A5/1 to be broken with arainbow tableattack.[31]The system supports multiple algorithms so operators may replace that cipher with a stronger one.
Since 2000, different efforts have been made in order to crack the A5 encryption algorithms. Both A5/1 and A5/2 algorithms have been broken, and theircryptanalysishas been revealed in the literature. As an example,Karsten Nohldeveloped a number ofrainbow tables(static values which reduce the time needed to carry out an attack) and have found new sources forknown plaintext attacks.[32]He said that it is possible to build "a full GSM interceptor... from open-source components" but that they had not done so because of legal concerns.[33]Nohl claimed that he was able to intercept voice and text conversations by impersonating another user to listen tovoicemail, make calls, or send text messages using a seven-year-oldMotorolacellphone and decryption software available for free online.[34]
GSM usesGeneral Packet Radio Service(GPRS) for data transmissions like browsing the web. The most commonly deployed GPRS ciphers were publicly broken in 2011.[35]
The researchers revealed flaws in the commonly used GEA/1 and GEA/2 (standing for GPRS Encryption Algorithms 1 and 2) ciphers and published the open-source "gprsdecode" software forsniffingGPRS networks. They also noted that some carriers do not encrypt the data (i.e., using GEA/0) in order to detect the use of traffic or protocols they do not like (e.g.,Skype), leaving customers unprotected. GEA/3 seems to remain relatively hard to break and is said to be in use on some more modern networks. If used withUSIMto prevent connections to fake base stations anddowngrade attacks, users will be protected in the medium term, though migration to 128-bit GEA/4 is still recommended.
The first public cryptanalysis of GEA/1 and GEA/2 (also written GEA-1 and GEA-2) was done in 2021. It concluded that although using a 64-bit key, the GEA-1 algorithm actually provides only 40 bits of security, due to a relationship between two parts of the algorithm. The researchers found that this relationship was very unlikely to have happened if it was not intentional. This may have been done in order to satisfy European controls on export of cryptographic programs.[36][37][38]
The GSM systems and services are described in a set of standards governed byETSI, where a full list is maintained.[39]
Severalopen-source softwareprojects exist that provide certain GSM features,[40]such as abase transceiver stationbyOpenBTSdevelops aBase transceiver stationand theOsmocomstack providing various parts.[41]
Patents remain a problem for any open-source GSM implementation, because it is not possible for GNU or any other free software distributor to guarantee immunity from all lawsuits by the patent holders against the users. Furthermore, new features are being added to the standard all the time which means they have patent protection for a number of years.[citation needed]
The original GSM implementations from 1991 may now be entirely free of patent encumbrances, however patent freedom is not certain due to the United States' "first to invent" system that was in place until 2012. The "first to invent" system, coupled with "patentterm adjustment" can extend the life of a U.S. patent far beyond 20 years from its priority date. It is unclear at this time whetherOpenBTSwill be able to implement features of that initial specification without limit. As patents subsequently expire, however, those features can be added into the open-source version. As of 2011[update], there have been no lawsuits against users of OpenBTS over GSM use.[citation needed]
|
https://en.wikipedia.org/wiki/Global_System_for_Mobile_Communications
|
TheGlobal System for Mobile Communications(GSM) is a family of standards to describe the protocols for second-generation (2G) digitalcellular networks,[2]as used by mobile devices such asmobile phonesandmobile broadband modems. GSM is also atrade markowned by theGSM Association.[3]"GSM" may also refer to the voice codec initially used in GSM.[4]
2G networks developed as a replacement for first generation (1G) analog cellular networks. The original GSM standard, which was developed by theEuropean Telecommunications Standards Institute(ETSI), originally described a digital, circuit-switched network optimized forfull duplexvoicetelephony, employingtime division multiple access(TDMA) between stations. This expanded over time to includedata communications, first bycircuit-switched transport, then bypacketdata transport via its upgraded standards,GPRSand thenEDGE. GSM exists in various versions based on thefrequency bands used.
GSM was first implemented inFinlandin December 1991.[5]It became the global standard for mobile cellular communications, with over 2 billion GSM subscribers globally in 2006, far above its competing standard,CDMA.[6]Its share reached over 90% market share by the mid-2010s, and operating in over 219 countries and territories.[2]The specifications and maintenance of GSM passed over to the3GPPbody in 2000,[7]which at the time developed third-generation (3G)UMTSstandards, followed by the fourth-generation (4G) LTE Advanced and the fifth-generation5Gstandards, which do not form part of the GSM standard. Beginning in the late 2010s, various carriers worldwidestarted to shut down their GSM networks; nevertheless, as a result of the network's widespread use, the acronym "GSM" is still used as a generic term for the plethora ofGmobile phone technologies evolved from it or mobile phones itself.
In 1983, work began to develop a European standard for digital cellular voice telecommunications when theEuropean Conference of Postal and Telecommunications Administrations(CEPT) set up theGroupe Spécial Mobile(GSM) committee and later provided a permanent technical-support group based inParis. Five years later, in 1987, 15 representatives from 13 European countries signed amemorandum of understandinginCopenhagento develop and deploy a common cellular telephone system across Europe, and EU rules were passed to make GSM a mandatory standard.[8]The decision to develop a continental standard eventually resulted in a unified, open, standard-based network which was larger than that in the United States.[9][10][11][12]
In February 1987 Europe produced the first agreed GSM Technical Specification. Ministers fromthe four big EU countries[clarification needed]cemented their political support for GSM with the Bonn Declaration on Global Information Networks in May and the GSMMoUwas tabled for signature in September. The MoU drew in mobile operators from across Europe to pledge to invest in new GSM networks to an ambitious common date.
In this short 38-week period the whole of Europe (countries and industries) had been brought behind GSM in a rare unity and speed guided by four public officials: Armin Silberhorn (Germany), Stephen Temple (UK),Philippe Dupuis(France), and Renzo Failli (Italy).[13]In 1989 the Groupe Spécial Mobile committee was transferred from CEPT to theEuropean Telecommunications Standards Institute(ETSI).[10][11][12]The IEEE/RSE awarded toThomas HaugandPhilippe Dupuisthe 2018James Clerk Maxwell medalfor their "leadership in the development of the first international mobile communications standard with subsequent evolution into worldwide smartphone data communication".[14]The GSM (2G) has evolved into 3G, 4G and 5G.
In parallelFranceandGermanysigned a joint development agreement in 1984 and were joined byItalyand theUKin 1986. In 1986, theEuropean Commissionproposed reserving the 900 MHz spectrum band for GSM. It was long believed that the formerFinnishprime ministerHarri Holkerimade the world's first GSM call on 1 July 1991, callingKaarina Suonio(deputy mayor of the city ofTampere) using a network built byNokia and SiemensandoperatedbyRadiolinja.[15]In 2021 a former Nokia engineerPekka Lonkarevealed toHelsingin Sanomatmaking a test call just a couple of hours earlier. "World's first GSM call was actually made by me. I called Marjo Jousinen, in Salo.", Lonka informed.[16]The following year saw the sending of the firstshort messaging service(SMS or "text message") message, andVodafone UKand Telecom Finland signed the first internationalroamingagreement.
Work began in 1991 to expand the GSM standard to the 1800 MHz frequency band and the first 1800 MHz network became operational in the UK by 1993, called the DCS 1800. Also that year,Telstrabecame the first network operator to deploy a GSM network outside Europe and the first practical hand-held GSMmobile phonebecame available.
In 1995 fax, data and SMS messaging services were launched commercially, the first 1900 MHz GSM network became operational in the United States and GSM subscribers worldwide exceeded 10 million. In the same year, theGSM Associationformed. Pre-paid GSM SIM cards were launched in 1996 and worldwide GSM subscribers passed 100 million in 1998.[11]
In 2000 the first commercialGeneral Packet Radio Service(GPRS) services were launched and the first GPRS-compatible handsets became available for sale. In 2001, the first UMTS (W-CDMA) network was launched, a 3G technology that is not part of GSM. Worldwide GSM subscribers exceeded 500 million. In 2002, the firstMultimedia Messaging Service(MMS) was introduced and the first GSM network in the 800 MHz frequency band became operational.Enhanced Data rates for GSM Evolution(EDGE) services first became operational in a network in 2003, and the number of worldwide GSM subscribers exceeded 1 billion in 2004.[11]
By 2005 GSM networks accounted for more than 75% of the worldwide cellular network market, serving 1.5 billion subscribers. In 2005, the firstHSDPA-capable network also became operational. The firstHSUPAnetwork launched in 2007. (High Speed Packet Access(HSPA) and its uplink and downlink versions are 3G technologies, not part of GSM.) Worldwide GSM subscribers exceeded three billion in 2008.[11]
TheGSM Associationestimated in 2011 that technologies defined in the GSM standard served 80% of the mobile market, encompassing more than 5 billion people across more than 212 countries and territories, making GSM the most ubiquitous of the many standards for cellular networks.[17]
GSM is a second-generation (2G) standard employing time-division multiple-access (TDMA) spectrum-sharing, issued by the European Telecommunications Standards Institute (ETSI). The GSM standard does not include the 3GUniversal Mobile Telecommunications System(UMTS),code-division multiple access(CDMA) technology, nor the 4G LTEorthogonal frequency-division multiple access(OFDMA) technology standards issued by the 3GPP.[18]
GSM, for the first time, set a common standard for Europe for wireless networks. It was also adopted by many countries outside Europe. This allowed subscribers to use other GSM networks that have roaming agreements with each other. The common standard reduced research and development costs, since hardware and software could be sold with only minor adaptations for the local market.[19]
TelstrainAustraliashut down its 2G GSM network on 1 December 2016, the first mobile network operator to decommission a GSM network.[20]The second mobile provider to shut down its GSM network (on 1 January 2017) wasAT&T Mobilityfrom theUnited States.[21]OptusinAustraliacompleted the shut down of its 2G GSM network on 1 August 2017, part of the Optus GSM network coveringWestern Australiaand theNorthern Territoryhad earlier in the year been shut down in April 2017.[22]Singaporeshut down 2G services entirely in April 2017.[23]
The network is structured into several discrete sections:
GSM utilizes acellular network, meaning thatcell phonesconnect to it by searching for cells in the immediate vicinity. There are five different cell sizes in a GSM network:
The coverage area of each cell varies according to the implementation environment. Macro cells can be regarded as cells where thebase-stationantennais installed on a mast or a building above average rooftop level. Micro cells are cells whose antenna height is under average rooftop level; they are typically deployed in urban areas. Picocells are small cells whose coverage diameter is a few dozen meters; they are mainly used indoors. Femtocells are cells designed for use in residential orsmall-businessenvironments and connect to atelecommunications service provider's network via abroadband-internetconnection. Umbrella cells are used to cover shadowed regions of smaller cells and to fill in gaps in coverage between those cells.
Cell horizontal radius varies – depending on antenna height,antenna gain, andpropagationconditions – from a couple of hundred meters to several tens of kilometers. The longest distance the GSM specification supports in practical use is 35 kilometres (22 mi). There are also several implementations of the concept of an extended cell,[24]where the cell radius could be double or even more, depending on the antenna system, the type of terrain, and thetiming advance.
GSM supports indoor coverage – achievable by using an indoor picocell base station, or anindoor repeaterwith distributed indoor antennas fed through power splitters – to deliver the radio signals from an antenna outdoors to the separate indoor distributed antenna system. Picocells are typically deployed when significant call capacity is needed indoors, as in shopping centers or airports. However, this is not a prerequisite, since indoor coverage is also provided by in-building penetration of radio signals from any nearby cell.
GSM networks operate in a number of differentcarrier frequencyranges (separated intoGSM frequency rangesfor 2G andUMTS frequency bandsfor 3G), with most2GGSM networks operating in the 900 MHz or 1800 MHz bands. Where these bands were already allocated, the 850 MHz and 1900 MHz bands were used instead (for example in Canada and the United States). In rare cases the 400 and 450 MHz frequency bands are assigned in some countries because they were previously used for first-generation systems.
For comparison, most3Gnetworks in Europe operate in the 2100 MHz frequency band. For more information on worldwide GSM frequency usage, seeGSM frequency bands.
Regardless of the frequency selected by an operator, it is divided intotimeslotsfor individual phones. This allows eight full-rate or sixteen half-rate speech channels perradio frequency. These eight radio timeslots (orburstperiods) are grouped into aTDMAframe. Half-rate channels use alternate frames in the same timeslot. The channel data rate for all8 channelsis270.833 kbit/s,and the frame duration is4.615 ms.[25]TDMA noise is interference that can be heard on speakers near a GSM phone using TDMA, audible as a buzzing sound.[26]
The transmission power in the handset is limited to a maximum of 2 watts inGSM 850/900and1 wattinGSM 1800/1900.
GSM has used a variety of voicecodecsto squeeze 3.1 kHz audio into between 7 and 13 kbit/s. Originally, two codecs, named after the types of data channel they were allocated, were used, calledHalf Rate(6.5 kbit/s) andFull Rate(13 kbit/s). These used a system based onlinear predictive coding(LPC). In addition to being efficient withbitrates, these codecs also made it easier to identify more important parts of the audio, allowing the air interface layer to prioritize and better protect these parts of the signal. GSM was further enhanced in 1997[27]with theenhanced full rate(EFR) codec, a 12.2 kbit/s codec that uses a full-rate channel. Finally, with the development ofUMTS, EFR was refactored into a variable-rate codec calledAMR-Narrowband, which is high quality and robust against interference when used on full-rate channels, or less robust but still relatively high quality when used in good radio conditions on half-rate channel.
One of the key features of GSM is theSubscriber Identity Module, commonly known as aSIM card. The SIM is a detachablesmart card[3]containing a user's subscription information and phone book. This allows users to retain their information after switching handsets. Alternatively, users can change networks or network identities without switching handsets - simply by changing the SIM.
Sometimesmobile network operatorsrestrict handsets that they sell for exclusive use in their own network. This is calledSIM lockingand is implemented by a software feature of the phone. A subscriber may usually contact the provider to remove the lock for a fee, utilize private services to remove the lock, or use software and websites to unlock the handset themselves. It is possible to hack past a phone locked by a network operator.
In some countries and regions (e.g.BrazilandGermany) all phones are sold unlocked due to the abundance of dual-SIM handsets and operators.[28]
GSM was intended to be a secure wireless system. It has considered the user authentication using apre-shared keyandchallenge–response, and over-the-air encryption. However, GSM is vulnerable to different types of attack, each of them aimed at a different part of the network.[29]
Research findings indicate that GSM faces susceptibility to hacking byscript kiddies, a term referring to inexperienced individuals utilizing readily available hardware and software. The vulnerability arises from the accessibility of tools such as a DVB-T TV tuner, posing a threat to both mobile and network users. Despite the term "script kiddies" implying a lack of sophisticated skills, the consequences of their attacks on GSM can be severe, impacting the functionality ofcellular networks. Given that GSM continues to be the main source of cellular technology in numerous countries, its susceptibility to potential threats from malicious attacks is one that needs to be addressed.[30]
The development ofUMTSintroduced an optionalUniversal Subscriber Identity Module(USIM), that uses a longer authentication key to give greater security, as well as mutually authenticating the network and the user, whereas GSM only authenticates the user to the network (and not vice versa). The security model therefore offers confidentiality and authentication, but limited authorization capabilities, and nonon-repudiation.
GSM uses several cryptographic algorithms for security. TheA5/1,A5/2, andA5/3stream ciphersare used for ensuring over-the-air voice privacy. A5/1 was developed first and is a stronger algorithm used within Europe and the United States; A5/2 is weaker and used in other countries. Serious weaknesses have been found in both algorithms: it is possible to break A5/2 in real-time with aciphertext-only attack, and in January 2007, The Hacker's Choice started the A5/1 cracking project with plans to useFPGAsthat allow A5/1 to be broken with arainbow tableattack.[31]The system supports multiple algorithms so operators may replace that cipher with a stronger one.
Since 2000, different efforts have been made in order to crack the A5 encryption algorithms. Both A5/1 and A5/2 algorithms have been broken, and theircryptanalysishas been revealed in the literature. As an example,Karsten Nohldeveloped a number ofrainbow tables(static values which reduce the time needed to carry out an attack) and have found new sources forknown plaintext attacks.[32]He said that it is possible to build "a full GSM interceptor... from open-source components" but that they had not done so because of legal concerns.[33]Nohl claimed that he was able to intercept voice and text conversations by impersonating another user to listen tovoicemail, make calls, or send text messages using a seven-year-oldMotorolacellphone and decryption software available for free online.[34]
GSM usesGeneral Packet Radio Service(GPRS) for data transmissions like browsing the web. The most commonly deployed GPRS ciphers were publicly broken in 2011.[35]
The researchers revealed flaws in the commonly used GEA/1 and GEA/2 (standing for GPRS Encryption Algorithms 1 and 2) ciphers and published the open-source "gprsdecode" software forsniffingGPRS networks. They also noted that some carriers do not encrypt the data (i.e., using GEA/0) in order to detect the use of traffic or protocols they do not like (e.g.,Skype), leaving customers unprotected. GEA/3 seems to remain relatively hard to break and is said to be in use on some more modern networks. If used withUSIMto prevent connections to fake base stations anddowngrade attacks, users will be protected in the medium term, though migration to 128-bit GEA/4 is still recommended.
The first public cryptanalysis of GEA/1 and GEA/2 (also written GEA-1 and GEA-2) was done in 2021. It concluded that although using a 64-bit key, the GEA-1 algorithm actually provides only 40 bits of security, due to a relationship between two parts of the algorithm. The researchers found that this relationship was very unlikely to have happened if it was not intentional. This may have been done in order to satisfy European controls on export of cryptographic programs.[36][37][38]
The GSM systems and services are described in a set of standards governed byETSI, where a full list is maintained.[39]
Severalopen-source softwareprojects exist that provide certain GSM features,[40]such as abase transceiver stationbyOpenBTSdevelops aBase transceiver stationand theOsmocomstack providing various parts.[41]
Patents remain a problem for any open-source GSM implementation, because it is not possible for GNU or any other free software distributor to guarantee immunity from all lawsuits by the patent holders against the users. Furthermore, new features are being added to the standard all the time which means they have patent protection for a number of years.[citation needed]
The original GSM implementations from 1991 may now be entirely free of patent encumbrances, however patent freedom is not certain due to the United States' "first to invent" system that was in place until 2012. The "first to invent" system, coupled with "patentterm adjustment" can extend the life of a U.S. patent far beyond 20 years from its priority date. It is unclear at this time whetherOpenBTSwill be able to implement features of that initial specification without limit. As patents subsequently expire, however, those features can be added into the open-source version. As of 2011[update], there have been no lawsuits against users of OpenBTS over GSM use.[citation needed]
|
https://en.wikipedia.org/wiki/GSM#Security
|
3Grefers to the third-generation ofcellular networktechnology. These networks were rolled out beginning in the early 2000s and represented a significant advancement over the second-generation (2G), particularly in terms of data transfer speeds andmobile internetcapabilities. The major 3G standards areUMTS(developed by3GPP, succeedingGSM) andCDMA2000(developed byQualcomm, succeedingcdmaOne);[1][2]both of these are based on theIMT-2000specifications established by theInternational Telecommunication Union(ITU).
While 2G networks such asGPRSandEDGEsupported limited data services, 3G introduced significantly higher-speed mobile internet and enhancedmultimediacapabilities, in addition to improvedvoicequality.[3]It provided moderate internet speeds suitable for generalweb browsingand multimedia content includingvideo callingandmobile TV,[3]supporting services that provide an information transfer rate of at least 144kbit/s.[4][5]
Later 3G releases, often referred to as 3.5G (HSPA) and 3.75G (HSPA+) as well asEV-DO, introduced important improvements, enabling 3G networks to offermobile broadbandaccess with speeds ranging from severalMbit/sup to 42 Mbit/s.[6]These updates improved the reliability and speed of internet browsing, video streaming, and online gaming, enhancing the overall user experience forsmartphonesandmobile modemsin comparison to earlier 3G technologies. 3G was later succeeded by4Gtechnology, which provided even higher data transfer rates and introduced advancements in network performance.
A new generation of cellular standards has emerged roughly every decade since the introduction of1Gsystems in 1979. Each generation is defined by the introduction of newfrequency bands, higher data rates, and transmission technologies that are not backward-compatible due to the need for significant changes in network architecture and infrastructure.
Several telecommunications companies marketed wireless mobile Internet services as3G, indicating that the advertised service was provided over a 3G wireless network. However, 3G services have largely been supplanted in marketing by 4G and 5G services in most areas of the world. Services advertised as 3G are required to meetIMT-2000technical standards, including standards for reliability and speed (data transfer rates). To meet the IMT-2000 standards, Third-generation mobile networks, or 3G, must maintain minimum consistent Internet speeds of 144 Kbps.[5]However, many services advertised as 3G provide higher speed than the minimum technical requirements for a 3G service.[7]Subsequent 3G releases, denoted3.5Gand3.75G, provided mobile broadband access of severalMbit/sfor smartphones and mobile modems in laptop computers.[8]
3G branded standards:
The 3G systems and radio interfaces are based onspread spectrumradio transmission technology. While theGSM EDGEstandard ("2.9G"),DECTcordless phones andMobile WiMAXstandards formally also fulfill the IMT-2000 requirements and are approved as 3G standards by ITU, these are typically not branded as 3G and are based on completely different technologies.
The common standards complying with the IMT2000/3G standard are:
While DECT cordless phones andMobile WiMAXstandards formally also fulfill the IMT-2000 requirements, they are not usually considered due to their rarity and unsuitability for usage with mobile phones.[9]
The 3G (UMTS and CDMA2000) research and development projects started in 1992. In 1999, ITU approved five radio interfaces for IMT-2000 as a part of the ITU-R M.1457 Recommendation;WiMAXwas added in 2007.[10]
There are evolutionary standards (EDGE and CDMA) that are backward-compatible extensions to pre-existing2Gnetworks as well as revolutionary standards that require all-new network hardware and frequency allocations. The cell phones use UMTS in combination with 2G GSM standards and bandwidths, butdo not support EDGE. The latter group is theUMTSfamily, which consists of standards developed for IMT-2000, as well as the independently developed standardsDECTand WiMAX, which were included because they fit the IMT-2000 definition.
WhileEDGEfulfills the 3G specifications, most GSM/UMTS phones report EDGE ("2.75G") and UMTS ("3G") functionality.[11]
3G technology was the result of research and development work carried out by theInternational Telecommunication Union(ITU) in the early 1980s. 3G specifications and standards were developed in fifteen years. The technical specifications were made available to the public under the name IMT-2000. The communication spectrum between 400 MHz to 3 GHz was allocated for 3G. Both the government and communication companies approved the 3G standard. The first pre-commercial 3G network was launched byNTT DoCoMoin Japan in 1998,[12]branded asFOMA. It was first available in May 2001 as a pre-release (test) ofW-CDMAtechnology. The first commercial launch of 3G was also by NTT DoCoMo in Japan on 1 October 2001, although it was initially somewhat limited in scope;[13][14]broader availability of the system was delayed by apparent concerns over its reliability.[15][16][17][18][19]
The first European pre-commercial network was anUMTSnetwork on theIsle of ManbyManx Telecom, the operator then owned byBritish Telecom, and the first commercial network (also UMTS based W-CDMA) in Europe was opened for business byTelenorin December 2001 with no commercial handsets and thus no paying customers.
The first network to go commercially live was bySK Telecomin South Korea on the CDMA-based1xEV-DOtechnology in January 2002. By May 2002, the second South Korean 3G network was byKTon EV-DO and thus the South Koreans were the first to see competition among 3G operators.
The first commercial United States 3G network was by Monet Mobile Networks, onCDMA20001x EV-DO technology, but the network provider later shut down operations. The second 3G network operator in the US was Verizon Wireless in July 2002, also on CDMA2000 1x EV-DO. AT&T Mobility was also a true 3GUMTSnetwork, having completed its upgrade of the 3G network toHSUPA.
The first commercial United Kingdom 3G network was started byHutchison Telecomwhich was originally behindOrange S.A.[20]In 2003, it announced first commercial third generation or 3G mobile phone network in the UK.
The first pre-commercial demonstration network in the southern hemisphere was built inAdelaide, South Australia, by m.Net Corporation in February 2002 using UMTS on 2100 MHz. This was a demonstration network for the 2002 IT World Congress. The first commercial 3G network was launched by Hutchison Telecommunications branded asThreeor "3" in June 2003.[21]
InIndia, on 11 December 2008, the first 3G mobile and internet services were launched by a state-owned company, Mahanagar Telecom Nigam Limited (MTNL), within the metropolitan cities of Delhi and Mumbai. After MTNL, another state-owned company, Bharat Sanchar Nigam Limited (BSNL), began deploying the 3G networks country-wide.
Emtellaunched the first 3G network in Africa.[22]
Japanwas one of the first countries to adopt 3G, the reason being the process of 3G spectrum allocation, which in Japan was awarded without much upfront cost. The frequency spectrum was allocated in the US and Europe based on auctioning, thereby requiring a huge initial investment for any company wishing to provide 3G services. European companies collectively paid over 100 billion dollars in their spectrum auctions.[23]
Nepal Telecomadopted 3G Service for the first time in southernAsia. However, its 3G was relatively slow to be adopted inNepal. In some instances, 3G networks do not use the same radio frequencies as2G, so mobile operators must build entirely new networks and license entirely new frequencies, especially to achieve high data transmission rates. Other countries' delays were due to the expenses of upgrading transmission hardware, especially forUMTS, whose deployment required the replacement of most broadcast towers. Due to these issues and difficulties with deployment, many carriers could not or delayed the acquisition of these updated capabilities.
In December 2007, 190 3G networks were operating in 40 countries and 154HSDPAnetworks were operating in 71 countries, according to the Global Mobile Suppliers Association (GSA). In Asia, Europe, Canada, and the US, telecommunication companies useW-CDMAtechnology with the support of around 100 terminal designs to operate 3G mobile networks.
The roll-out of 3G networks was delayed by the enormous costs of additional spectrum licensing fees in some countries. The license fees in some European countries were particularly high, bolstered by government auctions of a limited number of licenses andsealed bid auctions, and initial excitement over 3G's potential. This led to atelecoms crashthat ran concurrently with similar crashes in thefibre-opticanddot.comfields.
The 3G standard is perhaps well known because of a massive expansion of the mobile communications market post-2G and advances of the consumer mobile phone. An especially notable development during this time is thesmartphone(for example, theiPhone, and theAndroidfamily), combining the abilities of a PDA with a mobile phone, leading to widespread demand for mobile internet connectivity. 3G has also introduced the term "mobile broadband" because its speed and capability made it a viable alternative for internet browsing, and USB Modems connecting to 3G networks, and now4Gbecame increasingly common.
By June 2007, the 200 millionth 3G subscriber had been connected of which 10 million were inNepaland 8.2 million inIndia. This 200 millionth is only 6.7% of the 3 billion mobile phone subscriptions worldwide. (When counting CDMA2000 1x RTT customers—max bitrate 72% of the 200 kbit/s which defines 3G—the total size of the nearly-3G subscriber base was 475 million as of June 2007, which was 15.8% of all subscribers worldwide.) In the countries where 3G was launched first – Japan and South Korea – 3G penetration is over 70%.[24]In Europe the leading country[when?]for 3G penetration is Italy with a third of its subscribers migrated to 3G. Other leading countries[when?]for 3G use includeNepal,UK,Austria,AustraliaandSingaporeat the 32% migration level.
According to ITU estimates,[25]as of Q4 2012 there were 2096 million active mobile-broadband[vague]subscribers worldwide out of a total of 6835 million subscribers—this is just over 30%. About half the mobile-broadband subscriptions are for subscribers in developed nations, 934 million out of 1600 million total, well over 50%. Note however that there is a distinction between a phone with mobile-broadband connectivity and asmart phonewith a large display and so on—although according[26]to the ITU and informatandm.com the US has 321 million mobile subscriptions, including 256 million that are 3G or 4G, which is both 80% of the subscriber base and 80% of the US population, according[25]to ComScore just a year earlier in Q4 2011 only about 42% of people surveyed in the US reported they owned a smart phone. In Japan, 3G penetration was similar at about 81%, but smart phone ownership was lower at about 17%.[25]InChina, there were 486.5 million 3G subscribers in June 2014,[27]in a population of 1,385,566,537 (2013 UN estimate).
Since the increasing adoption of4Gnetworks across the globe, 3G use has been in decline. Several operators around the world have already or are in the process of shutting down their 3G networks (seetable below). In several places, 3G is being shut down while its older predecessor 2G is being kept in operation;VodafoneUK is doing this, citing 2G's usefulness as a low-power fallback.[28]EEin the UK, plans to switch off their 3G networks in early 2024.[29]In the US,Verizonshutdown their 3G services on 31 December 2022,[30]T-Mobile shut downSprint's networks on 31 March 2022 and shutdown their main networks on 1 July 2022,[31]andAT&Thas done so on 22 February 2022.[32]
Currently 3G around the world is declining in availability and support. Technology that depends on 3G for usage are becoming inoperable in many places. For example, theEuropean Unionplans to ensure that member countries maintain 2G networks as a fallback[citation needed], so 3G devices that are backwards compatible with 2G frequencies can continue to be used. However, in countries that plan to decommission 2G networks or have already done so as well, such as the United States and Singapore, devices supporting only 3G and backwards compatible with 2G are becoming inoperable.[33]As of February 2022, less than 1% of cell phone customers in the United States used 3G; AT&T offered free replacement devices to some customers in the run-up to its shutdown.[34]
It has been estimated that there are almost 8,000 patents declared essential (FRAND) related to the 483 technical specifications which form the3GPPand3GPP2standards.[35][36]Twelve companies accounted in 2004 for 90% of the patents (Qualcomm,Ericsson,Nokia,Motorola,Philips,NTT DoCoMo,Siemens,Mitsubishi,Fujitsu,Hitachi,InterDigital, andMatsushita).
Even then, some patentsessentialto 3G might not have been declared by their patent holders. It is believed thatNortelandLucenthave undisclosed patents essential to these standards.[36]
Furthermore, the existing 3G Patent Platform Partnership Patent pool has little impact onFRANDprotection because it excludes the four largest patent owners for 3G.[37][38]
ITU has not provided a clear[39][vague]definition of the data rate that users can expect from 3G equipment or providers. Thus users sold 3G service may not be able to point to a standard and say that the rates it specifies are not being met. While stating in commentary that "it is expected that IMT-2000 will provide higher transmission rates: a minimum data rate of 2 Mbit/s for stationary or walking users, and 348 kbit/s in a moving vehicle,"[40]the ITU does not actually clearly specify minimum required rates, nor required average rates, nor what modes[clarification needed]of the interfaces qualify as 3G, so various[vague]data rates are sold as '3G' in the market.
In a market implementation, 3G downlink data speeds defined by telecom service providers vary depending on the underlying technology deployed; up to 384 kbit/s for UMTS (WCDMA), up to 7.2 Mbit/sec for HSPA, and a theoretical maximum of 21.1 Mbit/s for HSPA+ and 42.2 Mbit/s for DC-HSPA+ (technically 3.5G, but usually clubbed under the tradename of 3G).[citation needed]
3G networks offer greater security than their 2G predecessors. By allowing the UE (User Equipment) to authenticate the network it is attaching to, the user can be sure the network is the intended one and not an impersonator.[41]
3G networks use theKASUMIblock cipherinstead of the olderA5/1stream cipher. However, a number of serious weaknesses in the KASUMI cipher have been identified.
In addition to the 3G network infrastructure security, end-to-end security is offered when application frameworks such as IMS are accessed, although this is not strictly a 3G property.
The bandwidth and location capabilities introduced by 3G networks enabled a wide range of applications that were previously impractical or unavailable on 2G networks. Among the most significant advancements was the ability to perform data-intensive tasks, such as browsing the internet seamlessly while on the move, as well as engaging in other activities that benefited from faster data speeds and enhanced reliability.
Beyond personal communication, 3G networks supported applications in various fields, includingmedical devices,fire alarms, and ankle monitors. This versatility marked a significant milestone in cellular communications, as 3G became the first network to enable such a broad range of use cases.[42]By expanding its functionality beyond traditionalmobile phoneusage, 3G set the stage for the integration ofcellular networksinto a wide array of technologies and services, paving the way for further advancements with subsequent generations of mobile networks.
Both3GPPand3GPP2are working on the extensions to 3G standards that are based on anall-IP network infrastructureand using advanced wireless technologies such asMIMO. These specifications already display features characteristic forIMT-Advanced(4G), the successor of 3G. However, falling short of the bandwidth requirements for 4G (which is 1 Gbit/s for stationary and 100 Mbit/s for mobile operation), these standards are classified as 3.9G or Pre-4G.
3GPP plans to meet the 4G goals withLTE Advanced, whereas Qualcomm has haltedUMBdevelopment in favour of the LTE family.[43]
On 14 December 2009,TeliaSoneraannounced in an official press release that "We are very proud to be the first operator in the world to offer our customers 4G services."[44]With the launch of their LTE network, initially they are offeringpre-4G(orbeyond 3G) services in Stockholm, Sweden and Oslo, Norway.
|
https://en.wikipedia.org/wiki/3G#Security
|
"Bluetoothis a short-rangewirelesstechnology standard that is used for exchanging data between fixed(...TRUNCATED) |
https://en.wikipedia.org/wiki/Bluetooth#Security
|
"Wired Equivalent Privacy(WEP) is an obsolete, severely flawedsecurityalgorithm for 802.11wireless n(...TRUNCATED) |
https://en.wikipedia.org/wiki/Wired_Equivalent_Privacy#Authentication
|
End of preview. Expand
in Data Studio
Documents from the first scraping approach
- Downloads last month
- 5