text: # Determining whether a function is Piecewise Polynomial
  
  I am trying to determine whether or not a function is piecewise polynomial. The function is as below:
  
  Let $\ X$ be a continuous random variable with support on $\ \Omega_x$, and with corresponding cdf $\ F$. Is the function $g_r$, $r\geq 1$, piecewise polynomial?
  
  $\ g_r(x) = x\sum_{k=0}^{r-1} \left( (-1)^{r-1-k} {r-1 \choose k}{r-1+k \choose k}(F(x)^k)\right)$
  
  If it helps (though I doubt it makes a difference) then $\ \Omega_x$ could be restricted to the positive reals.
  
  I am not exactly sure of what I would need to do to prove this is (or isn't) the case. I have spent some time reading on the subject but it is not at all clear to me. My initial guess is yes, since the function is smooth, but I would be grateful for any thoughts.
  
  The definition I have found for a function to be piecewise-polynomial is:
  
  "A piecewise polynomial function is a continuous function $\ f : A \rightarrow \mathbb{R}$ for which there exist finitely many polynomials $\ p_1, \ldots , p_k$ such that for every $\ a \in A$, $\ f(a) = p_i(a)$ for some $i$."
  
  Many thanks for all the help.
  
  -
  That definition of piecewise polynomial looks suspect. Usually one requires each "piece" to be an interval; otherwise, the Dirichlet function (1 on the rationals, 0 on the irrationals) is nowhere continuous but piecewise constant! – Rahul Feb 3 '12 at 10:20
  Anyway, don't you have any more conditions on $F(x)$? For $r = 2$, your $g_r(x)$ reduces to $x(-1 + 2F(x))$, and if say $X$ is normally distributed, this is not piecewise polynomial in any sense. – Rahul Feb 3 '12 at 10:30
  Many thanks for your response. Clearly I do not know what it means for a function to be piecewise polynomial. I thought it meant that you could split $\ \Omega_x$ up into lots of small intervals and approximate the function $\ g_r(x)$ by a polynomial function over each interval. And thus, since the function was smooth you can use Bernstein polynomials on each interval to approximate the function. Could you explain why $\ x(-1+2F(x))$ is not piecewise polynomial when $X$ is, say, normally distributed? Thanks! – mfrmn Feb 3 '12 at 11:07
  
  According to the definition that I am familiar with, a function on $\mathbb R$ is piecewise $P$ (for some property $P$, e.g. continuous, differentiable, constant, linear, polynomial, ...) if its domain can be divided into a union of non-degenerate intervals such that the function is $P$ over each interval.
  Fix $r = 2$, so that $g_r(x) = x(-1 + 2F(x))$. Suppose $X$ follows an exponential distribution with parameter $\lambda = 1$. Then $F(x) = 1 - e^{-x}$, and $g_2(x) = x - 2xe^{-x}$. The function $g_2$ has an infinite Taylor expansion about any $x$, so it cannot be polynomial in any neighbourhood.
  Of course, if the distribution of $X$ is such that $F(x)$ itself is piecewise polynomial, then so is $g_r$ for any $r$. However, I'm not sure if there are any $F$ and $r$ such that $F$ is not piecewise polynomial but $g_r$ is.
  As a very quick follow up, currently I am trying to solve an optimisation problem over $\ F \in \mathcal{D}$ where $\mathcal{D}$ is a convex set of distributions subject to some contraints. To convert this into a semidefinite program I needed to show that $g_r(x)$ was piecewise polynomial. So, if I were to restrict $\mathcal{D}$ to the class of piecewise polynomial distributions, then $F(x)$ would itself be piecewise polynomial, and so $g_r$ would be piecewise polynomial also? – mfrmn Feb 3 '12 at 12:51
  Yes, I think that's right. And the class of piecewise polynomial functions is closed under convex combinations, so everything should be fine. Of course, the degree of the polynomial pieces of $g_r$ goes up roughly as $r$ times the degree of the corresponding pieces of $F$, but I don't know if that's going to be a problem for you. – Rahul Feb 3 '12 at 12:59
explanation: The document is a discussion about determining whether a given function \( g_r(x) \) is piecewise polynomial. The user provides the function and its context, including the definition of a piecewise polynomial function. The user also includes a response from another user (Rahul) who provides insights and counterexamples, and the user's follow-up questions and clarifications.
  
  The document contains a question and a series of responses and follow-up questions, but it does not contain a definitive answer to the original question.
distilabel_metadata.content: Evaluate the user given text extract and determine if it contains a math question and optionally and answer to this question.
  
  Output rules:
  
  1. Briefly describe the document and mention if it contains a question or a question and answer.
  2. Finalize the output with: Label: no-question,question,question-and-answer,multiple-question,multiple-question-and-answer
distilabel_metadata.role: system
distilabel_metadata.content: # Determining whether a function is Piecewise Polynomial
  
  I am trying to determine whether or not a function is piecewise polynomial. The function is as below:
  
  Let $\ X$ be a continuous random variable with support on $\ \Omega_x$, and with corresponding cdf $\ F$. Is the function $g_r$, $r\geq 1$, piecewise polynomial?
  
  $\ g_r(x) = x\sum_{k=0}^{r-1} \left( (-1)^{r-1-k} {r-1 \choose k}{r-1+k \choose k}(F(x)^k)\right)$
  
  If it helps (though I doubt it makes a difference) then $\ \Omega_x$ could be restricted to the positive reals.
  
  I am not exactly sure of what I would need to do to prove this is (or isn't) the case. I have spent some time reading on the subject but it is not at all clear to me. My initial guess is yes, since the function is smooth, but I would be grateful for any thoughts.
  
  The definition I have found for a function to be piecewise-polynomial is:
  
  "A piecewise polynomial function is a continuous function $\ f : A \rightarrow \mathbb{R}$ for which there exist finitely many polynomials $\ p_1, \ldots , p_k$ such that for every $\ a \in A$, $\ f(a) = p_i(a)$ for some $i$."
  
  Many thanks for all the help.
  
  -
  That definition of piecewise polynomial looks suspect. Usually one requires each "piece" to be an interval; otherwise, the Dirichlet function (1 on the rationals, 0 on the irrationals) is nowhere continuous but piecewise constant! – Rahul Feb 3 '12 at 10:20
  Anyway, don't you have any more conditions on $F(x)$? For $r = 2$, your $g_r(x)$ reduces to $x(-1 + 2F(x))$, and if say $X$ is normally distributed, this is not piecewise polynomial in any sense. – Rahul Feb 3 '12 at 10:30
  Many thanks for your response. Clearly I do not know what it means for a function to be piecewise polynomial. I thought it meant that you could split $\ \Omega_x$ up into lots of small intervals and approximate the function $\ g_r(x)$ by a polynomial function over each interval. And thus, since the function was smooth you can use Bernstein polynomials on each interval to approximate the function. Could you explain why $\ x(-1+2F(x))$ is not piecewise polynomial when $X$ is, say, normally distributed? Thanks! – mfrmn Feb 3 '12 at 11:07
  
  According to the definition that I am familiar with, a function on $\mathbb R$ is piecewise $P$ (for some property $P$, e.g. continuous, differentiable, constant, linear, polynomial, ...) if its domain can be divided into a union of non-degenerate intervals such that the function is $P$ over each interval.
  Fix $r = 2$, so that $g_r(x) = x(-1 + 2F(x))$. Suppose $X$ follows an exponential distribution with parameter $\lambda = 1$. Then $F(x) = 1 - e^{-x}$, and $g_2(x) = x - 2xe^{-x}$. The function $g_2$ has an infinite Taylor expansion about any $x$, so it cannot be polynomial in any neighbourhood.
  Of course, if the distribution of $X$ is such that $F(x)$ itself is piecewise polynomial, then so is $g_r$ for any $r$. However, I'm not sure if there are any $F$ and $r$ such that $F$ is not piecewise polynomial but $g_r$ is.
  As a very quick follow up, currently I am trying to solve an optimisation problem over $\ F \in \mathcal{D}$ where $\mathcal{D}$ is a convex set of distributions subject to some contraints. To convert this into a semidefinite program I needed to show that $g_r(x)$ was piecewise polynomial. So, if I were to restrict $\mathcal{D}$ to the class of piecewise polynomial distributions, then $F(x)$ would itself be piecewise polynomial, and so $g_r$ would be piecewise polynomial also? – mfrmn Feb 3 '12 at 12:51
  Yes, I think that's right. And the class of piecewise polynomial functions is closed under convex combinations, so everything should be fine. Of course, the degree of the polynomial pieces of $g_r$ goes up roughly as $r$ times the degree of the corresponding pieces of $F$, but I don't know if that's going to be a problem for you. – Rahul Feb 3 '12 at 12:59
distilabel_metadata.role: user
distilabel_metadata.raw_output_q_a_detector_0: The document is a discussion about determining whether a given function \( g_r(x) \) is piecewise polynomial. The user provides the function and its context, including the definition of a piecewise polynomial function. The user also includes a response from another user (Rahul) who provides insights and counterexamples, and the user's follow-up questions and clarifications.
  
  The document contains a question and a series of responses and follow-up questions, but it does not contain a definitive answer to the original question.
  
  Label: question-and-answer