Is this egyptian fractions problem NP-complete?

87 Views Asked by At

Given a set of positive integers $\ M=${$\ a_1,a_2,\cdots ,a_k\ $} and a rational number $\ r\ $ , is the following decision problem NP-complete ?

Is there a subset $S\subset M$ with $$\sum_{p\in S} \frac{1}{p}=r$$ ?

In other words, can we choose positive integers out of $\ M\ $ such that there is an egyptian fraction representation of $\ r\ $ with those denominators ?

This seems to be similar to the subset sum problem , but I am not sure whether we can reudce the given problem to it.

1

There are 1 best solutions below

0
On BEST ANSWER

I think the following should work:

We can reduce it to the subset sum problem as follows. There is a solution to $$ \sum_{p\in S} \frac{1}{p}=r $$ iff there is a solution to $$ \sum_{p\in S} \frac{a_1\cdot a_2 \cdot\ldots \cdot a_k}{p} = a_1\cdot a_2 \cdot\ldots \cdot a_k \cdot r .$$ Now all summands are integers, so if the left hand side is not an integer the answer is no. Otherwise, this is the subset sum problem applied to the set $\{c /a_1,\ldots, c/a_k \}$ with target sum $cr$ where $c= a_1\cdot\ldots \cdot a_k$. This is a polynomial time reduction.

Now we reduce the subset sum problem to the current problem. If we have integers $\{a_1,\ldots, a_k\}$ and want to see if for some set $M$ we have $\sum_{p\in M} p = r$ for some fixed $r$. Then we can ask the equivalent question if there is a subset $M'$ of $\{1/a_1,\ldots, 1/a_k\}$ with $\sum_{p\in M'} 1/p = r$.