# Tag

Sort by:

### Ball Picking

Consider an infinite repository containing balls of different types. Then the following table summarizes the number of distinct ways in which balls can be picked for four common definitions of "distinct."type of pickingnamesymbol namesymbolordered samples with replacementstringpowerordered sample without replacementpermutationunordered samples with replacementmultisetmultichooseunordered samples without replacementcombinationbinomial coefficient, choose

### Permutation Pattern

Let denote the number of permutations on the symmetric group which avoid as a subpattern, where " contains as a subpattern" is interpreted to mean that there exist such that for ,iff .For example, a permutation contains the pattern (123) iff it has an ascending subsequence of length three. Here, note that members need not actually be consecutive, merely ascending (Wilf 1997). Therefore, of the partitions of , all but (i.e., , , , , and ) contain the pattern (12) (i.e., an increasing subsequence of length two).The following table gives the numbers of pattern-matching permutations of , , ..., numbers for various patterns of length .patternOEISnumber of pattern-matching permutations1A0001421, 2, 6, 24, 120, 720, 5040, ...12A0333121, 5, 23, 119, 719, 5039, 40319, ...A0569861, 10, 78, 588, 4611, 38890, ...1234A1580051, 17, 207, 2279, 24553, ...1324A1580091, 17, 207, 2278, 24527, ...1342A1580061, 17, 208, 2300, 24835, ...The following..

### Eulerian Number

The Eulerian number gives the number of permutations of having permutation ascents (Graham et al. 1994, p. 267). Note that a slightly different definition of Eulerian number is used by Comtet (1974), who defines the Eulerian number (sometimes also denoted ) as the number of permutation runs of length , and hence .The Eulerian numbers are given explicitly by the sum(1)(Comtet 1974, p.  243). The Eulerian numbers satisfy the sum identity(2)as well as Worpitzky's identity(3)Eulerian numbers also arise in the surprising context of integrating the sincfunction, and also in sums of the form(4)(5)where is the polylogarithm function. is therefore given by the coefficient of in(6) has the exponential generating function(7)The Eulerian numbers satisfy the recurrence relation(8)Special cases are given by(9)(10)(11)and summarized in the following table.OEIS, , , ...1A0002950, 1, 4, 11, 26, 57, 120, 247, 502, 1013, ...2A0004600,..

### Euler Zigzag Number

The number of alternating permutations for elements is sometimes called an Euler zigzag number. Denote the number of alternating permutations on elements for which the first element is by . Then and(1)where is an Entringer number.

### Alternating Permutation

An alternating permutation is an arrangement of the elements , ..., such that no element has a magnitude between and is called an alternating (or zigzag) permutation. The determination of the number of alternating permutations for the set of the first integers is known as André's problem.The numbers of alternating permutations on the integers from 1 to for , 2, ... are 1, 2, 4, 10, 32, 122, 544, ... (OEIS A001250). For example, the alternating permutations on integers for small are summarized in the following table.alternating permutations1122, 34, , , 410, , , , ,, , , , For , every alternating permutation can be written either forward or reversed, and so must be an even number . The quantity can be simply computed from the recurrence equation(1)where and pass through all integral numbers such that(2), and(3)The numbers are sometimes called the Euler zigzag numbers, and the first few are given by 1, 1, 1, 2, 5, 16, 61, 272, ... (OEIS A000111).The..

### Euler Number

The Euler numbers, also called the secant numbers or zig numbers, are defined for by(1)(2)where is the hyperbolic secant and sec is the secant. Euler numbers give the number of odd alternating permutations and are related to Genocchi numbers. The base e of the natural logarithm is sometimes known as Euler's number.A different sort of Euler number, the Euler number of a finite complex , is defined by(3)This Euler number is a topological invariant.To confuse matters further, the Euler characteristic is sometimes also called the "Euler number" and numbers produced by the prime-generating polynomial are sometimes called "Euler numbers" (Flannery and Flannery 2000, p. 47). In this work, primes generated by that polynomial are termed Euler primes.Some values of the (secant) Euler numbers are(4)(5)(6)(7)(8)(9)(10)(11)(12)(13)(14)(15)(OEIS A000364).The slightly different convention defined by(16)(17)is..

### Random Permutation

A random permutation is a permutation containing a fixed number of a random selection from a given set of elements. There are two main algorithms for constructing random permutations. The first constructs a vector of random real numbers and uses them as keys to records containing the integers 1 to . The second starts with an arbitrary permutation and then exchanges the th element with a randomly selected one from the first elements for , ..., (Skiena 1990).A random permutation on the integers can be implemented in the Wolfram Language as RandomSample[Range[n]]. A random permutation in the permutation graph pg can be computed using RandomPermutation[pg], and such random permutations by RandomPermutation[pg, n]. random permutations in the symmetric group of order can be computed using RandomPermutation[d, n].There are an average of permutation inversions in a permutation on elements (Skiena 1990, p. 29). The expected number of permutation..

### Tangent Number

The tangent numbers, also called a zag number, andgiven by(1)where is a Bernoulli number, are numbers that can be defined either in terms of a generating function given as the Maclaurin series of or as the numbers of alternating permutations on , 3, 5, 7, ... symbols (where permutations that are the reverses of one another counted as equivalent). The first few for , 2, ... are 1, 2, 16, 272, 7936, ... (OEIS A000182).For example, the reversal-nonequivalent alternating permutations on and 3 numbers are , and , , respectively.The tangent numbers have the generating function(2)(3)(4)Shanks (1967) defines a generalization of the tangent numbers by(5)where is a Dirichlet L-series, giving the special case(6)The following table gives the first few values of for , 2, ....OEIS1A0001821, 2, 16, 272, 7936, ...2A0004641, 11, 361, 24611, ...3A0001912, 46, 3362, 515086, ...4A0003184, 128, 16384, 4456448, ...5A0003204, 272, 55744, 23750912, ...6A0004116,..

### Symmetric Group

The symmetric group of degree is the group of all permutations on symbols. is therefore a permutation group of order and contains as subgroups every group of order .The th symmetric group is represented in the Wolfram Language as SymmetricGroup[n]. Its cycle index can be generated in the Wolfram Language using CycleIndexPolynomial[SymmetricGroup[n], x1, ..., xn]. The number of conjugacy classes of is given , where is the partition function P of . The symmetric group is a transitive group (Holton and Sheehan 1993, p. 27).For any finite group , Cayley's group theorem proves is isomorphic to a subgroup of a symmetric group.The multiplication table for is illustrated above.Let be the usual permutation cycle notation for a given permutation. Then the following table gives the multiplication table for , which has elements.(1)(2)(3)(1)(23)(3)(12)(123)(132)(2)(13)(1)(2)(3)(1)(2)(3)(1)(23)(3)(12)(123)(132)(2)(13)(1)(23)(1)(23)(1)(2)(3)(132)(2)(13)(3)(12)(123)(3)(12)(3)(12)(123)(1)(2)(3)(1)(23)(2)(13)(132)(123)(123)(3)(12)(2)(13)(132)(1)(2)(3)(1)(23)(132)(132)(2)(13)(1)(23)(1)(2)(3)(123)(3)(12)(2)(13)(2)(13)(132)(123)(3)(12)(1)(23)(1)(2)(3)This..

### Permutation Group

A permutation group is a finite group whose elements are permutations of a given set and whose group operation is composition of permutations in . Permutation groups have orders dividing .Two permutations form a group only if one is the identity element and the other is a permutation involution, i.e., a permutation which is its own inverse (Skiena 1990, p. 20). Every permutation group with more than two elements can be written as a product of transpositions.Permutation groups are represented in the Wolfram Language as a set of permutation cycles with PermutationGroup. A set of permutations may be tested to see if it forms a permutation group using PermutationGroupQ[l] in the Wolfram Language package Combinatorica` .Conjugacy classes of elements which are interchangedin a permutation group are called permutation cycles.Examples of permutation groups include the symmetric group (of order ), the alternating group (of order for ),..

### Factorial

The factorial is defined for a positive integer as(1)So, for example, . An older notation for the factorial was written (Mellin 1909; Lewin 1958, p. 19; Dudeney 1970; Gardner 1978; Conway and Guy 1996).The special case is defined to have value , consistent with the combinatorial interpretation of there being exactly one way to arrange zero objects (i.e., there is a single permutation of zero elements, namely the empty set ).The factorial is implemented in the Wolfram Language as Factorial[n] or n!.The triangular number can be regarded as the additive analog of the factorial . Another relationship between factorials and triangular numbers is given by the identity(2)(K. MacMillan, pers. comm., Jan. 21, 2008).The factorial gives the number of ways in which objects can be permuted. For example, , since the six possible permutations of are , , , , , . The first few factorials for , 1, 2, ... are 1, 1, 2, 6, 24, 120, ... (OEIS A000142).The..

### Birthday Problem

Consider the probability that no two people out of a group of will have matching birthdays out of equally possible birthdays. Start with an arbitrary person's birthday, then note that the probability that the second person's birthday is different is , that the third person's birthday is different from the first two is , and so on, up through the th person. Explicitly,(1)(2)But this can be written in terms of factorials as(3)so the probability that two or more people out of a group of do have the same birthday is therefore(4)(5)In general, let denote the probability that a birthday is shared by exactly (and no more) people out of a group of people. Then the probability that a birthday is shared by or more people is given by(6)In general, can be computed using the recurrence relation(7)(Finch 1997). However, the time to compute this recursive function grows exponentially with and so rapidly becomes unwieldy.If 365-day years have been assumed, i.e.,..

### Subfactorial

The th subfactorial (also called the derangement number; Goulden and Jackson 1983, p. 48; Graham et al. 2003, p. 1050) is the number of permutations of objects in which no object appears in its natural place (i.e., "derangements").The term "subfactorial "was introduced by Whitworth (1867 or 1878; Cajori 1993, p. 77). Euler (1809) calculated the first ten terms.The first few values of for , 2, ... are 0, 1, 2, 9, 44, 265, 1854, 14833, ... (OEIS A000166). For example, the only derangements of are and , so . Similarly, the derangements of are , , , , , , , , and , so .Sums and formulas for include(1)(2)(3)(4)where is a factorial, is a binomial coefficient, and is the incomplete gamma function.Subfactorials are implemented in the WolframLanguage as Subfactorial[n].A plot the real and imaginary parts of the subfactorial generalized to any real argument is illustrated above, with the usual integer-valued subfactorial..

Check the price