Questions tagged [generating-functions]
11 questions
4
votes
1 answer
Existence of isomorphism between two algebraic data types that have the same "generating function"
This is just a curiosity I wanted to know the answer for but don't really know how to tackle. Also any advice on how to make this question more specific
Exposition
For the following examples, consider the following datatypes:
'a list = [] | ::…
Alan Abraham
- 142
- 7
3
votes
1 answer
How to solve this recurrence involving binomial coefficients?
How to solve the following recurrence involving binomial coefficients, where $c$ is a constant non-negative integer, and $n$ and $k$ are non-negative integers ($n \ge k \ge 0$)?
$$
A(n,k) = A(n-1,k) + A(n-1,k-1) + c, \\
A(n,0) = 1, A(n,n) = 1
$$
My…
hengxin
- 9,671
- 3
- 37
- 75
2
votes
1 answer
Advantage of using generating functions in analyzing an algorithm
I'm reading through the first chapters of "Introduction to the analysis of algorithm" by Sedgewick. I wasn't familiar with the use of generating functions, and complex analysis in general to analyse algorithms. I do understand the use of the tool is…
user8469759
- 723
- 3
- 19
2
votes
1 answer
Solving the recurrence $ T(n) = \dfrac{T(n-1) + T(n-3)} {T(n-2)} $
What's the (asymptotic) solution of the following recurrence?
$$ T(n) = \frac{T(n-1) + T(n-3)} {T(n-2)}. $$
I tried to solve this with generating functions to find an accurate bound.
user128010
1
vote
1 answer
Obtaining a recurrence from a rational generating function
Looking at some Generating functions of a series, I have conjectured -
If $G(x) \ =\ \frac{1}{1-x^{t_1}-x^{t_2}-...-x^{t_n}}$, then the recurrence equation of the the series is -
$a_n = a_{n-t_1}+a_{n-t_2}+...+a_{n-t_n}$
How can I prove or disprove…
Mr. Sigma.
- 1,301
- 1
- 16
- 38
1
vote
1 answer
Number of ways to make change in o(k), where k is number of coins
Godd afternoon,
We have set C of k coins; For example C = (2, 3)
We have positive integer n.
In how many ways we can represent n using those coins?
Example:
If n = 12; C = (2, 3) we can represent 12 as 3+3+3+3, 3+3+2+2+2 or 2+2+2+2+2+2, so in…
yomol777
- 111
- 3
1
vote
0 answers
How to compute the general term formula for the number of full binary tree heaps that can be formed with distinct elements?
The number of possible heaps that are full binary trees of height $h$ and can be formed with ($n = 2^h - 1$) distinct elements can be computed by recursion:
$$ a_h = {2^h - 2 \choose 2^{h - 1} - 1} a_{h - 1}^2 $$
How to compute the general term…
Shreck Ye
- 145
- 5
0
votes
0 answers
How to quickly compute power of matrix of generating functions?
I have a 2x2 matrix of generating functions which I want to raise to a large power $m$:
$$\begin{bmatrix}
a(x) & b(x)\\
c(x) & d(x)
\end{bmatrix}^m.$$
I then want to retrieve the first $n$ coefficients of each of the resulting generating functions.…
Joseph Camacho
- 101
- 1
0
votes
0 answers
Data structure for arguments in Arrow functions in JS
As per the rules of JS, Arrow functions don't have an argument Object, like a regular function inside JS.
But it is also true, that we can pass arguments to the Arrow functions like any other functions.
What is the data structure at play here, if…
0
votes
1 answer
How does one define transcendental numbers (such as Pi) in theory of general recursive functions
On a turing machine and in the lambda calculus one can define transcendental numbers such as Pi, the golden ratio, etc.
These are computatible functions with 0-arity that never terminate.
In the theory of general recursive functions (which also…
RFV
- 141
- 6
-2
votes
2 answers
Are mathematical functions used in computer science?
Well, I know the difference between functions used in math and C language. But what are those specific areas where mathematical functions are used?
Bilal Sheikh
- 7
- 4