We are given rational numbers $[c\_1, c\_2, \ldots, c\_n]$ and $v$ from the interval $[0,1]$. 


Consider the $n$-fold integral 
$$
J = \int\_{\theta\_1 \in I\_1, \theta\_2 \in I\_2 \ldots, \theta\_n \in I\_n} d\theta\_n\ldots d\theta\_2 d\theta\_1
$$
whose intervals are defined by 
$$
I\_j = \begin{cases}
[0,1] & j = 1\\
[\max(c\_j,\theta\_{j-1}),1] & 2\leq j\leq n 
\end{cases}
$$
We want to check if $J$ is equal to $v$. 



> 
> Is this problem $\mathsf{NP}$-hard?
> 
> 
> 


Informally, each $\max$ in the lower limits of the intervals leads to a two-way split in evaluating the integral, and thus to $2^{n-1}$ integrals that sum to $J$. 


Note that $J$ is also the volume of an $n$ dimensional polytope define by the following inequalities:


$$c\_j \leq x\_j \leq 1 \ (\text{for } 1 \leq j \leq n),$$
$$0 \leq x\_1 \leq x\_2 \leq \ldots \leq x\_n \leq 1.$$


Is there a result in computational complexity or computational geometry about volume of such shapes?


[This question was originally posted CS.SE](https://cs.stackexchange.com/questions/12896/a-hard-n-fold-integral).



An NP-hard $n$ fold integral
The integral essentially asks for the probability that, for $n$ independent "events" uniformly distributed in $[0,1]$, at least one happens after $c\_n$, at least two happen after $c\_{n-1}$, etc (thinking of the unit interval as time). Let $P\_n(c\_1,\dots,c\_n) = n!\cdot J$ denote this probability (the integral $J$ also requires the $n$ events to occur in a specified order). 


If we condition on the number $k$ of events in the interval $[c\_n,1]$, then the remaining events will be uniformly distributed in $[0,c\_n]$, and we can write $P\_n$ as $$P\_n(c\_1,\dots,c\_n) = Pr(k=1)\cdot P\_{n-1}\left(\frac{c\_1}{c\_n},\dots,\frac{c\_{n-1}}{c\_n}\right) + Pr(k=2)\cdot P\_{n-2}\left(\frac{c\_1}{c\_n},\dots,\frac{c\_{n-2}}{c\_n}\right)+\dots.$$


To complete a recursive computation, we only need to compute the $O(n^2)$ integrals of the form $$P\_i\left(\frac{c\_1}{c\_j},\dots,\frac{c\_i}{c\_j}\right)$$ for $1\leq i < j\leq n$. I'm not an expert on the complexity of rational arithmetic, but it seems to me that this should be doable in polynomial time.


EDIT: 


Just for completeness, yes, the integral can be evaluated in $O(n^2)$ arithmetical operations, but so can $2^{2^n}$ (in fact in a linear number of operations), and that doesn't mean we can output (let alone compute) the digits in polynomial time. Even if the problem is to check an identity (so that the potential answer has to be part of the input), I don't see a general reason why that should be possible in polynomial time just because the number of arithmetical operations is polynomial (but people must have thought of that before, feel free to comment).


In this case however, the integral $P\_n(c\_1,\dots,c\_n)$ is a degree $n$ polynomial in $c\_1,\dots,c\_n$, with coefficients that grow "only" exponentially. It follows that all the denominators (and numerators) of the partial results will have size (number of digits) polynomial in the size of the input.


