Search NKS | Online

21 - 29 of 29 for Binomial
As in other systems based on numbers, nested patterns are not common—though page 1160 shows how they can in principle be achieved with an equation whose solutions satisfy Mod[Binomial[x, y], 2]  1 .
In general, the pattern produced by evolution for t steps is given by NestList[ Inner[f, Prepend[#, 0], Append[#, 0], List] &, {a}, t] so that the first few steps yield {a}, {f[0, a], f[a, 0]}, {f[0, f[0, a]], f[f[0, a], f[a, 0]], f[f[a, 0], 0]}, {f[0, f[0, f[0, a]]], f[f[0, f[0, a]], f[f[0, a], f[a, 0]]], f[f[f[0, a], f[a, 0]], f[f[a, 0], 0]], f[f[f[a, 0], 0], 0]} If f is Flat , however, then the last two lines here become {f[0, 0, a], f[0, a, a, 0], f[a, 0, 0]}, {f[0, 0, 0, a], f[0, 0, a, 0, a, a, 0], f[0, a, a, 0, a, 0, 0], f[a, 0, 0, 0]} and in general the number of a 's that appear in a particular element is given as in Pascal's triangle by a binomial coefficient.
The total number of combinator expressions of successively greater sizes is {2, 4, 16, 80, 448, 2688, 16896, 109824, …} (or in general 2 n Binomial[2n - 2, n - 1]/n ; see page 897 ).
A typical collection of tests described by Donald Knuth in 1968 includes: (1) frequency or equidistribution test (possible elements should occur with equal frequency); (2) serial test (pairs of elements should be equally likely to be in descending and ascending order); (3) gap test (runs of elements all greater or less than some fixed value should have lengths that follow a binomial distribution); (4) poker test (blocks corresponding to possible poker hands should occur with appropriate frequencies); (5) coupon collector's test (runs before complete sets of values are found should have lengths that follow a definite distribution); (6) permutation test (in blocks of elements possible orderings of values should occur equally often); (7) runs up test (runs of monotonically increasing elements should have lengths that follow a definite distribution); (8) maximum-of-t test (maximum values in blocks of elements should follow a power-law distribution).
Fibonacci[n] can be obtained in many ways: • (GoldenRatio n - (-GoldenRatio) -n )/ √ 5 • Round[GoldenRatio n / √ 5 ] • 2 1 - n Coefficient[(1 + √ 5 ) n , √ 5 ] • MatrixPower[{{1, 1}, {1, 0}}, n - 1] 〚 1, 1 〛 • Numerator[NestList[1/(1 + #)&, 1, n]] • Coefficient[Series[1/(1 - t - t 2 ), {t, 0, n}], t n - 1 ] • Sum[Binomial[n - i - 1, i], {i, 0, (n - 1)/2}] • 2 n - 2 - Count[IntegerDigits[Range[0, 2 n - 2 ], 2], {___, 1, 1, ___}] A fast method for evaluating Fibonacci[n] is First[Fold[f, {1, 0, -1}, Rest[IntegerDigits[n, 2]]]] f[{a_, b_, s_}, 0] = {a (a + 2b), s + a (2a - b), 1} f[{a_, b_, s_}, 1] = {-s + (a + b) (a + 2b), a (a + 2b), -1} Fibonacci numbers appear to have first arisen in perhaps 200 BC in work by Pingala on enumerating possible patterns of poetry formed from syllables of two lengths.
(d) (Cantor set) The color of the element at position n is given by If[FreeQ[IntegerDigits[n - 1, 3], 1], 1, 0] , which turns out to be equivalent to If[OddQ[n], Sign[Mod[Binomial[n - 1, (n - 1)/2], 3]], 0, 1] There are 3 t elements after t steps, of which 2 t are black.
Primitive recursive functions are defined to deal with non-negative integers and to be set up by combining the basic functions z = 0 & (zero), s = # + 1 & (successor) and p[i_] := Slot[i] & (projection) using the operations of composition and primitive recursion f[0, y___Integer] := g[y] f[x_Integer, y___Integer] := h[f[x - 1, y], x - 1, y] Plus and Times can then for example be defined as plus[0, y_] = y; plus[x_, y_] := s[plus[x - 1, y]] times[0, y_] = 0; times[x_, y_] := plus[times[x - 1, y], y] Most familiar integer mathematical functions also turn out to be primitive recursive—examples being Power , Mod , Binomial , GCD and Prime .
With r string pairs and n = StringLength[StringJoin[p]] there are 2 n Binomial[n - 1, 2r - 1] possible constraints (assuming no strings of zero length), each being related to at most 8 r!
123