File: ch11s10.html

package info (click to toggle)
genius 1.0.27-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, sid, trixie
  • size: 25,308 kB
  • sloc: ansic: 75,620; xml: 71,565; sh: 4,445; makefile: 1,927; lex: 523; yacc: 298; perl: 54
file content (130 lines) | stat: -rw-r--r-- 14,907 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>Kombinatorik</title><meta name="generator" content="DocBook XSL Stylesheets Vsnapshot"><link rel="home" href="index.html" title="Genius-Handbuch"><link rel="up" href="ch11.html" title="Chapter 11. Liste der GEL-Funktionen"><link rel="prev" href="ch11s09.html" title="Lineare Algebra"><link rel="next" href="ch11s11.html" title="Analysis"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Kombinatorik</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ch11s09.html">Prev</a> </td><th width="60%" align="center">Chapter 11. Liste der GEL-Funktionen</th><td width="20%" align="right"> <a accesskey="n" href="ch11s11.html">Next</a></td></tr></table><hr></div><div class="sect1"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="genius-gel-function-list-combinatorics"></a>Kombinatorik</h2></div></div></div><div class="variablelist"><dl class="variablelist"><dt><span lang="en" class="term"><a name="gel-function-Catalan"></a>Catalan</span></dt><dd><pre class="synopsis">Catalan (n)</pre><p lang="en">Get <code class="varname">n</code>th Catalan number.</p><p lang="en">
	    See
	    <a class="ulink" href="http://planetmath.org/CatalanNumbers" target="_top">Planetmath</a> for more information.
          </p></dd><dt><span lang="en" class="term"><a name="gel-function-Combinations"></a>Combinations</span></dt><dd><pre class="synopsis">Combinations (k,n)</pre><p lang="en">Get all combinations of k numbers from 1 to n as a vector of vectors.
	  (See also <a class="link" href="ch11s10.html#gel-function-NextCombination">NextCombination</a>)
</p><p lang="en">
	    See
	    <a class="ulink" href="https://en.wikipedia.org/wiki/Combination" target="_top">Wikipedia</a> for more information.
	  </p></dd><dt><span lang="en" class="term"><a name="gel-function-DoubleFactorial"></a>DoubleFactorial</span></dt><dd><pre class="synopsis">DoubleFactorial (n)</pre><p lang="en">Double factorial: <strong class="userinput"><code>n(n-2)(n-4)...</code></strong></p><p lang="en">
	    See
	    <a class="ulink" href="http://planetmath.org/DoubleFactorial" target="_top">Planetmath</a> for more information.
          </p></dd><dt><span lang="en" class="term"><a name="gel-function-Factorial"></a>Factorial</span></dt><dd><pre class="synopsis">Factorial (n)</pre><p lang="en">Factorial: <strong class="userinput"><code>n(n-1)(n-2)...</code></strong></p><p lang="en">
	    See
	    <a class="ulink" href="http://planetmath.org/Factorial" target="_top">Planetmath</a> for more information.
          </p></dd><dt><span lang="en" class="term"><a name="gel-function-FallingFactorial"></a>FallingFactorial</span></dt><dd><pre class="synopsis">FallingFactorial (n,k)</pre><p lang="en">Falling factorial: <strong class="userinput"><code>(n)_k = n(n-1)...(n-(k-1))</code></strong></p><p lang="en">
	    See
	    <a class="ulink" href="http://planetmath.org/FallingFactorial" target="_top">Planetmath</a> for more information.
          </p></dd><dt><span lang="en" class="term"><a name="gel-function-Fibonacci"></a>Fibonacci</span></dt><dd><pre class="synopsis">Fibonacci (x)</pre><p lang="en">Aliases: <code class="function">fib</code></p><p lang="en">
	    Calculate <code class="varname">n</code>th Fibonacci number.  That
	    is the number defined recursively by
	    <strong class="userinput"><code>Fibonacci(n) = Fibonacci(n-1) + Fibonacci(n-2)</code></strong>
	    and 
	    <strong class="userinput"><code>Fibonacci(1) = Fibonacci(2) = 1</code></strong>.
	  </p><p lang="en">
	    See
	    <a class="ulink" href="https://en.wikipedia.org/wiki/Fibonacci_number" target="_top">Wikipedia</a> or
	    <a class="ulink" href="http://planetmath.org/FibonacciSequence" target="_top">Planetmath</a> or
	    <a class="ulink" href="http://mathworld.wolfram.com/FibonacciNumber.html" target="_top">Mathworld</a> for more information.
	  </p></dd><dt><span lang="en" class="term"><a name="gel-function-FrobeniusNumber"></a>FrobeniusNumber</span></dt><dd><pre class="synopsis">FrobeniusNumber (v,arg...)</pre><p lang="en">
	    Calculate the Frobenius number.  That is calculate largest
	    number that cannot be given as a non-negative integer linear
	    combination of a given vector of non-negative integers.
	    The vector can be given as separate numbers or a single vector.
	    All the numbers given should have GCD of 1.
	  </p><p lang="en">
	    See
	    <a class="ulink" href="https://en.wikipedia.org/wiki/Coin_problem" target="_top">Wikipedia</a> or
	    <a class="ulink" href="http://mathworld.wolfram.com/FrobeniusNumber.html" target="_top">Mathworld</a> for more information.
	  </p></dd><dt><span lang="en" class="term"><a name="gel-function-GaloisMatrix"></a>GaloisMatrix</span></dt><dd><pre class="synopsis">GaloisMatrix (combining_rule)</pre><p lang="en">Galois matrix given a linear combining rule (a_1*x_1+...+a_n*x_n=x_(n+1)).</p></dd><dt><span lang="en" class="term"><a name="gel-function-GreedyAlgorithm"></a>GreedyAlgorithm</span></dt><dd><pre lang="en" class="synopsis">GreedyAlgorithm (n,v)</pre><p lang="en">
	    Find the vector <code class="varname">c</code> of non-negative integers
	    such that taking the dot product with <code class="varname">v</code> is
	    equal to n.  If not possible returns <code class="constant">null</code>.  <code class="varname">v</code>
	    should be given sorted in increasing order and should consist
	    of non-negative integers.
	  </p><p lang="en">
	    See
	    <a class="ulink" href="https://en.wikipedia.org/wiki/Greedy_algorithm" target="_top">Wikipedia</a> or
	    <a class="ulink" href="http://mathworld.wolfram.com/GreedyAlgorithm.html" target="_top">Mathworld</a> for more information.
	  </p></dd><dt><span lang="en" class="term"><a name="gel-function-HarmonicNumber"></a>HarmonicNumber</span></dt><dd><pre class="synopsis">HarmonicNumber (n,r)</pre><p lang="en">Aliases: <code class="function">HarmonicH</code></p><p lang="en">Harmonic Number, the <code class="varname">n</code>th harmonic number of order <code class="varname">r</code>.
	        That is, it is the sum of <strong class="userinput"><code>1/k^r</code></strong> for <code class="varname">k</code>
		from 1 to n.  Equivalent to <strong class="userinput"><code>sum k = 1 to n do 1/k^r</code></strong>.</p><p lang="en">
	    See
	    <a class="ulink" href="https://en.wikipedia.org/wiki/Harmonic_number" target="_top">Wikipedia</a> for more information.
	  </p></dd><dt><span lang="en" class="term"><a name="gel-function-Hofstadter"></a>Hofstadter</span></dt><dd><pre class="synopsis">Hofstadter (n)</pre><p lang="en">Hofstadter's function q(n) defined by q(1)=1, q(2)=1, q(n)=q(n-q(n-1))+q(n-q(n-2)).</p><p lang="en">
	    See
	    <a class="ulink" href="https://en.wikipedia.org/wiki/Hofstadter_sequence" target="_top">Wikipedia</a> for more information.
	    The sequence is <a class="ulink" href="https://oeis.org/A005185" target="_top">A005185 in OEIS</a>.
	  </p></dd><dt><span lang="en" class="term"><a name="gel-function-LinearRecursiveSequence"></a>LinearRecursiveSequence</span></dt><dd><pre class="synopsis">LinearRecursiveSequence (seed_values,combining_rule,n)</pre><p lang="en">Compute linear recursive sequence using Galois stepping.</p></dd><dt><span lang="en" class="term"><a name="gel-function-Multinomial"></a>Multinomial</span></dt><dd><pre class="synopsis">Multinomial (v,arg...)</pre><p lang="en">Calculate multinomial coefficients.  Takes a vector of
	    <code class="varname">k</code>
	    non-negative integers and computes the multinomial coefficient.
	    This corresponds to the coefficient in the homogeneous polynomial
	    in <code class="varname">k</code> variables with the corresponding powers.
	  </p><p lang="en">
	    The formula for <strong class="userinput"><code>Multinomial(a,b,c)</code></strong>
	    can be written as:
</p><pre lang="en" class="programlisting">(a+b+c)! / (a!b!c!)
</pre><p lang="en">
	    In other words, if we would have only two elements, then
<strong class="userinput"><code>Multinomial(a,b)</code></strong> is the same thing as
<strong class="userinput"><code>Binomial(a+b,a)</code></strong> or
<strong class="userinput"><code>Binomial(a+b,b)</code></strong>.
	  </p><p lang="en">
	    See
	    <a class="ulink" href="https://en.wikipedia.org/wiki/Multinomial_theorem" target="_top">Wikipedia</a>,
	    <a class="ulink" href="http://planetmath.org/MultinomialTheorem" target="_top">Planetmath</a>, or
	    <a class="ulink" href="http://mathworld.wolfram.com/MultinomialCoefficient.html" target="_top">Mathworld</a> for more information.
	  </p></dd><dt><span lang="en" class="term"><a name="gel-function-NextCombination"></a>NextCombination</span></dt><dd><pre class="synopsis">NextCombination (v,n)</pre><p lang="en">Get combination that would come after v in call to
combinations, first combination should be <strong class="userinput"><code>[1:k]</code></strong>.  This
function is useful if you have many combinations to go through and you don't
want to waste memory to store them all.
	  </p><p lang="en">
	    For example with Combinations you would normally write a loop like:
          </p><pre lang="en" class="screen"><strong class="userinput"><code>for n in Combinations (4,6) do (
  SomeFunction (n)
);</code></strong>
</pre><p lang="en">
	    But with NextCombination you would write something like:
          </p><pre lang="en" class="screen"><strong class="userinput"><code>n:=[1:4];
do (
  SomeFunction (n)
) while not IsNull(n:=NextCombination(n,6));</code></strong>
</pre><p lang="en">
	  See also <a class="link" href="ch11s10.html#gel-function-Combinations">Combinations</a>.
	  </p><p lang="en">
	    See
	    <a class="ulink" href="https://en.wikipedia.org/wiki/Combination" target="_top">Wikipedia</a> for more information.
	  </p></dd><dt><span lang="en" class="term"><a name="gel-function-Pascal"></a>Pascal</span></dt><dd><pre class="synopsis">Pascal (i)</pre><p lang="en">Get the Pascal's triangle as a matrix.  This will return
	  an <code class="varname">i</code>+1 by <code class="varname">i</code>+1 lower diagonal
	  matrix that is the Pascal's triangle after <code class="varname">i</code>
	  iterations.</p><p lang="en">
	    See
	    <a class="ulink" href="http://planetmath.org/PascalsTriangle" target="_top">Planetmath</a> for more information.
          </p></dd><dt><span lang="en" class="term"><a name="gel-function-Permutations"></a>Permutations</span></dt><dd><pre class="synopsis">Permutations (k,n)</pre><p lang="en">Get all permutations of <code class="varname">k</code> numbers from 1 to <code class="varname">n</code> as a vector of vectors.</p><p lang="en">
	    See
	    <a class="ulink" href="http://mathworld.wolfram.com/Permutation.html" target="_top">Mathworld</a> or
	    <a class="ulink" href="https://en.wikipedia.org/wiki/Permutation" target="_top">Wikipedia</a> for more information.
	  </p></dd><dt><span lang="en" class="term"><a name="gel-function-RisingFactorial"></a>RisingFactorial</span></dt><dd><pre class="synopsis">RisingFactorial (n,k)</pre><p lang="en">Aliases: <code class="function">Pochhammer</code></p><p lang="en">(Pochhammer) Rising factorial: (n)_k = n(n+1)...(n+(k-1)).</p><p lang="en">
	    See
	    <a class="ulink" href="http://planetmath.org/RisingFactorial" target="_top">Planetmath</a> for more information.
          </p></dd><dt><span lang="en" class="term"><a name="gel-function-StirlingNumberFirst"></a>StirlingNumberFirst</span></dt><dd><pre class="synopsis">StirlingNumberFirst (n,m)</pre><p lang="en">Aliases: <code class="function">StirlingS1</code></p><p lang="en">Stirling number of the first kind.</p><p lang="en">
	    See
	    <a class="ulink" href="http://planetmath.org/StirlingNumbersOfTheFirstKind" target="_top">Planetmath</a> or
	    <a class="ulink" href="http://mathworld.wolfram.com/StirlingNumberoftheFirstKind.html" target="_top">Mathworld</a> for more information.
	  </p></dd><dt><span lang="en" class="term"><a name="gel-function-StirlingNumberSecond"></a>StirlingNumberSecond</span></dt><dd><pre class="synopsis">StirlingNumberSecond (n,m)</pre><p lang="en">Aliases: <code class="function">StirlingS2</code></p><p lang="en">Stirling number of the second kind.</p><p lang="en">
	    See
	    <a class="ulink" href="http://planetmath.org/StirlingNumbersSecondKind" target="_top">Planetmath</a> or
	    <a class="ulink" href="http://mathworld.wolfram.com/StirlingNumberoftheSecondKind.html" target="_top">Mathworld</a> for more information.
	  </p></dd><dt><span lang="en" class="term"><a name="gel-function-Subfactorial"></a>Subfactorial</span></dt><dd><pre class="synopsis">Subfactorial (n)</pre><p lang="en">Subfactorial: n! times sum_{k=0}^n (-1)^k/k!.</p></dd><dt><span lang="en" class="term"><a name="gel-function-Triangular"></a>Triangular</span></dt><dd><pre class="synopsis">Triangular (nth)</pre><p lang="en">Calculate the <code class="varname">n</code>th triangular number.</p><p lang="en">
	    See
	    <a class="ulink" href="http://planetmath.org/TriangularNumbers" target="_top">Planetmath</a> for more information.
          </p></dd><dt><span lang="en" class="term"><a name="gel-function-nCr"></a>nCr</span></dt><dd><pre class="synopsis">nCr (n,r)</pre><p lang="en">Aliases: <code class="function">Binomial</code></p><p lang="en">Calculate combinations, that is, the binomial coefficient.
	        <code class="varname">n</code> can be any real number.</p><p lang="en">
	    See
	    <a class="ulink" href="http://planetmath.org/Choose" target="_top">Planetmath</a> for more information.
          </p></dd><dt><span lang="en" class="term"><a name="gel-function-nPr"></a>nPr</span></dt><dd><pre class="synopsis">nPr (n,r)</pre><p lang="en">Calculate the number of permutations of size
	   <code class="varname">r</code> of numbers from 1 to <code class="varname">n</code>.</p><p lang="en">
	    See
	    <a class="ulink" href="http://mathworld.wolfram.com/Permutation.html" target="_top">Mathworld</a> or
	    <a class="ulink" href="https://en.wikipedia.org/wiki/Permutation" target="_top">Wikipedia</a> for more information.
	  </p></dd></dl></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="ch11s09.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="ch11.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="ch11s11.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Lineare Algebra </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> Analysis</td></tr></table></div></body></html>