patternMinor
Is there any algorithm can solve the following equations efficiently?
Viewed 0 times
cantheefficientlyequationsanyalgorithmfollowingsolvethere
Problem
$$ x_1 + x_2 + \cdots +x_n = c_1 $$
$$ \frac{x_1^2}{2} + \frac{x_2^2}{2} + \cdots +\frac{x_n^2}{2} = c_2 $$
$$ \cdots $$
$$ \frac{x_1^n}{n!} + \frac{x_2^n}{n!} + \cdots +\frac{x_n^n}{n!} = c_n $$
$c_1,\cdots,c_n$ are known constants. $x_1 \cdots x_n$ are the unknown variables to solve.
$$ \frac{x_1^2}{2} + \frac{x_2^2}{2} + \cdots +\frac{x_n^2}{2} = c_2 $$
$$ \cdots $$
$$ \frac{x_1^n}{n!} + \frac{x_2^n}{n!} + \cdots +\frac{x_n^n}{n!} = c_n $$
$c_1,\cdots,c_n$ are known constants. $x_1 \cdots x_n$ are the unknown variables to solve.
Solution
One way, which is numerically probably a bad idea, is to use Newton's identities. They give the value of the elementary symmetric functions given the power sums, and from the elementary symmetric functions you can construct a polynomial whose roots are the answers to your problem. Let $p_k = k! c_k$, and let $e_k$ be the sum of all $\binom{n}{k}$ products of $k$ variables out of $x_1,\ldots,x_n$. Newton's identities state that
$$ ke_k = (-1)^{k-1} p_k + \sum_{i=1}^{k-1} (-1)^{i-1} e_{k-i} p_i. $$
Using these identities, you can compute $e_1,\ldots,e_n$. Now consider the polynomial
$$ P = x^n + \sum_{i=1}^n (-1)^i e_i x^{n-i}. $$
The unique solution to your equations are the $n$ roots of $P$.
As an example, let's do the case $n = 2$. We have $e_1 = p_1$ and
$$ 2e_2 = -p_2 + e_1 p_1 = p_1^2 - p_2. $$
The polynomial $P$ is therefore
$$ x^2 - p_1 x + \frac{p_1^2-p_2}{2}. $$
For $n=3$ we calculate additionally
$$ 3e_3 = p_3 - e_1 p_2 + e_2 p_1 = p_3 - p_1 p_2 + \frac{p_1^2-p_2}{2} p_1 = \frac{2p_3 - 3p_1p_2 + p_1^3}{2}. $$
The polynomial $P$ is therefore
$$ x^3 - p_1 x^2 + \frac{p_1^2-p_2}{2}x - \frac{2p_3 - 3p_1p_2 + p_1^3}{6}. $$
$$ ke_k = (-1)^{k-1} p_k + \sum_{i=1}^{k-1} (-1)^{i-1} e_{k-i} p_i. $$
Using these identities, you can compute $e_1,\ldots,e_n$. Now consider the polynomial
$$ P = x^n + \sum_{i=1}^n (-1)^i e_i x^{n-i}. $$
The unique solution to your equations are the $n$ roots of $P$.
As an example, let's do the case $n = 2$. We have $e_1 = p_1$ and
$$ 2e_2 = -p_2 + e_1 p_1 = p_1^2 - p_2. $$
The polynomial $P$ is therefore
$$ x^2 - p_1 x + \frac{p_1^2-p_2}{2}. $$
For $n=3$ we calculate additionally
$$ 3e_3 = p_3 - e_1 p_2 + e_2 p_1 = p_3 - p_1 p_2 + \frac{p_1^2-p_2}{2} p_1 = \frac{2p_3 - 3p_1p_2 + p_1^3}{2}. $$
The polynomial $P$ is therefore
$$ x^3 - p_1 x^2 + \frac{p_1^2-p_2}{2}x - \frac{2p_3 - 3p_1p_2 + p_1^3}{6}. $$
Context
StackExchange Computer Science Q#33452, answer score: 7
Revisions (0)
No revisions yet.